create-nextjs-cms 0.9.23 → 0.9.24
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/(auth)/auth/login/LoginPage.tsx +2 -2
- package/templates/default/app/(auth)/layout.tsx +1 -1
- package/templates/default/app/(rootLayout)/admins/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/layout.tsx +2 -2
- package/templates/default/app/(rootLayout)/loading.tsx +1 -1
- package/templates/default/app/(rootLayout)/log/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/new/[section]/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/section/[section]/page.tsx +1 -1
- package/templates/default/app/(rootLayout)/settings/page.tsx +1 -1
- package/templates/default/app/providers.tsx +1 -1
- package/templates/default/cms.config.ts +4 -2
- package/templates/default/components/{AdminCard.tsx → admin/admin-card.tsx} +3 -3
- package/templates/default/components/{AdminEditPage.tsx → admin/admin-edit-page.tsx} +3 -3
- package/templates/default/components/{NewAdminForm.tsx → admin/new-admin-form.tsx} +3 -3
- package/templates/default/components/{ContainerBox.tsx → container-box.tsx} +1 -1
- package/templates/default/components/{ErrorComponent.tsx → feedback/error-component.tsx} +1 -1
- package/templates/default/{context/ModalProvider.tsx → components/feedback/modal-context.tsx} +56 -53
- package/templates/default/components/{Modal.tsx → feedback/modal.tsx} +1 -1
- package/templates/default/components/form/{FormInputs.tsx → form-inputs.tsx} +17 -17
- package/templates/default/components/form/{Form.tsx → form.tsx} +8 -10
- package/templates/default/components/form/inputs/{CheckboxFormInput.tsx → checkbox-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{ColorFormInput.tsx → color-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{DateFormInput.tsx → date-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{DateRangeFormInput.tsx → date-range-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{DocumentFormInput.tsx → document-form-input.tsx} +3 -3
- package/templates/default/components/form/inputs/{MapFormInput.tsx → map-form-input.tsx} +5 -4
- package/templates/default/components/form/inputs/{MultipleSelectFormInput.tsx → multiple-select-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{NumberFormInput.tsx → number-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{PasswordFormInput.tsx → password-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{PhotoFormInput.tsx → photo-form-input.tsx} +3 -3
- package/templates/default/components/form/inputs/{RichTextFormInput.tsx → rich-text-form-input.tsx} +2 -2
- package/templates/default/components/form/inputs/{SelectFormInput.tsx → select-form-input.tsx} +4 -4
- package/templates/default/components/form/inputs/{SlugFormInput.tsx → slug-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{TagsFormInput.tsx → tags-form-input.tsx} +1 -1
- package/templates/default/components/form/inputs/{TextFormInput.tsx → text-form-input.tsx} +2 -2
- package/templates/default/components/form/inputs/{TextareaFormInput.tsx → textarea-form-input.tsx} +2 -2
- package/templates/default/components/form/inputs/{VideoFormInput.tsx → video-form-input.tsx} +3 -3
- package/templates/default/components/{Layout.tsx → layout/layout.tsx} +4 -4
- package/templates/default/components/{Navbar.tsx → layout/navbar.tsx} +2 -2
- package/templates/default/components/{SidebarDropdownItem.tsx → layout/sidebar-dropdown-item.tsx} +1 -1
- package/templates/default/components/{SidebarItem.tsx → layout/sidebar-item.tsx} +1 -1
- package/templates/default/components/{SidebarPluginGroup.tsx → layout/sidebar-plugin-group.tsx} +1 -1
- package/templates/default/components/{Sidebar.tsx → layout/sidebar.tsx} +4 -4
- package/templates/default/components/{LocaleSwitcher.tsx → locale/locale-switcher.tsx} +2 -2
- package/templates/default/components/{Dropzone.tsx → media/dropzone.tsx} +1 -1
- package/templates/default/components/{GalleryPhoto.tsx → media/gallery-photo.tsx} +2 -2
- package/templates/default/components/{PhotoGallery.tsx → media/photo-gallery.tsx} +2 -2
- package/templates/default/components/multi-select.tsx +8 -4
- package/templates/default/components/{AdminsPage.tsx → pages/admins-page.tsx} +4 -4
- package/templates/default/components/{BrowsePage.tsx → pages/browse-page.tsx} +7 -7
- package/templates/default/components/{CategorizedSectionPage.tsx → pages/categorized-section-page.tsx} +2 -2
- package/templates/default/components/{ItemEditPage.tsx → pages/item-edit-page.tsx} +7 -33
- package/templates/default/components/{LogPage.tsx → pages/log-page.tsx} +1 -1
- package/templates/default/components/{NewPage.tsx → pages/new-page.tsx} +27 -50
- package/templates/default/components/{SectionPage.tsx → pages/section-page.tsx} +6 -6
- package/templates/default/components/{SettingsPage.tsx → pages/settings-page.tsx} +4 -4
- package/templates/default/components/pagination/{Pagination.tsx → pagination.tsx} +1 -1
- package/templates/default/components/{CategoryDeleteConfirmPage.tsx → sections/category-delete-confirm-page.tsx} +4 -4
- package/templates/default/components/{CategorySectionSelectInput.tsx → sections/category-section-select-input.tsx} +4 -4
- package/templates/default/components/{ConditionalFields.tsx → sections/conditional-fields.tsx} +1 -1
- package/templates/default/components/{SectionItemCard.tsx → sections/section-item-card.tsx} +3 -3
- package/templates/default/components/{SelectInputButtons.tsx → sections/select-input-buttons.tsx} +4 -4
- package/templates/default/env/env.ts +42 -0
- package/templates/default/next-env.d.ts +1 -1
- package/templates/default/next.config.ts +1 -0
- package/templates/default/package.json +1 -0
- package/templates/default/components/AnalyticsPage.tsx +0 -144
- package/templates/default/components/BarChartBox.tsx +0 -42
- package/templates/default/components/NewVariantComponent.tsx +0 -229
- package/templates/default/components/PieChartBox.tsx +0 -101
- package/templates/default/components/VariantCard.tsx +0 -124
- package/templates/default/components/VariantEditPage.tsx +0 -230
- package/templates/default/components/analytics/BounceRate.tsx +0 -70
- package/templates/default/components/analytics/LivePageViews.tsx +0 -55
- package/templates/default/components/analytics/LiveUsersCount.tsx +0 -33
- package/templates/default/components/analytics/MonthlyPageViews.tsx +0 -42
- package/templates/default/components/analytics/TopCountries.tsx +0 -52
- package/templates/default/components/analytics/TopDevices.tsx +0 -46
- package/templates/default/components/analytics/TopMediums.tsx +0 -58
- package/templates/default/components/analytics/TopSources.tsx +0 -45
- package/templates/default/components/analytics/TotalPageViews.tsx +0 -41
- package/templates/default/components/analytics/TotalSessions.tsx +0 -41
- package/templates/default/components/analytics/TotalUniqueUsers.tsx +0 -41
- package/templates/default/components/custom/RightHomeRoomVariantCard.tsx +0 -138
- package/templates/default/env/env.js +0 -130
- package/templates/default/hooks/useModal.ts +0 -8
- package/templates/default/lib/apiHelpers.ts +0 -92
- /package/templates/default/components/{AdminPrivilegeCard.tsx → admin/admin-privilege-card.tsx} +0 -0
- /package/templates/default/components/{dndKit/Draggable.tsx → dnd-kit/draggable.tsx} +0 -0
- /package/templates/default/components/{dndKit/Droppable.tsx → dnd-kit/droppable.tsx} +0 -0
- /package/templates/default/components/{dndKit/SortableItem.tsx → dnd-kit/sortable-item.tsx} +0 -0
- /package/templates/default/components/{InfoCard.tsx → feedback/info-card.tsx} +0 -0
- /package/templates/default/components/{LoadingSpinners.tsx → feedback/loading-spinners.tsx} +0 -0
- /package/templates/default/components/{ProgressBar.tsx → feedback/progress-bar.tsx} +0 -0
- /package/templates/default/components/{TooltipComponent.tsx → feedback/tooltip-component.tsx} +0 -0
- /package/templates/default/components/form/{ContentLocaleContext.tsx → content-locale-context.tsx} +0 -0
- /package/templates/default/components/form/{FormInputElement.tsx → form-input-element.tsx} +0 -0
- /package/templates/default/components/{language-dropdown.tsx → i18n/language-dropdown.tsx} +0 -0
- /package/templates/default/components/{language-picker.tsx → i18n/language-picker.tsx} +0 -0
- /package/templates/default/components/{login-language-dropdown.tsx → i18n/login-language-dropdown.tsx} +0 -0
- /package/templates/default/components/{DefaultNavItems.tsx → layout/default-nav-items.tsx} +0 -0
- /package/templates/default/components/{ThemeProvider.tsx → layout/theme-provider.tsx} +0 -0
- /package/templates/default/components/{theme-toggle.tsx → layout/theme-toggle.tsx} +0 -0
- /package/templates/default/components/{ProtectedDocument.tsx → media/protected-document.tsx} +0 -0
- /package/templates/default/components/{ProtectedImage.tsx → media/protected-image.tsx} +0 -0
- /package/templates/default/components/{ProtectedVideo.tsx → media/protected-video.tsx} +0 -0
- /package/templates/default/components/{DashboardPageAlt.tsx → pages/dashboard-page-alt.tsx} +0 -0
- /package/templates/default/components/pagination/{PaginationButtons.tsx → pagination-buttons.tsx} +0 -0
- /package/templates/default/components/{SectionIcon.tsx → sections/section-icon.tsx} +0 -0
- /package/templates/default/components/{SectionItemStatusBadge.tsx → sections/section-item-status-badge.tsx} +0 -0
- /package/templates/default/components/{SelectBox.tsx → select-box.tsx} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nextjs-cms",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.24",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"prettier": "^3.3.3",
|
|
29
29
|
"tsx": "^4.20.6",
|
|
30
30
|
"typescript": "^5.9.2",
|
|
31
|
-
"@lzcms/prettier-config": "0.1.0",
|
|
32
31
|
"@lzcms/eslint-config": "0.3.0",
|
|
33
|
-
"@lzcms/tsconfig": "0.1.0"
|
|
32
|
+
"@lzcms/tsconfig": "0.1.0",
|
|
33
|
+
"@lzcms/prettier-config": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"prettier": "@lzcms/prettier-config",
|
|
36
36
|
"scripts": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react'
|
|
4
4
|
import { useRouter, useSearchParams } from 'next/navigation'
|
|
5
5
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
6
|
-
import InfoCard from '@/components/
|
|
6
|
+
import InfoCard from '@/components/feedback/info-card'
|
|
7
7
|
import Link from 'next/link'
|
|
8
8
|
import { Switch } from '@/components/ui/switch'
|
|
9
9
|
import { Label } from '@/components/ui/label'
|
|
@@ -12,7 +12,7 @@ import { MoonIcon, SunIcon } from '@radix-ui/react-icons'
|
|
|
12
12
|
import { useTheme } from 'next-themes'
|
|
13
13
|
import { login, useSession } from 'nextjs-cms/auth/react'
|
|
14
14
|
import { wasLanguageChangedOnLogin } from 'nextjs-cms/translations'
|
|
15
|
-
import LoginLanguageDropdown from '@/components/login-language-dropdown'
|
|
15
|
+
import LoginLanguageDropdown from '@/components/i18n/login-language-dropdown'
|
|
16
16
|
import { useAuthLanguage } from '../../auth-language-provider'
|
|
17
17
|
|
|
18
18
|
type fromErrors = {
|
|
@@ -3,7 +3,7 @@ import { cookies } from 'next/headers'
|
|
|
3
3
|
import '../globals.css'
|
|
4
4
|
import type { Metadata } from 'next'
|
|
5
5
|
import { cn } from '@/lib/utils'
|
|
6
|
-
import { ThemeProvider } from '@/components/
|
|
6
|
+
import { ThemeProvider } from '@/components/layout/theme-provider'
|
|
7
7
|
import Providers from '@/app/providers'
|
|
8
8
|
import auth from 'nextjs-cms/auth'
|
|
9
9
|
import { getCMSConfig } from 'nextjs-cms/core'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BrowsePage from '@/components/
|
|
1
|
+
import BrowsePage from '@/components/pages/browse-page'
|
|
2
2
|
import { api, HydrateClient } from '@/app/_trpc/server'
|
|
3
3
|
type Params = Promise<{ section: string; page: string }>
|
|
4
4
|
type SearchParams = Promise<{ q: string | undefined }>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ItemEditPage from '@/components/
|
|
1
|
+
import ItemEditPage from '@/components/pages/item-edit-page'
|
|
2
2
|
import { api, HydrateClient } from '@/app/_trpc/server'
|
|
3
3
|
type Params = Promise<{ section: string; itemId: string }>
|
|
4
4
|
type SearchParams = Promise<{ locale?: string }>
|
|
@@ -2,7 +2,7 @@ import { Inter, Cairo } from 'next/font/google'
|
|
|
2
2
|
import '../globals.css'
|
|
3
3
|
import type { Metadata } from 'next'
|
|
4
4
|
import { cn } from '@/lib/utils'
|
|
5
|
-
import { ThemeProvider } from '@/components/
|
|
5
|
+
import { ThemeProvider } from '@/components/layout/theme-provider'
|
|
6
6
|
import Providers from '@/app/providers'
|
|
7
7
|
import auth from 'nextjs-cms/auth'
|
|
8
8
|
import { getCMSConfig } from 'nextjs-cms/core'
|
|
@@ -10,7 +10,7 @@ import { I18nProviderClient } from 'nextjs-cms/translations/client'
|
|
|
10
10
|
import { resolveLanguage, RTL_LANGUAGES } from 'nextjs-cms/translations'
|
|
11
11
|
import { getClientDictionaries } from 'nextjs-cms/translations/server'
|
|
12
12
|
import { api, HydrateClient } from '@/app/_trpc/server'
|
|
13
|
-
import Layout from '@/components/
|
|
13
|
+
import Layout from '@/components/layout/layout'
|
|
14
14
|
import { redirect } from 'next/navigation'
|
|
15
15
|
import { DirectionProvider } from "@/components/ui/direction"
|
|
16
16
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Session } from 'nextjs-cms/auth'
|
|
4
4
|
import { NextjsCmsProvider } from '@/app/_trpc/client'
|
|
5
|
-
import { ModalProvider } from '@/context
|
|
5
|
+
import { ModalProvider } from '@/components/feedback/modal-context'
|
|
6
6
|
|
|
7
7
|
export default function Providers({ children, session }: { children: React.ReactNode; session: Session | undefined }) {
|
|
8
8
|
return (
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from 'nextjs-cms/core/config'
|
|
1
|
+
import { defineConfig } from 'nextjs-cms/core/config'
|
|
2
|
+
import process from 'process'
|
|
2
3
|
import { resolve } from 'path'
|
|
4
|
+
import { env } from './env/env'
|
|
3
5
|
|
|
4
6
|
export default defineConfig({
|
|
5
7
|
ui: {
|
|
@@ -17,7 +19,7 @@ export default defineConfig({
|
|
|
17
19
|
media: {
|
|
18
20
|
upload: {
|
|
19
21
|
path:
|
|
20
|
-
|
|
22
|
+
env.NODE_ENV === 'development'
|
|
21
23
|
? 'D:/Work/WebstormProjects/turbo-expo-next/apps/web/public/content/'
|
|
22
24
|
: '/home2/syriasell/public_html/assets/content',
|
|
23
25
|
preserveExtension: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import useModal from '@/
|
|
4
|
-
import ProtectedImage from '@/components/
|
|
5
|
-
import AdminEditPage from '@/components/
|
|
3
|
+
import { useModal } from '@/components/feedback/modal-context'
|
|
4
|
+
import ProtectedImage from '@/components/media/protected-image'
|
|
5
|
+
import AdminEditPage from '@/components/admin/admin-edit-page'
|
|
6
6
|
import { useToast } from '@/components/ui/use-toast'
|
|
7
7
|
import { ScrollArea } from '@/components/ui/scroll-area'
|
|
8
8
|
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import useModal from '@/
|
|
3
|
+
import { useModal } from '@/components/feedback/modal-context'
|
|
4
4
|
import { trpc } from '@/app/_trpc/client'
|
|
5
|
-
import AdminRoleCard from '
|
|
6
|
-
import LoadingSpinners from '
|
|
5
|
+
import AdminRoleCard from '@/components/admin/admin-privilege-card'
|
|
6
|
+
import LoadingSpinners from '@/components/feedback/loading-spinners'
|
|
7
7
|
import { Button } from '@/components/ui/button'
|
|
8
8
|
|
|
9
9
|
export default function AdminEditPage({ id, action }: { id: string; action: any }) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import useModal from '@/
|
|
4
|
-
import InfoCard from '@/components/
|
|
3
|
+
import { useModal } from '@/components/feedback/modal-context'
|
|
4
|
+
import InfoCard from '@/components/feedback/info-card'
|
|
5
5
|
import { useToast } from '@/components/ui/use-toast'
|
|
6
6
|
import { trpc } from '@/app/_trpc/client'
|
|
7
|
-
import AdminRoleCard from '@/components/
|
|
7
|
+
import AdminRoleCard from '@/components/admin/admin-privilege-card'
|
|
8
8
|
import { Button } from '@/components/ui/button'
|
|
9
9
|
import type { RouterOutputs } from '@/app/_trpc/types'
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
// import { Card, CardContent, CardHeader, CardTitle } from '
|
|
2
|
+
// import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
3
3
|
|
|
4
4
|
export default function ContainerBox({ children, title }: { children: React.ReactNode; title?: string }) {
|
|
5
5
|
return (
|
package/templates/default/{context/ModalProvider.tsx → components/feedback/modal-context.tsx}
RENAMED
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React, { createContext, useState } from 'react'
|
|
4
|
-
|
|
5
|
-
export type ModalResponse = {
|
|
6
|
-
message: React.ReactNode | string
|
|
7
|
-
messageColor?: string
|
|
8
|
-
borderColor?: string
|
|
9
|
-
bgColor?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type Modal = {
|
|
13
|
-
title: string
|
|
14
|
-
titleColor: string
|
|
15
|
-
headerColor: string
|
|
16
|
-
body: React.ReactNode
|
|
17
|
-
lang: string
|
|
18
|
-
size?: 'sm' | 'md' | 'lg' | 'xl'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
modal: Modal | null
|
|
23
|
-
setModal: React.Dispatch<React.SetStateAction<Modal | null>>
|
|
24
|
-
modalResponse: ModalResponse | null
|
|
25
|
-
setModalResponse: React.Dispatch<React.SetStateAction<ModalResponse | null>>
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { createContext, useContext, useState } from 'react'
|
|
4
|
+
|
|
5
|
+
export type ModalResponse = {
|
|
6
|
+
message: React.ReactNode | string
|
|
7
|
+
messageColor?: string
|
|
8
|
+
borderColor?: string
|
|
9
|
+
bgColor?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type Modal = {
|
|
13
|
+
title: string
|
|
14
|
+
titleColor: string
|
|
15
|
+
headerColor: string
|
|
16
|
+
body: React.ReactNode
|
|
17
|
+
lang: string
|
|
18
|
+
size?: 'sm' | 'md' | 'lg' | 'xl'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type ModalContextValue = {
|
|
22
|
+
modal: Modal | null
|
|
23
|
+
setModal: React.Dispatch<React.SetStateAction<Modal | null>>
|
|
24
|
+
modalResponse: ModalResponse | null
|
|
25
|
+
setModalResponse: React.Dispatch<React.SetStateAction<ModalResponse | null>>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ModalContext = createContext<ModalContextValue | null>(null)
|
|
29
|
+
|
|
30
|
+
export function ModalProvider({ children }: { children: React.ReactNode }) {
|
|
31
|
+
const [modal, setModal] = useState<Modal | null>(null)
|
|
32
|
+
const [modalResponse, setModalResponse] = useState<ModalResponse | null>(null)
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<ModalContext.Provider
|
|
36
|
+
value={{
|
|
37
|
+
modal,
|
|
38
|
+
setModal,
|
|
39
|
+
modalResponse,
|
|
40
|
+
setModalResponse,
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</ModalContext.Provider>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function useModal() {
|
|
49
|
+
const context = useContext(ModalContext)
|
|
50
|
+
|
|
51
|
+
if (!context) {
|
|
52
|
+
throw new Error('useModal must be used within ModalProvider')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return context
|
|
56
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { Suspense, useEffect, useRef, useState } from 'react'
|
|
4
|
-
import useModal from '@/
|
|
4
|
+
import { useModal } from '@/components/feedback/modal-context'
|
|
5
5
|
import classNames from 'classnames'
|
|
6
6
|
import { X, Loader2 } from 'lucide-react'
|
|
7
7
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { FieldClientConfig } from 'nextjs-cms/core/fields'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import CheckboxFormInput from '@/components/form/inputs/
|
|
4
|
-
import ColorFormInput from '@/components/form/inputs/
|
|
5
|
-
import DateFormInput from '@/components/form/inputs/
|
|
6
|
-
import DateRangeFormInput from '@/components/form/inputs/
|
|
7
|
-
import DocumentFormInput from '@/components/form/inputs/
|
|
8
|
-
import MapFormInput from '@/components/form/inputs/
|
|
9
|
-
import MultipleSelectFormInput from '@/components/form/inputs/
|
|
10
|
-
import NumberFormInput from '@/components/form/inputs/
|
|
11
|
-
import PasswordFormInput from '@/components/form/inputs/
|
|
12
|
-
import PhotoFormInput from '@/components/form/inputs/
|
|
13
|
-
import RichTextFormInput from '@/components/form/inputs/
|
|
14
|
-
import SelectFormInput from '@/components/form/inputs/
|
|
15
|
-
import SlugFormInput from '@/components/form/inputs/
|
|
16
|
-
import TagsFormInput from '@/components/form/inputs/
|
|
17
|
-
import TextareaFormInput from '@/components/form/inputs/
|
|
18
|
-
import TextFormInput from '@/components/form/inputs/
|
|
19
|
-
import VideoFormInput from '@/components/form/inputs/
|
|
3
|
+
import CheckboxFormInput from '@/components/form/inputs/checkbox-form-input'
|
|
4
|
+
import ColorFormInput from '@/components/form/inputs/color-form-input'
|
|
5
|
+
import DateFormInput from '@/components/form/inputs/date-form-input'
|
|
6
|
+
import DateRangeFormInput from '@/components/form/inputs/date-range-form-input'
|
|
7
|
+
import DocumentFormInput from '@/components/form/inputs/document-form-input'
|
|
8
|
+
import MapFormInput from '@/components/form/inputs/map-form-input'
|
|
9
|
+
import MultipleSelectFormInput from '@/components/form/inputs/multiple-select-form-input'
|
|
10
|
+
import NumberFormInput from '@/components/form/inputs/number-form-input'
|
|
11
|
+
import PasswordFormInput from '@/components/form/inputs/password-form-input'
|
|
12
|
+
import PhotoFormInput from '@/components/form/inputs/photo-form-input'
|
|
13
|
+
import RichTextFormInput from '@/components/form/inputs/rich-text-form-input'
|
|
14
|
+
import SelectFormInput from '@/components/form/inputs/select-form-input'
|
|
15
|
+
import SlugFormInput from '@/components/form/inputs/slug-form-input'
|
|
16
|
+
import TagsFormInput from '@/components/form/inputs/tags-form-input'
|
|
17
|
+
import TextareaFormInput from '@/components/form/inputs/textarea-form-input'
|
|
18
|
+
import TextFormInput from '@/components/form/inputs/text-form-input'
|
|
19
|
+
import VideoFormInput from '@/components/form/inputs/video-form-input'
|
|
20
20
|
import {
|
|
21
21
|
CheckboxFieldClientConfig,
|
|
22
22
|
ColorFieldClientConfig,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { RouterOutputs } from '@/app/_trpc/types'
|
|
2
2
|
import React, { RefObject, useCallback, useEffect } from 'react'
|
|
3
|
-
import ContainerBox from '@/components/
|
|
4
|
-
import Dropzone, { DropzoneHandles } from '@/components/
|
|
5
|
-
import { LocalizationProvider } from '@/components/form/
|
|
6
|
-
import FormInputs from '@/components/form/
|
|
3
|
+
import ContainerBox from '@/components/container-box'
|
|
4
|
+
import Dropzone, { DropzoneHandles } from '@/components/media/dropzone'
|
|
5
|
+
import { LocalizationProvider } from '@/components/form/content-locale-context'
|
|
6
|
+
import FormInputs from '@/components/form/form-inputs'
|
|
7
7
|
import { configLastUpdated } from '@/components/form/helpers/util'
|
|
8
|
-
import
|
|
9
|
-
import ProgressBar from '@/components/ProgressBar'
|
|
8
|
+
import ProgressBar from '@/components/feedback/progress-bar'
|
|
10
9
|
import { zodResolver } from '@hookform/resolvers/zod'
|
|
11
10
|
import classNames from 'classnames'
|
|
12
11
|
import { useSession } from 'nextjs-cms/auth/react'
|
|
@@ -53,7 +52,7 @@ import {
|
|
|
53
52
|
import { FormProvider, useForm } from 'react-hook-form'
|
|
54
53
|
import * as z from 'zod'
|
|
55
54
|
|
|
56
|
-
import PhotoGallery from '
|
|
55
|
+
import PhotoGallery from '@/components/media/photo-gallery'
|
|
57
56
|
|
|
58
57
|
export const revalidate = 1
|
|
59
58
|
|
|
@@ -61,7 +60,6 @@ export default function Form({
|
|
|
61
60
|
formType,
|
|
62
61
|
data,
|
|
63
62
|
dropzoneRef,
|
|
64
|
-
variantRef,
|
|
65
63
|
handleSubmit,
|
|
66
64
|
isSubmitting,
|
|
67
65
|
response,
|
|
@@ -104,7 +102,6 @@ export default function Form({
|
|
|
104
102
|
| undefined
|
|
105
103
|
}
|
|
106
104
|
dropzoneRef?: RefObject<DropzoneHandles | null>
|
|
107
|
-
variantRef?: RefObject<VariantHandles[]>
|
|
108
105
|
handleSubmit: any
|
|
109
106
|
isSubmitting: boolean
|
|
110
107
|
response?: any
|
|
@@ -353,7 +350,8 @@ export default function Form({
|
|
|
353
350
|
className={classNames({
|
|
354
351
|
'w-full': buttonType === 'big',
|
|
355
352
|
'float-end': buttonType === 'small',
|
|
356
|
-
'bg-linear-to-r
|
|
353
|
+
'rounded bg-linear-to-r px-4 py-2 font-bold text-white drop-shadow-sm':
|
|
354
|
+
true,
|
|
357
355
|
'from-emerald-700 via-green-700 to-green-500 dark:from-blue-800 dark:via-sky-800 dark:to-slate-500':
|
|
358
356
|
!isSubmitting,
|
|
359
357
|
'from-gray-600 via-gray-500 to-gray-400': isSubmitting,
|
package/templates/default/components/form/inputs/{CheckboxFormInput.tsx → checkbox-form-input.tsx}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
3
|
import { CheckboxFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form'
|
|
5
5
|
import { Switch } from '@/components/ui/switch'
|
package/templates/default/components/form/inputs/{ColorFormInput.tsx → color-form-input.tsx}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
3
|
import { ColorFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form'
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import dayjs from 'dayjs'
|
|
3
|
-
import FormInputElement from '@/components/form/
|
|
3
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
4
4
|
import { Button } from '@/components/ui/button'
|
|
5
5
|
import { Calendar } from '@/components/ui/calendar'
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
|
|
@@ -8,7 +8,7 @@ import { CalendarIcon, ChevronDownIcon } from '@radix-ui/react-icons'
|
|
|
8
8
|
import { Button } from '@/components/ui/button'
|
|
9
9
|
import { Calendar } from '@/components/ui/calendar'
|
|
10
10
|
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
|
|
11
|
-
import FormInputElement from '@/components/form/
|
|
11
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
12
12
|
import type { DateRangeFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
13
13
|
|
|
14
14
|
const seasonEmoji: Record<string, string> = {
|
package/templates/default/components/form/inputs/{DocumentFormInput.tsx → document-form-input.tsx}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
3
|
-
import ProtectedDocument from '@/components/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
|
+
import ProtectedDocument from '@/components/media/protected-document'
|
|
4
4
|
import { Badge } from '@/components/ui/badge'
|
|
5
5
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
6
|
-
import useModal from '@/
|
|
6
|
+
import { useModal } from '@/components/feedback/modal-context'
|
|
7
7
|
import { ChevronRight, InfoIcon, Trash2Icon, Undo2Icon, UploadIcon, X } from 'lucide-react'
|
|
8
8
|
import { DocumentFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
9
9
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { APIProvider, Map, Marker } from '@vis.gl/react-google-maps'
|
|
3
|
-
import ContainerBox from '@/components/
|
|
3
|
+
import ContainerBox from '@/components/container-box'
|
|
4
4
|
import { Button } from '@/components/ui/button'
|
|
5
|
-
import TooltipComponent from '@/components/
|
|
5
|
+
import TooltipComponent from '@/components/feedback/tooltip-component'
|
|
6
6
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
7
7
|
import { MapFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
8
8
|
import { useController, useFormContext } from 'react-hook-form'
|
|
9
|
-
import FormInputElement from '@/components/form/
|
|
9
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
10
|
+
import { env } from '@/env/env'
|
|
10
11
|
|
|
11
12
|
export default function MapFormInput({ input }: { input: MapFieldClientConfig }) {
|
|
12
13
|
const t = useI18n()
|
|
@@ -62,7 +63,7 @@ export default function MapFormInput({ input }: { input: MapFieldClientConfig })
|
|
|
62
63
|
onBlur={field.onBlur}
|
|
63
64
|
ref={field.ref}
|
|
64
65
|
/>
|
|
65
|
-
<APIProvider apiKey={
|
|
66
|
+
<APIProvider apiKey={env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY ?? ''}>
|
|
66
67
|
<Map
|
|
67
68
|
clickableIcons={false}
|
|
68
69
|
zoomControl={true}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FormInputElement from '@/components/form/
|
|
1
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
2
2
|
import { useEffect, useState } from 'react'
|
|
3
3
|
import { SelectMultipleFieldClientConfig, SelectOption } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form'
|
package/templates/default/components/form/inputs/{NumberFormInput.tsx → number-form-input.tsx}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
3
|
import type { NumberFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form'
|
|
5
5
|
import { isNumber, toNumber } from 'lodash-es'
|
package/templates/default/components/form/inputs/{PasswordFormInput.tsx → password-form-input.tsx}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
3
|
import { PasswordFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form'
|
|
5
5
|
|
package/templates/default/components/form/inputs/{PhotoFormInput.tsx → photo-form-input.tsx}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
3
|
-
import FormInputElement from '@/components/form/
|
|
4
|
-
import ProtectedImage from '@/components/
|
|
3
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
4
|
+
import ProtectedImage from '@/components/media/protected-image'
|
|
5
5
|
import Image from 'next/image'
|
|
6
|
-
import useModal from '@/
|
|
6
|
+
import { useModal } from '@/components/feedback/modal-context'
|
|
7
7
|
import { ChevronRight, InfoIcon, Trash2Icon, Undo2Icon, UploadIcon, X } from 'lucide-react'
|
|
8
8
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
9
9
|
import { Badge } from '@/components/ui/badge'
|
package/templates/default/components/form/inputs/{RichTextFormInput.tsx → rich-text-form-input.tsx}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useRef, useState } from 'react'
|
|
2
2
|
import { Editor } from '@tinymce/tinymce-react'
|
|
3
|
-
import FormInputElement from '@/components/form/
|
|
3
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
4
4
|
// import { useTheme } from 'next-themes'
|
|
5
5
|
import { useAxiosPrivate } from 'nextjs-cms/api/client'
|
|
6
6
|
import { RichTextFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
7
7
|
import { FieldError, useFormContext } from 'react-hook-form'
|
|
8
|
-
import { useLocale } from '@/components/form/
|
|
8
|
+
import { useLocale } from '@/components/form/content-locale-context'
|
|
9
9
|
|
|
10
10
|
export default function RichTextFormInput({ input }: { input: RichTextFieldClientConfig }) {
|
|
11
11
|
const { setValue, register, formState } = useFormContext()
|
package/templates/default/components/form/inputs/{SelectFormInput.tsx → select-form-input.tsx}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useEffect, useState, useMemo } from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
3
|
-
import SelectBox from '@/components/
|
|
4
|
-
import LoadingSpinners from '@/components/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
|
+
import SelectBox from '@/components/select-box'
|
|
4
|
+
import LoadingSpinners from '@/components/feedback/loading-spinners'
|
|
5
5
|
import { useAutoAnimate } from '@formkit/auto-animate/react'
|
|
6
6
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
7
7
|
import { useSession } from 'nextjs-cms/auth/react'
|
|
8
8
|
import { trpc } from '@/app/_trpc/client'
|
|
9
9
|
import { SelectFieldClientConfig, SelectOption } from 'nextjs-cms/core/fields'
|
|
10
|
-
import { ConditionalFields } from '@/components/
|
|
10
|
+
import { ConditionalFields } from '@/components/sections/conditional-fields'
|
|
11
11
|
import { useController, useFormContext } from 'react-hook-form'
|
|
12
12
|
|
|
13
13
|
export default function SelectFormInput({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useEffect, useRef } from 'react'
|
|
4
|
-
import FormInputElement from '@/components/form/
|
|
4
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
5
5
|
import type { SlugFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
6
6
|
import { useFormContext, useController, useWatch } from 'react-hook-form'
|
|
7
7
|
import { InputGroup, InputGroupInput, InputGroupAddon } from '@/components/ui/input-group'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FormInputElement from '@/components/form/
|
|
1
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
2
2
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
3
3
|
import { TagsFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import FormInputElement from '@/components/form/
|
|
2
|
+
import FormInputElement from '@/components/form/form-input-element'
|
|
3
3
|
import type { TextFieldClientConfig } from 'nextjs-cms/core/fields'
|
|
4
4
|
import { useFormContext, useController } from 'react-hook-form'
|
|
5
|
-
import { useLocale } from '@/components/form/
|
|
5
|
+
import { useLocale } from '@/components/form/content-locale-context'
|
|
6
6
|
|
|
7
7
|
export default function TextFormInput({
|
|
8
8
|
input,
|