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.
Files changed (47) hide show
  1. package/package.json +3 -3
  2. package/templates/default/app/(rootLayout)/(plugins)/[...slug]/plugin-server-registry.ts +3 -2
  3. package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +1 -0
  4. package/templates/default/app/(rootLayout)/layout.tsx +3 -1
  5. package/templates/default/app/layout.tsx +12 -6
  6. package/templates/default/cms.config.ts +1 -2
  7. package/templates/default/components/AdminsPage.tsx +6 -7
  8. package/templates/default/components/BarChartBox.tsx +1 -2
  9. package/templates/default/components/BrowsePage.tsx +10 -24
  10. package/templates/default/components/CategorizedSectionPage.tsx +5 -10
  11. package/templates/default/components/EmailsPage.tsx +1 -1
  12. package/templates/default/components/ErrorComponent.tsx +17 -0
  13. package/templates/default/components/GalleryPhoto.tsx +1 -2
  14. package/templates/default/components/InfoCard.tsx +0 -1
  15. package/templates/default/components/ItemEditPage.tsx +26 -30
  16. package/templates/default/components/Layout.tsx +3 -2
  17. package/templates/default/components/LogPage.tsx +0 -1
  18. package/templates/default/components/Modal.tsx +64 -7
  19. package/templates/default/components/Navbar.tsx +170 -17
  20. package/templates/default/components/NewPage.tsx +9 -11
  21. package/templates/default/components/PhotoGallery.tsx +0 -1
  22. package/templates/default/components/SectionItemCard.tsx +1 -1
  23. package/templates/default/components/SectionPage.tsx +8 -8
  24. package/templates/default/components/SelectBox.tsx +62 -77
  25. package/templates/default/components/SettingsPage.tsx +2 -9
  26. package/templates/default/components/Sidebar.tsx +5 -22
  27. package/templates/default/components/SidebarDropdownItem.tsx +2 -2
  28. package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
  29. package/templates/default/components/ui/alert-dialog.tsx +157 -0
  30. package/templates/default/components/ui/command.tsx +137 -184
  31. package/templates/default/components/ui/custom-alert-dialog.tsx +113 -0
  32. package/templates/default/components/ui/custom-dialog.tsx +123 -0
  33. package/templates/default/components/ui/dialog.tsx +123 -143
  34. package/templates/default/components/ui/popover.tsx +28 -34
  35. package/templates/default/components/ui/sheet.tsx +103 -107
  36. package/templates/default/package.json +6 -12
  37. package/templates/default/public/favicon.ico +0 -0
  38. package/templates/default/public/nextjscms.webp +0 -0
  39. package/templates/default/styles/globals.css +2 -1
  40. package/templates/default/app/(rootLayout)/(plugins)/[...slug]/.plugin-registry.mjs +0 -7
  41. package/templates/default/app/(rootLayout)/advanced/page.tsx +0 -11
  42. package/templates/default/components/AdvancedSettingsPage.tsx +0 -167
  43. package/templates/default/components/NavbarAlt.tsx +0 -182
  44. package/templates/default/components/TempPage.tsx +0 -12
  45. package/templates/default/public/lazemni_logo.png +0 -0
  46. package/templates/default/public/next.svg +0 -1
  47. package/templates/default/public/vercel.svg +0 -1
