(isDragOver = false)} on:drop={handleDrop} role="region" aria-label={$i18n.t('Pyodide file browser')} >
{#if overlay}
{/if}
loadDir(path)} listFolders={async (path) => { try { const res = await sendWorkerMessage({ type: 'fs:list', path: path.replace(/\/$/, '') || '/' }); return (res.entries || []) .filter((entry: FileEntry) => entry.type === 'directory') .map((entry: FileEntry) => entry.name); } catch { return []; } }} onRefresh={async () => { try { await sendWorkerMessage({ type: 'fs:sync' }); } catch {} if (selectedFile) { const name = selectedFile.split('/').pop() ?? ''; openEntry({ name, type: 'file', size: 0 }); } else { loadDir(currentPath); } }} onNewFolder={startNewFolder} onNewFile={startNewFile} onUploadFiles={uploadFiles} onMove={() => {}} >
selectedFile && downloadFile(selectedFile)} aria-label={$i18n.t('Download')} >
{#if selectedFile}
{:else if loading}
{:else if error}
{error}
{:else if entries.length === 0 && !creatingFolder && !creatingFile}
{$i18n.t('This folder is empty')}
{/if} {#if !loading && !error && !selectedFile} {#if creatingFolder}
{ if (e.key === 'Enter') submitNewFolder(); if (e.key === 'Escape') { creatingFolder = false; newFolderName = ''; } }} on:blur={submitNewFolder} />
{/if} {#if creatingFile}
{ if (e.key === 'Enter') submitNewFile(); if (e.key === 'Escape') { creatingFile = false; newFileName = ''; } }} on:blur={submitNewFile} />
{/if} {#if entries.length > 0 || creatingFolder || creatingFile}
{#each entries as entry (entry.name)}
{/each}
{/if} {/if}