@dyrected/admin 2.4.0 → 2.4.1
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/App.d.ts +1 -0
- package/dist/admin.css +2 -0
- package/dist/components/auth/auth-gate.d.ts +13 -0
- package/dist/components/error-boundary.d.ts +16 -0
- package/dist/components/forms/field-renderer.d.ts +22 -0
- package/dist/components/forms/fields/block-builder.d.ts +9 -0
- package/dist/components/forms/fields/date-picker.d.ts +8 -0
- package/dist/components/forms/fields/json-editor.d.ts +8 -0
- package/dist/components/forms/fields/media-picker.d.ts +12 -0
- package/dist/components/forms/fields/multi-select.d.ts +19 -0
- package/dist/components/forms/fields/radio-field.d.ts +8 -0
- package/dist/components/forms/fields/relationship-picker.d.ts +10 -0
- package/dist/components/forms/fields/rich-text-editor.d.ts +9 -0
- package/dist/components/forms/fields/select-field.d.ts +8 -0
- package/dist/components/forms/fields/switch-field.d.ts +6 -0
- package/dist/components/forms/fields/text-area-field.d.ts +8 -0
- package/dist/components/forms/fields/text-field.d.ts +8 -0
- package/dist/components/forms/form-engine.d.ts +14 -0
- package/dist/components/forms/form-field-renderer.d.ts +20 -0
- package/dist/components/forms/utils.d.ts +11 -0
- package/dist/components/layout/admin-shell.d.ts +5 -0
- package/dist/components/layout/branding-provider.d.ts +4 -0
- package/dist/components/live-preview/LivePreviewPane.d.ts +7 -0
- package/dist/components/media/focal-point-picker.d.ts +12 -0
- package/dist/components/media/media-card.d.ts +8 -0
- package/dist/components/media/media-grid.d.ts +8 -0
- package/dist/components/media/media-library-dialog.d.ts +11 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/command.d.ts +80 -0
- package/dist/components/ui/data-table.d.ts +14 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/page-header.d.ts +10 -0
- package/dist/components/ui/pagination.d.ts +11 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/render-cell.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-preferences.d.ts +6 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.mjs +69091 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/main.d.ts +0 -0
- package/dist/pages/auth/first-user-page.d.ts +4 -0
- package/dist/pages/auth/login-page.d.ts +4 -0
- package/dist/pages/collections/edit-page.d.ts +1 -0
- package/dist/pages/collections/list-page.d.ts +5 -0
- package/dist/pages/dashboard/dashboard.d.ts +1 -0
- package/dist/pages/globals/editor-page.d.ts +1 -0
- package/dist/pages/media/media-page.d.ts +4 -0
- package/dist/pages/setup/setup-prompt.d.ts +6 -0
- package/dist/providers/dyrected-provider.d.ts +29 -0
- package/dist/providers/query-provider.d.ts +3 -0
- package/package.json +6 -3
- package/CHANGELOG.md +0 -153
- package/components.json +0 -17
- package/eslint.config.js +0 -22
- package/index.html +0 -13
- package/postcss.config.js +0 -6
- package/scripts/prefix-tailwind-precision.py +0 -98
- package/scripts/prefix-tailwind.py +0 -67
- package/src/App.css +0 -184
- package/src/App.tsx +0 -25
- package/src/assets/dyrected.svg +0 -155
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +0 -1
- package/src/assets/vite.svg +0 -1
- package/src/components/auth/auth-gate.tsx +0 -64
- package/src/components/error-boundary.tsx +0 -45
- package/src/components/forms/field-renderer.tsx +0 -111
- package/src/components/forms/fields/block-builder.tsx +0 -213
- package/src/components/forms/fields/date-picker.tsx +0 -60
- package/src/components/forms/fields/json-editor.tsx +0 -62
- package/src/components/forms/fields/media-picker.tsx +0 -286
- package/src/components/forms/fields/multi-select.tsx +0 -145
- package/src/components/forms/fields/radio-field.tsx +0 -51
- package/src/components/forms/fields/relationship-picker.tsx +0 -143
- package/src/components/forms/fields/rich-text-editor.tsx +0 -224
- package/src/components/forms/fields/select-field.tsx +0 -35
- package/src/components/forms/fields/switch-field.tsx +0 -16
- package/src/components/forms/fields/text-area-field.tsx +0 -15
- package/src/components/forms/fields/text-field.tsx +0 -24
- package/src/components/forms/form-engine.tsx +0 -87
- package/src/components/forms/form-field-renderer.tsx +0 -269
- package/src/components/forms/utils.ts +0 -97
- package/src/components/layout/admin-shell.tsx +0 -479
- package/src/components/layout/branding-provider.tsx +0 -112
- package/src/components/live-preview/LivePreviewPane.tsx +0 -128
- package/src/components/media/focal-point-picker.tsx +0 -66
- package/src/components/media/media-card.tsx +0 -44
- package/src/components/media/media-grid.tsx +0 -32
- package/src/components/media/media-library-dialog.tsx +0 -465
- package/src/components/ui/aspect-ratio.tsx +0 -7
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -214
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/command.tsx +0 -151
- package/src/components/ui/data-table.tsx +0 -219
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/dropdown-menu.tsx +0 -200
- package/src/components/ui/form.tsx +0 -178
- package/src/components/ui/input.tsx +0 -24
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/page-header.tsx +0 -30
- package/src/components/ui/pagination.tsx +0 -57
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -26
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/render-cell.tsx +0 -110
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -160
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -27
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -117
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-preferences.ts +0 -56
- package/src/index.css +0 -111
- package/src/index.tsx +0 -198
- package/src/lib/utils.ts +0 -36
- package/src/main.tsx +0 -10
- package/src/pages/auth/first-user-page.tsx +0 -115
- package/src/pages/auth/login-page.tsx +0 -91
- package/src/pages/collections/edit-page.tsx +0 -280
- package/src/pages/collections/list-page.tsx +0 -343
- package/src/pages/dashboard/dashboard.tsx +0 -150
- package/src/pages/globals/editor-page.tsx +0 -122
- package/src/pages/media/media-page.tsx +0 -564
- package/src/pages/setup/setup-prompt.tsx +0 -181
- package/src/providers/dyrected-provider.tsx +0 -122
- package/src/providers/query-provider.tsx +0 -19
- package/src/types/jexl.d.ts +0 -11
- package/tailwind.config.ts +0 -103
- package/tsconfig.app.json +0 -28
- package/tsconfig.json +0 -12
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -39
- /package/{public → dist}/favicon.svg +0 -0
- /package/{public → dist}/icons.svg +0 -0
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { Database, Globe, ImageIcon, ArrowRight } from "lucide-react";
|
|
2
|
-
import { Link } from "react-router-dom";
|
|
3
|
-
import { useQuery, useQueries } from "@tanstack/react-query";
|
|
4
|
-
import { useDyrected } from "../../providers/dyrected-provider";
|
|
5
|
-
import { Button } from "../../components/ui/button";
|
|
6
|
-
|
|
7
|
-
export function Dashboard() {
|
|
8
|
-
const { client } = useDyrected();
|
|
9
|
-
|
|
10
|
-
const { data: schemas, isLoading: isLoadingSchemas } = useQuery({
|
|
11
|
-
queryKey: ["schemas"],
|
|
12
|
-
queryFn: () => client!.getSchemas(),
|
|
13
|
-
enabled: !!client,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const collections = (schemas?.collections || []).filter((c: any) => !c.admin?.hidden && !c.slug.startsWith('platform_'));
|
|
17
|
-
const globals = (schemas?.globals || []).filter((g: any) => !g.admin?.hidden && !g.slug.startsWith('platform_'));
|
|
18
|
-
|
|
19
|
-
const collectionCounts = useQueries({
|
|
20
|
-
queries: collections.map((col: any) => ({
|
|
21
|
-
queryKey: ["collection-count", col.slug],
|
|
22
|
-
queryFn: () => client!.find(col.slug, { limit: 1 }),
|
|
23
|
-
enabled: !!client && !!col.slug,
|
|
24
|
-
})),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (isLoadingSchemas) {
|
|
28
|
-
return (
|
|
29
|
-
<div className="dy-flex dy-items-center dy-justify-center dy-h-64">
|
|
30
|
-
<div className="dy-animate-spin dy-rounded-full dy-h-8 dy-w-8 dy-border-b-2 dy-border-primary"></div>
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// No schema yet — route to /setup
|
|
36
|
-
if (collections.length === 0 && globals.length === 0) {
|
|
37
|
-
return (
|
|
38
|
-
<div className="dy-flex dy-items-center dy-justify-center dy-h-64">
|
|
39
|
-
<div className="dy-text-center dy-space-y-4">
|
|
40
|
-
<p className="dy-text-muted-foreground">No collections configured yet.</p>
|
|
41
|
-
<Button asChild>
|
|
42
|
-
<Link to="/setup">View Integration Guide</Link>
|
|
43
|
-
</Button>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className="dy-space-y-8 dy-animate-in dy-fade-in dy-duration-500">
|
|
51
|
-
<div>
|
|
52
|
-
<h2 className="dy-text-2xl dy-font-semibold dy-tracking-tight">Overview</h2>
|
|
53
|
-
<p className="dy-text-muted-foreground">Monitor and manage your site's content and structure.</p>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div className="dy-grid dy-gap-6 md:dy-grid-cols-2 lg:dy-grid-cols-3">
|
|
57
|
-
<div className="dy-p-1 dy-space-y-2 dy-group dy-border dy-border-card">
|
|
58
|
-
<div className="dy-flex dy-items-center dy-gap-3">
|
|
59
|
-
<div className="dy-rounded-md dy-bg-primary/5 dy-p-1.5 dy-text-primary/60 dy-group-hover:dy-bg-primary/10 dy-group-hover:dy-text-primary dy-transition-colors">
|
|
60
|
-
<Database className="dy-h-4 dy-w-4" />
|
|
61
|
-
</div>
|
|
62
|
-
<h3 className="dy-text-[10px] dy-font-bold dy-text-muted-foreground/40 dy-uppercase dy-tracking-widest">Collections</h3>
|
|
63
|
-
</div>
|
|
64
|
-
<p className="dy-text-3xl dy-font-bold dy-tracking-tight">{collections.length}</p>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div className="dy-p-1 dy-space-y-2 dy-group dy-border dy-border-card">
|
|
68
|
-
<div className="dy-flex dy-items-center dy-gap-3">
|
|
69
|
-
<div className="dy-rounded-md dy-bg-secondary/5 dy-p-1.5 dy-text-muted-foreground/60 dy-group-hover:dy-bg-accent dy-group-hover:dy-text-foreground dy-transition-colors">
|
|
70
|
-
<Globe className="dy-h-4 dy-w-4" />
|
|
71
|
-
</div>
|
|
72
|
-
<h3 className="dy-text-[10px] dy-font-bold dy-text-muted-foreground/40 dy-uppercase dy-tracking-widest">Global Configs</h3>
|
|
73
|
-
</div>
|
|
74
|
-
<p className="dy-text-3xl dy-font-bold dy-tracking-tight">{globals.length}</p>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div className="dy-p-1 dy-space-y-2 dy-group dy-border dy-border-card">
|
|
78
|
-
<div className="dy-flex dy-items-center dy-gap-3">
|
|
79
|
-
<div className="dy-rounded-md dy-bg-accent dy-p-1.5 dy-text-muted-foreground/60 dy-group-hover:dy-bg-accent dy-group-hover:dy-text-foreground dy-transition-colors">
|
|
80
|
-
<ImageIcon className="dy-h-4 dy-w-4" />
|
|
81
|
-
</div>
|
|
82
|
-
<h3 className="dy-text-[10px] dy-font-bold dy-text-muted-foreground/40 dy-uppercase dy-tracking-widest">Media Files</h3>
|
|
83
|
-
</div>
|
|
84
|
-
<p className="dy-text-3xl dy-font-bold dy-tracking-tight">-</p>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div className="dy-grid dy-gap-8 md:dy-grid-cols-2">
|
|
89
|
-
<section >
|
|
90
|
-
<div className="dy-flex dy-items-center dy-justify-between dy-mb-4">
|
|
91
|
-
<h3 className="dy-text-lg dy-font-semibold dy-flex dy-items-center dy-gap-2">
|
|
92
|
-
<Database className="dy-h-5 dy-w-5 dy-text-primary" />
|
|
93
|
-
Collections
|
|
94
|
-
</h3>
|
|
95
|
-
{/* <Button variant="ghost" size="sm" asChild className="dy-text-xs">
|
|
96
|
-
<Link to="/collections">View All</Link>
|
|
97
|
-
</Button> */}
|
|
98
|
-
</div>
|
|
99
|
-
<div className="dy-space-y-1 dy-border dy-border-card">
|
|
100
|
-
{collections.map((col: any, idx: number) => (
|
|
101
|
-
<Link
|
|
102
|
-
key={col.slug}
|
|
103
|
-
to={`/collections/${col.slug}`}
|
|
104
|
-
className="dy-group dy-flex dy-items-center dy-justify-between dy-p-3 dy-rounded-md hover:dy-bg-primary/[0.02] dy-transition-colors"
|
|
105
|
-
>
|
|
106
|
-
<div>
|
|
107
|
-
<p className="dy-font-medium dy-group-hover:dy-text-primary dy-transition-colors">{col.labels?.plural || col.slug}</p>
|
|
108
|
-
<p className="dy-text-xs dy-text-muted-foreground dy-uppercase">{col.slug}</p>
|
|
109
|
-
</div>
|
|
110
|
-
<div className="dy-flex dy-items-center dy-gap-3">
|
|
111
|
-
<div className="dy-text-right dy-mr-4">
|
|
112
|
-
<p className="dy-text-sm dy-font-semibold">{collectionCounts[idx]?.data?.total || 0}</p>
|
|
113
|
-
<p className="dy-text-[10px] dy-text-muted-foreground dy-uppercase">Entries</p>
|
|
114
|
-
</div>
|
|
115
|
-
<ArrowRight className="dy-h-4 dy-w-4 dy-text-muted-foreground dy-group-hover:dy-text-primary dy-transition-transform dy-group-hover:dy-translate-x-0.5" />
|
|
116
|
-
</div>
|
|
117
|
-
</Link>
|
|
118
|
-
))}
|
|
119
|
-
</div>
|
|
120
|
-
</section>
|
|
121
|
-
|
|
122
|
-
<section>
|
|
123
|
-
<div className="dy-flex dy-items-center dy-justify-between dy-mb-4">
|
|
124
|
-
<h3 className="dy-text-lg dy-font-semibold dy-flex dy-items-center dy-gap-2">
|
|
125
|
-
<Globe className="dy-h-5 dy-w-5 dy-text-secondary-foreground" />
|
|
126
|
-
Global Settings
|
|
127
|
-
</h3>
|
|
128
|
-
</div>
|
|
129
|
-
<div className="dy-space-y-1 dy-border dy-border-card">
|
|
130
|
-
{globals.map((glb: any) => (
|
|
131
|
-
<Link
|
|
132
|
-
key={glb.slug}
|
|
133
|
-
to={`/globals/${glb.slug}`}
|
|
134
|
-
className="dy-group dy-flex dy-items-center dy-justify-between dy-p-3 dy-rounded-md hover:dy-bg-primary/[0.02] dy-transition-colors"
|
|
135
|
-
>
|
|
136
|
-
<div>
|
|
137
|
-
<p className="dy-font-medium dy-group-hover:dy-text-secondary-foreground dy-transition-colors">{glb.label || glb.slug}</p>
|
|
138
|
-
<p className="dy-text-xs dy-text-muted-foreground dy-uppercase">{glb.slug}</p>
|
|
139
|
-
</div>
|
|
140
|
-
<div className="dy-bg-secondary/10 dy-px-2 dy-py-1 dy-rounded dy-text-[10px] dy-font-bold dy-text-secondary-foreground dy-uppercase">
|
|
141
|
-
Global
|
|
142
|
-
</div>
|
|
143
|
-
</Link>
|
|
144
|
-
))}
|
|
145
|
-
</div>
|
|
146
|
-
</section>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"
|
|
2
|
-
import { toast } from "sonner"
|
|
3
|
-
import { useDyrected } from "../../providers/dyrected-provider"
|
|
4
|
-
import { FormEngine } from "../../components/forms/form-engine"
|
|
5
|
-
import { useParams } from "react-router-dom"
|
|
6
|
-
import { Globe, Save } from "lucide-react"
|
|
7
|
-
import { useState, useEffect } from "react"
|
|
8
|
-
import { Button } from "../../components/ui/button"
|
|
9
|
-
|
|
10
|
-
export function GlobalEditorPage() {
|
|
11
|
-
const { slug } = useParams()
|
|
12
|
-
const { client } = useDyrected()
|
|
13
|
-
const queryClient = useQueryClient()
|
|
14
|
-
const [isDirty, setIsDirty] = useState(false)
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const handleBeforeUnload = (e: BeforeUnloadEvent) => {
|
|
18
|
-
if (isDirty) {
|
|
19
|
-
e.preventDefault()
|
|
20
|
-
e.returnValue = ""
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
window.addEventListener("beforeunload", handleBeforeUnload)
|
|
24
|
-
return () => window.removeEventListener("beforeunload", handleBeforeUnload)
|
|
25
|
-
}, [isDirty])
|
|
26
|
-
|
|
27
|
-
// Fetch schema
|
|
28
|
-
const { data: schemas } = useQuery({
|
|
29
|
-
queryKey: ["schemas"],
|
|
30
|
-
queryFn: () => client!.getSchemas(),
|
|
31
|
-
enabled: !!client,
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
const schema = schemas?.globals.find((g: any) => g.slug === slug)
|
|
35
|
-
|
|
36
|
-
// Fetch global data
|
|
37
|
-
const { data: globalData, isLoading: isGlobalLoading } = useQuery({
|
|
38
|
-
queryKey: ["global", slug],
|
|
39
|
-
queryFn: () => client!.getGlobal(slug!),
|
|
40
|
-
enabled: !!client && !!slug,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
// Cmd+S to save
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const handleSave = (e: KeyboardEvent) => {
|
|
46
|
-
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
47
|
-
e.preventDefault()
|
|
48
|
-
document.getElementById('dyrected-form-submit')?.click()
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
window.addEventListener("keydown", handleSave)
|
|
52
|
-
return () => window.removeEventListener("keydown", handleSave)
|
|
53
|
-
}, [])
|
|
54
|
-
|
|
55
|
-
const saveMutation = useMutation({
|
|
56
|
-
mutationFn: (data: any) => {
|
|
57
|
-
return client!.updateGlobal(slug!, data)
|
|
58
|
-
},
|
|
59
|
-
onSuccess: () => {
|
|
60
|
-
setIsDirty(false)
|
|
61
|
-
queryClient.invalidateQueries({ queryKey: ["global", slug] })
|
|
62
|
-
toast.success(`${schema.label || schema.slug} updated successfully`)
|
|
63
|
-
},
|
|
64
|
-
onError: (error: any) => {
|
|
65
|
-
toast.error("Failed to update settings", {
|
|
66
|
-
description: error.message
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
if (!schema) return <div>Global schema not found for: {slug}</div>
|
|
72
|
-
if (isGlobalLoading) return <div>Loading global settings...</div>
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div className="dy-space-y-8 dy-max-w-5xl dy-mx-auto">
|
|
76
|
-
<div className="dy-flex dy-items-center dy-justify-between dy-gap-4 dy-border-b dy-border-border/50 dy-pb-6">
|
|
77
|
-
<div className="dy-flex dy-items-center dy-gap-4">
|
|
78
|
-
<div className="dy-p-2 dy-bg-primary/10 dy-text-primary dy-rounded-lg dy-shrink-0">
|
|
79
|
-
<Globe className="dy-h-5 dy-w-5" />
|
|
80
|
-
</div>
|
|
81
|
-
<div>
|
|
82
|
-
<h1 className="dy-text-lg dy-font-serif dy-font-bold dy-tracking-tight dy-text-foreground dy-truncate">
|
|
83
|
-
{schema.label || schema.slug}
|
|
84
|
-
</h1>
|
|
85
|
-
<p className="dy-text-[10px] dy-font-bold dy-uppercase dy-tracking-widest dy-text-muted-foreground/40 dy-leading-none dy-mt-1">
|
|
86
|
-
Global Configuration
|
|
87
|
-
</p>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div className="dy-flex dy-items-center dy-gap-2">
|
|
92
|
-
<Button
|
|
93
|
-
size="icon"
|
|
94
|
-
className="dy-h-9 dy-w-9 dy-rounded-lg dy-shadow-sm"
|
|
95
|
-
onClick={() => document.getElementById('dyrected-form-submit')?.click()}
|
|
96
|
-
disabled={saveMutation.isPending}
|
|
97
|
-
title="Save Changes (⌘S)"
|
|
98
|
-
>
|
|
99
|
-
{saveMutation.isPending ? (
|
|
100
|
-
<div className="dy-h-4 dy-w-4 dy-animate-spin dy-border-2 dy-border-current dy-border-t-transparent dy-rounded-full" />
|
|
101
|
-
) : (
|
|
102
|
-
<Save className="dy-h-4 dy-w-4" />
|
|
103
|
-
)}
|
|
104
|
-
</Button>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<div className="dy-animate-in dy-space-y-8 dy-pb-20">
|
|
109
|
-
<FormEngine
|
|
110
|
-
collection={slug!}
|
|
111
|
-
fields={schema.fields}
|
|
112
|
-
defaultValues={globalData || {}}
|
|
113
|
-
onSubmit={(data) => saveMutation.mutate(data)}
|
|
114
|
-
isLoading={saveMutation.isPending}
|
|
115
|
-
onChange={(dirty) => setIsDirty(dirty)}
|
|
116
|
-
submitLabel="Save Changes"
|
|
117
|
-
/>
|
|
118
|
-
<button id="dyrected-form-submit" type="submit" className="dy-hidden" />
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
)
|
|
122
|
-
}
|