create-nextjs-cms 0.5.23 → 0.5.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.
Files changed (191) hide show
  1. package/package.json +5 -7
  2. package/templates/default/components/NewPage.tsx +2 -2
  3. package/templates/default/components/ProgressBar.tsx +46 -22
  4. package/templates/default/components/form/DateRangeFormInput.tsx +8 -6
  5. package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
  6. package/templates/default/components/form/inputs/DateFormInput.tsx +82 -34
  7. package/templates/default/components/form/inputs/MultipleSelectFormInput.tsx +40 -107
  8. package/templates/default/components/form/inputs/RichTextFormInput.tsx +2 -0
  9. package/templates/default/components/form/inputs/TagsFormInput.tsx +115 -26
  10. package/templates/default/components/form/inputs/TextFormInput.tsx +1 -1
  11. package/templates/default/components/multi-select.tsx +1144 -0
  12. package/templates/default/components/ui/badge.tsx +16 -12
  13. package/templates/default/components/ui/button.tsx +35 -30
  14. package/templates/default/components/ui/calendar.tsx +145 -47
  15. package/templates/default/components/ui/command.tsx +184 -0
  16. package/templates/default/components/ui/dialog.tsx +143 -0
  17. package/templates/default/components/ui/popover.tsx +39 -22
  18. package/templates/default/components/ui/progress.tsx +31 -0
  19. package/templates/default/components/ui/select.tsx +150 -149
  20. package/templates/default/components/ui/separator.tsx +28 -0
  21. package/templates/default/components.json +8 -3
  22. package/templates/default/{postinstall.js → lib/postinstall.js} +1 -1
  23. package/templates/default/lib/utils.ts +6 -0
  24. package/templates/default/{proxy.ts → middleware.ts} +3 -2
  25. package/templates/default/next-env.d.ts +1 -1
  26. package/templates/default/package.json +41 -52
  27. package/templates/default/public/tinymce/CHANGELOG.md +155 -0
  28. package/templates/default/public/tinymce/README.md +12 -12
  29. package/templates/default/public/tinymce/bower.json +1 -1
  30. package/templates/default/public/tinymce/composer.json +2 -2
  31. package/templates/default/public/tinymce/icons/default/icons.js +40 -32
  32. package/templates/default/public/tinymce/icons/default/icons.min.js +1 -1
  33. package/templates/default/public/tinymce/license.md +7 -4
  34. package/templates/default/public/tinymce/models/dom/model.js +36 -50
  35. package/templates/default/public/tinymce/models/dom/model.min.js +1 -1
  36. package/templates/default/public/tinymce/notices.txt +2 -2
  37. package/templates/default/public/tinymce/package.json +2 -2
  38. package/templates/default/public/tinymce/plugins/accordion/plugin.js +45 -21
  39. package/templates/default/public/tinymce/plugins/accordion/plugin.min.js +1 -1
  40. package/templates/default/public/tinymce/plugins/advlist/plugin.js +8 -6
  41. package/templates/default/public/tinymce/plugins/advlist/plugin.min.js +1 -1
  42. package/templates/default/public/tinymce/plugins/anchor/plugin.js +1 -1
  43. package/templates/default/public/tinymce/plugins/autolink/plugin.js +3 -6
  44. package/templates/default/public/tinymce/plugins/autolink/plugin.min.js +1 -1
  45. package/templates/default/public/tinymce/plugins/autoresize/plugin.js +4 -6
  46. package/templates/default/public/tinymce/plugins/autoresize/plugin.min.js +1 -1
  47. package/templates/default/public/tinymce/plugins/autosave/plugin.js +4 -7
  48. package/templates/default/public/tinymce/plugins/autosave/plugin.min.js +1 -1
  49. package/templates/default/public/tinymce/plugins/charmap/plugin.js +8 -8
  50. package/templates/default/public/tinymce/plugins/charmap/plugin.min.js +1 -1
  51. package/templates/default/public/tinymce/plugins/code/plugin.js +3 -2
  52. package/templates/default/public/tinymce/plugins/code/plugin.min.js +1 -1
  53. package/templates/default/public/tinymce/plugins/codesample/plugin.js +11 -10
  54. package/templates/default/public/tinymce/plugins/codesample/plugin.min.js +2 -2
  55. package/templates/default/public/tinymce/plugins/directionality/plugin.js +9 -11
  56. package/templates/default/public/tinymce/plugins/directionality/plugin.min.js +1 -1
  57. package/templates/default/public/tinymce/plugins/emoticons/plugin.js +7 -7
  58. package/templates/default/public/tinymce/plugins/emoticons/plugin.min.js +1 -1
  59. package/templates/default/public/tinymce/plugins/fullscreen/plugin.js +11 -13
  60. package/templates/default/public/tinymce/plugins/fullscreen/plugin.min.js +1 -1
  61. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +93 -0
  62. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +93 -0
  63. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he-IL.js +93 -0
  64. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +93 -0
  65. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +93 -0
  66. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +93 -0
  67. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +93 -0
  68. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +93 -0
  69. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +93 -0
  70. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +93 -0
  71. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th-TH.js +93 -0
  72. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +87 -0
  73. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +93 -0
  74. package/templates/default/public/tinymce/plugins/help/plugin.js +15 -17
  75. package/templates/default/public/tinymce/plugins/help/plugin.min.js +1 -1
  76. package/templates/default/public/tinymce/plugins/image/plugin.js +34 -32
  77. package/templates/default/public/tinymce/plugins/image/plugin.min.js +1 -1
  78. package/templates/default/public/tinymce/plugins/importcss/plugin.js +4 -6
  79. package/templates/default/public/tinymce/plugins/importcss/plugin.min.js +1 -1
  80. package/templates/default/public/tinymce/plugins/insertdatetime/plugin.js +4 -3
  81. package/templates/default/public/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
  82. package/templates/default/public/tinymce/plugins/link/plugin.js +170 -38
  83. package/templates/default/public/tinymce/plugins/link/plugin.min.js +1 -1
  84. package/templates/default/public/tinymce/plugins/lists/plugin.js +111 -2053
  85. package/templates/default/public/tinymce/plugins/lists/plugin.min.js +1 -1
  86. package/templates/default/public/tinymce/plugins/media/plugin.js +15 -23
  87. package/templates/default/public/tinymce/plugins/media/plugin.min.js +1 -1
  88. package/templates/default/public/tinymce/plugins/nonbreaking/plugin.js +1 -1
  89. package/templates/default/public/tinymce/plugins/pagebreak/plugin.js +1 -1
  90. package/templates/default/public/tinymce/plugins/preview/plugin.js +88 -10
  91. package/templates/default/public/tinymce/plugins/preview/plugin.min.js +1 -1
  92. package/templates/default/public/tinymce/plugins/quickbars/plugin.js +9 -9
  93. package/templates/default/public/tinymce/plugins/quickbars/plugin.min.js +1 -1
  94. package/templates/default/public/tinymce/plugins/save/plugin.js +1 -1
  95. package/templates/default/public/tinymce/plugins/searchreplace/plugin.js +10 -13
  96. package/templates/default/public/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  97. package/templates/default/public/tinymce/plugins/table/plugin.js +13 -24
  98. package/templates/default/public/tinymce/plugins/table/plugin.min.js +1 -1
  99. package/templates/default/public/tinymce/plugins/visualblocks/plugin.js +1 -1
  100. package/templates/default/public/tinymce/plugins/visualchars/plugin.js +9 -10
  101. package/templates/default/public/tinymce/plugins/visualchars/plugin.min.js +1 -1
  102. package/templates/default/public/tinymce/plugins/wordcount/plugin.js +1 -1
  103. package/templates/default/public/tinymce/skins/content/dark/content.min.ts +3 -0
  104. package/templates/default/public/tinymce/skins/content/dark/content.ts +3 -0
  105. package/templates/default/public/tinymce/skins/content/default/content.min.ts +3 -0
  106. package/templates/default/public/tinymce/skins/content/default/content.ts +3 -0
  107. package/templates/default/public/tinymce/skins/content/document/content.min.ts +3 -0
  108. package/templates/default/public/tinymce/skins/content/document/content.ts +3 -0
  109. package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.ts +3 -0
  110. package/templates/default/public/tinymce/skins/content/tinymce-5/content.ts +3 -0
  111. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.ts +3 -0
  112. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.ts +3 -0
  113. package/templates/default/public/tinymce/skins/content/writer/content.min.ts +3 -0
  114. package/templates/default/public/tinymce/skins/content/writer/content.ts +3 -0
  115. package/templates/default/public/tinymce/skins/ui/oxide/content.css +144 -0
  116. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.css +144 -0
  117. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.js +1 -1
  118. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  119. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.ts +116 -0
  120. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.ts +116 -0
  121. package/templates/default/public/tinymce/skins/ui/oxide/content.js +1 -1
  122. package/templates/default/public/tinymce/skins/ui/oxide/content.min.css +1 -1
  123. package/templates/default/public/tinymce/skins/ui/oxide/content.min.ts +116 -0
  124. package/templates/default/public/tinymce/skins/ui/oxide/content.ts +116 -0
  125. package/templates/default/public/tinymce/skins/ui/oxide/skin.css +923 -449
  126. package/templates/default/public/tinymce/skins/ui/oxide/skin.js +1 -1
  127. package/templates/default/public/tinymce/skins/ui/oxide/skin.min.css +1 -1
  128. package/templates/default/public/tinymce/skins/ui/oxide/skin.min.ts +507 -0
  129. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +9 -0
  130. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.ts +9 -0
  131. package/templates/default/public/tinymce/skins/ui/oxide/skin.ts +507 -0
  132. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.css +144 -0
  133. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.css +144 -0
  134. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.js +1 -1
  135. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  136. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.ts +116 -0
  137. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.ts +116 -0
  138. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.js +1 -1
  139. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  140. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.ts +116 -0
  141. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.ts +116 -0
  142. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.css +926 -452
  143. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.js +1 -1
  144. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  145. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.ts +507 -0
  146. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +9 -0
  147. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +9 -0
  148. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.ts +507 -0
  149. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.css +144 -0
  150. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.css +144 -0
  151. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.js +1 -1
  152. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
  153. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.ts +116 -0
  154. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.ts +116 -0
  155. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.js +1 -1
  156. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
  157. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.ts +116 -0
  158. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.ts +116 -0
  159. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.css +924 -450
  160. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.js +1 -1
  161. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  162. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.ts +508 -0
  163. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +9 -0
  164. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +9 -0
  165. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.ts +508 -0
  166. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.css +144 -0
  167. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.css +144 -0
  168. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -1
  169. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  170. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +116 -0
  171. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +116 -0
  172. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.js +1 -1
  173. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
  174. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.ts +116 -0
  175. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.ts +116 -0
  176. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.css +925 -451
  177. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -1
  178. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  179. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +508 -0
  180. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +9 -0
  181. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +9 -0
  182. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.ts +508 -0
  183. package/templates/default/public/tinymce/themes/silver/theme.js +543 -593
  184. package/templates/default/public/tinymce/themes/silver/theme.min.js +1 -1
  185. package/templates/default/public/tinymce/tinymce.d.ts +559 -496
  186. package/templates/default/public/tinymce/tinymce.js +6788 -3964
  187. package/templates/default/public/tinymce/tinymce.min.js +3 -4
  188. package/templates/default/styles/globals.css +132 -107
  189. package/templates/default/tsconfig.json +45 -45
  190. package/templates/default/.prettierrc.json +0 -19
  191. package/templates/default/eslint.config.mjs +0 -38
