diff --git a/package.json b/package.json index 498dd9a..0ce6f88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filedime", - "version": "0.9.52", + "version": "0.9.53", "private": true, "engines": { "node": "20.x" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 55b036d..9a7f0fe 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -868,7 +868,7 @@ dependencies = [ [[package]] name = "filedime" -version = "0.9.52" +version = "0.9.53" dependencies = [ "chrono", "comrak", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index a6efa06..77b6792 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "filedime" -version = "0.9.52" +version = "0.9.53" description = "rust based file explorer." authors = ["visnk"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 1d1a907..ad7a957 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,8 +7,7 @@ "withGlobalTauri": true }, "package": { - "productName": "filedime", - "version": "0.9.52" + "productName": "filedime" }, "tauri": { "allowlist": { diff --git a/src/components/greet.tsx b/src/components/greet.tsx index 16e49ff..11932c5 100644 --- a/src/components/greet.tsx +++ b/src/components/greet.tsx @@ -85,7 +85,8 @@ import { ToastAction } from "./ui/toast"; import Link from "next/link"; import MillerCol from "./millercol"; import GPTchatinterface from "./gptchatinterface"; -let supportedfiles = [ +import EachFromGrid from "./grideach"; +export let supportedfiles = [ "csv", "xlsx", "xls", @@ -2080,162 +2081,7 @@ export default function Greet() { .slice(currentpage*perpage,((currentpage)+1)*perpage) .map((message, index) => (
- } - - - - - - -

{message.path}

