refactor, added slate, added editor, added book

This commit is contained in:
lnn0q 2025-05-28 23:25:46 +03:00
parent bc250e73bb
commit 029b7e9353
33 changed files with 714 additions and 496 deletions

View file

@ -8,8 +8,6 @@
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { createFileRoute } from '@tanstack/react-router'
// Import Routes
import { Route as rootRoute } from './pages/__root'
@ -20,19 +18,10 @@ import { Route as AboutImport } from './pages/about'
import { Route as IndexImport } from './pages/index'
import { Route as ProfileUsernameImport } from './pages/profile/$username'
import { Route as NewBookImport } from './pages/new/book'
// Create Virtual Routes
const BookLazyImport = createFileRoute('/book')()
import { Route as WorkBookBookIdImport } from './pages/work/book/$bookId'
// Create/Update Routes
const BookLazyRoute = BookLazyImport.update({
id: '/book',
path: '/book',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./pages/book.lazy').then((d) => d.Route))
const RegisterRoute = RegisterImport.update({
id: '/register',
path: '/register',
@ -75,6 +64,12 @@ const NewBookRoute = NewBookImport.update({
getParentRoute: () => rootRoute,
} as any)
const WorkBookBookIdRoute = WorkBookBookIdImport.update({
id: '/work/book/$bookId',
path: '/work/book/$bookId',
getParentRoute: () => rootRoute,
} as any)
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
@ -114,13 +109,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof RegisterImport
parentRoute: typeof rootRoute
}
'/book': {
id: '/book'
path: '/book'
fullPath: '/book'
preLoaderRoute: typeof BookLazyImport
parentRoute: typeof rootRoute
}
'/new/book': {
id: '/new/book'
path: '/new/book'
@ -135,6 +123,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof ProfileUsernameImport
parentRoute: typeof rootRoute
}
'/work/book/$bookId': {
id: '/work/book/$bookId'
path: '/work/book/$bookId'
fullPath: '/work/book/$bookId'
preLoaderRoute: typeof WorkBookBookIdImport
parentRoute: typeof rootRoute
}
}
}
@ -146,9 +141,9 @@ export interface FileRoutesByFullPath {
'/editor': typeof EditorRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
'/new/book': typeof NewBookRoute
'/profile/$username': typeof ProfileUsernameRoute
'/work/book/$bookId': typeof WorkBookBookIdRoute
}
export interface FileRoutesByTo {
@ -157,9 +152,9 @@ export interface FileRoutesByTo {
'/editor': typeof EditorRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
'/new/book': typeof NewBookRoute
'/profile/$username': typeof ProfileUsernameRoute
'/work/book/$bookId': typeof WorkBookBookIdRoute
}
export interface FileRoutesById {
@ -169,9 +164,9 @@ export interface FileRoutesById {
'/editor': typeof EditorRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
'/new/book': typeof NewBookRoute
'/profile/$username': typeof ProfileUsernameRoute
'/work/book/$bookId': typeof WorkBookBookIdRoute
}
export interface FileRouteTypes {
@ -182,9 +177,9 @@ export interface FileRouteTypes {
| '/editor'
| '/login'
| '/register'
| '/book'
| '/new/book'
| '/profile/$username'
| '/work/book/$bookId'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
@ -192,9 +187,9 @@ export interface FileRouteTypes {
| '/editor'
| '/login'
| '/register'
| '/book'
| '/new/book'
| '/profile/$username'
| '/work/book/$bookId'
id:
| '__root__'
| '/'
@ -202,9 +197,9 @@ export interface FileRouteTypes {
| '/editor'
| '/login'
| '/register'
| '/book'
| '/new/book'
| '/profile/$username'
| '/work/book/$bookId'
fileRoutesById: FileRoutesById
}
@ -214,9 +209,9 @@ export interface RootRouteChildren {
EditorRoute: typeof EditorRoute
LoginRoute: typeof LoginRoute
RegisterRoute: typeof RegisterRoute
BookLazyRoute: typeof BookLazyRoute
NewBookRoute: typeof NewBookRoute
ProfileUsernameRoute: typeof ProfileUsernameRoute
WorkBookBookIdRoute: typeof WorkBookBookIdRoute
}
const rootRouteChildren: RootRouteChildren = {
@ -225,9 +220,9 @@ const rootRouteChildren: RootRouteChildren = {
EditorRoute: EditorRoute,
LoginRoute: LoginRoute,
RegisterRoute: RegisterRoute,
BookLazyRoute: BookLazyRoute,
NewBookRoute: NewBookRoute,
ProfileUsernameRoute: ProfileUsernameRoute,
WorkBookBookIdRoute: WorkBookBookIdRoute,
}
export const routeTree = rootRoute
@ -245,9 +240,9 @@ export const routeTree = rootRoute
"/editor",
"/login",
"/register",
"/book",
"/new/book",
"/profile/$username"
"/profile/$username",
"/work/book/$bookId"
]
},
"/": {
@ -265,14 +260,14 @@ export const routeTree = rootRoute
"/register": {
"filePath": "register.tsx"
},
"/book": {
"filePath": "book.lazy.tsx"
},
"/new/book": {
"filePath": "new/book.tsx"
},
"/profile/$username": {
"filePath": "profile/$username.tsx"
},
"/work/book/$bookId": {
"filePath": "work/book/$bookId.tsx"
}
}
}