@@ -0,0 +1,143 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as DialogPrimitive from "@radix-ui/react-dialog"
5
+ import { XIcon } from "lucide-react"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function Dialog({
10
+ ...props
11
+ }: React.ComponentProps<typeof DialogPrimitive.Root>) {
12
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
13
+ }
14
+
15
+ function DialogTrigger({
16
+ ...props
17
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
18
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
19
+ }
20
+
21
+ function DialogPortal({
22
+ ...props
23
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
24
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
25
+ }
26
+
27
+ function DialogClose({
28
+ ...props
29
+ }: React.ComponentProps<typeof DialogPrimitive.Close>) {
30
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
31
+ }
32
+
33
+ function DialogOverlay({
34
+ className,
35
+ ...props
36
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
37
+ return (
38
+ <DialogPrimitive.Overlay
39
+ data-slot="dialog-overlay"
40
+ className={cn(
41
+ "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",
42
+ className
43
+ )}
44
+ {...props}
45
+ />
46
+ )
47
+ }
48
+
49
+ function DialogContent({
50
+ className,
51
+ children,
52
+ showCloseButton = true,
53
+ ...props
54
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
55
+ showCloseButton?: boolean
56
+ }) {
57
+ return (
58
+ <DialogPortal data-slot="dialog-portal">
59
+ <DialogOverlay />
60
+ <DialogPrimitive.Content
61
+ data-slot="dialog-content"
62
+ className={cn(
63
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
64
+ className
65
+ )}
66
+ {...props}
67
+ >
68
+ {children}
69
+ {showCloseButton && (
70
+ <DialogPrimitive.Close
71
+ data-slot="dialog-close"
72
+ className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
73
+ >
74
+ <XIcon />
75
+ <span className="sr-only">Close</span>
76
+ </DialogPrimitive.Close>
77
+ )}
78
+ </DialogPrimitive.Content>
79
+ </DialogPortal>
80
+ )
81
+ }
82
+
83
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
84
+ return (
85
+ <div
86
+ data-slot="dialog-header"
87
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
88
+ {...props}
89
+ />
90
+ )
91
+ }
92
+
93
+ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
94
+ return (
95
+ <div
96
+ data-slot="dialog-footer"
97
+ className={cn(
98
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
99
+ className
100
+ )}
101
+ {...props}
102
+ />
103
+ )
104
+ }
105
+
106
+ function DialogTitle({
107
+ className,
108
+ ...props
109
+ }: React.ComponentProps<typeof DialogPrimitive.Title>) {
110
+ return (
111
+ <DialogPrimitive.Title
112
+ data-slot="dialog-title"
113
+ className={cn("text-lg leading-none font-semibold", className)}
114
+ {...props}
115
+ />
116
+ )
117
+ }
118
+
119
+ function DialogDescription({
120
+ className,
121
+ ...props
122
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) {
123
+ return (
124
+ <DialogPrimitive.Description
125
+ data-slot="dialog-description"
126
+ className={cn("text-muted-foreground text-sm", className)}
127
+ {...props}
128
+ />
129
+ )
130
+ }
131
+
132
+ export {
133
+ Dialog,
134
+ DialogClose,
135
+ DialogContent,
136
+ DialogDescription,
137
+ DialogFooter,
138
+ DialogHeader,
139
+ DialogOverlay,
140
+ DialogPortal,
141
+ DialogTitle,
142
+ DialogTrigger,
143
+ }
@@ -3,29 +3,46 @@
3
3
  import * as React from "react"
4
4
  import * as PopoverPrimitive from "@radix-ui/react-popover"
5
5
 
6
- import { cn } from 'nextjs-cms/utils'
6
+ import { cn } from "@/lib/utils"
7
7
 
8
- const Popover = PopoverPrimitive.Root
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
+ }
9
13
 
10
- const PopoverTrigger = PopoverPrimitive.Trigger
14
+ function PopoverTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
+ }
11
19
 
