@postxl/generators 1.17.1 → 1.18.0
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/backend-core/backend.generator.js +10 -10
- package/dist/backend-core/backend.generator.js.map +1 -1
- package/dist/backend-core/modules/backend-module-xlport.generator.js +2 -2
- package/dist/backend-data-management/data-management.generator.js +1 -1
- package/dist/backend-database-prisma/prisma.generator.js +3 -3
- package/dist/backend-rest-api/rest-api.generator.js +1 -1
- package/dist/backend-router-trpc/router-trpc.generator.js +1 -1
- package/dist/backend-router-trpc/router-trpc.generator.js.map +1 -1
- package/dist/backend-s3/s3.generator.js +1 -1
- package/dist/backend-upload/upload.generator.js +1 -1
- package/dist/base/base.generator.js +9 -9
- package/dist/devops/generators/e2e-yml.generator.js +1 -1
- package/dist/e2e/template/e2e/Dockerfile +2 -2
- package/dist/e2e/template/e2e/package.json +7 -7
- package/dist/frontend-actions/actions.generator.js +1 -20
- package/dist/frontend-actions/actions.generator.js.map +1 -1
- package/dist/frontend-admin/admin.generator.js +2 -2
- package/dist/frontend-admin/admin.generator.js.map +1 -1
- package/dist/frontend-admin/generators/admin-sidebar.generator.d.ts +2 -1
- package/dist/frontend-admin/generators/admin-sidebar.generator.js +8 -26
- package/dist/frontend-admin/generators/admin-sidebar.generator.js.map +1 -1
- package/dist/frontend-admin/generators/data-management-page.generator.js +14 -7
- package/dist/frontend-admin/generators/data-management-page.generator.js.map +1 -1
- package/dist/frontend-admin/generators/excel-io-page.generator.js +16 -9
- package/dist/frontend-admin/generators/excel-io-page.generator.js.map +1 -1
- package/dist/frontend-admin/generators/import-review-page-review-stage.generator.js +6 -6
- package/dist/frontend-admin/generators/import-review-page.generator.js +16 -10
- package/dist/frontend-admin/generators/import-review-page.generator.js.map +1 -1
- package/dist/frontend-admin/generators/model-admin-page.generator.js +125 -76
- package/dist/frontend-admin/generators/model-admin-page.generator.js.map +1 -1
- package/dist/frontend-core/frontend.generator.js +35 -35
- package/dist/frontend-core/frontend.generator.js.map +1 -1
- package/dist/frontend-core/template/src/components/ui/application-header/application-header.tsx +44 -0
- package/dist/frontend-core/template/src/components/ui/color-mode-toggle/color-mode-toggle.tsx +1 -1
- package/dist/frontend-core/template/src/context-providers/header-context-provider.tsx +41 -0
- package/dist/frontend-core/template/src/pages/authorized-page-layout.tsx +49 -0
- package/dist/frontend-core/template/src/pages/dashboard/dashboard.page.tsx +73 -50
- package/dist/frontend-core/template/src/routes/_auth-routes.tsx +3 -2
- package/dist/frontend-core/template/src/styles/theme-default.css +7 -3
- package/dist/frontend-trpc-client/trpc-client.generator.js +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CommandPalette } from '@app-actions/command-palette'
|
|
2
|
+
import { HeaderProvider } from '@context-providers/header-context-provider'
|
|
3
|
+
import { Outlet } from '@tanstack/react-router'
|
|
4
|
+
|
|
5
|
+
import { ApplicationHeader } from '@components/ui/application-header/application-header'
|
|
6
|
+
import { DynamicTabbedSidebar, SidebarInset, SidebarProvider, SidebarTabsProvider } from '@postxl/ui-components'
|
|
7
|
+
|
|
8
|
+
export const AuthorizedPageLayout = () => {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<CommandPalette />
|
|
12
|
+
|
|
13
|
+
<SidebarTabsProvider>
|
|
14
|
+
<SidebarProvider
|
|
15
|
+
defaultOpenSidebars={{ left: true, right: false }}
|
|
16
|
+
defaultWidths={{ left: 300, right: 300 }}
|
|
17
|
+
keyboardShortcuts={{ b: 'left', '.': 'right' }}
|
|
18
|
+
storageKey={'app-sidebar-state'}
|
|
19
|
+
>
|
|
20
|
+
<HeaderProvider>
|
|
21
|
+
<div className="flex flex-col h-screen max-h-screen relative w-full">
|
|
22
|
+
<ApplicationHeader />
|
|
23
|
+
|
|
24
|
+
<div className="flex grow relative max-h-[calc(100vh-var(--header-height))]">
|
|
25
|
+
{/* sidebar left */}
|
|
26
|
+
<DynamicTabbedSidebar
|
|
27
|
+
side="left"
|
|
28
|
+
orientation="vertical"
|
|
29
|
+
className="top-[var(--header-height)] h-[calc(100%-var(--header-height))]"
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
{/* page content */}
|
|
33
|
+
<SidebarInset className="h-full grid">
|
|
34
|
+
<Outlet />
|
|
35
|
+
</SidebarInset>
|
|
36
|
+
|
|
37
|
+
{/* sidebar right */}
|
|
38
|
+
<DynamicTabbedSidebar
|
|
39
|
+
side="right"
|
|
40
|
+
className="top-[var(--header-height)] h-[calc(100%-var(--header-height))]"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</HeaderProvider>
|
|
45
|
+
</SidebarProvider>
|
|
46
|
+
</SidebarTabsProvider>
|
|
47
|
+
</>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -1,29 +1,52 @@
|
|
|
1
|
+
import { AiSidebarContent } from '@app-actions/ai-sidebar-content'
|
|
1
2
|
import { useAuth } from '@context-providers/auth-context-provider'
|
|
2
|
-
import { ColorMode } from '@context-providers/theme-context-provider'
|
|
3
|
-
import { PersonIcon } from '@radix-ui/react-icons'
|
|
4
3
|
import { Post } from '@types'
|
|
5
4
|
|
|
6
|
-
import {
|
|
5
|
+
import { FunnelPlus, ListTree, Sparkles } from 'lucide-react'
|
|
6
|
+
import React, { useState } from 'react'
|
|
7
7
|
import { toast } from 'sonner'
|
|
8
8
|
|
|
9
9
|
import { UpdatePostModal } from '@components/forms/post/update'
|
|
10
|
-
import { ColorModeToggle } from '@components/ui/color-mode-toggle/color-mode-toggle'
|
|
11
10
|
import { Spreadsheet } from '@components/ui/spreadsheet'
|
|
12
11
|
import model from '@components/ui/spreadsheet/model.json'
|
|
13
12
|
import type { Model } from '@components/ui/spreadsheet/types'
|
|
14
13
|
import { usePosts } from '@hooks/use-posts'
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import {
|
|
15
|
+
ContentFrame,
|
|
16
|
+
SidebarGroup,
|
|
17
|
+
SidebarGroupContent,
|
|
18
|
+
SidebarMenu,
|
|
19
|
+
SidebarMenuButton,
|
|
20
|
+
SidebarMenuItem,
|
|
21
|
+
SidebarTab,
|
|
22
|
+
} from '@postxl/ui-components'
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// placeholder tab content (only for demo)
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
function TabContent({ items }: Readonly<{ items: string[] }>) {
|
|
28
|
+
return (
|
|
29
|
+
<SidebarGroup>
|
|
30
|
+
<SidebarGroupContent>
|
|
31
|
+
<SidebarMenu>
|
|
32
|
+
{items.map((item) => (
|
|
33
|
+
<SidebarMenuItem key={item}>
|
|
34
|
+
<SidebarMenuButton>
|
|
35
|
+
<span>{item}</span>
|
|
36
|
+
</SidebarMenuButton>
|
|
37
|
+
</SidebarMenuItem>
|
|
38
|
+
))}
|
|
39
|
+
</SidebarMenu>
|
|
40
|
+
</SidebarGroupContent>
|
|
41
|
+
</SidebarGroup>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
20
44
|
|
|
45
|
+
export const DashboardPage = () => {
|
|
46
|
+
const { viewerData } = useAuth()
|
|
21
47
|
const [selectedPost, setSelectedPost] = useState<Post | null>(null)
|
|
22
48
|
const [isUpdateModalOpen, setIsUpdateModalOpen] = useState(false)
|
|
23
49
|
|
|
24
|
-
const onToggleTheme = (nextMode: ColorMode) => {
|
|
25
|
-
toast.info("As you may see now it's " + nextMode + ' color mode')
|
|
26
|
-
}
|
|
27
50
|
const { list } = usePosts()
|
|
28
51
|
|
|
29
52
|
const data = {
|
|
@@ -36,44 +59,35 @@ export const DashboardPage = () => {
|
|
|
36
59
|
}
|
|
37
60
|
|
|
38
61
|
return (
|
|
39
|
-
|
|
40
|
-
<ContentFrame
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className="cursor-pointer mb-2 hover:underline"
|
|
69
|
-
>
|
|
70
|
-
<strong>{post.title}</strong>: {post.body}
|
|
71
|
-
</li>
|
|
72
|
-
))}
|
|
73
|
-
</ul>
|
|
74
|
-
</div>
|
|
75
|
-
<div className="p-3">
|
|
76
|
-
<Spreadsheet model={model as Model} data={data} />
|
|
62
|
+
<>
|
|
63
|
+
<ContentFrame title={`Hi ${viewerData?.user?.name}!`}>
|
|
64
|
+
<div className="grid">
|
|
65
|
+
<div className="p-3">
|
|
66
|
+
<p>eMail: {viewerData?.user?.email}</p>
|
|
67
|
+
<p>roles: {viewerData?.userRoles.join(', ')}</p>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="p-3">
|
|
70
|
+
<h3 className="mb-4">Posts:</h3>
|
|
71
|
+
<ul>
|
|
72
|
+
{list
|
|
73
|
+
.toSorted((a, b) => a.title.localeCompare(b.title))
|
|
74
|
+
.map((post) => (
|
|
75
|
+
<li
|
|
76
|
+
key={post.id}
|
|
77
|
+
onClick={() => {
|
|
78
|
+
setSelectedPost(post)
|
|
79
|
+
setIsUpdateModalOpen(true)
|
|
80
|
+
}}
|
|
81
|
+
className="cursor-pointer mb-2 hover:underline"
|
|
82
|
+
>
|
|
83
|
+
<strong>{post.title}</strong>: {post.body}
|
|
84
|
+
</li>
|
|
85
|
+
))}
|
|
86
|
+
</ul>
|
|
87
|
+
</div>
|
|
88
|
+
<div className="p-3 overflow-auto">
|
|
89
|
+
<Spreadsheet model={model as Model} data={data} />
|
|
90
|
+
</div>
|
|
77
91
|
</div>
|
|
78
92
|
</ContentFrame>
|
|
79
93
|
<UpdatePostModal
|
|
@@ -88,6 +102,15 @@ export const DashboardPage = () => {
|
|
|
88
102
|
toast.error(`Error updating post "${updatedPost.title}": ${String(error)}`)
|
|
89
103
|
}}
|
|
90
104
|
/>
|
|
91
|
-
|
|
105
|
+
<SidebarTab side="left" id="tab-l-1" icon={ListTree} label="Tab 1 label" order={0}>
|
|
106
|
+
<TabContent items={['Lorem ipsum', 'Dolor sit', 'Amet consectetur']} />
|
|
107
|
+
</SidebarTab>
|
|
108
|
+
<SidebarTab side="left" id="tab-l-2" icon={FunnelPlus} label="Tab 2 label" order={1}>
|
|
109
|
+
<TabContent items={['Donec felis neque', 'Tincidunt vel eros', 'Rutrum, porttitor pulvinar']} />
|
|
110
|
+
</SidebarTab>
|
|
111
|
+
<SidebarTab side="right" id="ai-assistant-content" icon={Sparkles} label="AI Assistant" order={2}>
|
|
112
|
+
<AiSidebarContent />
|
|
113
|
+
</SidebarTab>
|
|
114
|
+
</>
|
|
92
115
|
)
|
|
93
116
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useAuth } from '@context-providers/auth-context-provider'
|
|
2
|
-
import {
|
|
2
|
+
import { AuthorizedPageLayout } from '@pages/authorized-page-layout'
|
|
3
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
3
4
|
|
|
4
5
|
import { useEffect } from 'react'
|
|
5
6
|
|
|
@@ -28,5 +29,5 @@ function AuthGuard() {
|
|
|
28
29
|
return null
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
return <
|
|
32
|
+
return <AuthorizedPageLayout />
|
|
32
33
|
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
html.default.light {
|
|
4
4
|
--color-scheme: light;
|
|
5
5
|
|
|
6
|
+
--header-height: 49px;
|
|
7
|
+
|
|
6
8
|
--background: hsl(0 0% 100%);
|
|
7
9
|
--foreground: hsl(0 0% 20%);
|
|
8
10
|
--card: hsl(0 0% 100%);
|
|
@@ -36,7 +38,7 @@ html.default.light {
|
|
|
36
38
|
--sidebar-border: hsl(220 13.0435% 90.9804%);
|
|
37
39
|
--sidebar-ring: hsl(217.2193 91.2195% 59.8039%);
|
|
38
40
|
--font-sans: Helvetica, sans-serif;
|
|
39
|
-
--font-serif:
|
|
41
|
+
--font-serif: 'Times New Roman', Times, serif;
|
|
40
42
|
--font-mono: JetBrains Mono, monospace;
|
|
41
43
|
--radius: 0.375rem;
|
|
42
44
|
--shadow-x: 0;
|
|
@@ -55,7 +57,7 @@ html.default.light {
|
|
|
55
57
|
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
|
56
58
|
--tracking-normal: 0em;
|
|
57
59
|
--spacing: 0.25rem;
|
|
58
|
-
|
|
60
|
+
|
|
59
61
|
/* additional theme colors */
|
|
60
62
|
--discreet-border: #c0c6c9;
|
|
61
63
|
|
|
@@ -75,6 +77,8 @@ html.default.light {
|
|
|
75
77
|
html.default.dark {
|
|
76
78
|
--color-scheme: dark;
|
|
77
79
|
|
|
80
|
+
--header-height: 49px;
|
|
81
|
+
|
|
78
82
|
--background: hsl(0 0% 9.0196%);
|
|
79
83
|
--foreground: hsl(0 0% 89.8039%);
|
|
80
84
|
--card: hsl(0 0% 14.902%);
|
|
@@ -125,7 +129,7 @@ html.default.dark {
|
|
|
125
129
|
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
|
126
130
|
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
|
127
131
|
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
|
128
|
-
|
|
132
|
+
|
|
129
133
|
/* additional theme colors */
|
|
130
134
|
--discreet-border: #3f4143;
|
|
131
135
|
}
|
|
@@ -54,7 +54,7 @@ exports.generator = {
|
|
|
54
54
|
],
|
|
55
55
|
register: (context) => {
|
|
56
56
|
const { packageVersions } = context.trpcRouter;
|
|
57
|
-
context.frontend.packageJson.dependencies.push({ packageName: '@tanstack/react-query-devtools', version: '5.91.
|
|
57
|
+
context.frontend.packageJson.dependencies.push({ packageName: '@tanstack/react-query-devtools', version: '5.91.3' }, { packageName: '@tanstack/react-query', version: '5.90.21' }, { packageName: '@trpc/client', version: packageVersions.trpc }, { packageName: '@trpc/react-query', version: packageVersions.trpc }, { packageName: '@trpc/tanstack-react-query', version: packageVersions.trpc }, { packageName: 'react-query', version: '3.39.3' }, { packageName: 'superjson', version: packageVersions.superJSON });
|
|
58
58
|
const location = Generator.toBackendModuleLocation('@lib/trpc');
|
|
59
59
|
const trpcClient = {
|
|
60
60
|
// Important: Do not change this name as this is the default name as provided by the TRPC library
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postxl/generators",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "Code generators for PXL - generates backend, frontend, Prisma schemas, and more",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"directory": "packages/generators"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@faker-js/faker": "9.
|
|
45
|
-
"@prisma/prisma-schema-wasm": "7.
|
|
44
|
+
"@faker-js/faker": "9.9.0",
|
|
45
|
+
"@prisma/prisma-schema-wasm": "7.5.0-9.c6be8e68bf8e4a36534064f9323a343f2fcafe21",
|
|
46
46
|
"exceljs": "^4.4.0",
|
|
47
|
-
"@postxl/generator": "^1.3.
|
|
47
|
+
"@postxl/generator": "^1.3.6",
|
|
48
48
|
"@postxl/schema": "^1.6.0",
|
|
49
|
-
"@postxl/
|
|
50
|
-
"@postxl/
|
|
49
|
+
"@postxl/ui-components": "^1.6.0",
|
|
50
|
+
"@postxl/utils": "^1.3.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {},
|
|
53
53
|
"wallaby": {
|