@@ -1,107 +1,103 @@
1
- 'use client'
2
-
3
- import * as React from 'react'
4
- import * as SheetPrimitive from '@radix-ui/react-dialog'
5
- import { Cross2Icon } from '@radix-ui/react-icons'
6
- import { cva, type VariantProps } from 'class-variance-authority'
7
-
8
- import { cn } from '@/lib/utils'
9
-
10
- const Sheet = SheetPrimitive.Root
11
-
12
- const SheetTrigger = SheetPrimitive.Trigger
13
-
14
- const SheetClose = SheetPrimitive.Close
15
-
16
- const SheetPortal = SheetPrimitive.Portal
17
-
18
- const SheetOverlay = React.forwardRef<
19
- React.ElementRef<typeof SheetPrimitive.Overlay>,
20
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
21
- >(({ className, ...props }, ref) => (
22
- <SheetPrimitive.Overlay
23
- className={cn(
24
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80',
25
- className,
26
- )}
27
- {...props}
28
- ref={ref}
29
- />
30
- ))
31
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
32
-
33
- const sheetVariants = cva(
34
- 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-200',
35
- {
36
- variants: {
37
- side: {
38
- top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
39
- bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
40
- left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
41
- right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
42
- },
43
- },
44
- defaultVariants: {
45
- side: 'right',
46
- },
47
- },
48
- )
49
-
50
- interface SheetContentProps
51
- extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
52
- VariantProps<typeof sheetVariants> {}
53
-
54
- const SheetContent = React.forwardRef<React.ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
55
- ({ side = 'right', className, children, ...props }, ref) => (
56
- <SheetPortal>
57
- <SheetOverlay />
58
- <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
59
- {children}
60
- <SheetPrimitive.Close className='ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none'>
61
- <Cross2Icon className='h-4 w-4' />
62
- <span className='sr-only'>Close</span>
63
- </SheetPrimitive.Close>
64
- </SheetPrimitive.Content>
65
- </SheetPortal>
66
- ),
67
- )
68
- SheetContent.displayName = SheetPrimitive.Content.displayName
69
-
70
- const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
71
- <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
72
- )
73
- SheetHeader.displayName = 'SheetHeader'
74
-
75
- const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
76
- <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
77
- )
78
- SheetFooter.displayName = 'SheetFooter'
79
-
80
- const SheetTitle = React.forwardRef<
81
- React.ElementRef<typeof SheetPrimitive.Title>,
82
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
83
- >(({ className, ...props }, ref) => (
84
- <SheetPrimitive.Title ref={ref} className={cn('text-foreground text-lg font-semibold', className)} {...props} />
85
- ))
86
- SheetTitle.displayName = SheetPrimitive.Title.displayName
87
-
88
- const SheetDescription = React.forwardRef<
89
- React.ElementRef<typeof SheetPrimitive.Description>,
90
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
91
- >(({ className, ...props }, ref) => (
92
- <SheetPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
93
- ))
94
- SheetDescription.displayName = SheetPrimitive.Description.displayName
95
-
96
- export {
97
- Sheet,
98
- SheetPortal,
99
- SheetOverlay,
100
- SheetTrigger,
101
- SheetClose,
102
- SheetContent,
103
- SheetHeader,
104
- SheetFooter,
105
- SheetTitle,
106
- SheetDescription,
107
- }
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import * as SheetPrimitive from '@radix-ui/react-dialog'
5
+ import { XIcon } from 'lucide-react'
6
+
7
+ import { cn } from '@/lib/utils'
8
+
9
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
+ return <SheetPrimitive.Root data-slot='sheet' {...props} />
11
+ }
12
+
13
+ function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
14
+ return <SheetPrimitive.Trigger data-slot='sheet-trigger' {...props} />
15
+ }
16
+
17
+ function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
18
+ return <SheetPrimitive.Close data-slot='sheet-close' {...props} />
19
+ }
20
+
21
+ function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
22
+ return <SheetPrimitive.Portal data-slot='sheet-portal' {...props} />
23
+ }
24
+
25
+ function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
26
+ return (
27
+ <SheetPrimitive.Overlay
28
+ data-slot='sheet-overlay'
29
+ className={cn(
30
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
31
+ className,
32
+ )}
33
+ {...props}
34
+ />
35
+ )
36
+ }
37
+
38
+ function SheetContent({
39
+ className,
40
+ children,
41
+ side = 'right',
42
+ ...props
43
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & {
44
+ side?: 'top' | 'right' | 'bottom' | 'left'
45
+ }) {
46
+ return (
47
+ <SheetPortal>
48
+ <SheetOverlay />
49
+ <SheetPrimitive.Content
50
+ data-slot='sheet-content'
51
+ className={cn(
52
+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
53
+ side === 'right' &&
54
+ 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
55
+ side === 'left' &&
56
+ 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
57
+ side === 'top' &&
58
+ 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
59
+ side === 'bottom' &&
60
+ 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
61
+ className,
62
+ )}
63
+ {...props}
64
+ >
65
+ {children}
66
+ <SheetPrimitive.Close className='ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none'>
67
+ <XIcon className='size-4' />
68
+ <span className='sr-only'>Close</span>
69
+ </SheetPrimitive.Close>
70
+ </SheetPrimitive.Content>
71
+ </SheetPortal>
72
+ )
73
+ }
74
+
75
+ function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
76
+ return <div data-slot='sheet-header' className={cn('flex flex-col gap-1.5 p-4', className)} {...props} />
77
+ }
78
+
79
+ function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
80
+ return <div data-slot='sheet-footer' className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />
81
+ }
82
+
83
+ function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
84
+ return (
85
+ <SheetPrimitive.Title
86
+ data-slot='sheet-title'
87
+ className={cn('text-foreground font-semibold', className)}
88
+ {...props}
89
+ />
90
+ )
91
+ }
92
+
93
+ function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
94
+ return (
95
+ <SheetPrimitive.Description
96
+ data-slot='sheet-description'
97
+ className={cn('text-muted-foreground text-sm', className)}
98
+ {...props}
99
+ />
100
+ )
101
+ }
102
+
103
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription }
@@ -17,10 +17,10 @@
17
17
  "@dnd-kit/sortable": "^10.0.0",
