create-nextjs-cms 0.5.70 → 0.5.72
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/package.json +3 -3
- package/templates/default/app/(rootLayout)/(plugins)/[...slug]/plugin-server-registry.ts +3 -2
- package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +1 -0
- package/templates/default/app/(rootLayout)/layout.tsx +3 -1
- package/templates/default/app/layout.tsx +12 -6
- package/templates/default/cms.config.ts +1 -2
- package/templates/default/components/AdminsPage.tsx +6 -7
- package/templates/default/components/BarChartBox.tsx +1 -2
- package/templates/default/components/BrowsePage.tsx +10 -24
- package/templates/default/components/CategorizedSectionPage.tsx +5 -10
- package/templates/default/components/EmailsPage.tsx +1 -1
- package/templates/default/components/ErrorComponent.tsx +17 -0
- package/templates/default/components/GalleryPhoto.tsx +1 -2
- package/templates/default/components/InfoCard.tsx +0 -1
- package/templates/default/components/ItemEditPage.tsx +26 -30
- package/templates/default/components/Layout.tsx +3 -2
- package/templates/default/components/LogPage.tsx +0 -1
- package/templates/default/components/Modal.tsx +64 -7
- package/templates/default/components/Navbar.tsx +170 -17
- package/templates/default/components/NewPage.tsx +9 -11
- package/templates/default/components/PhotoGallery.tsx +0 -1
- package/templates/default/components/SectionItemCard.tsx +1 -1
- package/templates/default/components/SectionPage.tsx +8 -8
- package/templates/default/components/SelectBox.tsx +62 -77
- package/templates/default/components/SettingsPage.tsx +2 -9
- package/templates/default/components/Sidebar.tsx +5 -22
- package/templates/default/components/SidebarDropdownItem.tsx +2 -2
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/components/ui/alert-dialog.tsx +157 -0
- package/templates/default/components/ui/command.tsx +137 -184
- package/templates/default/components/ui/custom-alert-dialog.tsx +113 -0
- package/templates/default/components/ui/custom-dialog.tsx +123 -0
- package/templates/default/components/ui/dialog.tsx +123 -143
- package/templates/default/components/ui/popover.tsx +28 -34
- package/templates/default/components/ui/sheet.tsx +103 -107
- package/templates/default/package.json +6 -12
- package/templates/default/public/favicon.ico +0 -0
- package/templates/default/public/nextjscms.webp +0 -0
- package/templates/default/styles/globals.css +2 -1
- package/templates/default/app/(rootLayout)/(plugins)/[...slug]/.plugin-registry.mjs +0 -7
- package/templates/default/app/(rootLayout)/advanced/page.tsx +0 -11
- package/templates/default/components/AdvancedSettingsPage.tsx +0 -167
- package/templates/default/components/NavbarAlt.tsx +0 -182
- package/templates/default/components/TempPage.tsx +0 -12
- package/templates/default/public/lazemni_logo.png +0 -0
- package/templates/default/public/next.svg +0 -1
- package/templates/default/public/vercel.svg +0 -1
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
import { MoonIcon, SunIcon, BellIcon, HamburgerMenuIcon } from '@radix-ui/react-icons'
|
|
4
|
-
import { useTheme } from 'next-themes'
|
|
5
|
-
import Link from 'next/link'
|
|
6
|
-
import getString from 'nextjs-cms/translations'
|
|
7
|
-
import ProtectedImage from '@/components/ProtectedImage'
|
|
8
|
-
import Image from 'next/image'
|
|
9
|
-
import { LogOut, Settings } from 'lucide-react'
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
DropdownMenu,
|
|
13
|
-
DropdownMenuContent,
|
|
14
|
-
DropdownMenuGroup,
|
|
15
|
-
DropdownMenuItem,
|
|
16
|
-
DropdownMenuLabel,
|
|
17
|
-
DropdownMenuSeparator,
|
|
18
|
-
DropdownMenuShortcut,
|
|
19
|
-
DropdownMenuTrigger,
|
|
20
|
-
} from '@/components/ui/dropdown-menu'
|
|
21
|
-
import { useToast } from '@/components/ui/use-toast'
|
|
22
|
-
import { logout, useSession } from 'nextjs-cms/auth/react'
|
|
23
|
-
type Props = {
|
|
24
|
-
/**
|
|
25
|
-
* Allows the parent component to modify the state when the
|
|
26
|
-
* menu button is clicked.
|
|
27
|
-
*/
|
|
28
|
-
onMenuButtonClick(): void
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default function Navbar(props: Props) {
|
|
32
|
-
const { theme, setTheme } = useTheme()
|
|
33
|
-
const session = useSession()
|
|
34
|
-
const { toast } = useToast()
|
|
35
|
-
const handleLogout = async (e: React.MouseEvent<HTMLDivElement>) => {
|
|
36
|
-
e.preventDefault()
|
|
37
|
-
e.stopPropagation()
|
|
38
|
-
try {
|
|
39
|
-
await logout()
|
|
40
|
-
} catch (error: any) {
|
|
41
|
-
toast({
|
|
42
|
-
variant: 'destructive',
|
|
43
|
-
title: getString('logoutError'),
|
|
44
|
-
description: error.message,
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<nav
|
|
52
|
-
className={classNames({
|
|
53
|
-
'sticky top-0 h-[65px] bg-white text-zinc-500 drop-shadow-sm dark:bg-slate-800': true, // colors
|
|
54
|
-
'top-0 z-10 w-full px-4 shadow-xs md:w-full': true, //positioning & styling
|
|
55
|
-
})}
|
|
56
|
-
>
|
|
57
|
-
<div className='mx-auto px-0 lg:px-2'>
|
|
58
|
-
<div className='flex h-16 items-center justify-between'>
|
|
59
|
-
<div className='flex items-center'>
|
|
60
|
-
<div className='shrink-0'>
|
|
61
|
-
<div className='flex md:hidden'>
|
|
62
|
-
{/* Mobile menu button */}
|
|
63
|
-
<button
|
|
64
|
-
onClick={props.onMenuButtonClick}
|
|
65
|
-
className='border-foreground text-foreground hover:text-foreground/90 relative inline-flex items-center justify-center rounded-md border p-2 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800 focus:outline-hidden'
|
|
66
|
-
>
|
|
67
|
-
<span className='absolute -inset-0.5' />
|
|
68
|
-
<span className='sr-only'>Open main menu</span>
|
|
69
|
-
<HamburgerMenuIcon className='block h-6 w-6' aria-hidden='true' />
|
|
70
|
-
</button>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
{/*<div className=''>
|
|
75
|
-
<div className='flex items-baseline space-x-4'>
|
|
76
|
-
<input
|
|
77
|
-
type='text'
|
|
78
|
-
className='h-full w-full border-0 bg-transparent text-amber-500 outline-0 ring-0'
|
|
79
|
-
placeholder='Search...'
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
</div>*/}
|
|
83
|
-
</div>
|
|
84
|
-
<div className=''>
|
|
85
|
-
<div className='ml-4 flex items-center md:ml-6'>
|
|
86
|
-
<div className='flex flex-row items-center gap-3'>
|
|
87
|
-
<DropdownMenu>
|
|
88
|
-
<DropdownMenuTrigger
|
|
89
|
-
asChild
|
|
90
|
-
className='text-foreground hover:text-foreground/90 cursor-pointer'
|
|
91
|
-
>
|
|
92
|
-
<BellIcon className='h-6 w-6' />
|
|
93
|
-
</DropdownMenuTrigger>
|
|
94
|
-
<DropdownMenuContent className='mt-2 w-[300px]'>
|
|
95
|
-
<DropdownMenuLabel>{getString('notifications')}</DropdownMenuLabel>
|
|
96
|
-
<DropdownMenuSeparator />
|
|
97
|
-
<DropdownMenuGroup></DropdownMenuGroup>
|
|
98
|
-
<DropdownMenuSeparator />
|
|
99
|
-
|
|
100
|
-
<Link href='/log'>
|
|
101
|
-
<DropdownMenuItem className='cursor-pointer'>
|
|
102
|
-
<span>{getString('seeAll')}</span>
|
|
103
|
-
</DropdownMenuItem>
|
|
104
|
-
</Link>
|
|
105
|
-
</DropdownMenuContent>
|
|
106
|
-
</DropdownMenu>
|
|
107
|
-
<button
|
|
108
|
-
onClick={() => {
|
|
109
|
-
setTheme(theme === 'dark' ? 'light' : 'dark')
|
|
110
|
-
}}
|
|
111
|
-
type='button'
|
|
112
|
-
className='text-foreground hover:text-foreground/90 relative rounded-full p-1 focus:outline-hidden'
|
|
113
|
-
>
|
|
114
|
-
<span className='absolute -inset-1.5' />
|
|
115
|
-
<span className='sr-only'>Theme</span>
|
|
116
|
-
{theme === 'dark' ? (
|
|
117
|
-
<SunIcon className='h-6 w-6' aria-hidden='true' />
|
|
118
|
-
) : (
|
|
119
|
-
<MoonIcon className='h-6 w-6' aria-hidden='true' />
|
|
120
|
-
)}
|
|
121
|
-
</button>
|
|
122
|
-
{/* Profile dropdown */}
|
|
123
|
-
<DropdownMenu>
|
|
124
|
-
<DropdownMenuTrigger
|
|
125
|
-
asChild
|
|
126
|
-
className='relative ms-2 flex max-w-xs cursor-pointer items-center rounded-full bg-gray-800 text-sm hover:ring-3 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800 focus:outline-hidden'
|
|
127
|
-
>
|
|
128
|
-
<div>
|
|
129
|
-
<span className='absolute -inset-1.5' />
|
|
130
|
-
<span className='sr-only'>Open user menu</span>
|
|
131
|
-
{session?.data?.user.image ? (
|
|
132
|
-
<ProtectedImage
|
|
133
|
-
section={'admins'}
|
|
134
|
-
photo={session.data.user.image}
|
|
135
|
-
isThumb={true}
|
|
136
|
-
alt={session.data.user.name}
|
|
137
|
-
width={40}
|
|
138
|
-
height={40}
|
|
139
|
-
// fill={true}
|
|
140
|
-
className='rounded-full'
|
|
141
|
-
/>
|
|
142
|
-
) : (
|
|
143
|
-
<Image
|
|
144
|
-
src='/blank_avatar.png'
|
|
145
|
-
height={36}
|
|
146
|
-
width={36}
|
|
147
|
-
alt='profile image'
|
|
148
|
-
className='rounded-full ring-2 ring-amber-300 ring-inset'
|
|
149
|
-
/>
|
|
150
|
-
)}
|
|
151
|
-
</div>
|
|
152
|
-
</DropdownMenuTrigger>
|
|
153
|
-
<DropdownMenuContent className='w-56'>
|
|
154
|
-
<DropdownMenuLabel>{session.data?.user.name}</DropdownMenuLabel>
|
|
155
|
-
<DropdownMenuSeparator />
|
|
156
|
-
<DropdownMenuGroup>
|
|
157
|
-
<Link href='/settings'>
|
|
158
|
-
<DropdownMenuItem className='cursor-pointer'>
|
|
159
|
-
<Settings className='mr-2 h-4 w-4' />
|
|
160
|
-
<span>{getString('accountSettings')}</span>
|
|
161
|
-
<DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
|
|
162
|
-
</DropdownMenuItem>
|
|
163
|
-
</Link>
|
|
164
|
-
</DropdownMenuGroup>
|
|
165
|
-
<DropdownMenuSeparator />
|
|
166
|
-
|
|
167
|
-
<DropdownMenuItem className='cursor-pointer' onClick={handleLogout}>
|
|
168
|
-
<LogOut className='mr-2 h-4 w-4' />
|
|
169
|
-
<span>{getString('logout')}</span>
|
|
170
|
-
<DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
|
|
171
|
-
</DropdownMenuItem>
|
|
172
|
-
</DropdownMenuContent>
|
|
173
|
-
</DropdownMenu>
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
</nav>
|
|
180
|
-
</>
|
|
181
|
-
)
|
|
182
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
|