chore: run auto fix to sort import (#9)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import fs from "node:fs"
|
||||
import { resolve } from "node:path"
|
||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite"
|
||||
|
||||
import react from "@vitejs/plugin-react"
|
||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite"
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"))
|
||||
|
||||
|
||||
@@ -26,11 +26,6 @@ export default defineConfig(
|
||||
// change to more like prettier
|
||||
"@stylistic/operator-linebreak": ["error", "after"],
|
||||
"@stylistic/max-statements-per-line": "off",
|
||||
|
||||
// run auto fix later
|
||||
"simple-import-sort/exports": "off",
|
||||
"simple-import-sort/imports": "off",
|
||||
"@typescript-eslint/consistent-type-imports": "off",
|
||||
},
|
||||
},
|
||||
// fix later or just always ignore
|
||||
|
||||
+6
-3
@@ -1,10 +1,13 @@
|
||||
import "dotenv/config"
|
||||
import { app, BrowserWindow, Menu } from "electron"
|
||||
|
||||
import path from "node:path"
|
||||
import { electronApp, optimizer } from "@electron-toolkit/utils"
|
||||
import { createWindow } from "./window"
|
||||
|
||||
import { registerIpcMain } from "@egoist/tipc/main"
|
||||
import { electronApp, optimizer } from "@electron-toolkit/utils"
|
||||
import { app, BrowserWindow, Menu } from "electron"
|
||||
|
||||
import { router } from "./tipc"
|
||||
import { createWindow } from "./window"
|
||||
|
||||
registerIpcMain(router)
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { tipc } from "@egoist/tipc/main"
|
||||
import { Menu, MessageBoxOptions, ShareMenu, dialog } from "electron"
|
||||
import type { MessageBoxOptions } from "electron"
|
||||
import { dialog, Menu, ShareMenu } from "electron"
|
||||
|
||||
const t = tipc.create()
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
import { shell, BrowserWindow } from "electron"
|
||||
import path from "node:path"
|
||||
|
||||
import { is } from "@electron-toolkit/utils"
|
||||
import { BrowserWindow, shell } from "electron"
|
||||
|
||||
import icon from "../../resources/icon.png?asset"
|
||||
|
||||
export function createWindow(options?: {
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ElectronAPI } from "@electron-toolkit/preload"
|
||||
import type { ElectronAPI } from "@electron-toolkit/preload"
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { contextBridge } from "electron"
|
||||
import { electronAPI } from "@electron-toolkit/preload"
|
||||
import { contextBridge } from "electron"
|
||||
|
||||
// Custom APIs for renderer
|
||||
const api = {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import { FeedIcon } from "@renderer/components/feed-icon"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
|
||||
export function ArticleItem({ entry }: { entry: EntriesResponse[number] }) {
|
||||
return (
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { useEntries } from "@renderer/lib/queries/entries"
|
||||
import { m } from "framer-motion"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { ArticleItem } from "./article-item"
|
||||
import { SocialMediaItem } from "./social-media-item"
|
||||
import { PictureItem } from "./picture-item"
|
||||
import { VideoItem } from "./video-item"
|
||||
import { NotificationItem } from "./notification-item"
|
||||
import { EntryItemWrapper } from "./item-wrapper"
|
||||
|
||||
import { useMainLayoutContext } from "@renderer/contexts/outlet/main-layout"
|
||||
import { useEntries } from "@renderer/lib/queries/entries"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { m } from "framer-motion"
|
||||
|
||||
import { ArticleItem } from "./article-item"
|
||||
import { EntryItemWrapper } from "./item-wrapper"
|
||||
import { NotificationItem } from "./notification-item"
|
||||
import { PictureItem } from "./picture-item"
|
||||
import { SocialMediaItem } from "./social-media-item"
|
||||
import { VideoItem } from "./video-item"
|
||||
|
||||
const gridMode = new Set([2, 3])
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useMainLayoutContext } from "@renderer/contexts/outlet/main-layout"
|
||||
import { useEntryActions } from "@renderer/hooks/useEntryActions"
|
||||
import { showNativeMenu } from "@renderer/lib/native-menu"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
|
||||
export function EntryItemWrapper({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import { FeedIcon } from "@renderer/components/feed-icon"
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
|
||||
export function NotificationItem({
|
||||
entry,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import { FeedIcon } from "@renderer/components/feed-icon"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
|
||||
export function PictureItem({ entry }: { entry: EntriesResponse[number] }) {
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import { FeedIcon } from "@renderer/components/feed-icon"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
|
||||
export function SocialMediaItem({ entry }: { entry: EntriesResponse[number] }) {
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import { FeedIcon } from "@renderer/components/feed-icon"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
|
||||
export function VideoItem({ entry }: { entry: EntriesResponse[number] }) {
|
||||
return (
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { parseHtml } from "@renderer/lib/parse-html"
|
||||
import { ActiveEntry } from "@renderer/lib/types"
|
||||
import { useEffect, useState } from "react"
|
||||
import { m } from "framer-motion"
|
||||
import { EntryShare } from "./share"
|
||||
import { useEntry } from "@renderer/lib/queries/entries"
|
||||
import type { ActiveEntry } from "@renderer/lib/types"
|
||||
import { m } from "framer-motion"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import { EntryShare } from "./share"
|
||||
|
||||
export function EntryContent({ entryId }: { entryId: ActiveEntry }) {
|
||||
const entry = useEntry({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
@@ -5,8 +6,7 @@ import {
|
||||
TooltipTrigger,
|
||||
} from "@renderer/components/ui/tooltip"
|
||||
import { useEntryActions } from "@renderer/hooks/useEntryActions"
|
||||
import { EntriesResponse } from "@renderer/lib/types"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import type { EntriesResponse } from "@renderer/lib/types"
|
||||
|
||||
export function EntryShare({
|
||||
view,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import {
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
@@ -9,6 +7,8 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@renderer/components/ui/alert-dialog"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
|
||||
export function CategoryRemoveDialog({
|
||||
feedIdList,
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { z } from "zod"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import {
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@renderer/components/ui/dialog"
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
@@ -8,15 +12,11 @@ import {
|
||||
FormItem,
|
||||
FormMessage,
|
||||
} from "@renderer/components/ui/form"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import {
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@renderer/components/ui/dialog"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { Input } from "@renderer/components/ui/input"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { z } from "zod"
|
||||
|
||||
const formSchema = z.object({
|
||||
category: z.string(),
|
||||
|
||||
@@ -8,11 +8,12 @@ import { client } from "@renderer/lib/client"
|
||||
import { levels } from "@renderer/lib/constants"
|
||||
import { showNativeMenu } from "@renderer/lib/native-menu"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { Response as SubscriptionsResponse } from "@renderer/lib/queries/subscriptions"
|
||||
import type { Response as SubscriptionsResponse } from "@renderer/lib/queries/subscriptions"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { AnimatePresence, m } from "framer-motion"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import { CategoryRenameDialog } from "./category-rename-dialog"
|
||||
import { FeedItem } from "./item"
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import { m, useSpring } from "framer-motion"
|
||||
import { Lethargy } from "lethargy"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { Link } from "react-router-dom"
|
||||
|
||||
import { FeedList } from "./list"
|
||||
|
||||
const lethargy = new Lethargy()
|
||||
|
||||
@@ -15,7 +15,7 @@ import { levels } from "@renderer/lib/constants"
|
||||
import dayjs from "@renderer/lib/dayjs"
|
||||
import { showNativeMenu } from "@renderer/lib/native-menu"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { SubscriptionResponse } from "@renderer/lib/types"
|
||||
import type { SubscriptionResponse } from "@renderer/lib/types"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { useState } from "react"
|
||||
|
||||
@@ -3,6 +3,7 @@ import { levels, views } from "@renderer/lib/constants"
|
||||
import { useSubscriptions } from "@renderer/lib/queries/subscriptions"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { useState } from "react"
|
||||
|
||||
import { FeedCategory } from "./category"
|
||||
|
||||
export function FeedList({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FeedResponse } from "@renderer/lib/types"
|
||||
import { SiteIcon } from "@renderer/components/site-icon"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import type { FeedResponse } from "@renderer/lib/types"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
|
||||
export function FeedIcon({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FeedResponse } from "@renderer/lib/types"
|
||||
import { FeedIcon } from "@renderer/components/feed-icon"
|
||||
import type { FeedResponse } from "@renderer/lib/types"
|
||||
|
||||
export function FollowSummary({
|
||||
feed,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { Dialog, DialogTrigger } from "@renderer/components/ui/dialog"
|
||||
import { FollowDialog } from "./dialog"
|
||||
import { FeedResponse } from "@renderer/lib/types"
|
||||
import type { FeedResponse } from "@renderer/lib/types"
|
||||
import { useState } from "react"
|
||||
|
||||
import { FollowDialog } from "./dialog"
|
||||
|
||||
export function FollowButton({ feed }: { feed: FeedResponse }) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const [isSuccessful, setIsSuccessful] = useState(false)
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
import { z } from "zod"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
FormDescription,
|
||||
} from "@renderer/components/ui/form"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { AutoComplete } from "@renderer/components/ui/autocomplete"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import {
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@renderer/components/ui/dialog"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@renderer/components/ui/form"
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -24,14 +22,17 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@renderer/components/ui/select"
|
||||
import { views } from "@renderer/lib/constants"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { Switch } from "@renderer/components/ui/switch"
|
||||
import { FollowSummary } from "../feed-summary"
|
||||
import { views } from "@renderer/lib/constants"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { SubscriptionResponse } from "@renderer/lib/types"
|
||||
import { AutoComplete } from "@renderer/components/ui/autocomplete"
|
||||
import { useSubscriptionCategories } from "@renderer/lib/queries/subscriptions"
|
||||
import type { SubscriptionResponse } from "@renderer/lib/types"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { z } from "zod"
|
||||
|
||||
import { FollowSummary } from "../feed-summary"
|
||||
|
||||
const formSchema = z.object({
|
||||
view: z.string(),
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { z } from "zod"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardFooter,
|
||||
CardHeader,
|
||||
} from "@renderer/components/ui/card"
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
@@ -10,20 +14,17 @@ import {
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@renderer/components/ui/form"
|
||||
import { Input } from "@renderer/components/ui/input"
|
||||
import { useEffect } from "react"
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import { FeedResponse, EntriesResponse } from "@renderer/lib/types"
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardFooter,
|
||||
CardHeader,
|
||||
} from "@renderer/components/ui/card"
|
||||
import { FollowButton } from "./button"
|
||||
import { FollowSummary } from "../feed-summary"
|
||||
import { Input } from "@renderer/components/ui/input"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import type { EntriesResponse, FeedResponse } from "@renderer/lib/types"
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { useEffect } from "react"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { z } from "zod"
|
||||
|
||||
import { FollowSummary } from "../feed-summary"
|
||||
import { FollowButton } from "./button"
|
||||
|
||||
const formSchema = z.object({
|
||||
keyword: z.string().min(1),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { Card, CardContent, CardHeader } from "@renderer/components/ui/card"
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
@@ -11,12 +10,14 @@ import {
|
||||
FormMessage,
|
||||
} from "@renderer/components/ui/form"
|
||||
import { Input } from "@renderer/components/ui/input"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { Card, CardContent, CardHeader } from "@renderer/components/ui/card"
|
||||
import { FollowSummary } from "../feed-summary"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import type { FeedResponse } from "@renderer/lib/types"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { z } from "zod"
|
||||
|
||||
import { FollowSummary } from "../feed-summary"
|
||||
|
||||
type FeedResponseList = {
|
||||
id: string
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import * as React from "react"
|
||||
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { buttonVariants } from "@renderer/components/ui/button"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const AlertDialog = AlertDialogPrimitive.Root
|
||||
|
||||
@@ -126,14 +125,14 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
||||
|
||||
export {
|
||||
AlertDialog,
|
||||
AlertDialogPortal,
|
||||
AlertDialogOverlay,
|
||||
AlertDialogTrigger,
|
||||
AlertDialogContent,
|
||||
AlertDialogHeader,
|
||||
AlertDialogFooter,
|
||||
AlertDialogTitle,
|
||||
AlertDialogDescription,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogOverlay,
|
||||
AlertDialogPortal,
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import {
|
||||
Command,
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandList,
|
||||
CommandInput,
|
||||
} from "@renderer/components/ui/command"
|
||||
import { useState, useCallback } from "react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { useCallback, useState } from "react"
|
||||
import * as React from "react"
|
||||
|
||||
export interface InputProps
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from "react"
|
||||
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const Avatar = React.forwardRef<
|
||||
React.ElementRef<typeof AvatarPrimitive.Root>,
|
||||
@@ -45,4 +44,4 @@ const AvatarFallback = React.forwardRef<
|
||||
))
|
||||
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
||||
|
||||
export { Avatar, AvatarImage, AvatarFallback }
|
||||
export { Avatar, AvatarFallback, AvatarImage }
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import * as React from "react"
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import { cva } from "class-variance-authority"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import { cva } from "class-variance-authority"
|
||||
import * as React from "react"
|
||||
|
||||
const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as React from "react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const Card = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
@@ -76,4 +75,4 @@ const CardFooter = React.forwardRef<
|
||||
))
|
||||
CardFooter.displayName = "CardFooter"
|
||||
|
||||
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
||||
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import * as React from "react"
|
||||
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
||||
import { Check } from "lucide-react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { Check } from "lucide-react"
|
||||
import * as React from "react"
|
||||
|
||||
const Checkbox = React.forwardRef<
|
||||
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
||||
|
||||
@@ -6,4 +6,4 @@ const { CollapsibleTrigger } = CollapsiblePrimitive
|
||||
|
||||
const { CollapsibleContent } = CollapsiblePrimitive
|
||||
|
||||
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
||||
export { Collapsible, CollapsibleContent, CollapsibleTrigger }
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import * as React from "react"
|
||||
import type { DialogProps } from "@radix-ui/react-dialog"
|
||||
import { Dialog, DialogContent } from "@renderer/components/ui/dialog"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { Command as CommandPrimitive } from "cmdk"
|
||||
import { Search } from "lucide-react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { Dialog, DialogContent } from "@renderer/components/ui/dialog"
|
||||
import * as React from "react"
|
||||
|
||||
const Command = React.forwardRef<
|
||||
React.ElementRef<typeof CommandPrimitive>,
|
||||
@@ -139,11 +138,11 @@ CommandShortcut.displayName = "CommandShortcut"
|
||||
export {
|
||||
Command,
|
||||
CommandDialog,
|
||||
CommandInput,
|
||||
CommandList,
|
||||
CommandEmpty,
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandShortcut,
|
||||
CommandList,
|
||||
CommandSeparator,
|
||||
CommandShortcut,
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import * as React from "react"
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
||||
import { X } from "lucide-react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { X } from "lucide-react"
|
||||
import * as React from "react"
|
||||
|
||||
const Dialog = DialogPrimitive.Root
|
||||
|
||||
@@ -108,13 +107,13 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName
|
||||
|
||||
export {
|
||||
Dialog,
|
||||
DialogPortal,
|
||||
DialogOverlay,
|
||||
DialogClose,
|
||||
DialogTrigger,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogFooter,
|
||||
DialogTitle,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogOverlay,
|
||||
DialogPortal,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
import * as React from "react"
|
||||
import * as LabelPrimitive from "@radix-ui/react-label"
|
||||
import type * as LabelPrimitive from "@radix-ui/react-label"
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import {
|
||||
Controller,
|
||||
import { Label } from "@renderer/components/ui/label"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
import type {
|
||||
ControllerProps,
|
||||
FieldPath,
|
||||
FieldValues,
|
||||
} from "react-hook-form"
|
||||
import {
|
||||
Controller,
|
||||
FormProvider,
|
||||
useFormContext,
|
||||
} from "react-hook-form"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { Label } from "@renderer/components/ui/label"
|
||||
|
||||
const Form = FormProvider
|
||||
|
||||
type FormFieldContextValue<
|
||||
@@ -163,12 +164,12 @@ const FormMessage = React.forwardRef<
|
||||
FormMessage.displayName = "FormMessage"
|
||||
|
||||
export {
|
||||
useFormField,
|
||||
Form,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormMessage,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
useFormField,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ImgHTMLAttributes, useState } from "react"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { getProxyUrl } from "@renderer/lib/img-proxy"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import type { ImgHTMLAttributes } from "react"
|
||||
import { useState } from "react"
|
||||
|
||||
const failedList = new Set<string | undefined>()
|
||||
export const Image = ({
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as React from "react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import * as React from "react"
|
||||
import * as LabelPrimitive from "@radix-ui/react-label"
|
||||
import { cva } from "class-variance-authority"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import { cva } from "class-variance-authority"
|
||||
import * as React from "react"
|
||||
|
||||
const labelVariants = cva(
|
||||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from "react"
|
||||
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const Popover = PopoverPrimitive.Root
|
||||
|
||||
@@ -26,4 +25,4 @@ const PopoverContent = React.forwardRef<
|
||||
))
|
||||
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
||||
|
||||
export { Popover, PopoverTrigger, PopoverContent }
|
||||
export { Popover, PopoverContent, PopoverTrigger }
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import * as React from "react"
|
||||
import * as SelectPrimitive from "@radix-ui/react-select"
|
||||
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
||||
import * as React from "react"
|
||||
|
||||
const Select = SelectPrimitive.Root
|
||||
|
||||
@@ -146,13 +145,13 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
||||
|
||||
export {
|
||||
Select,
|
||||
SelectGroup,
|
||||
SelectValue,
|
||||
SelectTrigger,
|
||||
SelectContent,
|
||||
SelectLabel,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectSeparator,
|
||||
SelectScrollUpButton,
|
||||
SelectLabel,
|
||||
SelectScrollDownButton,
|
||||
SelectScrollUpButton,
|
||||
SelectSeparator,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from "react"
|
||||
import * as SwitchPrimitives from "@radix-ui/react-switch"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const Switch = React.forwardRef<
|
||||
React.ElementRef<typeof SwitchPrimitives.Root>,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from "react"
|
||||
import * as TabsPrimitive from "@radix-ui/react-tabs"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const Tabs = TabsPrimitive.Root
|
||||
|
||||
@@ -50,4 +49,4 @@ const TabsContent = React.forwardRef<
|
||||
))
|
||||
TabsContent.displayName = TabsPrimitive.Content.displayName
|
||||
|
||||
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
||||
export { Tabs, TabsContent, TabsList, TabsTrigger }
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import * as React from "react"
|
||||
import * as ToastPrimitives from "@radix-ui/react-toast"
|
||||
import { cva } from "class-variance-authority"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import { X } from "lucide-react"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import { cva } from "class-variance-authority"
|
||||
import { X } from "lucide-react"
|
||||
import * as React from "react"
|
||||
|
||||
const ToastProvider = ToastPrimitives.Provider
|
||||
|
||||
@@ -114,13 +113,13 @@ type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
|
||||
type ToastActionElement = React.ReactElement<typeof ToastAction>
|
||||
|
||||
export {
|
||||
type ToastProps,
|
||||
type ToastActionElement,
|
||||
ToastProvider,
|
||||
ToastViewport,
|
||||
Toast,
|
||||
ToastTitle,
|
||||
ToastDescription,
|
||||
ToastClose,
|
||||
ToastAction,
|
||||
type ToastActionElement,
|
||||
ToastClose,
|
||||
ToastDescription,
|
||||
type ToastProps,
|
||||
ToastProvider,
|
||||
ToastTitle,
|
||||
ToastViewport,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from "react"
|
||||
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
||||
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import * as React from "react"
|
||||
|
||||
const TooltipProvider = TooltipPrimitive.Provider
|
||||
|
||||
@@ -29,8 +28,8 @@ const TooltipPortal = TooltipPrimitive.Portal
|
||||
|
||||
export {
|
||||
Tooltip,
|
||||
TooltipTrigger,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipPortal,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// Inspired by react-hot-toast library
|
||||
import * as React from "react"
|
||||
|
||||
import type {
|
||||
ToastActionElement,
|
||||
ToastProps,
|
||||
} from "@renderer/components/ui/toast"
|
||||
import * as React from "react"
|
||||
|
||||
const TOAST_LIMIT = 1
|
||||
const TOAST_REMOVE_DELAY = 1_000_000
|
||||
@@ -192,4 +191,4 @@ function useToast() {
|
||||
}
|
||||
}
|
||||
|
||||
export { useToast, toast }
|
||||
export { toast, useToast }
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useSession } from "@hono/auth-js/react"
|
||||
import {
|
||||
Avatar,
|
||||
AvatarFallback,
|
||||
AvatarImage,
|
||||
} from "@renderer/components/ui/avatar"
|
||||
import { useSession } from "@hono/auth-js/react"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
|
||||
export function UserButton({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ActiveList, ActiveEntry } from "@renderer/lib/types"
|
||||
import type { ActiveEntry, ActiveList } from "@renderer/lib/types"
|
||||
import { Outlet, useOutletContext } from "react-router-dom"
|
||||
|
||||
export interface MainLayoutContextType {
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import { useToast } from "@renderer/components/ui/use-toast"
|
||||
import { ofetch } from "ofetch"
|
||||
import type { FetchError } from "ofetch"
|
||||
import { client } from "@renderer/lib/client"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import type { EntriesResponse, ListResponse } from "@renderer/lib/types"
|
||||
import type { InfiniteData, QueryKey } from "@tanstack/react-query"
|
||||
import {
|
||||
QueryKey,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
|
||||
} from "@tanstack/react-query"
|
||||
import type { InfiniteData } from "@tanstack/react-query"
|
||||
import { client } from "@renderer/lib/client"
|
||||
import { EntriesResponse, ListResponse } from "@renderer/lib/types"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import type { FetchError } from "ofetch"
|
||||
import { ofetch } from "ofetch"
|
||||
|
||||
export const useEntryActions = ({
|
||||
view,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import dayjs from "dayjs"
|
||||
|
||||
import duration from "dayjs/plugin/duration"
|
||||
import relativeTime from "dayjs/plugin/relativeTime"
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { unified } from "unified"
|
||||
import rehypeParse from "rehype-parse"
|
||||
import rehypeSanitize from "rehype-sanitize"
|
||||
import rehypeInferDescriptionMeta from "rehype-infer-description-meta"
|
||||
import rehypeStringify from "rehype-stringify"
|
||||
import { VFile } from "vfile"
|
||||
import { visit } from "unist-util-visit"
|
||||
import { toJsxRuntime } from "hast-util-to-jsx-runtime"
|
||||
import { Fragment, jsx, jsxs } from "react/jsx-runtime"
|
||||
import rehypeInferDescriptionMeta from "rehype-infer-description-meta"
|
||||
import rehypeParse from "rehype-parse"
|
||||
import rehypeSanitize from "rehype-sanitize"
|
||||
import rehypeStringify from "rehype-stringify"
|
||||
import { unified } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
import { VFile } from "vfile"
|
||||
|
||||
export const parseHtml = async (content: string) => {
|
||||
const file = new VFile(content)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ofetch } from "ofetch"
|
||||
import { getCsrfToken } from "@hono/auth-js/react"
|
||||
import { ofetch } from "ofetch"
|
||||
|
||||
export const apiFetch = ofetch.create({
|
||||
baseURL: import.meta.env.VITE_API_URL,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useInfiniteQuery, useQuery } from "@tanstack/react-query"
|
||||
import { levels } from "@renderer/lib/constants"
|
||||
import { EntriesResponse, ListResponse, DataResponse } from "../types"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useInfiniteQuery, useQuery } from "@tanstack/react-query"
|
||||
|
||||
import type { DataResponse, EntriesResponse, ListResponse } from "../types"
|
||||
|
||||
export const useEntries = ({
|
||||
level,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { SubscriptionResponse } from "../types"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { parse } from "tldts"
|
||||
|
||||
import type { SubscriptionResponse } from "../types"
|
||||
|
||||
export type Response = {
|
||||
list: {
|
||||
list: SubscriptionResponse
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister"
|
||||
import { QueryClient } from "@tanstack/react-query"
|
||||
import { persistQueryClient } from "@tanstack/react-query-persist-client"
|
||||
import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister"
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { clsx } from "clsx"
|
||||
import type { ClassValue } from "clsx"
|
||||
import { clsx } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import "./assets/main.css"
|
||||
|
||||
import * as React from "react"
|
||||
import ReactDOM from "react-dom/client"
|
||||
import App from "./App"
|
||||
import { RouterProvider, createBrowserRouter } from "react-router-dom"
|
||||
import { LazyMotion, MotionConfig } from "framer-motion"
|
||||
import { QueryClientProvider } from "@tanstack/react-query"
|
||||
import { authConfigManager, SessionProvider } from "@hono/auth-js/react"
|
||||
import { Toaster } from "@renderer/components/ui/toaster"
|
||||
import { queryClient } from "@renderer/lib/query-client"
|
||||
import { QueryClientProvider } from "@tanstack/react-query"
|
||||
import { LazyMotion, MotionConfig } from "framer-motion"
|
||||
import * as React from "react"
|
||||
import ReactDOM from "react-dom/client"
|
||||
import { createBrowserRouter, RouterProvider } from "react-router-dom"
|
||||
|
||||
import App from "./App"
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { FollowForm } from "@renderer/components/follow/form"
|
||||
import { FollowImport } from "@renderer/components/follow/import"
|
||||
import { Recommendations } from "@renderer/components/follow/recommendations"
|
||||
import {
|
||||
Tabs,
|
||||
TabsContent,
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
} from "@renderer/components/ui/tabs"
|
||||
import { Recommendations } from "@renderer/components/follow/recommendations"
|
||||
import { FollowForm } from "@renderer/components/follow/form"
|
||||
import { FollowImport } from "@renderer/components/follow/import"
|
||||
|
||||
export function Component() {
|
||||
const tabs = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useEffect, useState } from "react"
|
||||
import { ActiveList, ActiveEntry } from "@renderer/lib/types"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
import { useSession } from "@hono/auth-js/react"
|
||||
import { MainLayoutOutlet } from "@renderer/contexts/outlet/main-layout"
|
||||
import type { ActiveEntry, ActiveList } from "@renderer/lib/types"
|
||||
import { useEffect, useState } from "react"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
|
||||
export function Component() {
|
||||
const { status } = useSession()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { signIn, useSession } from "@hono/auth-js/react"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { useEffect, useState } from "react"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { UserButton } from "@renderer/components/user-button"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useEffect } from "react"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
|
||||
export function Component() {
|
||||
const navigate = useNavigate()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useSession } from "@hono/auth-js/react"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { z } from "zod"
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import {
|
||||
Form,
|
||||
@@ -12,10 +11,11 @@ import {
|
||||
FormMessage,
|
||||
} from "@renderer/components/ui/form"
|
||||
import { Input } from "@renderer/components/ui/input"
|
||||
import { useSession } from "@hono/auth-js/react"
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useToast } from "@renderer/components/ui/use-toast"
|
||||
import { apiFetch } from "@renderer/lib/queries/api-fetch"
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { z } from "zod"
|
||||
|
||||
const formSchema = z.object({
|
||||
handle: z.string().max(50),
|
||||
|
||||
Reference in New Issue
Block a user