18
18
  "@dnd-kit/utilities": "^3.2.2",
19
19
  "@formkit/auto-animate": "^0.9.0",
20
- "@headlessui/react": "^2.2.0",
21
20
  "@hookform/resolvers": "^5.2.2",
22
21
  "@next/env": "16.1.1",
23
22
  "@radix-ui/react-accordion": "^1.2.3",
23
+ "@radix-ui/react-alert-dialog": "^1.1.15",
24
24
  "@radix-ui/react-aspect-ratio": "^1.1.2",
25
25
  "@radix-ui/react-checkbox": "^1.1.4",
26
26
  "@radix-ui/react-dialog": "^1.1.15",
@@ -32,7 +32,7 @@
32
32
  "@radix-ui/react-scroll-area": "^1.2.3",
33
33
  "@radix-ui/react-select": "^2.2.6",
34
34
  "@radix-ui/react-separator": "^1.1.8",
35
- "@radix-ui/react-slot": "^1.2.3",
35
+ "@radix-ui/react-slot": "^1.2.4",
36
36
  "@radix-ui/react-switch": "^1.1.3",
37
37
  "@radix-ui/react-tabs": "^1.1.3",
38
38
  "@radix-ui/react-toast": "^1.2.6",
@@ -64,7 +64,7 @@
64
64
  "nanoid": "^5.1.2",
65
65
  "next": "16.1.1",
66
66
  "next-themes": "^0.4.6",
67
- "nextjs-cms": "0.5.70",
67
+ "nextjs-cms": "0.5.72",
68
68
  "plaiceholder": "^3.0.0",
69
69
  "prettier-plugin-tailwindcss": "^0.7.2",
70
70
  "qrcode": "^1.5.4",
@@ -79,9 +79,9 @@
79
79
  "sharp": "^0.33.5",
80
80
  "superjson": "^2.2.2",
81
81
  "tailwind-merge": "^3.3.1",
82
+ "tailwindcss": "^4.1.18",
82
83
  "tinymce": "^8.3.1",
83
84
  "tsx": "^4.20.6",
84
- "tw-animate-css": "^1.4.0",
85
85
  "zod": "4.1.12"
