betterstart-cli 0.0.107 → 0.0.109
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/admin-globals.css +2 -62
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-header.tsx +2 -19
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-providers.tsx +4 -7
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar-user-menu.tsx +0 -1
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table-pagination.tsx +3 -1
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/copyable-code-block.tsx +2 -5
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/dev-mode-code-mirror.tsx +4 -5
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/dev-mode-types.ts +0 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog-content.tsx +1 -0
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-pagination.tsx +3 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-url-importer.tsx +89 -78
- package/dist/assets/adapters/next/templates/init/components/shared/search-input.tsx +5 -1
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-source-mode.tsx +2 -11
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor.ts +1 -2
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-form.tsx +42 -37
- package/dist/assets/adapters/next/templates/init/pages/login-form.tsx +95 -71
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-form.tsx +7 -7
- package/dist/assets/adapters/next/templates/init/pages/reset-password-form.tsx +88 -69
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/form-notifications-drawer.tsx +1 -0
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-endpoint-dialog.tsx +26 -8
- package/dist/assets/adapters/next/templates/init/pages/users/change-password-dialog.tsx +8 -10
- package/dist/assets/adapters/next/templates/init/pages/users/create-user-dialog.tsx +8 -5
- package/dist/assets/adapters/next/templates/init/pages/users/delete-user-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/edit-role-dialog.tsx +76 -33
- package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/mobile-toolbar-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/selection-bubble-menu.tsx +1 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode.tsx +3 -15
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-bubble-menu.tsx +0 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/blockquote-button/blockquote-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/code-block-button/code-block-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-button/color-highlight-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-control-popover.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/mark-button/mark-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/undo-redo-button/undo-redo-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/avatar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/badge.tsx +5 -3
- package/dist/assets/shared-assets/react-admin/ui/button.tsx +4 -4
- package/dist/assets/shared-assets/react-admin/ui/calendar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/chart.tsx +5 -16
- package/dist/assets/shared-assets/react-admin/ui/checkbox.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/combobox.tsx +12 -2
- package/dist/assets/shared-assets/react-admin/ui/context-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/drawer.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/dropdown-menu.tsx +24 -21
- package/dist/assets/shared-assets/react-admin/ui/field.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/input-group.tsx +9 -3
- package/dist/assets/shared-assets/react-admin/ui/input-otp.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/input.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/kbd.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/menubar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/native-select.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/radio-group.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/select.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sonner.tsx +2 -5
- package/dist/assets/shared-assets/react-admin/ui/switch.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/tabs.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/ui/textarea.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/toggle.tsx +1 -1
- package/dist/{chunk-OYU73Q2W.js → chunk-PSDUGFMD.js} +2 -2
- package/dist/{chunk-OYU73Q2W.js.map → chunk-PSDUGFMD.js.map} +1 -1
- package/dist/cli.js +240 -193
- package/dist/cli.js.map +1 -1
- package/dist/{read-namespaced-template-EIH2NPDJ.js → read-namespaced-template-TSATYQPP.js} +2 -2
- package/package.json +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-admin-theme.tsx +0 -72
- package/dist/assets/adapters/next/templates/init/utils/theme/system.ts +0 -6
- /package/dist/{read-namespaced-template-EIH2NPDJ.js.map → read-namespaced-template-TSATYQPP.js.map} +0 -0
package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-endpoint-dialog.tsx
CHANGED
|
@@ -67,8 +67,6 @@ export function WebhookEndpointDialog({ webhook, open, onOpenChange }: WebhookEn
|
|
|
67
67
|
: [],
|
|
68
68
|
[subscriptions, webhook]
|
|
69
69
|
)
|
|
70
|
-
const [selectedEvents, setSelectedEvents] = React.useState<string[] | null>(null)
|
|
71
|
-
const events = selectedEvents ?? subscribedEvents
|
|
72
70
|
const [secret, setSecret] = React.useState<string | null>(null)
|
|
73
71
|
|
|
74
72
|
const formSources = webhookEventSources.filter((source) => source.kind === 'form')
|
|
@@ -83,6 +81,19 @@ export function WebhookEndpointDialog({ webhook, open, onOpenChange }: WebhookEn
|
|
|
83
81
|
events: subscribedEvents
|
|
84
82
|
}
|
|
85
83
|
})
|
|
84
|
+
const events = form.watch('events')
|
|
85
|
+
|
|
86
|
+
React.useEffect(() => {
|
|
87
|
+
if (!open) return
|
|
88
|
+
|
|
89
|
+
form.reset({
|
|
90
|
+
name: webhook?.name ?? '',
|
|
91
|
+
url: webhook?.url ?? '',
|
|
92
|
+
enabled: webhook?.enabled ?? true,
|
|
93
|
+
events: subscribedEvents
|
|
94
|
+
})
|
|
95
|
+
setSecret(null)
|
|
96
|
+
}, [form, open, subscribedEvents, webhook])
|
|
86
97
|
|
|
87
98
|
const saveMutation = useMutation({
|
|
88
99
|
mutationFn: async (values: EndpointFormValues) => {
|
|
@@ -92,8 +103,8 @@ export function WebhookEndpointDialog({ webhook, open, onOpenChange }: WebhookEn
|
|
|
92
103
|
enabled: values.enabled
|
|
93
104
|
}
|
|
94
105
|
const result = webhook
|
|
95
|
-
? await updateWebhook(webhook.id, { ...endpointValues, events })
|
|
96
|
-
: await createWebhook({ ...endpointValues, events })
|
|
106
|
+
? await updateWebhook(webhook.id, { ...endpointValues, events: values.events })
|
|
107
|
+
: await createWebhook({ ...endpointValues, events: values.events })
|
|
97
108
|
if (!result.success) {
|
|
98
109
|
throw new Error(result.error || 'Failed to save this webhook')
|
|
99
110
|
}
|
|
@@ -172,16 +183,23 @@ export function WebhookEndpointDialog({ webhook, open, onOpenChange }: WebhookEn
|
|
|
172
183
|
const isPending = saveMutation.isPending
|
|
173
184
|
|
|
174
185
|
function toggleEvent(event: string, checked: boolean) {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
186
|
+
const currentEvents = form.getValues('events')
|
|
187
|
+
const nextEvents = checked
|
|
188
|
+
? currentEvents.includes(event)
|
|
189
|
+
? currentEvents
|
|
190
|
+
: [...currentEvents, event]
|
|
191
|
+
: currentEvents.filter((entry) => entry !== event)
|
|
192
|
+
form.setValue('events', nextEvents, { shouldDirty: true, shouldValidate: true })
|
|
178
193
|
}
|
|
179
194
|
|
|
180
195
|
return (
|
|
181
196
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
182
197
|
<DialogContent className="sm:max-w-135">
|
|
183
198
|
<Form {...form}>
|
|
184
|
-
<form
|
|
199
|
+
<form
|
|
200
|
+
autoComplete="off"
|
|
201
|
+
onSubmit={form.handleSubmit((values) => saveMutation.mutate(values))}
|
|
202
|
+
>
|
|
185
203
|
<DialogHeader>
|
|
186
204
|
<DialogTitle>{isEdit ? `Edit webhook — ${webhook.name}` : 'Add webhook'}</DialogTitle>
|
|
187
205
|
<DialogDescription>
|
|
@@ -82,7 +82,7 @@ export function ChangePasswordDialog({
|
|
|
82
82
|
const form = useForm<ChangePasswordFormValues>({
|
|
83
83
|
resolver: standardSchemaResolver(isCurrentUser ? ownPasswordSchema : userPasswordSchema),
|
|
84
84
|
defaultValues,
|
|
85
|
-
mode: '
|
|
85
|
+
mode: 'onChange',
|
|
86
86
|
reValidateMode: 'onChange'
|
|
87
87
|
})
|
|
88
88
|
|
|
@@ -144,7 +144,10 @@ export function ChangePasswordDialog({
|
|
|
144
144
|
</DialogTrigger>
|
|
145
145
|
<DialogContent className="sm:max-w-135">
|
|
146
146
|
<Form {...form}>
|
|
147
|
-
<form
|
|
147
|
+
<form
|
|
148
|
+
autoComplete="off"
|
|
149
|
+
onSubmit={form.handleSubmit((values) => mutation.mutate(values))}
|
|
150
|
+
>
|
|
148
151
|
<DialogHeader>
|
|
149
152
|
<DialogTitle>Change Password</DialogTitle>
|
|
150
153
|
<DialogDescription>
|
|
@@ -166,7 +169,7 @@ export function ChangePasswordDialog({
|
|
|
166
169
|
<FormControl>
|
|
167
170
|
<Input
|
|
168
171
|
type="password"
|
|
169
|
-
autoComplete="
|
|
172
|
+
autoComplete="off"
|
|
170
173
|
disabled={isPending}
|
|
171
174
|
autoFocus
|
|
172
175
|
{...field}
|
|
@@ -186,7 +189,7 @@ export function ChangePasswordDialog({
|
|
|
186
189
|
<FormControl>
|
|
187
190
|
<Input
|
|
188
191
|
type="password"
|
|
189
|
-
autoComplete="
|
|
192
|
+
autoComplete="off"
|
|
190
193
|
disabled={isPending}
|
|
191
194
|
autoFocus={!isCurrentUser}
|
|
192
195
|
{...field}
|
|
@@ -204,12 +207,7 @@ export function ChangePasswordDialog({
|
|
|
204
207
|
<FormItem>
|
|
205
208
|
<FormLabel>Confirm Password</FormLabel>
|
|
206
209
|
<FormControl>
|
|
207
|
-
<Input
|
|
208
|
-
type="password"
|
|
209
|
-
autoComplete="new-password"
|
|
210
|
-
disabled={isPending}
|
|
211
|
-
{...field}
|
|
212
|
-
/>
|
|
210
|
+
<Input type="password" autoComplete="off" disabled={isPending} {...field} />
|
|
213
211
|
</FormControl>
|
|
214
212
|
<FormMessage />
|
|
215
213
|
</FormItem>
|
|
@@ -67,7 +67,7 @@ export function CreateUserDialog() {
|
|
|
67
67
|
const form = useForm<CreateUserFormValues>({
|
|
68
68
|
resolver: standardSchemaResolver(createUserSchema),
|
|
69
69
|
defaultValues,
|
|
70
|
-
mode: '
|
|
70
|
+
mode: 'onChange',
|
|
71
71
|
reValidateMode: 'onChange'
|
|
72
72
|
})
|
|
73
73
|
|
|
@@ -111,7 +111,10 @@ export function CreateUserDialog() {
|
|
|
111
111
|
<DialogTrigger render={<Button />}>Create User</DialogTrigger>
|
|
112
112
|
<DialogContent className="sm:max-w-135">
|
|
113
113
|
<Form {...form}>
|
|
114
|
-
<form
|
|
114
|
+
<form
|
|
115
|
+
autoComplete="off"
|
|
116
|
+
onSubmit={form.handleSubmit((values) => mutation.mutate(values))}
|
|
117
|
+
>
|
|
115
118
|
<DialogHeader>
|
|
116
119
|
<DialogTitle>Create User</DialogTitle>
|
|
117
120
|
<DialogDescription>Add a new user to the system</DialogDescription>
|
|
@@ -129,7 +132,7 @@ export function CreateUserDialog() {
|
|
|
129
132
|
<Input
|
|
130
133
|
type="email"
|
|
131
134
|
placeholder="user@example.com"
|
|
132
|
-
autoComplete="
|
|
135
|
+
autoComplete="off"
|
|
133
136
|
disabled={isPending}
|
|
134
137
|
{...field}
|
|
135
138
|
/>
|
|
@@ -148,7 +151,7 @@ export function CreateUserDialog() {
|
|
|
148
151
|
<Input
|
|
149
152
|
type="text"
|
|
150
153
|
placeholder="Full name"
|
|
151
|
-
autoComplete="
|
|
154
|
+
autoComplete="off"
|
|
152
155
|
disabled={isPending}
|
|
153
156
|
{...field}
|
|
154
157
|
/>
|
|
@@ -167,7 +170,7 @@ export function CreateUserDialog() {
|
|
|
167
170
|
<Input
|
|
168
171
|
type="password"
|
|
169
172
|
placeholder="Min 8 characters"
|
|
170
|
-
autoComplete="
|
|
173
|
+
autoComplete="off"
|
|
171
174
|
disabled={isPending}
|
|
172
175
|
{...field}
|
|
173
176
|
/>
|
|
@@ -118,7 +118,7 @@ export function DeleteUserDialog({ userId, userName, isCurrentUser }: DeleteUser
|
|
|
118
118
|
</AlertDialogTrigger>
|
|
119
119
|
<AlertDialogContent>
|
|
120
120
|
<Form {...form}>
|
|
121
|
-
<form onSubmit={form.handleSubmit(() => mutation.mutate())}>
|
|
121
|
+
<form autoComplete="off" onSubmit={form.handleSubmit(() => mutation.mutate())}>
|
|
122
122
|
<AlertDialogHeader>
|
|
123
123
|
<AlertDialogTitle>Delete account?</AlertDialogTitle>
|
|
124
124
|
<AlertDialogDescription>
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
DialogTitle,
|
|
13
13
|
DialogTrigger
|
|
14
14
|
} from '@admin/components/ui/dialog'
|
|
15
|
+
import { Form, FormControl, FormField, FormItem, FormMessage } from '@admin/components/ui/form'
|
|
15
16
|
import {
|
|
16
17
|
Select,
|
|
17
18
|
SelectContent,
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
import { Spinner } from '@admin/components/ui/spinner'
|
|
23
24
|
import { UserRole } from '@admin/types/auth'
|
|
24
25
|
import { useQueryClient } from '@tanstack/react-query'
|
|
26
|
+
import { useForm } from 'react-hook-form'
|
|
25
27
|
import { toast } from 'sonner'
|
|
26
28
|
|
|
27
29
|
interface EditRoleDialogProps {
|
|
@@ -31,19 +33,32 @@ interface EditRoleDialogProps {
|
|
|
31
33
|
children: React.ReactNode
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
interface EditRoleFormValues {
|
|
37
|
+
role: UserRole
|
|
38
|
+
}
|
|
39
|
+
|
|
34
40
|
export function EditRoleDialog({ userId, currentRole, userName, children }: EditRoleDialogProps) {
|
|
35
41
|
const [open, setOpen] = React.useState(false)
|
|
36
|
-
const [role, setRole] = React.useState(currentRole)
|
|
37
42
|
const [isPending, startTransition] = React.useTransition()
|
|
38
43
|
const queryClient = useQueryClient()
|
|
44
|
+
const form = useForm<EditRoleFormValues>({
|
|
45
|
+
defaultValues: {
|
|
46
|
+
role: currentRole as UserRole
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
form.reset({ role: currentRole as UserRole })
|
|
52
|
+
}, [currentRole, form])
|
|
39
53
|
|
|
40
|
-
const handleSave = () => {
|
|
54
|
+
const handleSave = (values: EditRoleFormValues) => {
|
|
41
55
|
startTransition(async () => {
|
|
42
56
|
try {
|
|
43
|
-
const result = await updateUserRole(userId, role
|
|
57
|
+
const result = await updateUserRole(userId, values.role)
|
|
44
58
|
if (result.success) {
|
|
45
59
|
toast.success(`Role updated for ${userName}`)
|
|
46
60
|
queryClient.refetchQueries({ queryKey: ['users'] })
|
|
61
|
+
form.reset(values)
|
|
47
62
|
setOpen(false)
|
|
48
63
|
} else {
|
|
49
64
|
toast.error(result.error || 'Failed to update role')
|
|
@@ -54,41 +69,69 @@ export function EditRoleDialog({ userId, currentRole, userName, children }: Edit
|
|
|
54
69
|
})
|
|
55
70
|
}
|
|
56
71
|
|
|
72
|
+
function handleOpenChange(nextOpen: boolean) {
|
|
73
|
+
setOpen(nextOpen)
|
|
74
|
+
|
|
75
|
+
if (!nextOpen) {
|
|
76
|
+
form.reset({ role: currentRole as UserRole })
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
57
80
|
return (
|
|
58
|
-
<Dialog open={open} onOpenChange={
|
|
81
|
+
<Dialog open={open} onOpenChange={handleOpenChange}>
|
|
59
82
|
<DialogTrigger render={children as React.ReactElement} />
|
|
60
83
|
<DialogContent className="sm:max-w-87.5">
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
84
|
+
<Form {...form}>
|
|
85
|
+
<form autoComplete="off" onSubmit={form.handleSubmit(handleSave)}>
|
|
86
|
+
<DialogHeader>
|
|
87
|
+
<DialogTitle>Edit Role</DialogTitle>
|
|
88
|
+
<DialogDescription>Change the role for {userName}</DialogDescription>
|
|
89
|
+
</DialogHeader>
|
|
65
90
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
91
|
+
<div className="p-2">
|
|
92
|
+
<FormField
|
|
93
|
+
control={form.control}
|
|
94
|
+
name="role"
|
|
95
|
+
render={({ field }) => (
|
|
96
|
+
<FormItem>
|
|
97
|
+
<Select value={field.value} onValueChange={field.onChange} disabled={isPending}>
|
|
98
|
+
<FormControl>
|
|
99
|
+
<SelectTrigger className="w-full">
|
|
100
|
+
<SelectValue />
|
|
101
|
+
</SelectTrigger>
|
|
102
|
+
</FormControl>
|
|
103
|
+
<SelectContent>
|
|
104
|
+
<SelectItem value={UserRole.ADMIN}>Admin</SelectItem>
|
|
105
|
+
<SelectItem value={UserRole.EDITOR}>Editor</SelectItem>
|
|
106
|
+
<SelectItem value={UserRole.MEMBER}>Member</SelectItem>
|
|
107
|
+
</SelectContent>
|
|
108
|
+
</Select>
|
|
109
|
+
<FormMessage />
|
|
110
|
+
</FormItem>
|
|
111
|
+
)}
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
78
114
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
115
|
+
<DialogFooter>
|
|
116
|
+
<Button
|
|
117
|
+
type="button"
|
|
118
|
+
variant="outline"
|
|
119
|
+
onClick={() => setOpen(false)}
|
|
120
|
+
disabled={isPending}
|
|
121
|
+
>
|
|
122
|
+
Cancel
|
|
123
|
+
</Button>
|
|
124
|
+
<Button
|
|
125
|
+
type="submit"
|
|
126
|
+
disabled={isPending || !form.formState.isDirty}
|
|
127
|
+
aria-busy={isPending}
|
|
128
|
+
>
|
|
129
|
+
{isPending && <Spinner />}
|
|
130
|
+
{isPending ? 'Saving Role…' : 'Save Role'}
|
|
131
|
+
</Button>
|
|
132
|
+
</DialogFooter>
|
|
133
|
+
</form>
|
|
134
|
+
</Form>
|
|
92
135
|
</DialogContent>
|
|
93
136
|
</Dialog>
|
|
94
137
|
)
|
package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx
CHANGED
|
@@ -49,7 +49,7 @@ export function MainToolbarContent({
|
|
|
49
49
|
<UndoRedoButton action="redo" />
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
|
-
<Separator orientation="vertical"
|
|
52
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
53
53
|
|
|
54
54
|
<div className="flex items-center gap-0.5">
|
|
55
55
|
<HeadingDropdownMenu />
|
|
@@ -59,7 +59,7 @@ export function MainToolbarContent({
|
|
|
59
59
|
<HorizontalRuleButton editor={editor} />
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
|
-
<Separator orientation="vertical"
|
|
62
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
63
63
|
|
|
64
64
|
<div className="flex items-center gap-0.5">
|
|
65
65
|
<MarkButton type="bold" />
|
|
@@ -75,7 +75,7 @@ export function MainToolbarContent({
|
|
|
75
75
|
{!isMobile ? <LinkPopover /> : <LinkButton onClick={onLinkClick} />}
|
|
76
76
|
</div>
|
|
77
77
|
|
|
78
|
-
<Separator orientation="vertical"
|
|
78
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
79
79
|
|
|
80
80
|
<div className="flex items-center">
|
|
81
81
|
<TableButton editor={editor} />
|
package/dist/assets/shared-assets/react-admin/custom/content-editor/mobile-toolbar-content.tsx
CHANGED
|
@@ -38,7 +38,7 @@ export function MobileToolbarContent({
|
|
|
38
38
|
</Button>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
<Separator orientation="vertical"
|
|
41
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
42
42
|
|
|
43
43
|
{type === 'highlighter' ? (
|
|
44
44
|
<ColorHighlightPopoverContent />
|
package/dist/assets/shared-assets/react-admin/custom/content-editor/selection-bubble-menu.tsx
CHANGED
|
@@ -117,11 +117,7 @@ export function SelectionBubbleMenu({ editor }: { editor: Editor }) {
|
|
|
117
117
|
/>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
|
-
<Separator
|
|
121
|
-
orientation="vertical"
|
|
122
|
-
decorative
|
|
123
|
-
className="mx-1 my-auto h-[65%] self-center"
|
|
124
|
-
/>
|
|
120
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
125
121
|
|
|
126
122
|
<div className="flex items-center gap-0.5">
|
|
127
123
|
<MarkButton editor={editor} type="bold" />
|
|
@@ -152,11 +152,7 @@ export function SourceMode({
|
|
|
152
152
|
</Button>
|
|
153
153
|
</div>
|
|
154
154
|
|
|
155
|
-
<Separator
|
|
156
|
-
orientation="vertical"
|
|
157
|
-
decorative
|
|
158
|
-
className="mx-1 my-auto h-[65%] self-center"
|
|
159
|
-
/>
|
|
155
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
160
156
|
|
|
161
157
|
<div className="flex items-center gap-0.5">
|
|
162
158
|
<SourceModeDropdownButton
|
|
@@ -234,11 +230,7 @@ export function SourceMode({
|
|
|
234
230
|
</Button>
|
|
235
231
|
</div>
|
|
236
232
|
|
|
237
|
-
<Separator
|
|
238
|
-
orientation="vertical"
|
|
239
|
-
decorative
|
|
240
|
-
className="mx-1 my-auto h-[65%] self-center"
|
|
241
|
-
/>
|
|
233
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
242
234
|
|
|
243
235
|
<div className="flex items-center gap-0.5">
|
|
244
236
|
{[
|
|
@@ -300,11 +292,7 @@ export function SourceMode({
|
|
|
300
292
|
/>
|
|
301
293
|
</div>
|
|
302
294
|
|
|
303
|
-
<Separator
|
|
304
|
-
orientation="vertical"
|
|
305
|
-
decorative
|
|
306
|
-
className="mx-1 my-auto h-[65%] self-center"
|
|
307
|
-
/>
|
|
295
|
+
<Separator orientation="vertical" className="mx-1 my-auto h-[65%] self-center" />
|
|
308
296
|
|
|
309
297
|
<div className="flex items-center">
|
|
310
298
|
<TableButton disabled={disabled} onInsertTable={insertTable} />
|
|
@@ -230,7 +230,6 @@ export function TableBubbleMenu({ editor }: { editor: Editor }) {
|
|
|
230
230
|
</div>
|
|
231
231
|
<Separator
|
|
232
232
|
orientation="vertical"
|
|
233
|
-
decorative
|
|
234
233
|
className="mx-1 my-auto h-5 w-px self-center bg-border opacity-100"
|
|
235
234
|
/>
|
|
236
235
|
<div className="flex items-center gap-0.5">
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
4
|
import type { UseBlockquoteConfig } from '@admin/hooks/content-editor/use-blockquote'
|
|
5
|
+
import type { BaseUIEvent } from '@base-ui/react'
|
|
5
6
|
import { Button } from '@admin/components/ui/button'
|
|
6
7
|
import { useBlockquote } from '@admin/hooks/content-editor/use-blockquote'
|
|
7
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
@@ -48,7 +49,7 @@ export function BlockquoteButton({
|
|
|
48
49
|
)
|
|
49
50
|
|
|
50
51
|
const handleClick = useCallback(
|
|
51
|
-
(event: React.MouseEvent<HTMLButtonElement
|
|
52
|
+
(event: BaseUIEvent<React.MouseEvent<HTMLButtonElement>>) => {
|
|
52
53
|
onClick?.(event)
|
|
53
54
|
if (event.defaultPrevented) return
|
|
54
55
|
handleToggle()
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
4
|
import type { UseCodeBlockConfig } from '@admin/hooks/content-editor/use-code-block'
|
|
5
|
+
import type { BaseUIEvent } from '@base-ui/react'
|
|
5
6
|
import { Button } from '@admin/components/ui/button'
|
|
6
7
|
import { useCodeBlock } from '@admin/hooks/content-editor/use-code-block'
|
|
7
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
@@ -46,7 +47,7 @@ export function CodeBlockButton({
|
|
|
46
47
|
})
|
|
47
48
|
|
|
48
49
|
const handleClick = useCallback(
|
|
49
|
-
(event: React.MouseEvent<HTMLButtonElement
|
|
50
|
+
(event: BaseUIEvent<React.MouseEvent<HTMLButtonElement>>) => {
|
|
50
51
|
onClick?.(event)
|
|
51
52
|
if (event.defaultPrevented) return
|
|
52
53
|
handleToggle()
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
4
|
import type { UseColorHighlightConfig } from '@admin/hooks/content-editor/use-color-highlight'
|
|
5
|
+
import type { BaseUIEvent } from '@base-ui/react'
|
|
5
6
|
import { Button } from '@admin/components/ui/button'
|
|
6
7
|
import { useColorHighlight } from '@admin/hooks/content-editor/use-color-highlight'
|
|
7
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
@@ -59,7 +60,7 @@ export function ColorHighlightButton({
|
|
|
59
60
|
})
|
|
60
61
|
|
|
61
62
|
const handleClick = useCallback(
|
|
62
|
-
(event: React.MouseEvent<HTMLButtonElement
|
|
63
|
+
(event: BaseUIEvent<React.MouseEvent<HTMLButtonElement>>) => {
|
|
63
64
|
onClick?.(event)
|
|
64
65
|
if (event.defaultPrevented) return
|
|
65
66
|
handleColorHighlight()
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type * as React from 'react'
|
|
4
4
|
import type { LinkButtonProps } from './link-button'
|
|
5
5
|
import type { LinkMainProps } from './link-main'
|
|
6
|
+
import type { BaseUIEvent } from '@base-ui/react'
|
|
6
7
|
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
7
8
|
import { LinkIcon } from 'lucide-react'
|
|
8
9
|
import { useCallback, useState } from 'react'
|
|
@@ -52,7 +53,7 @@ export function LinkControlPopover({
|
|
|
52
53
|
}, [handleOnOpenChange, setLink])
|
|
53
54
|
|
|
54
55
|
const handleClick = useCallback(
|
|
55
|
-
(event: React.MouseEvent<HTMLButtonElement
|
|
56
|
+
(event: BaseUIEvent<React.MouseEvent<HTMLButtonElement>>) => {
|
|
56
57
|
onClick?.(event)
|
|
57
58
|
if (event.defaultPrevented) return
|
|
58
59
|
handleOnOpenChange(!isOpen)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
4
|
import type { UseMarkConfig } from '@admin/hooks/content-editor/use-mark'
|
|
5
|
+
import type { BaseUIEvent } from '@base-ui/react'
|
|
5
6
|
import { Button } from '@admin/components/ui/button'
|
|
6
7
|
import { useMark } from '@admin/hooks/content-editor/use-mark'
|
|
7
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
@@ -48,7 +49,7 @@ export function MarkButton({
|
|
|
48
49
|
})
|
|
49
50
|
|
|
50
51
|
const handleClick = useCallback(
|
|
51
|
-
(event: React.MouseEvent<HTMLButtonElement
|
|
52
|
+
(event: BaseUIEvent<React.MouseEvent<HTMLButtonElement>>) => {
|
|
52
53
|
onClick?.(event)
|
|
53
54
|
if (event.defaultPrevented) return
|
|
54
55
|
handleMark()
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
4
|
import type { UseUndoRedoConfig } from '@admin/hooks/content-editor/use-undo-redo'
|
|
5
|
+
import type { BaseUIEvent } from '@base-ui/react'
|
|
5
6
|
import { Button } from '@admin/components/ui/button'
|
|
6
7
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
7
8
|
import { useUndoRedo } from '@admin/hooks/content-editor/use-undo-redo'
|
|
@@ -48,7 +49,7 @@ export function UndoRedoButton({
|
|
|
48
49
|
})
|
|
49
50
|
|
|
50
51
|
const handleClick = useCallback(
|
|
51
|
-
(event: React.MouseEvent<HTMLButtonElement
|
|
52
|
+
(event: BaseUIEvent<React.MouseEvent<HTMLButtonElement>>) => {
|
|
52
53
|
onClick?.(event)
|
|
53
54
|
if (event.defaultPrevented) return
|
|
54
55
|
handleAction()
|
|
@@ -16,7 +16,7 @@ function Avatar({
|
|
|
16
16
|
data-slot="avatar"
|
|
17
17
|
data-size={size}
|
|
18
18
|
className={cn(
|
|
19
|
-
'group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6
|
|
19
|
+
'group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6',
|
|
20
20
|
className
|
|
21
21
|
)}
|
|
22
22
|
{...props}
|
|
@@ -5,17 +5,19 @@ import { useRender } from '@base-ui/react/use-render'
|
|
|
5
5
|
import { cva } from 'class-variance-authority'
|
|
6
6
|
|
|
7
7
|
const badgeVariants = cva(
|
|
8
|
-
'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20
|
|
8
|
+
'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
13
13
|
secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
|
|
14
14
|
destructive:
|
|
15
|
-
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20
|
|
15
|
+
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 [a]:hover:bg-destructive/20',
|
|
16
|
+
success:
|
|
17
|
+
'bg-emerald-500/10 text-emerald-700 focus-visible:ring-emerald-500/20 [a]:hover:bg-emerald-500/20',
|
|
16
18
|
outline:
|
|
17
19
|
'border-border bg-input/30 text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
18
|
-
ghost: 'hover:bg-muted hover:text-muted-foreground
|
|
20
|
+
ghost: 'hover:bg-muted hover:text-muted-foreground',
|
|
19
21
|
link: 'text-primary underline-offset-4 hover:underline'
|
|
20
22
|
}
|
|
21
23
|
},
|
|
@@ -4,7 +4,7 @@ import { Button as ButtonPrimitive } from '@base-ui/react/button'
|
|
|
4
4
|
import { cva } from 'class-variance-authority'
|
|
5
5
|
|
|
6
6
|
const buttonVariants = cva(
|
|
7
|
-
"group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20
|
|
7
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -14,11 +14,11 @@ const buttonVariants = cva(
|
|
|
14
14
|
secondary:
|
|
15
15
|
'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
16
16
|
ghost:
|
|
17
|
-
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground
|
|
17
|
+
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
18
18
|
destructive:
|
|
19
|
-
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20
|
|
19
|
+
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20',
|
|
20
20
|
warning:
|
|
21
|
-
'border-warning/20 bg-warning/10 text-warning hover:bg-warning/15 focus-visible:border-warning/40 focus-visible:ring-warning/15
|
|
21
|
+
'border-warning/20 bg-warning/10 text-warning hover:bg-warning/15 focus-visible:border-warning/40 focus-visible:ring-warning/15 [&_svg]:text-warning',
|
|
22
22
|
link: 'text-primary underline-offset-4 hover:underline'
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
@@ -176,7 +176,7 @@ function CalendarDayButton({
|
|
|
176
176
|
data-range-end={modifiers.range_end}
|
|
177
177
|
data-range-middle={modifiers.range_middle}
|
|
178
178
|
className={cn(
|
|
179
|
-
'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground
|
|
179
|
+
'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground [&>span]:text-xs [&>span]:opacity-70',
|
|
180
180
|
defaultClassNames.day,
|
|
181
181
|
className
|
|
182
182
|
)}
|