- { - invoke("newwindow", - { - path: message.path, - ff:"" - }); - - }}>Open in new window - { - newtab(message.path) - }}>Open in new tab - { - invoke( - "addmark", - { - windowname:appWindow?.label, - path: message.path, - id:new Date().getTime().toString() - } - ); - }}>Add bookmark - { - useEffect(() => { - if (typeof window !== 'undefined'){ - - try { - navigator.clipboard.writeText(message.path); - console.log('Content copied to clipboard'); - } catch (err) { - console.error('Failed to copy: ', err); - } - } - },[])}} - >Copy path to clipboard - { - setfos((old)=>[...old,message.path]) - }}>Copy -
- -
- - {!message.is_dir - // && - // [...MARKDOWN_TYPES,...PLAIN_TEXT,...IMAGE_TYPES,...].some(type => message.path.includes(type)) - // &&(message.name.includes(".pdf")||IMAGE_TYPES.some(type => message.name.includes(type))||HTML_TYPE.some(type => message.name.includes(type))||AUDIO_TYPES.some(type => message.name.includes(type))) - ?( - - - - - - - - Preview - - - - e.preventDefault()} onInteractOutside={(e) => e.preventDefault()}> - - - ):( -
- - - - - - - Load folder contents to search - - -
- )} -
- +
))} diff --git a/src/components/grideach.tsx b/src/components/grideach.tsx new file mode 100644 index 0000000..0ba8e3f --- /dev/null +++ b/src/components/grideach.tsx @@ -0,0 +1,215 @@ +import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem } from "./ui/context-menu"; +import { Folder, FileIcon, EyeIcon, ScanSearchIcon,BotIcon } from "lucide-react"; +import path from "path"; +import { LazyLoadImage } from "react-lazy-load-image-component"; +import { scrollorauto, setcolorpertheme, converttstodt, supportedfiles } from "./greet"; +import { Button } from "./ui/button"; +import { HoverCard, HoverCardTrigger, HoverCardContent } from "./ui/hover-card"; +import { Sheet,SheetTrigger, SheetContent } from "./ui/sheet"; +import { VideoComponent } from "./videoplaycomp"; +import { listen } from "@tauri-apps/api/event"; +import { pathsplit } from "../shared/tstypes"; +import ReadFileComp, { IMAGE_TYPES, MARKDOWN_TYPES, PLAIN_TEXT, VIDEO_TYPES } from "./readfile" +import FRc from "./findsizecomp" +import { convertFileSrc, invoke } from "@tauri-apps/api/tauri"; +import { useEffect, useState } from "react"; +import { FileItem } from "../shared/types"; +import GPTchatinterface from "./gptchatinterface"; + +interface argprops{ + message:FileItem, + populatesearchlist:(path: String) => void; + goto:(path: FileItem) => void; + newtab:(path: string,salt?:string) => void; + addmark:(path: string) => void; + showthumbnail?, + setfos?, + + +} + +export default function EachFromGrid({message,goto,newtab,populatesearchlist,showthumbnail,setfos,addmark}:argprops){ + return(} + + + + + + +

{message.path}

+ { + invoke("newwindow", + { + path: message.path, + ff:"" + }); + + }}>Open in new window + { + newtab(message.path) + }}>Open in new tab + { + addmark(message.path) + }}>Add bookmark + { + useEffect(() => { + if (typeof window !== 'undefined'){ + + try { + navigator.clipboard.writeText(message.path); + console.log('Content copied to clipboard'); + } catch (err) { + console.error('Failed to copy: ', err); + } + } + },[])}} + >Copy path to clipboard + { + setfos((old)=>[...old,message.path]) + }}>Copy +
+ +
+ + {!message.is_dir + // && + // [...MARKDOWN_TYPES,...PLAIN_TEXT,...IMAGE_TYPES,...].some(type => message.path.includes(type)) + // &&(message.name.includes(".pdf")||IMAGE_TYPES.some(type => message.name.includes(type))||HTML_TYPE.some(type => message.name.includes(type))||AUDIO_TYPES.some(type => message.name.includes(type))) + ?(
+ + + + + + + + Preview + + + + e.preventDefault()} onInteractOutside={(e) => e.preventDefault()}> + + + + {(supportedfiles.includes(message.ftype))?( + + + + + + +Ask queries about this file + + + + e.preventDefault()} onInteractOutside={(e) => e.preventDefault()}> +{/* + + + */} + + + +{/* + */} + + +{/* */} + + +):(null)} +
):( +
+ + + + + + + Load folder contents to search + + +
+ )} +
+ ) +} \ No newline at end of file diff --git a/src/components/millercol.tsx b/src/components/millercol.tsx index d81d076..b584519 100644 --- a/src/components/millercol.tsx +++ b/src/components/millercol.tsx @@ -5,16 +5,8 @@ import FRc from "./findsizecomp" import { convertFileSrc, invoke } from "@tauri-apps/api/tauri"; import { useEffect, useState } from "react"; import { FileItem } from "../shared/types"; -import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem } from "./ui/context-menu"; -import { Folder, FileIcon, EyeIcon, ScanSearchIcon } from "lucide-react"; -import path from "path"; -import { LazyLoadImage } from "react-lazy-load-image-component"; -import { scrollorauto, setcolorpertheme, converttstodt } from "./greet"; -import ReadFileComp from "./readfile"; -import { Button } from "./ui/button"; -import { HoverCard, HoverCardTrigger, HoverCardContent } from "./ui/hover-card"; -import { Sheet,SheetTrigger, SheetContent } from "./ui/sheet"; -import { VideoComponent } from "./videoplaycomp"; +import EachFromGrid from "./grideach"; + interface argprops{ eachif:pathsplit populatesearchlist:(path: String) => void; @@ -23,6 +15,7 @@ interface argprops{ addmark:(path: string) => void; searchstring:String, sftype:String, + appWindow? } export default function MillerCol({eachif,populatesearchlist,goto,newtab,addmark,searchstring,sftype}:argprops){ const filesobjinit:FileItem[]=[] @@ -55,125 +48,7 @@ export default function MillerCol({eachif,populatesearchlist,goto,newtab,addmark // if(eachitem.size>0){ return
- - - - Load folder contents to search - - -
- )} - - + // } // return;