@proofkit/cli 1.1.8 → 1.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/external-DCpQkgKf.js +1 -0
- package/dist/index.js +102 -124
- package/package.json +15 -10
- package/template/extras/config/query-provider-vite.tsx +0 -2
- package/template/extras/emailProviders/none/email.tsx +4 -4
- package/template/extras/emailProviders/plunk/email.tsx +5 -4
- package/template/extras/emailProviders/plunk/service.ts +1 -1
- package/template/extras/emailProviders/resend/email.tsx +1 -0
- package/template/extras/emailProviders/resend/service.ts +1 -1
- package/template/extras/emailTemplates/auth-code.tsx +156 -0
- package/template/extras/emailTemplates/generic.tsx +136 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/actions.ts +13 -9
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/page.tsx +2 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/profile-form.tsx +7 -5
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx +8 -6
- package/template/extras/fmaddon-auth/app/auth/forgot-password/actions.ts +7 -5
- package/template/extras/fmaddon-auth/app/auth/forgot-password/forgot-form.tsx +3 -2
- package/template/extras/fmaddon-auth/app/auth/forgot-password/page.tsx +1 -0
- package/template/extras/fmaddon-auth/app/auth/login/actions.ts +5 -4
- package/template/extras/fmaddon-auth/app/auth/login/login-form.tsx +7 -5
- package/template/extras/fmaddon-auth/app/auth/login/page.tsx +1 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/actions.ts +11 -8
- package/template/extras/fmaddon-auth/app/auth/reset-password/page.tsx +3 -2
- package/template/extras/fmaddon-auth/app/auth/reset-password/reset-password-form.tsx +5 -4
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/actions.ts +3 -2
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/page.tsx +3 -2
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/verify-email-form.tsx +3 -2
- package/template/extras/fmaddon-auth/app/auth/signup/actions.ts +10 -9
- package/template/extras/fmaddon-auth/app/auth/signup/page.tsx +1 -0
- package/template/extras/fmaddon-auth/app/auth/signup/signup-form.tsx +7 -6
- package/template/extras/fmaddon-auth/app/auth/verify-email/actions.ts +7 -8
- package/template/extras/fmaddon-auth/app/auth/verify-email/email-verification-form.tsx +5 -4
- package/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx +5 -3
- package/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx +4 -2
- package/template/extras/fmaddon-auth/components/auth/actions.ts +4 -1
- package/template/extras/fmaddon-auth/components/auth/protect.tsx +2 -1
- package/template/extras/fmaddon-auth/components/auth/redirect.tsx +2 -2
- package/template/extras/fmaddon-auth/components/auth/use-user.ts +3 -2
- package/template/extras/fmaddon-auth/components/auth/user-menu.tsx +3 -2
- package/template/extras/fmaddon-auth/middleware.ts +0 -1
- package/template/extras/fmaddon-auth/server/auth/utils/email-verification.ts +8 -7
- package/template/extras/fmaddon-auth/server/auth/utils/encryption.ts +2 -2
- package/template/extras/fmaddon-auth/server/auth/utils/password-reset.ts +5 -4
- package/template/extras/fmaddon-auth/server/auth/utils/redirect.ts +1 -1
- package/template/extras/fmaddon-auth/server/auth/utils/session.ts +6 -7
- package/template/extras/fmaddon-auth/server/auth/utils/user.ts +1 -2
- package/template/extras/src/app/next-auth/signin/page.tsx +2 -1
- package/template/fm-addon/ProofKitAuth/info.json +6 -9
- package/template/fm-addon/ProofKitAuth/info_de.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_es.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_fr.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_it.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_ja.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_ko.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_nl.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_pt.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_sv.json +5 -12
- package/template/fm-addon/ProofKitAuth/info_zh.json +5 -12
- package/template/fm-addon/ProofKitWV/info.json +6 -9
- package/template/fm-addon/ProofKitWV/info_de.json +5 -12
- package/template/fm-addon/ProofKitWV/info_en.json +1 -5
- package/template/fm-addon/ProofKitWV/info_es.json +5 -12
- package/template/fm-addon/ProofKitWV/info_fr.json +5 -12
- package/template/fm-addon/ProofKitWV/info_it.json +5 -12
- package/template/fm-addon/ProofKitWV/info_ja.json +5 -12
- package/template/fm-addon/ProofKitWV/info_ko.json +5 -12
- package/template/fm-addon/ProofKitWV/info_nl.json +5 -12
- package/template/fm-addon/ProofKitWV/info_pt.json +5 -12
- package/template/fm-addon/ProofKitWV/info_sv.json +5 -12
- package/template/fm-addon/ProofKitWV/info_zh.json +5 -12
- package/template/{nextjs → nextjs-mantine}/proofkit.json +2 -1
- package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/HeaderNavLink.tsx +5 -1
- package/template/{nextjs → nextjs-mantine}/src/utils/notification-helpers.ts +1 -1
- package/template/nextjs-mantine/tsconfig.json +27 -0
- package/template/nextjs-shadcn/.claude/CLAUDE.md +327 -0
- package/template/nextjs-shadcn/.cursor/rules/ultracite.mdc +333 -0
- package/template/nextjs-shadcn/.prettierrc +3 -0
- package/template/nextjs-shadcn/.vscode/settings.json +35 -0
- package/template/nextjs-shadcn/README.md +27 -0
- package/template/nextjs-shadcn/_gitignore +37 -0
- package/template/nextjs-shadcn/biome.json +43 -0
- package/template/nextjs-shadcn/components.json +21 -0
- package/template/nextjs-shadcn/next-env.d.ts +6 -0
- package/template/nextjs-shadcn/next.config.ts +8 -0
- package/template/nextjs-shadcn/package.json +35 -0
- package/template/nextjs-shadcn/postcss.config.mjs +5 -0
- package/template/nextjs-shadcn/proofkit.json +6 -0
- package/template/nextjs-shadcn/public/favicon.ico +0 -0
- package/template/nextjs-shadcn/public/proofkit.png +0 -0
- package/template/nextjs-shadcn/src/app/(main)/layout.tsx +6 -0
- package/template/nextjs-shadcn/src/app/(main)/page.tsx +124 -0
- package/template/nextjs-shadcn/src/app/globals.css +122 -0
- package/template/nextjs-shadcn/src/app/layout.tsx +35 -0
- package/template/nextjs-shadcn/src/app/navigation.tsx +12 -0
- package/template/nextjs-shadcn/src/components/AppLogo.tsx +6 -0
- package/template/nextjs-shadcn/src/components/AppShell/internal/AppShell.tsx +23 -0
- package/template/nextjs-shadcn/src/components/AppShell/internal/Header.module.css +33 -0
- package/template/nextjs-shadcn/src/components/AppShell/internal/Header.tsx +30 -0
- package/template/nextjs-shadcn/src/components/AppShell/internal/HeaderMobileMenu.tsx +25 -0
- package/template/nextjs-shadcn/src/components/AppShell/internal/HeaderNavLink.tsx +35 -0
- package/template/nextjs-shadcn/src/components/AppShell/internal/config.ts +1 -0
- package/template/nextjs-shadcn/src/components/AppShell/slot-header-center.tsx +13 -0
- package/template/nextjs-shadcn/src/components/AppShell/slot-header-left.tsx +23 -0
- package/template/nextjs-shadcn/src/components/AppShell/slot-header-mobile-content.tsx +43 -0
- package/template/nextjs-shadcn/src/components/AppShell/slot-header-right.tsx +25 -0
- package/template/nextjs-shadcn/src/components/providers.tsx +13 -0
- package/template/nextjs-shadcn/src/components/theme-provider.tsx +11 -0
- package/template/nextjs-shadcn/src/lib/env.ts +12 -0
- package/template/nextjs-shadcn/src/lib/utils.ts +6 -0
- package/template/{nextjs → nextjs-shadcn}/tsconfig.json +3 -2
- package/template/pages/nextjs/table-edit/page.tsx +5 -5
- package/template/pages/nextjs/table-edit/table.tsx +5 -3
- package/template/pages/nextjs/table-infinite/query.ts +4 -3
- package/template/pages/nextjs/table-infinite/table.tsx +3 -2
- package/template/pages/nextjs/table-infinite-edit/page.tsx +6 -6
- package/template/pages/nextjs/table-infinite-edit/query.ts +8 -2
- package/template/pages/vite-wv/table/index.tsx +5 -4
- package/template/pages/vite-wv/table-edit/index.tsx +6 -6
- package/template/vite-wv/src/main.tsx +1 -1
- package/template/vite-wv/src/routeTree.gen.ts +41 -41
- /package/template/{nextjs → nextjs-mantine}/.prettierrc +0 -0
- /package/template/{nextjs → nextjs-mantine}/README.md +0 -0
- /package/template/{nextjs → nextjs-mantine}/_gitignore +0 -0
- /package/template/{nextjs → nextjs-mantine}/components.json +0 -0
- /package/template/{nextjs → nextjs-mantine}/next.config.ts +0 -0
- /package/template/{nextjs → nextjs-mantine}/package.json +0 -0
- /package/template/{nextjs → nextjs-mantine}/postcss.config.cjs +0 -0
- /package/template/{nextjs → nextjs-mantine}/public/favicon.ico +0 -0
- /package/template/{nextjs → nextjs-mantine}/public/proofkit.png +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/app/(main)/layout.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/app/(main)/page.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/app/layout.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/app/navigation.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppLogo.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/AppShell.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/Header.module.css +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/Header.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/HeaderMobileMenu.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/config.ts +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-center.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-left.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-mobile-content.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-right.tsx +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/config/env.ts +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/config/theme/globals.css +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/config/theme/mantine-theme.ts +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/server/safe-action.ts +0 -0
- /package/template/{nextjs → nextjs-mantine}/src/utils/styles.ts +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type ProofKitRoute } from "@proofkit/cli";
|
|
4
|
+
import { usePathname } from "next/navigation";
|
|
5
|
+
import React from "react";
|
|
6
|
+
|
|
7
|
+
import classes from "./Header.module.css";
|
|
8
|
+
|
|
9
|
+
export default function HeaderNavLink(route: ProofKitRoute) {
|
|
10
|
+
const pathname = usePathname();
|
|
11
|
+
|
|
12
|
+
if (route.type === "function") {
|
|
13
|
+
return (
|
|
14
|
+
<button className={classes.link} onClick={route.onClick}>
|
|
15
|
+
{route.label}
|
|
16
|
+
</button>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const isActive = route.exactMatch
|
|
21
|
+
? pathname === route.href
|
|
22
|
+
: pathname.startsWith(route.href);
|
|
23
|
+
|
|
24
|
+
if (route.type === "link") {
|
|
25
|
+
return (
|
|
26
|
+
<a
|
|
27
|
+
href={route.href}
|
|
28
|
+
className={classes.link}
|
|
29
|
+
data-active={isActive || undefined}
|
|
30
|
+
>
|
|
31
|
+
{route.label}
|
|
32
|
+
</a>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const headerHeight = 56;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DO NOT REMOVE / RENAME THIS FILE
|
|
3
|
+
*
|
|
4
|
+
* You may CUSTOMIZE the content of this file, but the ProofKit CLI expects
|
|
5
|
+
* this file to exist and may use it to inject content for other components.
|
|
6
|
+
*
|
|
7
|
+
* If you don't want it to be used, you may return null or an empty fragment
|
|
8
|
+
*/
|
|
9
|
+
export function SlotHeaderCenter() {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default SlotHeaderCenter;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
import AppLogo from "../AppLogo";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* DO NOT REMOVE / RENAME THIS FILE
|
|
7
|
+
*
|
|
8
|
+
* You may CUSTOMIZE the content of this file, but the ProofKit CLI expects this file to exist and
|
|
9
|
+
* may use it to inject content for other components.
|
|
10
|
+
*
|
|
11
|
+
* If you don't want it to be used, you may return null or an empty fragment
|
|
12
|
+
*/
|
|
13
|
+
export function SlotHeaderLeft() {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Link href="/" style={{ display: "inline-flex", alignItems: "center" }}>
|
|
17
|
+
<AppLogo />
|
|
18
|
+
</Link>
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default SlotHeaderLeft;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { primaryRoutes } from "@/app/navigation";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DO NOT REMOVE / RENAME THIS FILE
|
|
8
|
+
*
|
|
9
|
+
* You may CUSTOMIZE the content of this file, but the ProofKit CLI expects
|
|
10
|
+
* this file to exist and may use it to inject content for other components.
|
|
11
|
+
*
|
|
12
|
+
* If you don't want it to be used, you may return null or an empty fragment
|
|
13
|
+
*/
|
|
14
|
+
export function SlotHeaderMobileMenuContent({
|
|
15
|
+
closeMenu,
|
|
16
|
+
}: {
|
|
17
|
+
closeMenu: () => void;
|
|
18
|
+
}) {
|
|
19
|
+
const router = useRouter();
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex flex-col">
|
|
22
|
+
{primaryRoutes.map((route) => (
|
|
23
|
+
<button
|
|
24
|
+
key={route.label}
|
|
25
|
+
className="flex items-center gap-2 rounded px-3 py-2 text-left hover:bg-zinc-100 dark:hover:bg-zinc-800"
|
|
26
|
+
onClick={() => {
|
|
27
|
+
closeMenu();
|
|
28
|
+
if (route.type === "function") {
|
|
29
|
+
route.onClick();
|
|
30
|
+
} else if (route.type === "link") {
|
|
31
|
+
router.push(route.href);
|
|
32
|
+
}
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{route.icon}
|
|
36
|
+
<span>{route.label}</span>
|
|
37
|
+
</button>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default SlotHeaderMobileMenuContent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { primaryRoutes } from "@/app/navigation";
|
|
2
|
+
|
|
3
|
+
import HeaderNavLink from "./internal/HeaderNavLink";
|
|
4
|
+
import { ModeToggle } from "../mode-toggle";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DO NOT REMOVE / RENAME THIS FILE
|
|
8
|
+
*
|
|
9
|
+
* You may CUSTOMIZE the content of this file, but the ProofKit CLI expects
|
|
10
|
+
* this file to exist and may use it to inject content for other components.
|
|
11
|
+
*
|
|
12
|
+
* If you don't want it to be used, you may return null or an empty fragment
|
|
13
|
+
*/
|
|
14
|
+
export function SlotHeaderRight() {
|
|
15
|
+
return (
|
|
16
|
+
<div className="flex items-center space-x-1">
|
|
17
|
+
{primaryRoutes.map((route) => (
|
|
18
|
+
<HeaderNavLink key={route.label} {...route} />
|
|
19
|
+
))}
|
|
20
|
+
<ModeToggle />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default SlotHeaderRight;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ThemeProvider } from "./theme-provider";
|
|
4
|
+
import { Toaster } from "./ui/sonner";
|
|
5
|
+
|
|
6
|
+
export default function Providers({ children }: { children: React.ReactNode }) {
|
|
7
|
+
return (
|
|
8
|
+
<ThemeProvider attribute="class" disableTransitionOnChange>
|
|
9
|
+
{children}
|
|
10
|
+
<Toaster richColors />
|
|
11
|
+
</ThemeProvider>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
export function ThemeProvider({
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof NextThemesProvider>) {
|
|
10
|
+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createEnv } from "@t3-oss/env-nextjs";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
|
|
4
|
+
export const env = createEnv({
|
|
5
|
+
server: {
|
|
6
|
+
NODE_ENV: z
|
|
7
|
+
.enum(["development", "test", "production"])
|
|
8
|
+
.default("development"),
|
|
9
|
+
},
|
|
10
|
+
client: {},
|
|
11
|
+
experimental__runtimeEnv: {},
|
|
12
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
3
4
|
"lib": [
|
|
4
5
|
"dom",
|
|
5
6
|
"dom.iterable",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"./src/*"
|
|
27
28
|
]
|
|
28
29
|
},
|
|
29
|
-
"
|
|
30
|
+
"strictNullChecks": true
|
|
30
31
|
},
|
|
31
32
|
"include": [
|
|
32
33
|
"next-env.d.ts",
|
|
@@ -37,4 +38,4 @@
|
|
|
37
38
|
"exclude": [
|
|
38
39
|
"node_modules"
|
|
39
40
|
]
|
|
40
|
-
}
|
|
41
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
|
|
2
|
-
import { Stack, Text
|
|
2
|
+
import { Code, Stack, Text } from "@mantine/core";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
|
-
import TableContent from "./table";
|
|
6
5
|
import { idFieldName } from "./schema";
|
|
6
|
+
import TableContent from "./table";
|
|
7
7
|
|
|
8
8
|
export default async function TablePage() {
|
|
9
9
|
// this function is limited to 100 records by default. To load more, see the other table templates from the docs
|
|
@@ -17,12 +17,12 @@ export default async function TablePage() {
|
|
|
17
17
|
This table allows editing. Double-click on a cell to edit the value.
|
|
18
18
|
</Text>
|
|
19
19
|
<Text size="sm" c="dimmed">
|
|
20
|
-
NOTE: This feature requires a primary key field on your API layout. If
|
|
21
|
-
primary key field is not <Code>{idFieldName}</Code>, update the
|
|
20
|
+
NOTE: This feature requires a primary key field on your API layout. If
|
|
21
|
+
your primary key field is not <Code>{idFieldName}</Code>, update the
|
|
22
22
|
<Code>idFieldName</Code> variable in the <Code>schema.ts</Code> file.
|
|
23
23
|
</Text>
|
|
24
24
|
</div>
|
|
25
25
|
<TableContent data={data.map((d) => d.fieldData)} />
|
|
26
26
|
</Stack>
|
|
27
27
|
);
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { type __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
|
|
4
|
+
import { showErrorNotification } from "@/utils/notification-helpers";
|
|
4
5
|
import {
|
|
5
6
|
MantineReactTable,
|
|
7
|
+
useMantineReactTable,
|
|
6
8
|
type MRT_Cell,
|
|
7
9
|
type MRT_ColumnDef,
|
|
8
|
-
useMantineReactTable,
|
|
9
10
|
} from "mantine-react-table";
|
|
10
11
|
import React from "react";
|
|
12
|
+
|
|
11
13
|
import { updateRecord } from "./actions";
|
|
12
|
-
import { showErrorNotification } from "@/utils/notification-helpers";
|
|
13
14
|
import { idFieldName } from "./schema";
|
|
14
15
|
|
|
15
16
|
type TData = __TYPE_NAME__;
|
|
@@ -39,5 +40,6 @@ export default function MyTable({ data }: { data: TData[] }) {
|
|
|
39
40
|
handleSaveCell(cell, event.target.value);
|
|
40
41
|
},
|
|
41
42
|
}),
|
|
42
|
-
});
|
|
43
|
+
});
|
|
44
|
+
return <MantineReactTable table={table} />;
|
|
43
45
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
4
|
-
import { fetchData } from "./actions";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
4
|
import type {
|
|
7
|
-
MRT_SortingState,
|
|
8
5
|
MRT_ColumnFiltersState,
|
|
6
|
+
MRT_SortingState,
|
|
9
7
|
} from "mantine-react-table";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
|
|
10
|
+
import { fetchData } from "./actions";
|
|
10
11
|
|
|
11
12
|
export function useAllData({
|
|
12
13
|
sorting,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
|
|
4
|
+
import { Text } from "@mantine/core";
|
|
4
5
|
import {
|
|
5
6
|
createMRTColumnHelper,
|
|
6
7
|
MantineReactTable,
|
|
@@ -11,14 +12,14 @@ import {
|
|
|
11
12
|
useMantineReactTable,
|
|
12
13
|
} from "mantine-react-table";
|
|
13
14
|
import React, {
|
|
14
|
-
type UIEvent,
|
|
15
15
|
useCallback,
|
|
16
16
|
useEffect,
|
|
17
17
|
useRef,
|
|
18
18
|
useState,
|
|
19
|
+
type UIEvent,
|
|
19
20
|
} from "react";
|
|
21
|
+
|
|
20
22
|
import { useAllData } from "./query";
|
|
21
|
-
import { Text } from "@mantine/core";
|
|
22
23
|
|
|
23
24
|
type TData = __TYPE_NAME__;
|
|
24
25
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack, Text
|
|
1
|
+
import { Code, Stack, Text } from "@mantine/core";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import TableContent from "./table";
|
|
5
4
|
import { idFieldName } from "./schema";
|
|
5
|
+
import TableContent from "./table";
|
|
6
6
|
|
|
7
7
|
export default async function TablePage() {
|
|
8
8
|
return (
|
|
@@ -12,12 +12,12 @@ export default async function TablePage() {
|
|
|
12
12
|
This table allows editing. Double-click on a cell to edit the value.
|
|
13
13
|
</Text>
|
|
14
14
|
<Text size="sm" c="dimmed">
|
|
15
|
-
NOTE: This feature requires a primary key field on your API layout. If
|
|
16
|
-
primary key field is not <Code>{idFieldName}</Code>, update the
|
|
15
|
+
NOTE: This feature requires a primary key field on your API layout. If
|
|
16
|
+
your primary key field is not <Code>{idFieldName}</Code>, update the
|
|
17
17
|
<Code>idFieldName</Code> variable in the <Code>schema.ts</Code> file.
|
|
18
18
|
</Text>
|
|
19
19
|
</div>
|
|
20
|
-
<TableContent
|
|
20
|
+
<TableContent />
|
|
21
21
|
</Stack>
|
|
22
22
|
);
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -66,7 +66,7 @@ export function useAllData({
|
|
|
66
66
|
data: page.data.map((row) =>
|
|
67
67
|
row.fieldData[idFieldName] === newRecord[idFieldName]
|
|
68
68
|
? { ...row, fieldData: { ...row.fieldData, ...newRecord } }
|
|
69
|
-
: row
|
|
69
|
+
: row
|
|
70
70
|
),
|
|
71
71
|
})),
|
|
72
72
|
};
|
|
@@ -77,5 +77,11 @@ export function useAllData({
|
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
...qr,
|
|
82
|
+
data: flatData,
|
|
83
|
+
totalDBRowCount,
|
|
84
|
+
totalFetched,
|
|
85
|
+
updateRecord: updateRecordMutation.mutate,
|
|
86
|
+
};
|
|
81
87
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import FullScreenLoader from "@/components/full-screen-loader";
|
|
2
|
+
import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
|
|
3
|
+
import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
|
|
4
|
+
import { Stack, Text } from "@mantine/core";
|
|
1
5
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
6
|
import {
|
|
3
7
|
MantineReactTable,
|
|
4
8
|
MRT_ColumnDef,
|
|
5
9
|
useMantineReactTable,
|
|
6
10
|
} from "mantine-react-table";
|
|
7
|
-
|
|
8
|
-
import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
|
|
9
|
-
import { Stack, Text } from "@mantine/core";
|
|
10
|
-
import FullScreenLoader from "@/components/full-screen-loader";
|
|
11
|
+
|
|
11
12
|
export const Route = createFileRoute("/")({
|
|
12
13
|
component: RouteComponent,
|
|
13
14
|
pendingComponent: () => <FullScreenLoader />,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import FullScreenLoader from "@/components/full-screen-loader";
|
|
2
|
+
import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
|
|
3
|
+
import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
|
|
4
|
+
import { Code, Stack, Text } from "@mantine/core";
|
|
1
5
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
6
|
import {
|
|
3
7
|
MantineReactTable,
|
|
@@ -5,10 +9,6 @@ import {
|
|
|
5
9
|
MRT_ColumnDef,
|
|
6
10
|
useMantineReactTable,
|
|
7
11
|
} from "mantine-react-table";
|
|
8
|
-
import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
|
|
9
|
-
import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
|
|
10
|
-
import { Code, Stack, Text } from "@mantine/core";
|
|
11
|
-
import FullScreenLoader from "@/components/full-screen-loader";
|
|
12
12
|
|
|
13
13
|
export const Route = createFileRoute("/")({
|
|
14
14
|
component: RouteComponent,
|
|
@@ -61,8 +61,8 @@ function RouteComponent() {
|
|
|
61
61
|
This table allows editing. Double-click on a cell to edit the value.
|
|
62
62
|
</Text>
|
|
63
63
|
<Text size="sm" c="dimmed">
|
|
64
|
-
NOTE: This feature requires a primary key field on your API layout. If
|
|
65
|
-
primary key field is not <Code>{idFieldName}</Code>, update the
|
|
64
|
+
NOTE: This feature requires a primary key field on your API layout. If
|
|
65
|
+
your primary key field is not <Code>{idFieldName}</Code>, update the
|
|
66
66
|
<Code>idFieldName</Code> variable in the code.
|
|
67
67
|
</Text>
|
|
68
68
|
</div>
|
|
@@ -10,85 +10,85 @@
|
|
|
10
10
|
|
|
11
11
|
// Import Routes
|
|
12
12
|
|
|
13
|
-
import { Route as rootRoute } from
|
|
14
|
-
import { Route as SecondaryImport } from
|
|
15
|
-
import { Route as IndexImport } from
|
|
13
|
+
import { Route as rootRoute } from "./routes/__root";
|
|
14
|
+
import { Route as SecondaryImport } from "./routes/secondary";
|
|
15
|
+
import { Route as IndexImport } from "./routes/index";
|
|
16
16
|
|
|
17
17
|
// Create/Update Routes
|
|
18
18
|
|
|
19
19
|
const SecondaryRoute = SecondaryImport.update({
|
|
20
|
-
id:
|
|
21
|
-
path:
|
|
20
|
+
id: "/secondary",
|
|
21
|
+
path: "/secondary",
|
|
22
22
|
getParentRoute: () => rootRoute,
|
|
23
|
-
} as any)
|
|
23
|
+
} as any);
|
|
24
24
|
|
|
25
25
|
const IndexRoute = IndexImport.update({
|
|
26
|
-
id:
|
|
27
|
-
path:
|
|
26
|
+
id: "/",
|
|
27
|
+
path: "/",
|
|
28
28
|
getParentRoute: () => rootRoute,
|
|
29
|
-
} as any)
|
|
29
|
+
} as any);
|
|
30
30
|
|
|
31
31
|
// Populate the FileRoutesByPath interface
|
|
32
32
|
|
|
33
|
-
declare module
|
|
33
|
+
declare module "@tanstack/react-router" {
|
|
34
34
|
interface FileRoutesByPath {
|
|
35
|
-
|
|
36
|
-
id:
|
|
37
|
-
path:
|
|
38
|
-
fullPath:
|
|
39
|
-
preLoaderRoute: typeof IndexImport
|
|
40
|
-
parentRoute: typeof rootRoute
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
id:
|
|
44
|
-
path:
|
|
45
|
-
fullPath:
|
|
46
|
-
preLoaderRoute: typeof SecondaryImport
|
|
47
|
-
parentRoute: typeof rootRoute
|
|
48
|
-
}
|
|
35
|
+
"/": {
|
|
36
|
+
id: "/";
|
|
37
|
+
path: "/";
|
|
38
|
+
fullPath: "/";
|
|
39
|
+
preLoaderRoute: typeof IndexImport;
|
|
40
|
+
parentRoute: typeof rootRoute;
|
|
41
|
+
};
|
|
42
|
+
"/secondary": {
|
|
43
|
+
id: "/secondary";
|
|
44
|
+
path: "/secondary";
|
|
45
|
+
fullPath: "/secondary";
|
|
46
|
+
preLoaderRoute: typeof SecondaryImport;
|
|
47
|
+
parentRoute: typeof rootRoute;
|
|
48
|
+
};
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// Create and export the route tree
|
|
53
53
|
|
|
54
54
|
export interface FileRoutesByFullPath {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
"/": typeof IndexRoute;
|
|
56
|
+
"/secondary": typeof SecondaryRoute;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export interface FileRoutesByTo {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
"/": typeof IndexRoute;
|
|
61
|
+
"/secondary": typeof SecondaryRoute;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export interface FileRoutesById {
|
|
65
|
-
__root__: typeof rootRoute
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
__root__: typeof rootRoute;
|
|
66
|
+
"/": typeof IndexRoute;
|
|
67
|
+
"/secondary": typeof SecondaryRoute;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export interface FileRouteTypes {
|
|
71
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
72
|
-
fullPaths:
|
|
73
|
-
fileRoutesByTo: FileRoutesByTo
|
|
74
|
-
to:
|
|
75
|
-
id:
|
|
76
|
-
fileRoutesById: FileRoutesById
|
|
71
|
+
fileRoutesByFullPath: FileRoutesByFullPath;
|
|
72
|
+
fullPaths: "/" | "/secondary";
|
|
73
|
+
fileRoutesByTo: FileRoutesByTo;
|
|
74
|
+
to: "/" | "/secondary";
|
|
75
|
+
id: "__root__" | "/" | "/secondary";
|
|
76
|
+
fileRoutesById: FileRoutesById;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface RootRouteChildren {
|
|
80
|
-
IndexRoute: typeof IndexRoute
|
|
81
|
-
SecondaryRoute: typeof SecondaryRoute
|
|
80
|
+
IndexRoute: typeof IndexRoute;
|
|
81
|
+
SecondaryRoute: typeof SecondaryRoute;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const rootRouteChildren: RootRouteChildren = {
|
|
85
85
|
IndexRoute: IndexRoute,
|
|
86
86
|
SecondaryRoute: SecondaryRoute,
|
|
87
|
-
}
|
|
87
|
+
};
|
|
88
88
|
|
|
89
89
|
export const routeTree = rootRoute
|
|
90
90
|
._addFileChildren(rootRouteChildren)
|
|
91
|
-
._addFileTypes<FileRouteTypes>()
|
|
91
|
+
._addFileTypes<FileRouteTypes>();
|
|
92
92
|
|
|
93
93
|
/* ROUTE_MANIFEST_START
|
|
94
94
|
{
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/Header.module.css
RENAMED
|
File without changes
|
|
File without changes
|
/package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/HeaderMobileMenu.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-mobile-content.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|