betterstart-cli 0.0.109 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/adapters/next/templates/init/components/layouts/{admin-sidebar-branding-rsc.tsx → admin-sidebar-branding.tsx} +1 -1
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/layouts/role-gate.tsx +14 -0
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode-integrate.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/entity-filters-bar.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-versions-drawer.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-filters-bar.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-gallery-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-preview.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-color-highlight.ts +1 -3
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-media-insertion.ts +1 -3
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor.ts +2 -6
- package/dist/assets/adapters/next/templates/init/pages/account-layout.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/{account-shell-rsc.tsx → account-shell.tsx} +2 -2
- package/dist/assets/adapters/next/templates/init/pages/{auth-gate-rsc.tsx → auth-gate.tsx} +2 -2
- package/dist/assets/adapters/next/templates/init/pages/authenticated-layout.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-form.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-page-skeleton.tsx +3 -3
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-page.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/login-form.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/{login-page-rsc.tsx → login-page-content.tsx} +1 -1
- package/dist/assets/adapters/next/templates/init/pages/login-page-skeleton.tsx +3 -3
- package/dist/assets/adapters/next/templates/init/pages/login-page.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/media/media-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-page-content.tsx +31 -0
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-page-skeleton.tsx +9 -0
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-page.tsx +7 -27
- package/dist/assets/adapters/next/templates/init/pages/reset-password-form.tsx +8 -8
- package/dist/assets/adapters/next/templates/init/pages/reset-password-page-skeleton.tsx +3 -3
- package/dist/assets/adapters/next/templates/init/pages/reset-password-page.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-detail-drawer.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page.tsx +6 -5
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/form-notifications-drawer.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page.tsx +6 -5
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/delete-webhook-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-endpoint-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-page.tsx +6 -5
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page.tsx +6 -5
- package/dist/assets/adapters/next/templates/init/pages/users/change-password-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/create-user-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/edit-role-dialog.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/index.tsx +5 -30
- package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx +6 -28
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/removable-image-node/removable-image-node.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/gallery-field.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/ui/alert-dialog.tsx +6 -6
- package/dist/assets/shared-assets/react-admin/ui/alert.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/breadcrumb.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/calendar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/dialog.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/drawer.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/field.tsx +2 -4
- package/dist/assets/shared-assets/react-admin/ui/input.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/pagination.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/sheet.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sidebar.tsx +13 -63
- package/dist/assets/shared-assets/react-admin/ui/textarea.tsx +1 -1
- package/dist/cli.js +115 -90
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-mobile-toolbar.ts +0 -17
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-is-breakpoint.ts +0 -24
- package/dist/assets/adapters/next/templates/init/hooks/use-mobile.ts +0 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/mobile-toolbar-content.tsx +0 -56
|
@@ -5,16 +5,8 @@ import type { VariantProps } from 'class-variance-authority'
|
|
|
5
5
|
import { Button } from '@admin/components/ui/button'
|
|
6
6
|
import { Input } from '@admin/components/ui/input'
|
|
7
7
|
import { Separator } from '@admin/components/ui/separator'
|
|
8
|
-
import {
|
|
9
|
-
Sheet,
|
|
10
|
-
SheetContent,
|
|
11
|
-
SheetDescription,
|
|
12
|
-
SheetHeader,
|
|
13
|
-
SheetTitle
|
|
14
|
-
} from '@admin/components/ui/sheet'
|
|
15
8
|
import { Skeleton } from '@admin/components/ui/skeleton'
|
|
16
9
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@admin/components/ui/tooltip'
|
|
17
|
-
import { useIsMobile } from '@admin/hooks/use-mobile'
|
|
18
10
|
import { cn } from '@admin/utils/shared/cn'
|
|
19
11
|
import { mergeProps } from '@base-ui/react/merge-props'
|
|
20
12
|
import { useRender } from '@base-ui/react/use-render'
|
|
@@ -24,7 +16,6 @@ import { PanelLeftIcon } from 'lucide-react'
|
|
|
24
16
|
const SIDEBAR_COOKIE_NAME = 'sidebar_state'
|
|
25
17
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
26
18
|
const SIDEBAR_WIDTH = '16rem'
|
|
27
|
-
const SIDEBAR_WIDTH_MOBILE = '18rem'
|
|
28
19
|
const SIDEBAR_WIDTH_ICON = '3rem'
|
|
29
20
|
const SIDEBAR_KEYBOARD_SHORTCUT = 'b'
|
|
30
21
|
|
|
@@ -32,9 +23,6 @@ type SidebarContextProps = {
|
|
|
32
23
|
state: 'expanded' | 'collapsed'
|
|
33
24
|
open: boolean
|
|
34
25
|
setOpen: (open: boolean) => void
|
|
35
|
-
openMobile: boolean
|
|
36
|
-
setOpenMobile: (open: boolean) => void
|
|
37
|
-
isMobile: boolean
|
|
38
26
|
toggleSidebar: () => void
|
|
39
27
|
}
|
|
40
28
|
|
|
@@ -62,9 +50,6 @@ function SidebarProvider({
|
|
|
62
50
|
open?: boolean
|
|
63
51
|
onOpenChange?: (open: boolean) => void
|
|
64
52
|
}) {
|
|
65
|
-
const isMobile = useIsMobile()
|
|
66
|
-
const [openMobile, setOpenMobile] = React.useState(false)
|
|
67
|
-
|
|
68
53
|
// This is the internal state of the sidebar.
|
|
69
54
|
// We use openProp and setOpenProp for control from outside the component.
|
|
70
55
|
const [_open, _setOpen] = React.useState(defaultOpen)
|
|
@@ -86,8 +71,8 @@ function SidebarProvider({
|
|
|
86
71
|
|
|
87
72
|
// Helper to toggle the sidebar.
|
|
88
73
|
const toggleSidebar = React.useCallback(() => {
|
|
89
|
-
return
|
|
90
|
-
}, [
|
|
74
|
+
return setOpen((open) => !open)
|
|
75
|
+
}, [setOpen])
|
|
91
76
|
|
|
92
77
|
// Adds a keyboard shortcut to toggle the sidebar.
|
|
93
78
|
React.useEffect(() => {
|
|
@@ -111,12 +96,9 @@ function SidebarProvider({
|
|
|
111
96
|
state,
|
|
112
97
|
open,
|
|
113
98
|
setOpen,
|
|
114
|
-
isMobile,
|
|
115
|
-
openMobile,
|
|
116
|
-
setOpenMobile,
|
|
117
99
|
toggleSidebar
|
|
118
100
|
}),
|
|
119
|
-
[state, open, setOpen,
|
|
101
|
+
[state, open, setOpen, toggleSidebar]
|
|
120
102
|
)
|
|
121
103
|
|
|
122
104
|
return (
|
|
@@ -148,14 +130,13 @@ function Sidebar({
|
|
|
148
130
|
collapsible = 'offcanvas',
|
|
149
131
|
className,
|
|
150
132
|
children,
|
|
151
|
-
dir,
|
|
152
133
|
...props
|
|
153
134
|
}: React.ComponentProps<'div'> & {
|
|
154
135
|
side?: 'left' | 'right'
|
|
155
136
|
variant?: 'sidebar' | 'floating' | 'inset'
|
|
156
137
|
collapsible?: 'offcanvas' | 'icon' | 'none'
|
|
157
138
|
}) {
|
|
158
|
-
const {
|
|
139
|
+
const { state } = useSidebar()
|
|
159
140
|
|
|
160
141
|
if (collapsible === 'none') {
|
|
161
142
|
return (
|
|
@@ -172,35 +153,9 @@ function Sidebar({
|
|
|
172
153
|
)
|
|
173
154
|
}
|
|
174
155
|
|
|
175
|
-
if (isMobile) {
|
|
176
|
-
return (
|
|
177
|
-
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
|
178
|
-
<SheetContent
|
|
179
|
-
dir={dir}
|
|
180
|
-
data-sidebar="sidebar"
|
|
181
|
-
data-slot="sidebar"
|
|
182
|
-
data-mobile="true"
|
|
183
|
-
className="w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
|
|
184
|
-
style={
|
|
185
|
-
{
|
|
186
|
-
'--sidebar-width': SIDEBAR_WIDTH_MOBILE
|
|
187
|
-
} as React.CSSProperties
|
|
188
|
-
}
|
|
189
|
-
side={side}
|
|
190
|
-
>
|
|
191
|
-
<SheetHeader className="sr-only">
|
|
192
|
-
<SheetTitle>Sidebar</SheetTitle>
|
|
193
|
-
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
|
194
|
-
</SheetHeader>
|
|
195
|
-
<div className="flex h-full w-full flex-col">{children}</div>
|
|
196
|
-
</SheetContent>
|
|
197
|
-
</Sheet>
|
|
198
|
-
)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
156
|
return (
|
|
202
157
|
<div
|
|
203
|
-
className="group peer
|
|
158
|
+
className="group peer block text-sidebar-foreground"
|
|
204
159
|
data-state={state}
|
|
205
160
|
data-collapsible={state === 'collapsed' ? collapsible : ''}
|
|
206
161
|
data-variant={variant}
|
|
@@ -226,7 +181,7 @@ function Sidebar({
|
|
|
226
181
|
data-slot="sidebar-container"
|
|
227
182
|
data-side={side}
|
|
228
183
|
className={cn(
|
|
229
|
-
'fixed inset-y-0 z-10
|
|
184
|
+
'fixed inset-y-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
230
185
|
{
|
|
231
186
|
'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]':
|
|
232
187
|
variant === 'floating' || variant === 'inset',
|
|
@@ -283,7 +238,7 @@ function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
|
|
|
283
238
|
onClick={toggleSidebar}
|
|
284
239
|
title="Toggle Sidebar"
|
|
285
240
|
className={cn(
|
|
286
|
-
'absolute inset-y-0 z-20
|
|
241
|
+
'absolute inset-y-0 z-20 flex w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border ltr:-translate-x-1/2 rtl:-translate-x-1/2',
|
|
287
242
|
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
|
288
243
|
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
289
244
|
'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar',
|
|
@@ -301,7 +256,7 @@ function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {
|
|
|
301
256
|
<main
|
|
302
257
|
data-slot="sidebar-inset"
|
|
303
258
|
className={cn(
|
|
304
|
-
'relative flex w-full flex-1 flex-col bg-background
|
|
259
|
+
'relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',
|
|
305
260
|
className
|
|
306
261
|
)}
|
|
307
262
|
{...props}
|
|
@@ -412,7 +367,7 @@ function SidebarGroupAction({
|
|
|
412
367
|
props: mergeProps<'button'>(
|
|
413
368
|
{
|
|
414
369
|
className: cn(
|
|
415
|
-
'absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden
|
|
370
|
+
'absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
416
371
|
className
|
|
417
372
|
)
|
|
418
373
|
},
|
|
@@ -494,7 +449,7 @@ function SidebarMenuButton({
|
|
|
494
449
|
isActive?: boolean
|
|
495
450
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>
|
|
496
451
|
} & VariantProps<typeof sidebarMenuButtonVariants>) {
|
|
497
|
-
const {
|
|
452
|
+
const { state } = useSidebar()
|
|
498
453
|
const comp = useRender({
|
|
499
454
|
defaultTagName: 'button',
|
|
500
455
|
props: mergeProps<'button'>(
|
|
@@ -525,12 +480,7 @@ function SidebarMenuButton({
|
|
|
525
480
|
return (
|
|
526
481
|
<Tooltip>
|
|
527
482
|
{comp}
|
|
528
|
-
<TooltipContent
|
|
529
|
-
side="right"
|
|
530
|
-
align="center"
|
|
531
|
-
hidden={state !== 'collapsed' || isMobile}
|
|
532
|
-
{...tooltip}
|
|
533
|
-
/>
|
|
483
|
+
<TooltipContent side="right" align="center" hidden={state !== 'collapsed'} {...tooltip} />
|
|
534
484
|
</Tooltip>
|
|
535
485
|
)
|
|
536
486
|
}
|
|
@@ -549,9 +499,9 @@ function SidebarMenuAction({
|
|
|
549
499
|
props: mergeProps<'button'>(
|
|
550
500
|
{
|
|
551
501
|
className: cn(
|
|
552
|
-
'absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-2 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1
|
|
502
|
+
'absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-2 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
553
503
|
{
|
|
554
|
-
'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100
|
|
504
|
+
'opacity-0 group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100':
|
|
555
505
|
showOnHover
|
|
556
506
|
},
|
|
557
507
|
className
|
|
@@ -6,7 +6,7 @@ function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
|
|
|
6
6
|
<textarea
|
|
7
7
|
data-slot="textarea"
|
|
8
8
|
className={cn(
|
|
9
|
-
'flex field-sizing-content min-h-16 w-full resize-none rounded-xl border border-input bg-input/30 px-3 py-3 text-
|
|
9
|
+
'flex field-sizing-content min-h-16 w-full resize-none rounded-xl border border-input bg-input/30 px-3 py-3 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20',
|
|
10
10
|
className
|
|
11
11
|
)}
|
|
12
12
|
{...props}
|