@marimo-team/frontend 0.21.2-dev3 → 0.21.2-dev31
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/{CellStatus-CDSBsjjF.js → CellStatus-B2zz_FmA.js} +1 -1
- package/dist/assets/JsonOutput-BKsCyU13.js +46 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-m8w66E4s.js → LazyAnyLanguageCodeMirror-Dmh6kfiy.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-az74f3Mp.js → MarimoErrorOutput-CuRqjiUs.js} +1 -1
- package/dist/assets/{RenderHTML-DJ8khuob.js → RenderHTML-D_zT74Lq.js} +1 -1
- package/dist/assets/{add-cell-with-ai-DUn4LN4W.js → add-cell-with-ai-mTm-dtan.js} +1 -1
- package/dist/assets/{add-connection-dialog-CBz0AUVX.js → add-connection-dialog-D-YPxf1v.js} +1 -1
- package/dist/assets/{agent-panel-u83dsDsM.js → agent-panel-B33uC899.js} +4 -4
- package/dist/assets/ai-model-dropdown-aWQwR5QF.js +5 -0
- package/dist/assets/{any-language-editor-DwQMnAM3.js → any-language-editor-C4OP3txB.js} +1 -1
- package/dist/assets/{app-config-button-rDu-lCIB.js → app-config-button-BPvtPnFO.js} +1 -1
- package/dist/assets/{azure-BTXHztTw.js → azure-B4I1bDnQ.js} +1 -1
- package/dist/assets/{cell-editor-DX7IcqNr.js → cell-editor-CphJ_7RI.js} +1 -1
- package/dist/assets/{cell-link-Q_UEP94Z.js → cell-link-DFqw-p8a.js} +1 -1
- package/dist/assets/{cells-fq1RMGX_.js → cells-Bg7-G3QJ.js} +53 -53
- package/dist/assets/{chat-display-D_Fuuy6r.js → chat-display-B6a8fK7j.js} +1 -1
- package/dist/assets/{chat-panel-BO-JoQSp.js → chat-panel-B247iLHO.js} +1 -1
- package/dist/assets/{column-preview-WsubyItX.js → column-preview-CtAbPvyW.js} +1 -1
- package/dist/assets/{command-rfxSsiHU.js → command-Bb5BQ9IQ.js} +1 -1
- package/dist/assets/{command-palette-Bez4BqJF.js → command-palette-Ba8b6UXV.js} +1 -1
- package/dist/assets/{common-BYwO983A.js → common-DrrPhv3x.js} +1 -1
- package/dist/assets/{components-Ozq0825a.js → components-B4UeUHl_.js} +1 -1
- package/dist/assets/{components-Bpgzv_5_.js → components-DREyNirk.js} +1 -1
- package/dist/assets/{context-aware-panel-CfsfBlhO.js → context-aware-panel-91O6JrAw.js} +3 -3
- package/dist/assets/copy-CA4fP28I.js +1 -0
- package/dist/assets/{copy-icon-BgmMM9Zg.js → copy-icon-C6n2vWSW.js} +1 -1
- package/dist/assets/{datasource-F9sJtuof.js → datasource-nFaOdZWT.js} +1 -1
- package/dist/assets/{dependency-graph-panel-AOBcX2tP.js → dependency-graph-panel-BHHmugpa.js} +1 -1
- package/dist/assets/{documentation-panel-D28MpqbI.js → documentation-panel-C0LXfz0P.js} +1 -1
- package/dist/assets/{download-B9_ToVd4.js → download-hacnp18J.js} +4 -4
- package/dist/assets/{edit-page-otS-QvnC.js → edit-page-DrMpMRcp.js} +3 -3
- package/dist/assets/{error-panel-RRoj_iOR.js → error-panel-D_jyOp9O.js} +1 -1
- package/dist/assets/{file-explorer-panel-CB8vF5ob.js → file-explorer-panel-BS6bXHdR.js} +1 -1
- package/dist/assets/{file-icons-CWLHDa1J.js → file-icons-DWJwqnd-.js} +1 -1
- package/dist/assets/{floating-outline-BvQKiC0F.js → floating-outline-D466s5lB.js} +1 -1
- package/dist/assets/{focus-DYwTiH9-.js → focus-DKnBT1ji.js} +1 -1
- package/dist/assets/{form-CrQYrsUC.js → form-DRz7hUP9.js} +1 -1
- package/dist/assets/{glide-data-editor-xt5xNZeV.js → glide-data-editor-CoE8cs_o.js} +1 -1
- package/dist/assets/{globals-BsV5fVR-.js → globals-ByNi1JTJ.js} +1 -1
- package/dist/assets/{home-page-itW0tRmv.js → home-page-D7Z_Tlyv.js} +1 -1
- package/dist/assets/{hooks-CHx5dUUq.js → hooks-3nahTPnh.js} +1 -1
- package/dist/assets/html-to-image-CN0roffg.js +2 -0
- package/dist/assets/index-CIk_2P5O.js +38 -0
- package/dist/assets/{index-GjXovVsl.css → index-D3rIJiKM.css} +1 -1
- package/dist/assets/{kiosk-mode-DNjEnIWb.js → kiosk-mode-BRjlh6JD.js} +1 -1
- package/dist/assets/{layout-CwFtCyW8.js → layout-fT20kG4_.js} +3 -3
- package/dist/assets/{logs-panel-BU1tNEVc.js → logs-panel-Bs9VL6Hy.js} +1 -1
- package/dist/assets/{markdown-renderer-MR9df58W.js → markdown-renderer-A3Ed0cjI.js} +1 -1
- package/dist/assets/{mode-AcL8c6qH.js → mode-CdFYvrq5.js} +1 -1
- package/dist/assets/{name-cell-input-DVFEv_aO.js → name-cell-input-l9v5UNrY.js} +1 -1
- package/dist/assets/{outline-panel-CP0oIuiU.js → outline-panel-YCGxMYb6.js} +1 -1
- package/dist/assets/{packages-panel-CzRELimG.js → packages-panel-BU9XDexQ.js} +1 -1
- package/dist/assets/{panels-wTweRyIv.js → panels-BQFJvWY0.js} +1 -1
- package/dist/assets/{process-output-CTVsT--B.js → process-output-CwDI4Cei.js} +1 -1
- package/dist/assets/{readonly-python-code-DH-1xZGq.js → readonly-python-code-i_LeNopW.js} +1 -1
- package/dist/assets/{run-page-FCvGnICa.js → run-page-DRNJCJFp.js} +1 -1
- package/dist/assets/{scratchpad-panel-k9lrm-rC.js → scratchpad-panel-DlQ1e62a.js} +1 -1
- package/dist/assets/{secrets-panel-B1Z-6dmz.js → secrets-panel-CfWyTaso.js} +1 -1
- package/dist/assets/{session-panel-WhN0qilM.js → session-panel-B1yjHqHu.js} +1 -1
- package/dist/assets/{snippets-panel-BCDHUuku.js → snippets-panel-Dk7Ka2Gd.js} +1 -1
- package/dist/assets/{state-3V5UxC3B.js → state-CXu3CC70.js} +1 -1
- package/dist/assets/{switch-CVKxYu_0.js → switch-DhfF9ECb.js} +1 -1
- package/dist/assets/{terminal-Cr7wbEjz.js → terminal-BZZqbl0D.js} +1 -1
- package/dist/assets/{tracing-DUVd0jtl.js → tracing-6mcSpkGK.js} +1 -1
- package/dist/assets/{tracing-panel-CuTxPn_x.js → tracing-panel-QfWW4RrJ.js} +2 -2
- package/dist/assets/{useAddCell-YC7rpcmD.js → useAddCell-rz5hgq-s.js} +1 -1
- package/dist/assets/{useBoolean-m1e6E3Ao.js → useBoolean-BYlCXj8U.js} +1 -1
- package/dist/assets/{useCellActionButton-GUb2fXU8.js → useCellActionButton-D-FPtHfb.js} +1 -1
- package/dist/assets/{useDeleteCell-DRUDRiy0.js → useDeleteCell-DSrWT4rB.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-nFVMlEx0.js → useDependencyPanelTab-CYwz2tNi.js} +1 -1
- package/dist/assets/{useNotebookActions-ChLHy-0O.js → useNotebookActions-BeK3aC7s.js} +1 -1
- package/dist/assets/{useRunCells-5m6jCnyo.js → useRunCells-RUEojcb5.js} +1 -1
- package/dist/assets/{useSplitCell-DGD9smMq.js → useSplitCell-Ct0VLOTS.js} +1 -1
- package/dist/index.html +36 -36
- package/package.json +1 -1
- package/src/components/app-config/user-config-form.tsx +5 -4
- package/src/components/data-table/__tests__/utils.test.ts +138 -1
- package/src/components/data-table/context-menu.tsx +9 -5
- package/src/components/data-table/data-table.tsx +3 -0
- package/src/components/data-table/range-focus/__tests__/atoms.test.ts +8 -2
- package/src/components/data-table/range-focus/__tests__/test-utils.ts +2 -0
- package/src/components/data-table/range-focus/__tests__/utils.test.ts +82 -8
- package/src/components/data-table/range-focus/atoms.ts +2 -2
- package/src/components/data-table/range-focus/utils.ts +50 -12
- package/src/components/data-table/types.ts +7 -0
- package/src/components/data-table/utils.ts +87 -0
- package/src/components/ui/range-slider.tsx +108 -1
- package/src/core/codemirror/lsp/notebook-lsp.ts +28 -2
- package/src/css/md.css +7 -0
- package/src/plugins/core/sanitize-html.ts +25 -18
- package/src/plugins/impl/DataTablePlugin.tsx +23 -2
- package/src/plugins/impl/SliderPlugin.tsx +1 -3
- package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +120 -0
- package/src/utils/__tests__/download.test.tsx +2 -2
- package/src/utils/copy.ts +18 -5
- package/src/utils/download.ts +4 -3
- package/src/utils/html-to-image.ts +6 -0
- package/dist/assets/JsonOutput-DKXKGKvX.js +0 -46
- package/dist/assets/ai-model-dropdown-DPTa_EpU.js +0 -5
- package/dist/assets/copy-YwM0Pd7v.js +0 -1
- package/dist/assets/html-to-image-BnSc-Wa0.js +0 -2
- package/dist/assets/index-0n92c_W7.js +0 -38
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
|
2
|
-
import{s as m}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as n}from"./compiler-runtime-B3qBwwSJ.js";import{t as f}from"./jsx-runtime-icT_Ltz2.js";import{t as _}from"./spinner-C5JoisA7.js";import{t as p}from"./preload-helper-BW0IMuFq.js";let c,u=(async()=>{let a,l,r,o,s;a=n(),l=m(i(),1),r=m(f(),1),o=l.lazy(()=>p(()=>import("./tracing-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-6mcSpkGK.js","./clear-button-DrIF5o__.js","./cn-BoaCR37F.js","./clsx-BDxNtGmi.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-icT_Ltz2.js","./cells-Bg7-G3QJ.js","./preload-helper-BW0IMuFq.js","./badge-hTpPIsMT.js","./button-Ej3vmCIF.js","./useEventListener-Dy81QR4n.js","./Combination-Cs9nbinQ.js","./react-dom-CSu739Rf.js","./select-CxT2Geqr.js","./menu-items-UxKrm8hS.js","./dist-DJBpXGro.js","./check-BE0hEwVo.js","./createLucideIcon-Cm-Z7dYr.js","./x-BI1M8X_v.js","./tooltip-D9723Brr.js","./use-toast-Hc8CXlvz.js","./utils-tNbLd14P.js","./useEvent-O0nX5vok.js","./_baseIsEqual-EYp9AUJI.js","./_Uint8Array-C0aUZfE0.js","./invariant-CQUIhlu2.js","./merge-CfcLlFFp.js","./isArrayLikeObject-Dx6-QZGQ.js","./zod-H_cgTO0M.js","./DeferredRequestRegistry-O6RDJKs0.js","./Deferred-BMfCOLaw.js","./uuid-ClFZlR7U.js","./config-3Aq84phF.js","./constants-Rz_lD4HK.js","./session-BrEm7qNv.js","./requests-Bgjtqo_1.js","./useLifecycle-DA9DjSPo.js","./assertNever-DWSyoPEi.js","./toString-lmrYznmk.js","./isSymbol-CiGN2w5X.js","./_baseSlice-39dTX4Wi.js","./_hasUnicode-QS_pSfjY.js","./_arrayReduce-BKEr35uH.js","./useNonce-BtW-rR_1.js","./useTheme-BYXBU1of.js","./once-CJOnx12W.js","./capabilities-D3x_db9Y.js","./createReducer-Drh7NmIR.js","./paths-D2lG83Oh.js","./dist-D0Vj4Kqc.js","./dist-B_cxg-E4.js","./dist-CtXb4bUU.js","./dist-BNC_tnlW.js","./dist-CXLJUPFl.js","./dist-CQqv2gQL.js","./dist-8UD0A5sU.js","./dist-apDpadc4.js","./dist-CEeVCRd_.js","./stex-0ac7Aukl.js","./toDate-BqKH-Jd9.js","./purify.es-BBn8CPhf.js","./cjs-BU2qXMKx.js","./debounce-DS_VtWMt.js","./toNumber-OnFQK5Wu.js","./now-8AYn-wiF.js","./toInteger-CO3ppIfA.js","./database-zap-DTWCDKdn.js","./main-DrBRErTM.js","./cells-jmgGt1lS.css","./CellStatus-B2zz_FmA.js","./multi-icon-DEWnuZs2.js","./multi-icon-pwGWVz3d.css","./useDateFormatter-CpE7XQLs.js","./context-CIAP2NOh.js","./SSRProvider-DC7ElCZZ.js","./en-US-BO8E69bZ.js","./ellipsis-0_zJdF6H.js","./refresh-cw-CHAHPgkx.js","./workflow-BmeqNuSH.js","./CellStatus-2Psjnl5F.css","./empty-state-B_US46Us.js","./panel-context-BN0DQXiK.js","./cell-link-DFqw-p8a.js","./ImperativeModal-qEtcJ95s.js","./alert-dialog-9WfvUF7e.js","./dialog-CVN1lcMF.js","./input-CUwqpKjd.js","./useDebounce-B0dx2Gp0.js","./numbers-CYnquDho.js","./useNumberFormatter-DbDKSvEd.js","./usePress-BHGkpw8X.js","./runs-Bhy0tbWr.js","./react-vega-BZav_-2n.js","./precisionRound-BOmLQIKI.js","./defaultLocale-OkOxlkkM.js","./linear-BP9rwmWK.js","./timer-CPT_vXom.js","./init-XMA8CWhh.js","./time-D2GKc0U6.js","./defaultLocale-DK1MWd7f.js","./range-DNqFcYmr.js","./vega-loader.browser-CZV6_g2i.js","./treemap-Cf5pgJDk.js","./path-CkIaQHJO.js","./colors-WO6MvCS3.js","./ordinal-BjO5SoTk.js","./arc-BrTIAGt4.js","./math-CeGhAAgQ.js","./array-psg969PF.js","./step-BkfKj3CL.js","./line-BBSd2MUH.js","./chevron-right-D0GQBpTb.js","./circle-check-gLIOLu8x.js","./circle-play-DYGULlKZ.js","./react-resizable-panels.browser.esm-DDRqG5ui.js","./bundle.esm-idScn0w0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{s as m}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as n}from"./compiler-runtime-B3qBwwSJ.js";import{t as f}from"./jsx-runtime-icT_Ltz2.js";import{t as _}from"./spinner-C5JoisA7.js";import{t as p}from"./preload-helper-BW0IMuFq.js";let c,u=(async()=>{let a,l,r,o,s;a=n(),l=m(i(),1),r=m(f(),1),o=l.lazy(()=>p(()=>import("./tracing-6mcSpkGK.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117]),import.meta.url).then(t=>({default:t.Tracing}))),c=()=>{let t=(0,a.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(o,{})}),t[0]=e):e=t[0],e},s=()=>{let t=(0,a.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("div",{className:"flex flex-col items-center justify-center h-full",children:(0,r.jsx)(_,{})}),t[0]=e):e=t[0],e}})();export{u as __tla,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as l}from"./useEvent-O0nX5vok.js";import{E as s}from"./cells-
|
|
1
|
+
import{u as l}from"./useEvent-O0nX5vok.js";import{E as s}from"./cells-Bg7-G3QJ.js";import{t as i}from"./compiler-runtime-B3qBwwSJ.js";import{o as n}from"./utils-tNbLd14P.js";import{n as f}from"./html-to-image-CN0roffg.js";import{o as c}from"./focus-DKnBT1ji.js";var p=i();function u(){let o=(0,p.c)(4),a=l(n),r=c(),{createNewCell:t}=s(),e;return o[0]!==a||o[1]!==t||o[2]!==r?(e=m=>{m.includes("alt")&&f({autoInstantiate:a,createNewCell:t,fromCellId:r}),t({code:m,before:!1,cellId:r??"__end__"})},o[0]=a,o[1]=t,o[2]=r,o[3]=e):e=o[3],e}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as k}from"./chunk-LvLJmgfZ.js";import{t as M}from"./react-Bj1aDYRI.js";import{t as A}from"./compiler-runtime-B3qBwwSJ.js";import{ot as F}from"./ai-model-dropdown-
|
|
1
|
+
import{s as k}from"./chunk-LvLJmgfZ.js";import{t as M}from"./react-Bj1aDYRI.js";import{t as A}from"./compiler-runtime-B3qBwwSJ.js";import{ot as F}from"./ai-model-dropdown-aWQwR5QF.js";import{m as p,u as x}from"./useEventListener-Dy81QR4n.js";import{r as R}from"./constants-Rz_lD4HK.js";import{S as H}from"./config-3Aq84phF.js";import{t as I}from"./createLucideIcon-Cm-Z7dYr.js";import{F as y,I as K,L as P,j as T}from"./usePress-BHGkpw8X.js";var D=I("case-sensitive",[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]]),O=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,b=new WeakMap,c=[];function W(t,e){let s=P(t==null?void 0:t[0]),d=e instanceof s.Element?{root:e}:e,f=(d==null?void 0:d.root)??document.body,v=(d==null?void 0:d.shouldUseInert)&&O,l=new Set(t),u=new Set,w=n=>v&&n instanceof s.HTMLElement?n.inert:n.getAttribute("aria-hidden")==="true",a=(n,o)=>{v&&n instanceof s.HTMLElement?n.inert=o:o?n.setAttribute("aria-hidden","true"):(n.removeAttribute("aria-hidden"),n instanceof s.HTMLElement&&(n.inert=!1))},m=new Set;if(y())for(let n of t){let o=n;for(;o&&o!==f;){let i=o.getRootNode();"shadowRoot"in i&&m.add(i.shadowRoot),o=i.parentNode}}let S=n=>{for(let r of n.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(r);let o=r=>{if(u.has(r)||l.has(r)||r.parentElement&&u.has(r.parentElement)&&r.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let C of l)if(T(r,C))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},i=F(K(n),n,NodeFilter.SHOW_ELEMENT,{acceptNode:o}),h=o(n);if(h===NodeFilter.FILTER_ACCEPT&&N(n),h!==NodeFilter.FILTER_REJECT){let r=i.nextNode();for(;r!=null;)N(r),r=i.nextNode()}},N=n=>{let o=b.get(n)??0;w(n)&&o===0||(o===0&&a(n,!0),u.add(n),b.set(n,o+1))};c.length&&c[c.length-1].disconnect(),S(f);let E=new MutationObserver(n=>{for(let o of n)if(o.type==="childList"){if(o.target.isConnected&&![...l,...u].some(i=>T(i,o.target)))for(let i of o.addedNodes)(i instanceof HTMLElement||i instanceof SVGElement)&&(i.dataset.liveAnnouncer==="true"||i.dataset.reactAriaTopLayer==="true")?l.add(i):i instanceof Element&&S(i);if(y()){for(let i of m)if(!i.isConnected){E.disconnect();break}}}});E.observe(f,{childList:!0,subtree:!0});let _=new Set;if(y())for(let n of m){let o=new MutationObserver(i=>{for(let h of i)if(h.type==="childList"){if(h.target.isConnected&&![...l,...u].some(r=>T(r,h.target)))for(let r of h.addedNodes)(r instanceof HTMLElement||r instanceof SVGElement)&&(r.dataset.liveAnnouncer==="true"||r.dataset.reactAriaTopLayer==="true")?l.add(r):r instanceof Element&&S(r);if(y()){for(let r of m)if(!r.isConnected){E.disconnect();break}}}});o.observe(n,{childList:!0,subtree:!0}),_.add(o)}let L={visibleNodes:l,hiddenNodes:u,observe(){E.observe(f,{childList:!0,subtree:!0})},disconnect(){E.disconnect()}};return c.push(L),()=>{if(E.disconnect(),y())for(let n of _)n.disconnect();for(let n of u){let o=b.get(n);o!=null&&(o===1?(a(n,!1),b.delete(n)):b.set(n,o-1))}L===c[c.length-1]?(c.pop(),c.length&&c[c.length-1].observe()):c.splice(c.indexOf(L),1)}}function q(t){let e=c[c.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}const z=typeof window<"u"&&window.parent!==window;function V(){new URLSearchParams(window.location.search).has(R.vscode)&&(!z||H()||(p.log("[vscode] Registering VS Code bindings"),J(),G(),U(),j()))}function G(){window.addEventListener("copy",()=>{var t;g({command:"copy",text:((t=window.getSelection())==null?void 0:t.toString())??""})}),window.addEventListener("cut",()=>{var e;let t=((e=window.getSelection())==null?void 0:e.toString())??"";x()&&document.execCommand("insertText",!1,""),g({command:"cut",text:t})}),window.addEventListener("message",async t=>{try{let e=t.data,s=x();switch(e.command){case"paste":if(p.log(`[vscode] Received paste mac=${s}`,e),s){let d=document.activeElement;if(!d){p.warn("[vscode] No active element to paste into"),document.execCommand("insertText",!1,e.text);return}let f=new DataTransfer;f.setData("text/plain",e.text),d.dispatchEvent(new ClipboardEvent("paste",{clipboardData:f}))}else p.log("[vscode] Not pasting on mac");return}}catch(e){p.error("Error in paste message handler",e)}})}function J(){document.addEventListener("keydown",t=>{var e,s;if((t.ctrlKey||t.metaKey)&&t.key==="c"){let d=((e=window.getSelection())==null?void 0:e.toString())??"";p.log("[vscode] Sending copy",d),g({command:"copy",text:d});return}if((t.ctrlKey||t.metaKey)&&t.key==="x"){let d=((s=window.getSelection())==null?void 0:s.toString())??"";x()&&document.execCommand("insertText",!1,""),p.log("[vscode] Sending cut",d),g({command:"cut",text:d});return}if((t.ctrlKey||t.metaKey)&&t.key==="v"){p.log("[vscode] Sending paste"),g({command:"paste"});return}})}function U(){document.addEventListener("click",t=>{let e=t.target;if(e.tagName!=="A")return;let s=e.getAttribute("href");s&&(s.startsWith("http://")||s.startsWith("https://"))&&(t.preventDefault(),g({command:"external_link",url:s}))})}function j(){document.addEventListener("contextmenu",t=>{t.preventDefault(),g({command:"context_menu"})})}function g(t){var e;(e=window.parent)==null||e.postMessage(t,"*")}var $=A(),B=k(M(),1);function Q(t){let e=(0,$.c)(6),[s,d]=(0,B.useState)(t),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=a=>{var m;(m=a==null?void 0:a.stopPropagation)==null||m.call(a),d(!0)},e[0]=f):f=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=a=>{var m;(m=a==null?void 0:a.stopPropagation)==null||m.call(a),d(!1)},e[1]=v):v=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=a=>{var m;(m=a==null?void 0:a.stopPropagation)==null||m.call(a),d(X)},e[2]=l):l=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={setTrue:f,setFalse:v,toggle:l},e[3]=u):u=e[3];let w;return e[4]===s?w=e[5]:(w=[s,u],e[4]=s,e[5]=w),w}function X(t){return!t}export{W as a,q as i,V as n,D as o,g as r,Q as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-O0nX5vok.js";import{An as ne,E as de,Jn as se,Qn as re,Tn as ce,Xn as he,Yn as me,di as pe,mt as Q,v as ke,wn as fe}from"./cells-
|
|
1
|
+
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-O0nX5vok.js";import{An as ne,E as de,Jn as se,Qn as re,Tn as ce,Xn as he,Yn as me,di as pe,mt as Q,v as ke,wn as fe}from"./cells-Bg7-G3QJ.js";import{t as ue}from"./compiler-runtime-B3qBwwSJ.js";import{a as ye,o as be,r as xe}from"./utils-tNbLd14P.js";import{t as je}from"./jsx-runtime-icT_Ltz2.js";import{r as ve}from"./requests-Bgjtqo_1.js";import{t as f}from"./createLucideIcon-Cm-Z7dYr.js";import{n as F,r as V}from"./x-BI1M8X_v.js";import{a as we,h as Ce}from"./download-hacnp18J.js";import{t as ge}from"./chevron-right-D0GQBpTb.js";import{t as G}from"./circle-plus-CGG-gArM.js";import{t as Ie}from"./code-xml-DwHPF_nL.js";import{t as ze}from"./eye-off-vwi9L975.js";import{t as We}from"./image-DXfkah9d.js";import{t as Me}from"./link-Cf10mh3t.js";import{t as _e}from"./play-DKSqmedg.js";import{a as Ae,n as Se}from"./state-CXu3CC70.js";import{t as Te}from"./trash-2-CAoNMkjq.js";import{t as De}from"./use-toast-Hc8CXlvz.js";import{r as Ee}from"./mode-CdFYvrq5.js";import{a as Ne,c as Re,n as Be}from"./dialog-CVN1lcMF.js";import{n as He}from"./ImperativeModal-qEtcJ95s.js";import{n as Le}from"./copy-CA4fP28I.js";import{i as Pe}from"./useRunCells-RUEojcb5.js";import{r as K}from"./html-to-image-CN0roffg.js";import{t as qe}from"./label-TNNaT1M9.js";import{t as Oe}from"./useDeleteCell-DSrWT4rB.js";import{n as Ue,t as Qe}from"./icons-CrUXojcA.js";import{n as J}from"./name-cell-input-l9v5UNrY.js";import{t as X}from"./multi-icon-DEWnuZs2.js";import{t as Fe}from"./useSplitCell-Ct0VLOTS.js";var Y=f("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),$=f("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Z=f("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),Ve=f("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),ee=f("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),le=f("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Ge(a){let e=new URL(window.location.href);return e.hash=`scrollTo=${encodeURIComponent(a)}`,e.toString()}function Ke(a){var c;let e=(c=a.match(/scrollTo=([^&]+)/))==null?void 0:c[1];return e?decodeURIComponent(e.split("&")[0]):null}function oe(a){return a==="_"?!1:!!(a&&a.trim().length>0)}var Je=ue(),l=ae(je(),1);function Xe(a){let e=(0,Je.c)(47),{cell:c,closePopover:u}=a,{createNewCell:m,updateCellConfig:s,updateCellName:x,moveCell:p,sendToTop:W,sendToBottom:M,addColumnBreakpoint:_,clearCellOutput:A,markUntouched:S}=de(),T=Fe(),D=Pe(c==null?void 0:c.cellId),E=!b(ke),N=Oe(),{openModal:j}=He(),R=ie(Se),B=b(xe),v=b(be),te=b(Ee),y=b(ye),{saveCellConfig:r}=ve();if(!c||te){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0],o}let{cellId:t,config:i,getEditorView:d,name:h,hasOutput:w,hasConsoleOutput:H,status:L}=c,C;e[1]!==t||e[2]!==i.disabled||e[3]!==r||e[4]!==s?(C=async()=>{let o={disabled:!i.disabled};await r({configs:{[t]:o}}),s({cellId:t,config:o})},e[1]=t,e[2]=i.disabled,e[3]=r,e[4]=s,e[5]=C):C=e[5];let P=C,g;e[6]!==t||e[7]!==i.hide_code||e[8]!==d||e[9]!==r||e[10]!==s?(g=async()=>{let o={hide_code:!i.hide_code};await r({configs:{[t]:o}}),s({cellId:t,config:o});let U=d();U&&(o.hide_code?U.contentDOM.blur():U.focus())},e[6]=t,e[7]=i.hide_code,e[8]=d,e[9]=r,e[10]=s,e[11]=g):g=e[11];let q=g,n=t===pe,I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.jsx)(_e,{size:13,strokeWidth:1.5}),e[12]=I):I=e[12];let O=L==="running"||L==="queued"||L==="disabled-transitively"||i.disabled,k;e[13]===D?k=e[14]:(k=()=>D(),e[13]=D,e[14]=k);let z;return e[15]!==_||e[16]!==B||e[17]!==y||e[18]!==v||e[19]!==E||e[20]!==t||e[21]!==A||e[22]!==u||e[23]!==i.disabled||e[24]!==i.hide_code||e[25]!==m||e[26]!==N||e[27]!==d||e[28]!==H||e[29]!==w||e[30]!==n||e[31]!==S||e[32]!==p||e[33]!==h||e[34]!==j||e[35]!==r||e[36]!==M||e[37]!==W||e[38]!==R||e[39]!==T||e[40]!==O||e[41]!==k||e[42]!==P||e[43]!==q||e[44]!==s||e[45]!==x?(z=[[{icon:I,label:"Run cell",hotkey:"cell.run",hidden:O,redundant:!0,handle:k},{icon:(0,l.jsx)(Ae,{size:13,strokeWidth:1.5}),label:"Refactor with AI",hidden:!B,handle:()=>{R(o=>(o==null?void 0:o.cellId)===t?null:{cellId:t})},hotkey:"cell.aiCompletion"},{icon:(0,l.jsx)(Z,{size:13,strokeWidth:1.5}),label:"Split",hotkey:"cell.splitCell",handle:()=>T({cellId:t})},{icon:(0,l.jsx)(Ie,{size:13,strokeWidth:1.5}),label:"Format",hotkey:"cell.format",handle:()=>{let o=d();o&&ne({[t]:o})}},{icon:i.hide_code?(0,l.jsx)(se,{size:13,strokeWidth:1.5}):(0,l.jsx)(ze,{size:13,strokeWidth:1.5}),label:i.hide_code?"Show code":"Hide code",handle:q,hotkey:"cell.hideCode"},{icon:i.disabled?(0,l.jsx)(ee,{size:13,strokeWidth:1.5}):(0,l.jsx)(le,{size:13,strokeWidth:1.5}),label:i.disabled?"Enable execution":"Disable execution",handle:P,hidden:n}],[{icon:(0,l.jsx)(Qe,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:async()=>{let o=d();o&&(K({autoInstantiate:v,createNewCell:m}),Q(o,{language:"markdown",keepCodeAsIs:!1}),i.hide_code||(await r({configs:{[t]:{hide_code:!0}}}),s({cellId:t,config:{hide_code:!0}}),S({cellId:t})))},hidden:n},fe(d())==="sql"?{icon:(0,l.jsx)(Ue,{}),label:"View as Python",hotkey:"cell.viewAsSQL",handle:()=>{let o=d();o&&ce(o,"python",{force:!0})},hidden:n}:{icon:(0,l.jsx)(me,{size:13,strokeWidth:1.5}),label:"Convert to SQL",hotkey:"cell.viewAsSQL",handle:()=>{let o=d();o&&(K({autoInstantiate:v,createNewCell:m}),Q(o,{language:"sql",keepCodeAsIs:!1}))},hidden:n}],[{icon:(0,l.jsxs)(X,{children:[(0,l.jsx)(G,{size:13,strokeWidth:1.5}),(0,l.jsx)(F,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>m({cellId:t,before:!0}),hidden:n,redundant:!0},{icon:(0,l.jsxs)(X,{children:[(0,l.jsx)(G,{size:13,strokeWidth:1.5}),(0,l.jsx)(V,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>m({cellId:t,before:!1}),redundant:!0},{icon:(0,l.jsx)(F,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>p({cellId:t,before:!0}),hidden:n},{icon:(0,l.jsx)(V,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>p({cellId:t,before:!1}),hidden:n},{icon:(0,l.jsx)(Ce,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>p({cellId:t,direction:"left"}),hidden:y!=="columns"||n},{icon:(0,l.jsx)(ge,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>p({cellId:t,direction:"right"}),hidden:y!=="columns"||n},{icon:(0,l.jsx)($,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>W({cellId:t,scroll:!1}),hidden:n},{icon:(0,l.jsx)(Y,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>M({cellId:t,scroll:!1}),hidden:n},{icon:(0,l.jsx)(he,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",handle:()=>_({cellId:t}),hidden:y!=="columns"||n}],[{icon:(0,l.jsx)(We,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!w,handle:()=>we(t,"result")},{icon:(0,l.jsx)(re,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(w||H),handle:()=>{A({cellId:t})}}],[{icon:(0,l.jsx)(Ve,{size:13,strokeWidth:1.5}),label:"Name",disableClick:!0,handle:el,handleHeadless:()=>{j((0,l.jsxs)(Be,{children:[(0,l.jsx)(Ne,{children:(0,l.jsx)(Re,{children:"Rename cell"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(qe,{htmlFor:"cell-name",children:"Cell name"}),(0,l.jsx)(J,{placeholder:"cell name",value:h,onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),o.stopPropagation(),j(null))},onChange:o=>x({cellId:t,name:o})})]})]}))},rightElement:(0,l.jsx)(J,{placeholder:"cell name",value:h,onChange:o=>x({cellId:t,name:o}),onEnterKey:()=>u==null?void 0:u()}),hidden:n},{icon:(0,l.jsx)(Me,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!oe(h),tooltip:oe(h)?void 0:"Only named cells can be linked to",handle:async()=>{await Le(Ge(h)),De({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!E,variant:"danger",icon:(0,l.jsx)(Te,{size:13,strokeWidth:1.5}),handle:()=>{N({cellId:t})}}]].map($e).filter(Ye),e[15]=_,e[16]=B,e[17]=y,e[18]=v,e[19]=E,e[20]=t,e[21]=A,e[22]=u,e[23]=i.disabled,e[24]=i.hide_code,e[25]=m,e[26]=N,e[27]=d,e[28]=H,e[29]=w,e[30]=n,e[31]=S,e[32]=p,e[33]=h,e[34]=j,e[35]=r,e[36]=M,e[37]=W,e[38]=R,e[39]=T,e[40]=O,e[41]=k,e[42]=P,e[43]=q,e[44]=s,e[45]=x,e[46]=z):z=e[46],z}function Ye(a){return a.length>0}function $e(a){return a.filter(Ze)}function Ze(a){return!a.hidden}function el(a){a==null||a.stopPropagation(),a==null||a.preventDefault()}export{Z as a,ee as i,Ke as n,$ as o,le as r,Y as s,Xe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as v}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-O0nX5vok.js";import{E as p,b as D,v as h}from"./cells-
|
|
1
|
+
import{s as v}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-O0nX5vok.js";import{E as p,b as D,v as h}from"./cells-Bg7-G3QJ.js";import{t as C}from"./compiler-runtime-B3qBwwSJ.js";import{t as I}from"./useEventListener-Dy81QR4n.js";import{t as x}from"./jsx-runtime-icT_Ltz2.js";import{t as _}from"./button-Ej3vmCIF.js";import{r as b}from"./requests-Bgjtqo_1.js";import{t as g}from"./use-toast-Hc8CXlvz.js";import{n as j}from"./renderShortcut-CnD1Dah5.js";var w=C(),d=v(x(),1);const f=e=>{let t=(0,w.c)(7),l;t[0]===e?l=t[1]:(l=a=>{var s;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(s=e.onClick)==null||s.call(e,a))},t[0]=e,t[1]=l);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r={capture:!0},t[2]=r):r=t[2],I(window,"keydown",l,r);let o=e.children??"Undo",i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,d.jsx)(j,{className:"ml-2",shortcut:"cmd-z"}),t[3]=i):i=t[3];let n;return t[4]!==o||t[5]!==e?(n=(0,d.jsxs)(_,{"data-testid":"undo-button",size:"sm",variant:"outline",...e,children:[o," ",i]}),t[4]=o,t[5]=e,t[6]=n):n=t[6],n};var y=C();function z(){let e=(0,y.c)(4),{deleteCell:t,undoDeleteCell:l}=p(),{sendDeleteCell:r}=b(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=i=>{var s;if(m.get(h))return;let{cellId:n}=i,a=(((s=m.get(D).cellData[n])==null?void 0:s.code)??"").trim()==="";if(t({cellId:n}),r({cellId:n}).catch(()=>{l()}),!a){let{dismiss:c}=g({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{l(),k()}})}),k=c}},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}function K(){let e=(0,y.c)(4),{deleteCell:t,undoDeleteCell:l}=p(),{sendDeleteCell:r}=b(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=async i=>{if(m.get(h))return;let{cellIds:n}=i;for(let c of n)await r({cellId:c}).then(()=>{t({cellId:c})});let{dismiss:a}=g({title:"Cells deleted",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{for(let c of n)l();s()}})}),s=a},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}export{K as n,f as r,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as G}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as M,p as Z,u as $}from"./useEvent-O0nX5vok.js";import{t as ee}from"./react-Bj1aDYRI.js";import{G as te,yt as re}from"./cells-
|
|
1
|
+
import{s as G}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as M,p as Z,u as $}from"./useEvent-O0nX5vok.js";import{t as ee}from"./react-Bj1aDYRI.js";import{G as te,yt as re}from"./cells-Bg7-G3QJ.js";import{t as V}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./jsx-runtime-icT_Ltz2.js";import{t as ae}from"./cn-BoaCR37F.js";import{t as ne}from"./createLucideIcon-Cm-Z7dYr.js";import{t as se}from"./useCellActionButton-D-FPtHfb.js";import{a as oe,n as ie,o as ce,t as me}from"./tooltip-D9723Brr.js";import{d as de}from"./alert-dialog-9WfvUF7e.js";import{i as B,r as he,t as J}from"./popover-BPGG2gPG.js";import{a as pe,c as fe,i as ue,o as xe,r as je,t as be,u as ye}from"./command-Bb5BQ9IQ.js";import{n as ve}from"./focus-DKnBT1ji.js";import{a as Ne,i as ge}from"./renderShortcut-CnD1Dah5.js";var we=ne("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),K=V(),h=G(ee(),1),t=G(le(),1);const L=h.memo(h.forwardRef((r,a)=>{let e=(0,K.c)(39),{children:n,showTooltip:c,...m}=r,p=c===void 0?!0:c,[d,I]=(0,h.useState)(!1),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>I(!1),e[0]=N):N=e[0];let W=N,D=(0,h.useRef)(null),E=se({cell:m,closePopover:W}).map(Ce).filter(_e),P=de(),g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{te(()=>{D.current&&D.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[1]=g):g=e[1];let T=M(g),w;e[2]===T?w=e[3]:(w=s=>{I(o=>{let l=typeof s=="function"?s(o):s;return l&&T(),l})},e[2]=T,e[3]=w);let i=M(w),k;e[4]===i?k=e[5]:(k=()=>({toggle:()=>i(Se)}),e[4]=i,e[5]=k),(0,h.useImperativeHandle)(a,k);let O=he,A=be,F=re(m.cellId),f;e[6]===F?f=e[7]:(f=(0,t.jsx)(pe,{placeholder:"Search actions...",className:"h-6 m-1",...F}),e[6]=F,e[7]=f);let H=ye,u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(je,{children:"No results"}),e[8]=u):u=e[8];let R=E.map((s,o)=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsx)(ue,{children:s.map(l=>{let z=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[l.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:l.icon}),(0,t.jsx)("div",{className:"flex-1",children:l.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[l.hotkey&&ge(l.hotkey),l.rightElement]})]});return l.tooltip&&(z=(0,t.jsx)(me,{content:l.tooltip,delayDuration:100,children:z})),(0,t.jsx)(xe,{className:ae(l.disabled&&"opacity-50!"),onSelect:()=>{l.disableClick||l.disabled||(l.handle(),I(!1))},variant:l.variant,children:z},l.label)})},o),o<E.length-1&&(0,t.jsx)(fe,{})]},o)),x;e[9]!==H||e[10]!==u||e[11]!==R?(x=(0,t.jsxs)(H,{children:[u,R]}),e[9]=H,e[10]=u,e[11]=R,e[12]=x):x=e[12];let j;e[13]!==A||e[14]!==x||e[15]!==f?(j=(0,t.jsxs)(A,{children:[f,x]}),e[13]=A,e[14]=x,e[15]=f,e[16]=j):j=e[16];let C;e[17]!==O||e[18]!==P||e[19]!==j?(C=(0,t.jsx)(O,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...P,children:j}),e[17]=O,e[18]=P,e[19]=j,e[20]=C):C=e[20];let b=C;if(!p){let s;e[21]===n?s=e[22]:(s=(0,t.jsx)(B,{asChild:!0,children:n}),e[21]=n,e[22]=s);let o;return e[23]!==b||e[24]!==i||e[25]!==d||e[26]!==s?(o=(0,t.jsxs)(J,{open:d,onOpenChange:i,children:[s,b]}),e[23]=b,e[24]=i,e[25]=d,e[26]=s,e[27]=o):o=e[27],o}let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)(ie,{tabIndex:-1,children:Ne("cell.cellActions")}),e[28]=_):_=e[28];let q=!d&&_,y;e[29]===n?y=e[30]:(y=(0,t.jsx)(ce,{ref:D,children:(0,t.jsx)(B,{className:"flex",children:n})}),e[29]=n,e[30]=y);let v;e[31]!==q||e[32]!==y?(v=(0,t.jsxs)(oe,{delayDuration:200,disableHoverableContent:!0,children:[q,y]}),e[31]=q,e[32]=y,e[33]=v):v=e[33];let S;return e[34]!==b||e[35]!==i||e[36]!==d||e[37]!==v?(S=(0,t.jsxs)(J,{open:d,onOpenChange:i,children:[v,b]}),e[34]=b,e[35]=i,e[36]=d,e[37]=v,e[38]=S):S=e[38],S})),Q=h.memo(r=>{let a=(0,K.c)(5),{children:e,cellId:n}=r,c;a[0]===n?c=a[1]:(c=ve(n),a[0]=n,a[1]=c);let m=$(c);if(!m)return null;let p;return a[2]!==e||a[3]!==m?(p=(0,t.jsx)(L,{showTooltip:!1,...m,children:e}),a[2]=e,a[3]=m,a[4]=p):p=a[4],p});Q.displayName="ConnectionCellActionsDropdown";function ke(r){return!r.redundant}function Ce(r){return r.filter(ke)}function _e(r){return r.length>0}function Se(r){return!r}var Ie=V();const U=Z("minimap");function De(){let r=(0,Ie.c)(3),[a,e]=Y(U),n;return r[0]!==a||r[1]!==e?(n={dependencyPanelTab:a,setDependencyPanelTab:e},r[0]=a,r[1]=e,r[2]=n):n=r[2],n}function Pe(){return X(U)}export{we as a,Q as i,Pe as n,L as r,De as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Xe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cr as tt,E as ge,Ft as at,Qn as ot,Yn as nt,_ as it,dn as st,fn as lt,gn as rt,h as je,li as ce,pn as dt,qn as ct,rr as ht,t as pt}from"./cells-fq1RMGX_.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as mt}from"./assertNever-DWSyoPEi.js";import{s as ve}from"./useLifecycle-DA9DjSPo.js";import{i as ut,n as Ce}from"./add-connection-dialog-CBz0AUVX.js";import{n as ft,x as yt}from"./ai-model-dropdown-DPTa_EpU.js";import{c as ze,m as H}from"./useEventListener-Dy81QR4n.js";import{y as kt}from"./utils-tNbLd14P.js";import{n as A,t as Me}from"./constants-Rz_lD4HK.js";import{S as he,h as bt,x as xt}from"./config-3Aq84phF.js";import{t as wt}from"./jsx-runtime-icT_Ltz2.js";import{r as gt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as We,f as jt,i as Se,m as vt,p as De,u as _e}from"./layout-CwFtCyW8.js";import{t as Ae}from"./check-BE0hEwVo.js";import{c as Ne,d as me,n as Ct,o as zt,r as ue,t as Mt}from"./download-B9_ToVd4.js";import{f as Wt}from"./maps-OKerBHH8.js";import{r as St}from"./useCellActionButton-GUb2fXU8.js";import{t as Dt}from"./copy-CkudG0Ej.js";import{t as _t}from"./download-DBW9RXtT.js";import{t as At}from"./eye-off-vwi9L975.js";import{t as Nt}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Pt}from"./github-BVtI-3F1.js";import{m as It}from"./form-CrQYrsUC.js";import{n as Et,r as Lt,t as Ht}from"./youtube-DE-Ej6FR.js";import{n as Tt,t as qt}from"./square-CxAsQQ77.js";import{t as Rt}from"./image-DXfkah9d.js";import{t as Bt}from"./link-Cf10mh3t.js";import{r as Ft}from"./input-CUwqpKjd.js";import{t as Vt}from"./settings-CzQUw9rV.js";import{x as Yt}from"./azure-BTXHztTw.js";import{t as C}from"./use-toast-Hc8CXlvz.js";import{n as Pe,t as Ot}from"./paths-D2lG83Oh.js";import{o as Kt}from"./session-BrEm7qNv.js";import{a as Ut,c as $t,i as Gt,n as Jt,r as Qt,s as Zt,t as Xt}from"./select-CxT2Geqr.js";import{t as ea}from"./tooltip-D9723Brr.js";import{a as Ie,i as ta,r as aa}from"./mode-AcL8c6qH.js";import{o as oa}from"./alert-dialog-9WfvUF7e.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-CVN1lcMF.js";import{n as fe}from"./ImperativeModal-qEtcJ95s.js";import{r as da,t as ca}from"./share-BdH_5I58.js";import{n as Q}from"./copy-YwM0Pd7v.js";import{r as ha}from"./useRunCells-5m6jCnyo.js";import{a as pa}from"./cell-link-Q_UEP94Z.js";import{a as ma}from"./renderShortcut-CnD1Dah5.js";import{t as ua}from"./icons-CrUXojcA.js";import{t as fa}from"./links-CIQwYQ48.js";import{r as ya,t as Ee}from"./hooks-CHx5dUUq.js";import{t as Le}from"./types-BfP_kuAY.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Te=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),qe=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),xa=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),wa=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),ga=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Re=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ja=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),va=h("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),za=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ma=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Fe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Ve=_(),ye=we(et(),1),a=we(wt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Ve.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let P=await r({download:!1,includeCode:!0,files:jt.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:P,path:l})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Ft,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await Q(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Ve.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=gt.stopPropagation(async m=>{m.preventDefault(),await Q(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(ea,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(Me.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Me.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ye(){let e=(0,Da.c)(2),t=L(Ie),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:ta(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Oe=Xe(!1);var Na=_();const Pa=()=>{let e=(0,Na.c)(7),{selectedLayout:t}=We(),{setLayoutView:n}=Se();if(he()&&!rt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Zt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Jt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Ut,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(Xt,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Lt;case"slides":return Be;default:return mt(e),qt}}function Ue(e){return ve(e)}function Ea(e){return(0,a.jsx)(Gt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ot.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Pe.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Pe.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=ze.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(bt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(oa,{onClick:async()=>{n({state:xt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),N=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=st(),{selectedPanel:r}=lt(),[l]=Ze(Ie),i=de(aa),d=qa(),[m]=kt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Oe),P=L(ft),z=L(yt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(it),ne=de(pt),{selectedLayout:q}=We(),{setLayoutView:ie}=Se(),R=Ye(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,V;e[0]!==t||e[1]!==W||e[2]!==M?(V=async c=>{let{preset:p,title:E}=c;if(!t){X();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Ct})})},e[0]=t,e[1]=W,e[2]=M,e[3]=V):V=e[3];let S=V,Y;e[4]===S?Y=e[5]:(Y=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=Y);let O=Y,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){X();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(De,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){X();return}await _e({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==O||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==P||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:N,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(De,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){X();return}await _e({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:N,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:O},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:N,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Bt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await Q(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:N,dropdown:dt.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Qe}=c;return re?[]:{label:ve(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Qe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:N,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Ae,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await Q((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(St,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=tt(je());await ae({configs:ze.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(nt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ce,{onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ce,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ot,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(At,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Vt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>P(Xa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"Resources",handle:N,dropdown:[{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Qa},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Tt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Oa).map(Va),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=O,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=P,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Va(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Ya)}:e}function Ya(e){return!e.hidden}function Oa(e){return!e.hidden}function Ka(){let e=Kt();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Qa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Xa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await zt({element:e,filename:document.title,prepare:Mt})}function no(){return window.print()}function io(e){return e?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ae,{size:14})})}function X(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ye as a,qe as c,Oe as i,Te as l,$e as n,Fe as o,Pa as r,Re as s,Fa as t,He as u};
|
|
1
|
+
import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Xe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cr as tt,E as ge,Ft as at,Qn as ot,Yn as nt,_ as it,dn as st,fn as lt,gn as rt,h as je,li as ce,pn as dt,qn as ct,rr as ht,t as pt}from"./cells-Bg7-G3QJ.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as mt}from"./assertNever-DWSyoPEi.js";import{s as ve}from"./useLifecycle-DA9DjSPo.js";import{i as ut,n as Ce}from"./add-connection-dialog-D-YPxf1v.js";import{n as ft,x as yt}from"./ai-model-dropdown-aWQwR5QF.js";import{c as ze,m as H}from"./useEventListener-Dy81QR4n.js";import{y as kt}from"./utils-tNbLd14P.js";import{n as A,t as Me}from"./constants-Rz_lD4HK.js";import{S as he,h as bt,x as xt}from"./config-3Aq84phF.js";import{t as wt}from"./jsx-runtime-icT_Ltz2.js";import{r as gt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as We,f as jt,i as Se,m as vt,p as De,u as _e}from"./layout-fT20kG4_.js";import{t as Ae}from"./check-BE0hEwVo.js";import{c as Ne,d as me,n as Ct,o as zt,r as ue,t as Mt}from"./download-hacnp18J.js";import{f as Wt}from"./maps-OKerBHH8.js";import{r as St}from"./useCellActionButton-D-FPtHfb.js";import{t as Dt}from"./copy-CkudG0Ej.js";import{t as _t}from"./download-DBW9RXtT.js";import{t as At}from"./eye-off-vwi9L975.js";import{t as Nt}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Pt}from"./github-BVtI-3F1.js";import{m as It}from"./form-DRz7hUP9.js";import{n as Et,r as Lt,t as Ht}from"./youtube-DE-Ej6FR.js";import{n as Tt,t as qt}from"./square-CxAsQQ77.js";import{t as Rt}from"./image-DXfkah9d.js";import{t as Bt}from"./link-Cf10mh3t.js";import{r as Ft}from"./input-CUwqpKjd.js";import{t as Vt}from"./settings-CzQUw9rV.js";import{x as Yt}from"./azure-B4I1bDnQ.js";import{t as C}from"./use-toast-Hc8CXlvz.js";import{n as Pe,t as Ot}from"./paths-D2lG83Oh.js";import{o as Kt}from"./session-BrEm7qNv.js";import{a as Ut,c as $t,i as Gt,n as Jt,r as Qt,s as Zt,t as Xt}from"./select-CxT2Geqr.js";import{t as ea}from"./tooltip-D9723Brr.js";import{a as Ie,i as ta,r as aa}from"./mode-CdFYvrq5.js";import{o as oa}from"./alert-dialog-9WfvUF7e.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-CVN1lcMF.js";import{n as fe}from"./ImperativeModal-qEtcJ95s.js";import{r as da,t as ca}from"./share-BdH_5I58.js";import{n as Q}from"./copy-CA4fP28I.js";import{r as ha}from"./useRunCells-RUEojcb5.js";import{a as pa}from"./cell-link-DFqw-p8a.js";import{a as ma}from"./renderShortcut-CnD1Dah5.js";import{t as ua}from"./icons-CrUXojcA.js";import{t as fa}from"./links-CIQwYQ48.js";import{r as ya,t as Ee}from"./hooks-3nahTPnh.js";import{t as Le}from"./types-BfP_kuAY.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Te=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),qe=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),xa=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),wa=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),ga=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Re=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ja=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),va=h("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),za=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ma=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Fe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Ve=_(),ye=we(et(),1),a=we(wt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Ve.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let P=await r({download:!1,includeCode:!0,files:jt.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:P,path:l})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Ft,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await Q(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Ve.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=gt.stopPropagation(async m=>{m.preventDefault(),await Q(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(ea,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(Me.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Me.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ye(){let e=(0,Da.c)(2),t=L(Ie),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:ta(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Oe=Xe(!1);var Na=_();const Pa=()=>{let e=(0,Na.c)(7),{selectedLayout:t}=We(),{setLayoutView:n}=Se();if(he()&&!rt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Zt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Jt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Ut,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(Xt,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Lt;case"slides":return Be;default:return mt(e),qt}}function Ue(e){return ve(e)}function Ea(e){return(0,a.jsx)(Gt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ot.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Pe.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Pe.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=ze.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(bt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(oa,{onClick:async()=>{n({state:xt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),N=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=st(),{selectedPanel:r}=lt(),[l]=Ze(Ie),i=de(aa),d=qa(),[m]=kt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Oe),P=L(ft),z=L(yt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(it),ne=de(pt),{selectedLayout:q}=We(),{setLayoutView:ie}=Se(),R=Ye(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,V;e[0]!==t||e[1]!==W||e[2]!==M?(V=async c=>{let{preset:p,title:E}=c;if(!t){X();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Ct})})},e[0]=t,e[1]=W,e[2]=M,e[3]=V):V=e[3];let S=V,Y;e[4]===S?Y=e[5]:(Y=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=Y);let O=Y,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){X();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(De,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){X();return}await _e({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==O||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==P||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:N,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(De,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){X();return}await _e({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:N,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:O},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:N,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Bt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await Q(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:N,dropdown:dt.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Qe}=c;return re?[]:{label:ve(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Qe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:N,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Ae,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await Q((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(St,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=tt(je());await ae({configs:ze.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(nt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ce,{onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ce,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ot,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(At,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Vt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>P(Xa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"Resources",handle:N,dropdown:[{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Qa},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Tt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Oa).map(Va),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=O,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=P,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Va(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Ya)}:e}function Ya(e){return!e.hidden}function Oa(e){return!e.hidden}function Ka(){let e=Kt();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Qa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Xa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await zt({element:e,filename:document.title,prepare:Mt})}function no(){return window.print()}function io(e){return e?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ae,{size:14})})}function X(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ye as a,qe as c,Oe as i,Te as l,$e as n,Fe as o,Pa as r,Re as s,Fa as t,He as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,n as i,p as k}from"./useEvent-O0nX5vok.js";import{E as v,Or as y,h as d,st as F,wn as b,wr as x}from"./cells-
|
|
1
|
+
import{d as g,n as i,p as k}from"./useEvent-O0nX5vok.js";import{E as v,Or as y,h as d,st as F,wn as b,wr as x}from"./cells-Bg7-G3QJ.js";import{t as D}from"./compiler-runtime-B3qBwwSJ.js";import{m as E}from"./useEventListener-Dy81QR4n.js";import{o as H}from"./dist-D0Vj4Kqc.js";import{r as O}from"./requests-Bgjtqo_1.js";var u=D();const w=k(!1);function V(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(y(d())),r[0]=n,r[1]=t),i(t)}function _(r){let n=(0,u.c)(3),t=f(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function j(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(x(d())),r[0]=n,r[1]=t),i(t)}function f(){let r=(0,u.c)(4),{prepareForRun:n}=v(),{sendRun:t}=O(),e=g(w),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),I({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function I({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,p;l?(b(l)!=="markdown"&&H(l),p=F(l)):p=((R=s[a])==null?void 0:R.code)||"",c.push(p),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{E.error(a)})}export{f as a,_ as i,I as n,V as o,j as r,w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-O0nX5vok.js";import{E as d,f,st as u}from"./cells-
|
|
1
|
+
import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-O0nX5vok.js";import{E as d,f,st as u}from"./cells-Bg7-G3QJ.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-icT_Ltz2.js";import{t as h}from"./use-toast-Hc8CXlvz.js";import{r as v}from"./useDeleteCell-DSrWT4rB.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:s,undoSplitCell:i}=d(),o;return t[0]!==s||t[1]!==i?(o=r=>{let l=f(r.cellId);if(!l)return;let a=u(l);s(r);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{i({...r,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=s,t[1]=i,t[2]=o):o=t[2],p(o)}export{j as t};
|
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-CIk_2P5O.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-BW0IMuFq.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/clsx-BDxNtGmi.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/cn-BoaCR37F.js">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/toInteger-CO3ppIfA.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/database-zap-DTWCDKdn.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/main-DrBRErTM.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-Bg7-G3QJ.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/spinner-C5JoisA7.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-D0GQBpTb.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-DdPu5Kfu.js">
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/dist-BhNN2V5a.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/label-TNNaT1M9.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/useDebounce-B0dx2Gp0.js">
|
|
151
|
-
<link rel="modulepreload" crossorigin href="./assets/azure-
|
|
151
|
+
<link rel="modulepreload" crossorigin href="./assets/azure-B4I1bDnQ.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/numbers-CYnquDho.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/SSRProvider-DC7ElCZZ.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/context-CIAP2NOh.js">
|
|
@@ -157,13 +157,13 @@
|
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/input-CUwqpKjd.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/links-DzgPOFJ-.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/popover-BPGG2gPG.js">
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/switch-
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/switch-DhfF9ECb.js">
|
|
161
161
|
<link rel="modulepreload" crossorigin href="./assets/table-BhH-Mm8O.js">
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/mode-
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/mode-CdFYvrq5.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-D-4ifFXh.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/errors-Bfogio62.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/error-banner-BRG6IPhC.js">
|
|
166
|
-
<link rel="modulepreload" crossorigin href="./assets/copy-
|
|
166
|
+
<link rel="modulepreload" crossorigin href="./assets/copy-CA4fP28I.js">
|
|
167
167
|
<link rel="modulepreload" crossorigin href="./assets/memoize-Bw1ifb7c.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/get-DBdMgUNq.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/capitalize-BfkXNxmI.js">
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-CHAHPgkx.js">
|
|
173
173
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-CAoNMkjq.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-qZo1ox6x.js">
|
|
175
|
-
<link rel="modulepreload" crossorigin href="./assets/ai-model-dropdown-
|
|
175
|
+
<link rel="modulepreload" crossorigin href="./assets/ai-model-dropdown-aWQwR5QF.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/defaultLocale-OkOxlkkM.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/precisionRound-BOmLQIKI.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/defaultLocale-DK1MWd7f.js">
|
|
@@ -181,21 +181,21 @@
|
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-Ba0LbbH4.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-C9V-on2J.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/ImperativeModal-qEtcJ95s.js">
|
|
184
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
185
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
186
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
187
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
188
|
-
<link rel="modulepreload" crossorigin href="./assets/copy-icon-
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/html-to-image-
|
|
190
|
-
<link rel="modulepreload" crossorigin href="./assets/focus-
|
|
191
|
-
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-
|
|
184
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-DFqw-p8a.js">
|
|
185
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-nFaOdZWT.js">
|
|
186
|
+
<link rel="modulepreload" crossorigin href="./assets/state-CXu3CC70.js">
|
|
187
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-CuRqjiUs.js">
|
|
188
|
+
<link rel="modulepreload" crossorigin href="./assets/copy-icon-C6n2vWSW.js">
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/html-to-image-CN0roffg.js">
|
|
190
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-DKnBT1ji.js">
|
|
191
|
+
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-Dmh6kfiy.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-CM1a_K7I.js">
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/katex-rvFxOCU-.js">
|
|
194
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
195
|
-
<link rel="modulepreload" crossorigin href="./assets/command-
|
|
196
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
197
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
198
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
194
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-A3Ed0cjI.js">
|
|
195
|
+
<link rel="modulepreload" crossorigin href="./assets/command-Bb5BQ9IQ.js">
|
|
196
|
+
<link rel="modulepreload" crossorigin href="./assets/download-hacnp18J.js">
|
|
197
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-RUEojcb5.js">
|
|
198
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-D_zT74Lq.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-DTN9kFDq.js">
|
|
200
200
|
<link rel="modulepreload" crossorigin href="./assets/formats-rhOJovGE.js">
|
|
201
201
|
<link rel="modulepreload" crossorigin href="./assets/en-US-BO8E69bZ.js">
|
|
@@ -207,42 +207,42 @@
|
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/useDateFormatter-CpE7XQLs.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/range-CJeRXUtp.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/table-BCnp9gKC.js">
|
|
210
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
211
|
-
<link rel="modulepreload" crossorigin href="./assets/useDeleteCell-
|
|
210
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-BKsCyU13.js">
|
|
211
|
+
<link rel="modulepreload" crossorigin href="./assets/useDeleteCell-DSrWT4rB.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/icons-CrUXojcA.js">
|
|
213
|
-
<link rel="modulepreload" crossorigin href="./assets/process-output-
|
|
213
|
+
<link rel="modulepreload" crossorigin href="./assets/process-output-CwDI4Cei.js">
|
|
214
214
|
<link rel="modulepreload" crossorigin href="./assets/blob-CObhN-9g.js">
|
|
215
215
|
<link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-DP4vAkvg.js">
|
|
216
216
|
<link rel="modulepreload" crossorigin href="./assets/esm-CBkHtTOV.js">
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/file-DzHkbIdO.js">
|
|
218
218
|
<link rel="modulepreload" crossorigin href="./assets/image-DXfkah9d.js">
|
|
219
219
|
<link rel="modulepreload" crossorigin href="./assets/play-DKSqmedg.js">
|
|
220
|
-
<link rel="modulepreload" crossorigin href="./assets/add-cell-with-ai-
|
|
220
|
+
<link rel="modulepreload" crossorigin href="./assets/add-cell-with-ai-mTm-dtan.js">
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/isEmpty-CfmnKtgL.js">
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/bot-message-square-CK6eoGWy.js">
|
|
223
|
-
<link rel="modulepreload" crossorigin href="./assets/chat-display-
|
|
223
|
+
<link rel="modulepreload" crossorigin href="./assets/chat-display-B6a8fK7j.js">
|
|
224
224
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-DV8gdCvH.js">
|
|
225
225
|
<link rel="modulepreload" crossorigin href="./assets/square-function-B006EYFX.js">
|
|
226
226
|
<link rel="modulepreload" crossorigin href="./assets/spec-DbmSqx09.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-CAB7tdza.js">
|
|
228
|
-
<link rel="modulepreload" crossorigin href="./assets/components-
|
|
229
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
228
|
+
<link rel="modulepreload" crossorigin href="./assets/components-DREyNirk.js">
|
|
229
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-CtAbPvyW.js">
|
|
230
230
|
<link rel="modulepreload" crossorigin href="./assets/toggle-RCwU-rnE.js">
|
|
231
|
-
<link rel="modulepreload" crossorigin href="./assets/globals-
|
|
231
|
+
<link rel="modulepreload" crossorigin href="./assets/globals-ByNi1JTJ.js">
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/share-BdH_5I58.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/_baseSet-D5BgdrnX.js">
|
|
234
234
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-DDRqG5ui.js">
|
|
235
|
-
<link rel="modulepreload" crossorigin href="./assets/context-aware-panel-
|
|
236
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
237
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
235
|
+
<link rel="modulepreload" crossorigin href="./assets/context-aware-panel-91O6JrAw.js">
|
|
236
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-D466s5lB.js">
|
|
237
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-rz5hgq-s.js">
|
|
238
238
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-vwi9L975.js">
|
|
239
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
239
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-i_LeNopW.js">
|
|
240
240
|
<link rel="modulepreload" crossorigin href="./assets/file-headphone-B5q2Ow55.js">
|
|
241
|
-
<link rel="modulepreload" crossorigin href="./assets/file-icons-
|
|
241
|
+
<link rel="modulepreload" crossorigin href="./assets/file-icons-DWJwqnd-.js">
|
|
242
242
|
<link rel="modulepreload" crossorigin href="./assets/refresh-ccw-DLpfIr8v.js">
|
|
243
|
-
<link rel="modulepreload" crossorigin href="./assets/form-
|
|
243
|
+
<link rel="modulepreload" crossorigin href="./assets/form-DRz7hUP9.js">
|
|
244
244
|
<link rel="modulepreload" crossorigin href="./assets/field-B1jGbQlH.js">
|
|
245
|
-
<link rel="modulepreload" crossorigin href="./assets/useBoolean-
|
|
245
|
+
<link rel="modulepreload" crossorigin href="./assets/useBoolean-BYlCXj8U.js">
|
|
246
246
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-yyiB9aJX.js">
|
|
247
247
|
<link rel="modulepreload" crossorigin href="./assets/types-C1RN112u.js">
|
|
248
248
|
<link rel="modulepreload" crossorigin href="./assets/prop-types-RrUi-pOT.js">
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
<link rel="stylesheet" crossorigin href="./assets/cells-jmgGt1lS.css">
|
|
260
260
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
|
|
261
261
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-B7vuddcd.css">
|
|
262
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
262
|
+
<link rel="stylesheet" crossorigin href="./assets/index-D3rIJiKM.css">
|
|
263
263
|
</head>
|
|
264
264
|
<body>
|
|
265
265
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
4
|
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
5
|
+
import { merge } from "lodash-es";
|
|
5
6
|
import {
|
|
6
7
|
AlertTriangleIcon,
|
|
7
8
|
BrainIcon,
|
|
@@ -287,10 +288,10 @@ export const UserConfigForm: React.FC = () => {
|
|
|
287
288
|
dirtyValues.ai = setAiModels(values.ai, dirtyValues.ai);
|
|
288
289
|
}
|
|
289
290
|
|
|
290
|
-
await saveUserConfig({ config: dirtyValues })
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
291
|
+
await saveUserConfig({ config: dirtyValues });
|
|
292
|
+
// Only apply the changed keys; this avoids stale request responses
|
|
293
|
+
// overwriting newer config changes.
|
|
294
|
+
setConfig((prev) => merge({}, prev, dirtyValues));
|
|
294
295
|
};
|
|
295
296
|
const onSubmit = useDebouncedCallback(onSubmitNotDebounced, FORM_DEBOUNCE);
|
|
296
297
|
|