diff options
| author | yxshv <[email protected]> | 2024-04-13 06:27:59 +0530 |
|---|---|---|
| committer | yxshv <[email protected]> | 2024-04-13 06:27:59 +0530 |
| commit | 957e0767ea959dbe7d7395f537eb362f6893fd89 (patch) | |
| tree | efb4f53b90364699b7725b388dd2c60492cf177b /apps/extension/src | |
| parent | update store route (diff) | |
| parent | proper caching and KV (diff) | |
| download | archived-supermemory-957e0767ea959dbe7d7395f537eb362f6893fd89.tar.xz archived-supermemory-957e0767ea959dbe7d7395f537eb362f6893fd89.zip | |
merge
Diffstat (limited to 'apps/extension/src')
| -rw-r--r-- | apps/extension/src/SideBar.tsx | 184 | ||||
| -rw-r--r-- | apps/extension/src/components/FilterCombobox.tsx | 185 | ||||
| -rw-r--r-- | apps/extension/src/components/ui/command.tsx | 77 | ||||
| -rw-r--r-- | apps/extension/src/components/ui/dialog.tsx | 57 | ||||
| -rw-r--r-- | apps/extension/src/components/ui/popover.tsx | 18 | ||||
| -rw-r--r-- | apps/extension/src/ext.css | 14 | ||||
| -rw-r--r-- | apps/extension/src/types/memory.ts | 6 | ||||
| -rw-r--r-- | apps/extension/src/util.ts | 2 |
8 files changed, 285 insertions, 258 deletions
diff --git a/apps/extension/src/SideBar.tsx b/apps/extension/src/SideBar.tsx index 20d54cde..890619ca 100644 --- a/apps/extension/src/SideBar.tsx +++ b/apps/extension/src/SideBar.tsx @@ -7,8 +7,17 @@ import { TooltipProvider, TooltipTrigger, } from "./components/ui/tooltip"; -import { FilterSpaces } from "./components/FilterCombobox" -import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogTrigger, DialogFooter, DialogClose } from "./components/ui/dialog"; +import { FilterSpaces } from "./components/FilterCombobox"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogDescription, + DialogTrigger, + DialogFooter, + DialogClose, +} from "./components/ui/dialog"; function sendUrlToAPI() { // get the current URL @@ -41,7 +50,7 @@ function SideBar() { const [isSendingData, setIsSendingData] = useState(false); - const [selectedSpaces, setSelectedSpaces] = useState<number[]>([0,1]) + const [selectedSpaces, setSelectedSpaces] = useState<number[]>([0, 1]); interface TweetData { tweetText: string; @@ -154,9 +163,7 @@ function SideBar() { {window.location.href.includes("twitter.com") || window.location.href.includes("x.com") ? ( <Tooltip delayDuration={300}> - <TooltipTrigger - className="anycontext-bg-transparent anycontext-border-none anycontext-m-0 anycontext-p-0" - > + <TooltipTrigger className="anycontext-bg-transparent anycontext-border-none anycontext-m-0 anycontext-p-0"> <button onClick={() => { if (window.location.href.endsWith("/i/bookmarks/all")) { @@ -198,87 +205,98 @@ function SideBar() { ) : ( <></> )} - <Dialog> - <Tooltip delayDuration={300}> - <TooltipTrigger - className="anycontext-bg-transparent + <Dialog> + <Tooltip delayDuration={300}> + <TooltipTrigger + className="anycontext-bg-transparent anycontext-border-none anycontext-m-0 anycontext-p-0 " - > - <DialogTrigger asChild> - <button - onClick={() => { - return - sendUrlToAPI(); - setIsSendingData(true); - setTimeout(() => { - setIsSendingData(false); - setSavedWebsites([...savedWebsites, window.location.href]); - }, 1000); - }} - disabled={savedWebsites.includes(window.location.href)} - className="anycontext-open-button disabled:anycontext-opacity-30 anycontext-bg-transparent + > + <DialogTrigger asChild> + <button + onClick={() => { + sendUrlToAPI(); + setIsSendingData(true); + setTimeout(() => { + setIsSendingData(false); + setSavedWebsites([ + ...savedWebsites, + window.location.href, + ]); + }, 1000); + }} + disabled={savedWebsites.includes(window.location.href)} + className="anycontext-open-button disabled:anycontext-opacity-30 anycontext-bg-transparent anycontext-border-none anycontext-m-0 anycontext-p-0" - > - {savedWebsites.includes(window.location.href) ? ( - <svg - xmlns="http://www.w3.org/2000/svg" - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - stroke="currentColor" - strokeWidth="2" - strokeLinecap="round" - strokeLinejoin="round" - className="lucide lucide-file-check-2" - > - <path d="M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4" /> - <path d="M14 2v4a2 2 0 0 0 2 2h4" /> - <path d="m3 15 2 2 4-4" /> - </svg> - ) : ( - <svg - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 20 20" - fill="currentColor" - className={`anycontext-w-5 anycontext-h-5 ${isSendingData ? "anycontext-animate-spin" : ""}`} - > - <path d="M15.98 1.804a1 1 0 0 0-1.96 0l-.24 1.192a1 1 0 0 1-.784.785l-1.192.238a1 1 0 0 0 0 1.962l1.192.238a1 1 0 0 1 .785.785l.238 1.192a1 1 0 0 0 1.962 0l.238-1.192a1 1 0 0 1 .785-.785l1.192-.238a1 1 0 0 0 0-1.962l-1.192-.238a1 1 0 0 1-.785-.785l-.238-1.192ZM6.949 5.684a1 1 0 0 0-1.898 0l-.683 2.051a1 1 0 0 1-.633.633l-2.051.683a1 1 0 0 0 0 1.898l2.051.684a1 1 0 0 1 .633.632l.683 2.051a1 1 0 0 0 1.898 0l.683-2.051a1 1 0 0 1 .633-.633l2.051-.683a1 1 0 0 0 0-1.898l-2.051-.683a1 1 0 0 1-.633-.633L6.95 5.684ZM13.949 13.684a1 1 0 0 0-1.898 0l-.184.551a1 1 0 0 1-.632.633l-.551.183a1 1 0 0 0 0 1.898l.551.183a1 1 0 0 1 .633.633l.183.551a1 1 0 0 0 1.898 0l.184-.551a1 1 0 0 1 .632-.633l.551-.183a1 1 0 0 0 0-1.898l-.551-.184a1 1 0 0 1-.633-.632l-.183-.551Z" /> - </svg> - )} - </button> - </DialogTrigger> - </TooltipTrigger> - <TooltipContent className="anycontext-p-0" side="left"> - <p className="anycontext-p-0 anycontext-m-0"> - {savedWebsites.includes(window.location.href) - ? "Added to memory" - : "Add to memory"} - </p> - </TooltipContent> - </Tooltip> - <DialogContent> - <DialogHeader> - <DialogTitle>Add to Memory</DialogTitle> - <DialogDescription> - Add the current page to memory - </DialogDescription> - </DialogHeader> + > + {savedWebsites.includes(window.location.href) ? ( + <svg + xmlns="http://www.w3.org/2000/svg" + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + strokeWidth="2" + strokeLinecap="round" + strokeLinejoin="round" + className="lucide lucide-file-check-2" + > + <path d="M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4" /> + <path d="M14 2v4a2 2 0 0 0 2 2h4" /> + <path d="m3 15 2 2 4-4" /> + </svg> + ) : ( + <svg + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 20 20" + fill="currentColor" + className={`anycontext-w-5 anycontext-h-5 ${isSendingData ? "anycontext-animate-spin" : ""}`} + > + <path d="M15.98 1.804a1 1 0 0 0-1.96 0l-.24 1.192a1 1 0 0 1-.784.785l-1.192.238a1 1 0 0 0 0 1.962l1.192.238a1 1 0 0 1 .785.785l.238 1.192a1 1 0 0 0 1.962 0l.238-1.192a1 1 0 0 1 .785-.785l1.192-.238a1 1 0 0 0 0-1.962l-1.192-.238a1 1 0 0 1-.785-.785l-.238-1.192ZM6.949 5.684a1 1 0 0 0-1.898 0l-.683 2.051a1 1 0 0 1-.633.633l-2.051.683a1 1 0 0 0 0 1.898l2.051.684a1 1 0 0 1 .633.632l.683 2.051a1 1 0 0 0 1.898 0l.683-2.051a1 1 0 0 1 .633-.633l2.051-.683a1 1 0 0 0 0-1.898l-2.051-.683a1 1 0 0 1-.633-.633L6.95 5.684ZM13.949 13.684a1 1 0 0 0-1.898 0l-.184.551a1 1 0 0 1-.632.633l-.551.183a1 1 0 0 0 0 1.898l.551.183a1 1 0 0 1 .633.633l.183.551a1 1 0 0 0 1.898 0l.184-.551a1 1 0 0 1 .632-.633l.551-.183a1 1 0 0 0 0-1.898l-.551-.184a1 1 0 0 1-.633-.632l-.183-.551Z" /> + </svg> + )} + </button> + </DialogTrigger> + </TooltipTrigger> + <TooltipContent className="anycontext-p-0" side="left"> + <p className="anycontext-p-0 anycontext-m-0"> + {savedWebsites.includes(window.location.href) + ? "Added to memory" + : "Add to memory"} + </p> + </TooltipContent> + </Tooltip> + <DialogContent> + <DialogHeader> + <DialogTitle>Add to Memory</DialogTitle> + <DialogDescription> + Add the current page to memory + </DialogDescription> + </DialogHeader> - <FilterSpaces className='anycontext-mr-auto' selectedSpaces={selectedSpaces} setSelectedSpaces={setSelectedSpaces} name={"Add to Spaces"} spaces={[{ - name: "cool tech", - id: 0, - }, { - name: "cool libs", - id: 1, - }]} /> - <DialogFooter className="anycontext-w-full anycontext-text-sm"> - <DialogClose>Add</DialogClose> - <DialogClose>Cancel</DialogClose> - </DialogFooter> - </DialogContent> - </Dialog> + <FilterSpaces + className="anycontext-mr-auto" + selectedSpaces={selectedSpaces} + setSelectedSpaces={setSelectedSpaces} + name={"Add to Spaces"} + spaces={[ + { + name: "cool tech", + id: 0, + }, + { + name: "cool libs", + id: 1, + }, + ]} + /> + <DialogFooter className="anycontext-w-full anycontext-text-sm"> + <DialogClose>Add</DialogClose> + <DialogClose>Cancel</DialogClose> + </DialogFooter> + </DialogContent> + </Dialog> </div> </TooltipProvider> </> diff --git a/apps/extension/src/components/FilterCombobox.tsx b/apps/extension/src/components/FilterCombobox.tsx index 254cb0e1..f6215c03 100644 --- a/apps/extension/src/components/FilterCombobox.tsx +++ b/apps/extension/src/components/FilterCombobox.tsx @@ -15,7 +15,7 @@ import { PopoverContent, PopoverTrigger, } from "../components/ui/popover"; -import { Space } from "../types/memory" +import { Space } from "../types/memory"; export interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> { side?: "top" | "bottom"; @@ -26,10 +26,9 @@ export interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> { spaces: number[] | ((prev: number[]) => number[]), ) => void; name: string; - spaces: Space[]; + spaces: Space[]; } - export function FilterSpaces({ className, side = "bottom", @@ -38,12 +37,12 @@ export function FilterSpaces({ selectedSpaces, setSelectedSpaces, name, - spaces, + spaces, ...props }: Props) { const [open, setOpen] = React.useState(false); - console.log(selectedSpaces, spaces) + console.log(selectedSpaces, spaces); const sortedSpaces = spaces.sort(({ id: a }, { id: b }) => selectedSpaces.includes(a) && !selectedSpaces.includes(b) @@ -59,100 +58,98 @@ export function FilterSpaces({ } }, [open]); - return ( - <div className="anycontext-flex anycontext-flex-wrap anycontext-gap-1 anycontext-text-sm anycontext-"> - {selectedSpaces.map(spaceid => { - const space = spaces.find(s => s.id === spaceid)! - return (<SpaceItem {...space} key={spaceid} onRemove={() => {}} />) - })} - </div> - ) + return ( + <div className="anycontext-flex anycontext-flex-wrap anycontext-gap-1 anycontext-text-sm anycontext-"> + {selectedSpaces.map((spaceid) => { + const space = spaces.find((s) => s.id === spaceid)!; + return <SpaceItem {...space} key={spaceid} onRemove={() => {}} />; + })} + </div> + ); return ( - <Popover open={open} onOpenChange={setOpen}> - <PopoverTrigger asChild> - <button - type={undefined} - data-state-on={open} - className={cn( - "anycontext-combobox-button anycontext-w-fit", - className, - )} - {...props} - > - {name} - <ChevronsUpDown className="anycontext-h-4 anycontext-w-4" /> - <div - data-state-on={selectedSpaces.length > 0} - className="on:anycontext-flex anycontext-text-rgray-11 anycontext-border-rgray-6 anycontext-bg-rgray-2 anycontext-absolute anycontext-left-0 anycontext-top-0 anycontext-hidden anycontext-aspect-[1] anycontext-h-4 anycontext-w-4 anycontext--translate-x-1/3 anycontext--translate-y-1/3 anycontext-items-center anycontext-justify-center anycontext-rounded-full anycontext-border anycontext-text-center anycontext-text-[9px]" - > - {selectedSpaces.length} - </div> - </button> - </PopoverTrigger> - <PopoverContent - onCloseAutoFocus={(e) => e.preventDefault()} - align={align} - side={side} - className="anycontext-w-[200px] anycontext-p-0" + <Popover open={open} onOpenChange={setOpen}> + <PopoverTrigger asChild> + <button + type={undefined} + data-state-on={open} + className={cn( + "anycontext-combobox-button anycontext-w-fit", + className, + )} + {...props} + > + {name} + <ChevronsUpDown className="anycontext-h-4 anycontext-w-4" /> + <div + data-state-on={selectedSpaces.length > 0} + className="on:anycontext-flex anycontext-text-rgray-11 anycontext-border-rgray-6 anycontext-bg-rgray-2 anycontext-absolute anycontext-left-0 anycontext-top-0 anycontext-hidden anycontext-aspect-[1] anycontext-h-4 anycontext-w-4 anycontext--translate-x-1/3 anycontext--translate-y-1/3 anycontext-items-center anycontext-justify-center anycontext-rounded-full anycontext-border anycontext-text-center anycontext-text-[9px]" > - <Command - filter={(val, search) => - spaces - .find((s) => s.id.toString() === val) - ?.name.toLowerCase() - .includes(search.toLowerCase().trim()) - ? 1 - : 0 - } - > - <CommandInput placeholder="Filter spaces..." /> - <CommandList asChild> - <div> - <CommandEmpty>Nothing found</CommandEmpty> - <CommandGroup> - {sortedSpaces.map((space) => ( - <CommandItem - key={space.id} - value={space.id.toString()} - onSelect={(val) => { - setSelectedSpaces((prev: number[]) => - prev.includes(parseInt(val)) - ? prev.filter((v) => v !== parseInt(val)) - : [...prev, parseInt(val)], - ); - }} - asChild - > - <div - className="anycontext-text-black/90 dark:anycontext-text-white/90" - > - {space.name} - <Check - data-state-on={selectedSpaces.includes(space.id)} - className={cn( - "on:anycontext-opacity-100 anycontext-ml-auto anycontext-h-4 anycontext-w-4 anycontext-opacity-0", - )} - /> - </div> - </CommandItem> - ))} - </CommandGroup> - </div> - </CommandList> - </Command> - </PopoverContent> - </Popover> + {selectedSpaces.length} + </div> + </button> + </PopoverTrigger> + <PopoverContent + onCloseAutoFocus={(e) => e.preventDefault()} + align={align} + side={side} + className="anycontext-w-[200px] anycontext-p-0" + > + <Command + filter={(val, search) => + spaces + .find((s) => s.id.toString() === val) + ?.name.toLowerCase() + .includes(search.toLowerCase().trim()) + ? 1 + : 0 + } + > + <CommandInput placeholder="Filter spaces..." /> + <CommandList asChild> + <div> + <CommandEmpty>Nothing found</CommandEmpty> + <CommandGroup> + {sortedSpaces.map((space) => ( + <CommandItem + key={space.id} + value={space.id.toString()} + onSelect={(val) => { + setSelectedSpaces((prev: number[]) => + prev.includes(parseInt(val)) + ? prev.filter((v) => v !== parseInt(val)) + : [...prev, parseInt(val)], + ); + }} + asChild + > + <div className="anycontext-text-black/90 dark:anycontext-text-white/90"> + {space.name} + <Check + data-state-on={selectedSpaces.includes(space.id)} + className={cn( + "on:anycontext-opacity-100 anycontext-ml-auto anycontext-h-4 anycontext-w-4 anycontext-opacity-0", + )} + /> + </div> + </CommandItem> + ))} + </CommandGroup> + </div> + </CommandList> + </Command> + </PopoverContent> + </Popover> ); } function SpaceItem({ name, onRemove }: { onRemove: () => void } & Space) { - return ( - <div className="anycontext-flex anycontext-justify-center anycontext-items-center anycontext-gap-2 anycontext-p-1 anycontext-pl-2 anycontext-pr-3 anycontext-rounded-full anycontext-bg-black/5 dark:anycontext-bg-white/5 anycontext-border-white/20 dark:anycontext-border-black/20 border"> - <button className="anycontext-flex hover:anycontext-bg-transparent anycontext-justify-center anycontext-scale-110 anycontext-items-center focus-visible:anycontext-outline-none anycontext-rounded-full anycontext-w-3 anycontext-bg-black/5 dark:anycontext-bg-white/5 anycontext-h-3 anycontext-text-transparent hover:anycontext-text-black dark:hover:anycontext-text-white"> - <X className="anycontext-w-3 anycontext-h-3" /> - </button> - {name} - </div> - ) + return ( + <div className="anycontext-flex anycontext-justify-center anycontext-items-center anycontext-gap-2 anycontext-p-1 anycontext-pl-2 anycontext-pr-3 anycontext-rounded-full anycontext-bg-black/5 dark:anycontext-bg-white/5 anycontext-border-white/20 dark:anycontext-border-black/20 border"> + <button className="anycontext-flex hover:anycontext-bg-transparent anycontext-justify-center anycontext-scale-110 anycontext-items-center focus-visible:anycontext-outline-none anycontext-rounded-full anycontext-w-3 anycontext-bg-black/5 dark:anycontext-bg-white/5 anycontext-h-3 anycontext-text-transparent hover:anycontext-text-black dark:hover:anycontext-text-white"> + <X className="anycontext-w-3 anycontext-h-3" /> + </button> + {name} + </div> + ); } diff --git a/apps/extension/src/components/ui/command.tsx b/apps/extension/src/components/ui/command.tsx index 27ae9b96..858b67f4 100644 --- a/apps/extension/src/components/ui/command.tsx +++ b/apps/extension/src/components/ui/command.tsx @@ -1,10 +1,10 @@ -import * as React from "react" -import { type DialogProps } from "@radix-ui/react-dialog" -import { Command as CommandPrimitive } from "cmdk" -import { Search } from "lucide-react" +import * as React from "react"; +import { type DialogProps } from "@radix-ui/react-dialog"; +import { Command as CommandPrimitive } from "cmdk"; +import { Search } from "lucide-react"; -import { cn } from "../../lib/utils" -import { Dialog, DialogContent } from "../../components/ui/dialog" +import { cn } from "../../lib/utils"; +import { Dialog, DialogContent } from "../../components/ui/dialog"; const Command = React.forwardRef< React.ElementRef<typeof CommandPrimitive>, @@ -14,12 +14,12 @@ const Command = React.forwardRef< ref={ref} className={cn( "anycontext-flex anycontext-h-full anycontext-w-full anycontext-flex-col anycontext-overflow-hidden anycontext-rounded-md anycontext-bg-white anycontext-text-stone-950 dark:anycontext-bg-stone-950 dark:anycontext-text-stone-50", - className + className, )} {...props} /> -)) -Command.displayName = CommandPrimitive.displayName +)); +Command.displayName = CommandPrimitive.displayName; interface CommandDialogProps extends DialogProps {} @@ -32,27 +32,30 @@ const CommandDialog = ({ children, ...props }: CommandDialogProps) => { </Command> </DialogContent> </Dialog> - ) -} + ); +}; const CommandInput = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Input>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> >(({ className, ...props }, ref) => ( - <div className="anycontext-flex anycontext-items-center anycontext-border-b anycontext-px-3" cmdk-input-wrapper=""> + <div + className="anycontext-flex anycontext-items-center anycontext-border-b anycontext-px-3" + cmdk-input-wrapper="" + > <Search className="anycontext-mr-2 anycontext-h-4 anycontext-w-4 anycontext-shrink-0 anycontext-opacity-50" /> <CommandPrimitive.Input ref={ref} className={cn( "anycontext-flex anycontext-h-11 anycontext-w-full anycontext-rounded-md anycontext-bg-transparent anycontext-py-3 anycontext-text-sm anycontext-outline-none placeholder:anycontext-text-stone-500 disabled:anycontext-cursor-not-allowed disabled:anycontext-opacity-50 dark:placeholder:anycontext-text-stone-400", - className + className, )} {...props} /> </div> -)) +)); -CommandInput.displayName = CommandPrimitive.Input.displayName +CommandInput.displayName = CommandPrimitive.Input.displayName; const CommandList = React.forwardRef< React.ElementRef<typeof CommandPrimitive.List>, @@ -60,12 +63,15 @@ const CommandList = React.forwardRef< >(({ className, ...props }, ref) => ( <CommandPrimitive.List ref={ref} - className={cn("anycontext-max-h-[300px] anycontext-overflow-y-auto anycontext-overflow-x-hidden", className)} + className={cn( + "anycontext-max-h-[300px] anycontext-overflow-y-auto anycontext-overflow-x-hidden", + className, + )} {...props} /> -)) +)); -CommandList.displayName = CommandPrimitive.List.displayName +CommandList.displayName = CommandPrimitive.List.displayName; const CommandEmpty = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Empty>, @@ -76,9 +82,9 @@ const CommandEmpty = React.forwardRef< className="anycontext-py-6 anycontext-text-center anycontext-text-sm" {...props} /> -)) +)); -CommandEmpty.displayName = CommandPrimitive.Empty.displayName +CommandEmpty.displayName = CommandPrimitive.Empty.displayName; const CommandGroup = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Group>, @@ -88,13 +94,13 @@ const CommandGroup = React.forwardRef< ref={ref} className={cn( "anycontext-overflow-hidden anycontext-p-1 anycontext-text-stone-950 [&_[cmdk-group-heading]]:anycontext-px-2 [&_[cmdk-group-heading]]:anycontext-py-1.5 [&_[cmdk-group-heading]]:anycontext-text-xs [&_[cmdk-group-heading]]:anycontext-font-medium [&_[cmdk-group-heading]]:anycontext-text-stone-500 dark:anycontext-text-stone-50 dark:[&_[cmdk-group-heading]]:anycontext-text-stone-400", - className + className, )} {...props} /> -)) +)); -CommandGroup.displayName = CommandPrimitive.Group.displayName +CommandGroup.displayName = CommandPrimitive.Group.displayName; const CommandSeparator = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Separator>, @@ -102,11 +108,14 @@ const CommandSeparator = React.forwardRef< >(({ className, ...props }, ref) => ( <CommandPrimitive.Separator ref={ref} - className={cn("anycontext--mx-1 anycontext-h-px anycontext-bg-stone-200 dark:anycontext-bg-stone-800", className)} + className={cn( + "anycontext--mx-1 anycontext-h-px anycontext-bg-stone-200 dark:anycontext-bg-stone-800", + className, + )} {...props} /> -)) -CommandSeparator.displayName = CommandPrimitive.Separator.displayName +)); +CommandSeparator.displayName = CommandPrimitive.Separator.displayName; const CommandItem = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Item>, @@ -116,13 +125,13 @@ const CommandItem = React.forwardRef< ref={ref} className={cn( "anycontext-relative anycontext-flex anycontext-cursor-default anycontext-select-none anycontext-items-center anycontext-rounded-sm anycontext-px-2 anycontext-py-1.5 anycontext-text-sm anycontext-outline-none aria-selected:anycontext-bg-stone-100 aria-selected:anycontext-text-stone-900 data-[disabled]:anycontext-pointer-events-none data-[disabled]:anycontext-opacity-50 dark:aria-selected:anycontext-bg-stone-800 dark:aria-selected:anycontext-text-stone-50", - className + className, )} {...props} /> -)) +)); -CommandItem.displayName = CommandPrimitive.Item.displayName +CommandItem.displayName = CommandPrimitive.Item.displayName; const CommandShortcut = ({ className, @@ -132,13 +141,13 @@ const CommandShortcut = ({ <span className={cn( "anycontext-ml-auto anycontext-text-xs anycontext-tracking-widest anycontext-text-stone-500 dark:anycontext-text-stone-400", - className + className, )} {...props} /> - ) -} -CommandShortcut.displayName = "CommandShortcut" + ); +}; +CommandShortcut.displayName = "CommandShortcut"; export { Command, @@ -150,4 +159,4 @@ export { CommandItem, CommandShortcut, CommandSeparator, -} +}; diff --git a/apps/extension/src/components/ui/dialog.tsx b/apps/extension/src/components/ui/dialog.tsx index 2f8dcb69..583c335d 100644 --- a/apps/extension/src/components/ui/dialog.tsx +++ b/apps/extension/src/components/ui/dialog.tsx @@ -1,16 +1,16 @@ -import * as React from "react" -import * as DialogPrimitive from "@radix-ui/react-dialog" -import { X } from "lucide-react" +import * as React from "react"; +import * as DialogPrimitive from "@radix-ui/react-dialog"; +import { X } from "lucide-react"; -import { cn } from "../../lib/utils" +import { cn } from "../../lib/utils"; -const Dialog = DialogPrimitive.Root +const Dialog = DialogPrimitive.Root; -const DialogTrigger = DialogPrimitive.Trigger +const DialogTrigger = DialogPrimitive.Trigger; -const DialogPortal = DialogPrimitive.Portal +const DialogPortal = DialogPrimitive.Portal; -const DialogClose = DialogPrimitive.Close +const DialogClose = DialogPrimitive.Close; const DialogOverlay = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Overlay>, @@ -20,12 +20,12 @@ const DialogOverlay = React.forwardRef< ref={ref} className={cn( "anycontext-fixed anycontext-inset-0 anycontext-z-50 anycontext-bg-black/80 anycontext- data-[state=open]:anycontext-animate-in data-[state=closed]:anycontext-animate-out data-[state=closed]:anycontext-fade-out-0 data-[state=open]:anycontext-fade-in-0", - className + className, )} {...props} /> -)) -DialogOverlay.displayName = DialogPrimitive.Overlay.displayName +)); +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Content>, @@ -37,7 +37,7 @@ const DialogContent = React.forwardRef< ref={ref} className={cn( "anycontext-text-black dark:anycontext-text-white anycontext-fixed anycontext-left-[50%] anycontext-top-[50%] anycontext-z-50 anycontext-grid anycontext-w-full anycontext-max-w-lg anycontext-translate-x-[-50%] anycontext-translate-y-[-50%] anycontext-gap-4 anycontext-border anycontext-border-stone-200 anycontext-bg-white anycontext-p-6 anycontext-shadow-lg anycontext-duration-200 data-[state=open]:anycontext-animate-in data-[state=closed]:anycontext-animate-out data-[state=closed]:anycontext-fade-out-0 data-[state=open]:anycontext-fade-in-0 data-[state=closed]:anycontext-zoom-out-95 data-[state=open]:anycontext-zoom-in-95 data-[state=closed]:anycontext-slide-out-to-left-1/2 data-[state=closed]:anycontext-slide-out-to-top-[48%] data-[state=open]:anycontext-slide-in-from-left-1/2 data-[state=open]:anycontext-slide-in-from-top-[48%] sm:anycontext-rounded-lg dark:anycontext-border-stone-800 dark:anycontext-bg-stone-950", - className + className, )} {...props} > @@ -48,8 +48,8 @@ const DialogContent = React.forwardRef< </DialogPrimitive.Close> </DialogPrimitive.Content> </DialogPortal> -)) -DialogContent.displayName = DialogPrimitive.Content.displayName +)); +DialogContent.displayName = DialogPrimitive.Content.displayName; const DialogHeader = ({ className, @@ -58,12 +58,12 @@ const DialogHeader = ({ <div className={cn( "anycontext-flex anycontext-flex-col anycontext-space-y-1.5 anycontext-text-center sm:anycontext-text-left", - className + className, )} {...props} /> -) -DialogHeader.displayName = "DialogHeader" +); +DialogHeader.displayName = "DialogHeader"; const DialogFooter = ({ className, @@ -72,12 +72,12 @@ const DialogFooter = ({ <div className={cn( "anycontext-flex anycontext-flex-col-reverse sm:anycontext-flex-row sm:anycontext-justify-end sm:anycontext-space-x-2", - className + className, )} {...props} /> -) -DialogFooter.displayName = "DialogFooter" +); +DialogFooter.displayName = "DialogFooter"; const DialogTitle = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Title>, @@ -87,12 +87,12 @@ const DialogTitle = React.forwardRef< ref={ref} className={cn( "anycontext-text-lg anycontext-font-semibold anycontext-leading-none anycontext-tracking-tight", - className + className, )} {...props} /> -)) -DialogTitle.displayName = DialogPrimitive.Title.displayName +)); +DialogTitle.displayName = DialogPrimitive.Title.displayName; const DialogDescription = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Description>, @@ -100,11 +100,14 @@ const DialogDescription = React.forwardRef< >(({ className, ...props }, ref) => ( <DialogPrimitive.Description ref={ref} - className={cn("anycontext-text-sm anycontext-text-stone-500 dark:anycontext-text-stone-400", className)} + className={cn( + "anycontext-text-sm anycontext-text-stone-500 dark:anycontext-text-stone-400", + className, + )} {...props} /> -)) -DialogDescription.displayName = DialogPrimitive.Description.displayName +)); +DialogDescription.displayName = DialogPrimitive.Description.displayName; export { Dialog, @@ -117,4 +120,4 @@ export { DialogFooter, DialogTitle, DialogDescription, -} +}; diff --git a/apps/extension/src/components/ui/popover.tsx b/apps/extension/src/components/ui/popover.tsx index beda5d46..e1b9282d 100644 --- a/apps/extension/src/components/ui/popover.tsx +++ b/apps/extension/src/components/ui/popover.tsx @@ -1,11 +1,11 @@ -import * as React from "react" -import * as PopoverPrimitive from "@radix-ui/react-popover" +import * as React from "react"; +import * as PopoverPrimitive from "@radix-ui/react-popover"; -import { cn } from "../../lib/utils" +import { cn } from "../../lib/utils"; -const Popover = PopoverPrimitive.Root +const Popover = PopoverPrimitive.Root; -const PopoverTrigger = PopoverPrimitive.Trigger +const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverContent = React.forwardRef< React.ElementRef<typeof PopoverPrimitive.Content>, @@ -18,12 +18,12 @@ const PopoverContent = React.forwardRef< sideOffset={sideOffset} className={cn( "anycontext-z-50 anycontext-w-72 anycontext-rounded-md anycontext-border anycontext-border-stone-200 anycontext-bg-white anycontext-p-4 anycontext-text-stone-950 anycontext-shadow-md anycontext-outline-none data-[state=open]:anycontext-animate-in data-[state=closed]:anycontext-animate-out data-[state=closed]:anycontext-fade-out-0 data-[state=open]:anycontext-fade-in-0 data-[state=closed]:anycontext-zoom-out-95 data-[state=open]:anycontext-zoom-in-95 data-[side=bottom]:anycontext-slide-in-from-top-2 data-[side=left]:anycontext-slide-in-from-right-2 data-[side=right]:anycontext-slide-in-from-left-2 data-[side=top]:anycontext-slide-in-from-bottom-2 dark:anycontext-border-stone-800 dark:anycontext-bg-stone-950 dark:anycontext-text-stone-50", - className + className, )} {...props} /> </PopoverPrimitive.Portal> -)) -PopoverContent.displayName = PopoverPrimitive.Content.displayName +)); +PopoverContent.displayName = PopoverPrimitive.Content.displayName; -export { Popover, PopoverTrigger, PopoverContent } +export { Popover, PopoverTrigger, PopoverContent }; diff --git a/apps/extension/src/ext.css b/apps/extension/src/ext.css index 5ea84318..bf7a4156 100644 --- a/apps/extension/src/ext.css +++ b/apps/extension/src/ext.css @@ -3,13 +3,13 @@ @tailwind utilities; .anycontext-combobox-button { - padding: 0.5rem 1rem; - display: flex; - flex-direction: row; - justify-items: center; - align-items: center; - gap: 0.5rem; - @apply anycontext-rounded-md dark:anycontext-bg-white/5 anycontext-bg-black/5; + padding: 0.5rem 1rem; + display: flex; + flex-direction: row; + justify-items: center; + align-items: center; + gap: 0.5rem; + @apply anycontext-rounded-md dark:anycontext-bg-white/5 anycontext-bg-black/5; } .anycontext-overlay { diff --git a/apps/extension/src/types/memory.ts b/apps/extension/src/types/memory.ts index 83a7f00f..03ffb848 100644 --- a/apps/extension/src/types/memory.ts +++ b/apps/extension/src/types/memory.ts @@ -1,4 +1,4 @@ export type Space = { - id: number; - name: string; -} + id: number; + name: string; +}; diff --git a/apps/extension/src/util.ts b/apps/extension/src/util.ts index d2ea35d3..0b73b6c8 100644 --- a/apps/extension/src/util.ts +++ b/apps/extension/src/util.ts @@ -9,5 +9,5 @@ export const getEnv = () => { // }) // return null - return "production"; + return "development"; }; |