12
- const PopoverContent = React.forwardRef<
13
- React.ElementRef<typeof PopoverPrimitive.Content>,
14
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
15
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
- <PopoverPrimitive.Portal>
17
- <PopoverPrimitive.Content
18
- ref={ref}
19
- align={align}
20
- sideOffset={sideOffset}
21
- className={cn(
22
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
23
- className
24
- )}
25
- {...props}
26
- />
27
- </PopoverPrimitive.Portal>
28
- ))
29
- PopoverContent.displayName = PopoverPrimitive.Content.displayName
20
+ function PopoverContent({
21
+ className,
22
+ align = "center",
23
+ sideOffset = 4,
24
+ ...props
25
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
+ return (
27
+ <PopoverPrimitive.Portal>
28
+ <PopoverPrimitive.Content
29
+ data-slot="popover-content"
30
+ align={align}
31
+ sideOffset={sideOffset}
32
+ className={cn(
33
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ </PopoverPrimitive.Portal>
39
+ )
40
+ }
30
41
 
31
- export { Popover, PopoverTrigger, PopoverContent }
42
+ function PopoverAnchor({
43
+ ...props
44
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
45
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
46
+ }
47
+
48
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -0,0 +1,31 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ProgressPrimitive from "@radix-ui/react-progress"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Progress({
9
+ className,
10
+ value,
11
+ ...props
12
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
13
+ return (
14
+ <ProgressPrimitive.Root
15
+ data-slot="progress"
16
+ className={cn(
17
+ "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <ProgressPrimitive.Indicator
23
+ data-slot="progress-indicator"
24
+ className="bg-primary h-full w-full flex-1 transition-all"
25
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
26
+ />
27
+ </ProgressPrimitive.Root>
28
+ )
29
+ }
30
+
31
+ export { Progress }
@@ -1,164 +1,165 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import {
5
- CaretSortIcon,
6
- CheckIcon,
7
- ChevronDownIcon,
8
- ChevronUpIcon,
9
- } from "@radix-ui/react-icons"
10
- import * as SelectPrimitive from "@radix-ui/react-select"
3
+ import * as React from 'react'
4
+ import * as SelectPrimitive from '@radix-ui/react-select'
5
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
11
6
 
12
- import { cn } from 'nextjs-cms/utils'
7
+ import { cn } from '@/lib/utils'
13
8
 
14
- const Select = SelectPrimitive.Root
9
+ function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
10
+ return <SelectPrimitive.Root data-slot='select' {...props} />
11
+ }
15
12
 
16
- const SelectGroup = SelectPrimitive.Group
13
+ function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
14
+ return <SelectPrimitive.Group data-slot='select-group' {...props} />
15
+ }
17
16
 
18
- const SelectValue = SelectPrimitive.Value
17
+ function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
18
+ return <SelectPrimitive.Value data-slot='select-value' {...props} />
19
+ }
19
20
 
20
- const SelectTrigger = React.forwardRef<
21
- React.ElementRef<typeof SelectPrimitive.Trigger>,
22
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
23
- >(({ className, children, ...props }, ref) => (
24
- <SelectPrimitive.Trigger
25
- ref={ref}
26
- className={cn(
27
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
28
- className
29
- )}
30
- {...props}
31
- >
32
- {children}
33
- <SelectPrimitive.Icon asChild>
34
- <CaretSortIcon className="h-4 w-4 opacity-50" />
35
- </SelectPrimitive.Icon>
36
- </SelectPrimitive.Trigger>
37
- ))
38
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
21
+ function SelectTrigger({
22
+ className,
23
+ size = 'default',
24
+ children,
25
+ ...props
26
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
27
+ size?: 'sm' | 'default'
28
+ }) {
29
+ return (
30
+ <SelectPrimitive.Trigger
31
+ data-slot='select-trigger'
32
+ data-size={size}
33
+ className={cn(
34
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
35
+ className,
36
+ )}
37
+ {...props}
38
+ >
39
+ {children}
40
+ <SelectPrimitive.Icon asChild>
41
+ <ChevronDownIcon className='size-4 opacity-50' />
42
+ </SelectPrimitive.Icon>
43
+ </SelectPrimitive.Trigger>
44
+ )
45
+ }
39
46
 
40
- const SelectScrollUpButton = React.forwardRef<
41
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
42
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
43
- >(({ className, ...props }, ref) => (
44
- <SelectPrimitive.ScrollUpButton
45
- ref={ref}
46
- className={cn(
47
- "flex cursor-default items-center justify-center py-1",
48
- className
49
- )}
50
- {...props}
51
- >
52
- <ChevronUpIcon />
53
- </SelectPrimitive.ScrollUpButton>
54
- ))
55
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
47
+ function SelectContent({
48
+ className,
49
+ children,
50
+ position = 'item-aligned',
51
+ align = 'center',
52
+ ...props
53
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
54
+ return (
55
+ <SelectPrimitive.Portal>
56
+ <SelectPrimitive.Content
57
+ data-slot='select-content'
58
+ className={cn(
59
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
60
+ position === 'popper' &&
61
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
62
+ className,
63
+ )}
64
+ position={position}
65
+ align={align}
66
+ {...props}
67
+ >
68
+ <SelectScrollUpButton />
69
+ <SelectPrimitive.Viewport
70
+ className={cn(
71
+ 'p-1',
72
+ position === 'popper' &&
73
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1',
74
+ )}
75
+ >
76
+ {children}
77
+ </SelectPrimitive.Viewport>
78
+ <SelectScrollDownButton />
79
+ </SelectPrimitive.Content>
80
+ </SelectPrimitive.Portal>
81
+ )
82
+ }
56
83
 
57
- const SelectScrollDownButton = React.forwardRef<
58
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
59
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
60
- >(({ className, ...props }, ref) => (
61
- <SelectPrimitive.ScrollDownButton
62
- ref={ref}
63
- className={cn(
64
- "flex cursor-default items-center justify-center py-1",
65
- className
66
- )}
67
- {...props}
68
- >
69
- <ChevronDownIcon />
70
- </SelectPrimitive.ScrollDownButton>
71
- ))
72
- SelectScrollDownButton.displayName =
73
- SelectPrimitive.ScrollDownButton.displayName
84
+ function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
85
+ return (
86
+ <SelectPrimitive.Label
87
+ data-slot='select-label'
88
+ className={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
89
+ {...props}
90
+ />
91
+ )
92
+ }
74
93
 
75
- const SelectContent = React.forwardRef<
76
- React.ElementRef<typeof SelectPrimitive.Content>,
77
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
78
- >(({ className, children, position = "popper", ...props }, ref) => (
79
- <SelectPrimitive.Portal>
80
- <SelectPrimitive.Content
81
- ref={ref}
82
- className={cn(
83
- "relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
84
- position === "popper" &&
85
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
86
- className
87
- )}
88
- position={position}
89
- {...props}
90
- >
91
- <SelectScrollUpButton />
92
- <SelectPrimitive.Viewport
93
- className={cn(
94
- "p-1",
95
- position === "popper" &&
96
- "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
97
- )}
98
- >
99
- {children}
100
- </SelectPrimitive.Viewport>
101
- <SelectScrollDownButton />
102
- </SelectPrimitive.Content>
103
- </SelectPrimitive.Portal>
104
- ))
105
- SelectContent.displayName = SelectPrimitive.Content.displayName
94
+ function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
95
+ return (
96
+ <SelectPrimitive.Item
97
+ data-slot='select-item'
98
+ className={cn(
99
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
100
+ className,
101
+ )}
102
+ {...props}
103
+ >
104
+ <span
105
+ data-slot='select-item-indicator'
106
+ className='absolute right-2 flex size-3.5 items-center justify-center'
107
+ >
108
+ <SelectPrimitive.ItemIndicator>
109
+ <CheckIcon className='size-4' />
110
+ </SelectPrimitive.ItemIndicator>
111
+ </span>
112
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
113
+ </SelectPrimitive.Item>
114
+ )
115
+ }
106
116
 
107
- const SelectLabel = React.forwardRef<
108
- React.ElementRef<typeof SelectPrimitive.Label>,
109
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
110
- >(({ className, ...props }, ref) => (
111
- <SelectPrimitive.Label
112
- ref={ref}
113
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
114
- {...props}
115
- />
116
- ))
117
- SelectLabel.displayName = SelectPrimitive.Label.displayName
117
+ function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
118
+ return (
119
+ <SelectPrimitive.Separator
120
+ data-slot='select-separator'
121
+ className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
122
+ {...props}
123
+ />
124
+ )
125
+ }
118
126
 
119
- const SelectItem = React.forwardRef<
120
- React.ElementRef<typeof SelectPrimitive.Item>,
121
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
122
- >(({ className, children, ...props }, ref) => (
123
- <SelectPrimitive.Item
124
- ref={ref}
125
- className={cn(
126
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
127
- className
128
- )}
129
- {...props}
130
- >
131
- <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
132
- <SelectPrimitive.ItemIndicator>
133
- <CheckIcon className="h-4 w-4" />
134
- </SelectPrimitive.ItemIndicator>
135
- </span>
136
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
137
- </SelectPrimitive.Item>
138
- ))
139
- SelectItem.displayName = SelectPrimitive.Item.displayName
127
+ function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
128
+ return (
129
+ <SelectPrimitive.ScrollUpButton
130
+ data-slot='select-scroll-up-button'
131
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
132
+ {...props}
133
+ >
134
+ <ChevronUpIcon className='size-4' />
135
+ </SelectPrimitive.ScrollUpButton>
136
+ )
137
+ }
140
138
 
141
- const SelectSeparator = React.forwardRef<
142
- React.ElementRef<typeof SelectPrimitive.Separator>,
143
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
144
- >(({ className, ...props }, ref) => (
145
- <SelectPrimitive.Separator
146
- ref={ref}
147
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
148
- {...props}
149
- />
150
- ))
151
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName
139
+ function SelectScrollDownButton({
140
+ className,
141
+ ...props
142
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
143
+ return (
144
+ <SelectPrimitive.ScrollDownButton
145
+ data-slot='select-scroll-down-button'
146
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
147
+ {...props}
148
+ >
149
+ <ChevronDownIcon className='size-4' />
150
+ </SelectPrimitive.ScrollDownButton>
151
+ )
152
+ }
152
153
 
153
154
  export {
154
- Select,
155
- SelectGroup,
156
- SelectValue,
157
- SelectTrigger,
158
- SelectContent,
159
- SelectLabel,
160
- SelectItem,
161
- SelectSeparator,
162
- SelectScrollUpButton,
163
- SelectScrollDownButton,
155
+ Select,
156
+ SelectContent,
157
+ SelectGroup,
158
+ SelectItem,
159
+ SelectLabel,
160
+ SelectScrollDownButton,
161
+ SelectScrollUpButton,
162
+ SelectSeparator,
163
+ SelectTrigger,
164
+ SelectValue,
164
165
  }
@@ -0,0 +1,28 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Separator({
9
+ className,
10
+ orientation = "horizontal",
11
+ decorative = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
+ return (
15
+ <SeparatorPrimitive.Root
16
+ data-slot="separator"
17
+ decorative={decorative}
18
+ orientation={orientation}
19
+ className={cn(
20
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ export { Separator }
@@ -4,13 +4,18 @@
4
4
  "rsc": true,
5
5
  "tsx": true,
6
6
  "tailwind": {
7
- "config": "tailwind.config.js",
7
+ "config": "",
8
+ "prefix": "",
8
9
  "css": "styles/globals.css",
9
10
  "baseColor": "slate",
10
11
  "cssVariables": true
11
12
  },
12
13
  "aliases": {
13
14
  "components": "@/components",
14
- "utils": "nextjs-cms/utils"
15
- }
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/components/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide"
16
21
  }
@@ -5,7 +5,7 @@ const path = require('path')
5
5
  const tinymcePath = path.dirname(require.resolve('tinymce/package.json'))
6
6
 
7
7
  // Define the target directory
8
- const targetDir = path.join(__dirname, 'public', 'tinymce')
8
+ const targetDir = path.join(__dirname, '../public', 'tinymce')
9
9
 
10
10
  // Empty and copy the directory
11
11
  fse.emptyDirSync(targetDir)
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from 'clsx'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -1,7 +1,7 @@
1
1
  import { NextRequest } from 'next/server'
2
2
  import { validateCSRFToken } from 'nextjs-cms/auth/actions'
3
3
 
4
- export async function proxy(request: NextRequest) {
4
+ export async function middleware(request: NextRequest) {
5
5
  /**
6
6
  * If the request is a POST request, we will check if the request body is empty.
7
7
  */
@@ -19,6 +19,7 @@ export async function proxy(request: NextRequest) {
19
19
  }
20
20
 
21
21
  export const config = {
22
+ runtime: 'nodejs', // Specify the runtime environment as Node.js
22
23
  matcher: [
23
24
  /*
24
25
  * Match all request paths except for the ones starting with:
@@ -28,5 +29,5 @@ export const config = {
28
29
  * - favicon.ico (favicon file)
29
30
  */
30
31
  '/((?!_next/static|_next/image|favicon.ico).*)',
31
- ]
32
+ ],
32
33
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/dev/types/routes.d.ts";
3
+ /// <reference path="./.next/types/routes.d.ts" />
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.