86
86
  },
87
87
  "devDependencies": {
@@ -97,17 +97,11 @@
97
97
  "eslint-config-prettier": "^10.0.1",
98
98
  "eslint-plugin-prettier": "^5.2.3",
99
99
  "fs-extra": "^11.3.3",
100
- "nextjs-cms-kit": "0.5.70",
100
+ "nextjs-cms-kit": "0.5.72",
101
101
  "postcss": "^8.5.1",
102
102
  "prettier": "3.5.0",
103
103
  "raw-loader": "^4.0.2",
104
- "tailwindcss": "^4.1.18",
104
+ "tailwindcss-animate": "^1.0.7",
105
105
  "typescript": "^5.7.3"
106
- },
107
- "pnpm": {
108
- "overrides": {
109
- "@types/react": "19.2.7",
110
- "@types/react-dom": "19.2.3"
111
- }
112
106
  }
113
107
  }
@@ -1,4 +1,5 @@
1
- @import 'tailwindcss';
1
+ @import "tailwindcss";
2
+ @plugin "tailwindcss-animate";
2
3
 
3
4
  @custom-variant dark (&:is(.dark *));
4
5
 
@@ -1,7 +0,0 @@
1
- // AUTO GENERATED FILE, DO NOT DELETE OR EDIT
2
- // THIS FILE IS GENERATED BY THE PLUGIN SYSTEM
3
- export const _pluginNamesMap = {
4
- 'cpanel-dashboard': '@nextjs-cms-plugins/cpanel-dashboard/server',
5
- 'cpanel-emails': '@nextjs-cms-plugins/cpanel-emails/server',
6
- 'google-analytics': '@nextjs-cms-plugins/google-analytics/server',
7
- }
@@ -1,11 +0,0 @@
1
- import AdvancedSettingsPage from '@/components/AdvancedSettingsPage'
2
- import { api, HydrateClient } from 'nextjs-cms/api/trpc/server'
3
- export default async function Page() {
4
- await api.cmsSettings.get.prefetch()
5
-
6
- return (
7
- <HydrateClient>
8
- <AdvancedSettingsPage />
9
- </HydrateClient>
10
- )
11
- }
@@ -1,167 +0,0 @@
1
- 'use client'
2
-
3
- import React, { useEffect, useState } from 'react'
4
- import getString from 'nextjs-cms/translations'
5
- import useModal from '@/hooks/useModal'
6
- import InfoCard from '@/components/InfoCard'
7
- import LoadingSpinners from '@/components/LoadingSpinners'
8
- import { Alert, AlertDescription } from '@/components/ui/alert'
9
- import { useToast } from '@/components/ui/use-toast'
10
- import { trpc } from '@/app/_trpc/client'
11
- import Form from '@/components/form/Form'
12
-
13
- export default function AdvancedSettingsPage() {
14
- const [progress, setProgress] = useState(0)
15
- const [progressVariant, setProgressVariant] = useState<'determinate' | 'query'>('determinate')
16
- const [isSubmitting, setIsSubmitting] = useState(false)
17
- const { setModal } = useModal()
18
-
19
- const { toast } = useToast()
20
-
21
- const { isLoading, data, refetch } = trpc.cmsSettings.get.useQuery()
22
- const saveMutation = trpc.cmsSettings.save.useMutation({
23
- onSuccess: async (data) => {
24
- setIsSubmitting(false)
25
- setProgress(0)
26
- setProgressVariant('determinate')
27
- if (data === true) {
28
- // Refetch the page
29
- await refetch()
30
-
31
- toast({
32
- title: getString('success'),
33
- description: getString('success'),
34
- duration: 2000,
35
- })
36
- }
37
- },
38
- onError: (error) => {
39
- setIsSubmitting(false)
40
- setProgress(0)
41
- setProgressVariant('determinate')
42
- if (error) {
43
- setModal({
44
- title: getString('delete_admin'),
45
- body: <InfoCard result={{ key: 'danger', title: error.message, status: false }} />,
46
- headerColor: 'bg-red-700',
47
- titleColor: 'text-white',
48
- lang: 'en',
49
- })
50
- }
51
- },
52
- })
53
-
54
- const handleSubmit = async (formData: FormData) => {
55
- setIsSubmitting(true)
56
- if (isSubmitting) return
57
- saveMutation.mutate({
58
- googleTagId: formData.get('ga_tag_id') as string,
59
- googlePropertyId: formData.get('ga_property_id') as string,
60
- googleServiceAccountCredentials: formData.get('ga_code') as string,
61
- })
62
- }
63
-
64
- function cancelSubmit() {
65
- setIsSubmitting(false)
66
- setProgress(0)
67
- setProgressVariant('determinate')
68
- }
69
-
70
- useEffect(() => {
71
- return () => {
72
- cancelSubmit()
73
- }
74
- }, [])
75
-
76
- return (
77
- <div>
78
- <div className='w-full overflow-hidden bg-background'>
79
- <div className='bg-linear-to-r from-rose-200 via-rose-400 to-sky-400 p-8 font-extrabold text-black'>
80
- <h1 className='text-3xl'>{getString('advancedSettings')}</h1>
81
- </div>
82
- <div className='flex w-full flex-col'>
83
- <div className='flex w-full flex-col gap-2 p-4'>
84
- <Alert variant='destructive' className='bg-destructive text-destructive-foreground'>
85
- <AlertDescription className='font-bold'>
86
- {getString('advancedSettingsWarning')}
87
- </AlertDescription>
88
- </Alert>
89
- <Alert variant='default' className='bg-primary text-primary-foreground'>
90
- <AlertDescription className='font-bold'>
91
- <div>{getString('googleAnalyticsChangeText')}</div>
92
- <div>
93
- {getString('googleAnalyticsChangeSubText')}{' '}
94
- <a
95
- className='text-sky-500'
96
- target='_blank'
97
- href='https://analytics.google.com/analytics/web/'
98
- >
99
- {getString('here')}
100
- </a>
101
- </div>
102
- </AlertDescription>
103
- </Alert>
104
- </div>
105
- {isLoading ? (
106
- <div>
107
- <LoadingSpinners />
108
- </div>
109
- ) : (
110
- <Form
111
- buttonType='small'
112
- data={{
113
- section: {
114
- name: 'advanced_settings',
115
- },
116
-
117
- inputGroups: [
118
- {
119
- groupId: 1,
120
- groupTitle: getString('advancedSettings'),
121
- groupOrder: 1,
122
- inputs: [
123
- {
124
- type: 'text',
125
- required: false,
126
- label: 'Measurement ID (Google Tag ID)',
127
- name: 'ga_tag_id',
128
- placeholder: 'G-XXXXXXXXXX',
129
- value: data?.googleTagId,
130
- readonly: false,
131
- conditionalFields: [],
132
- },
133
- {
134
- type: 'text',
135
- required: false,
136
- label: 'Property ID',
137
- name: 'ga_property_id',
138
- placeholder: 'XXXXXXXXXX',
139
- value: data?.googlePropertyId,
140
- readonly: false,
141
- conditionalFields: [],
142
- },
143
- {
144
- type: 'textarea',
145
- required: false,
146
- label: 'Service Account Credentials',
147
- name: 'ga_code',
148
- placeholder: 'Paste your service account credentials here',
149
- value: data?.googleServiceAccountCredentials,
150
- readonly: false,
151
- conditionalFields: [],
152
- },
153
- ],
154
- },
155
- ],
156
- }}
157
- progressVariant={progressVariant}
158
- progress={progress}
159
- handleSubmit={handleSubmit}
160
- isSubmitting={isSubmitting}
161
- />
162
- )}
163
- </div>
164
- </div>
165
- </div>
166
- )
167
- }