{ e.dataTransfer?.setData('application/x-kb-dir-move', JSON.stringify({ dirId: directory.id })); }} on:dblclick={() => { if (writeAccess) startRename(); }} on:dragover={(e) => { const hasFile = e.dataTransfer?.types.includes('application/x-kb-file-move'); const hasDir = e.dataTransfer?.types.includes('application/x-kb-dir-move'); if (!hasFile && !hasDir) return; e.preventDefault(); e.stopPropagation(); dragOver = true; }} on:dragleave={() => { dragOver = false; }} on:drop={(e) => { e.preventDefault(); e.stopPropagation(); dragOver = false; const fileRaw = e.dataTransfer?.getData('application/x-kb-file-move'); if (fileRaw) { try { const data = JSON.parse(fileRaw); onFileDrop(data.fileId, directory.id); } catch {} return; } const dirRaw = e.dataTransfer?.getData('application/x-kb-dir-move'); if (dirRaw) { try { const data = JSON.parse(dirRaw); if (data.dirId !== directory.id) { onDirDrop(data.dirId, directory.id); } } catch {} } }} >
{#if writeAccess}
{/if}