@dyrected/admin 2.0.0 → 2.4.0
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/CHANGELOG.md +46 -0
- package/package.json +4 -4
- package/scripts/prefix-tailwind-precision.py +98 -0
- package/scripts/prefix-tailwind.py +67 -0
- package/src/components/auth/auth-gate.tsx +4 -4
- package/src/components/error-boundary.tsx +4 -4
- package/src/components/forms/fields/block-builder.tsx +24 -24
- package/src/components/forms/fields/date-picker.tsx +7 -7
- package/src/components/forms/fields/json-editor.tsx +5 -5
- package/src/components/forms/fields/media-picker.tsx +39 -39
- package/src/components/forms/fields/multi-select.tsx +12 -12
- package/src/components/forms/fields/radio-field.tsx +8 -8
- package/src/components/forms/fields/relationship-picker.tsx +13 -13
- package/src/components/forms/fields/rich-text-editor.tsx +22 -22
- package/src/components/forms/fields/select-field.tsx +3 -3
- package/src/components/forms/form-engine.tsx +3 -3
- package/src/components/forms/form-field-renderer.tsx +37 -37
- package/src/components/layout/admin-shell.tsx +60 -60
- package/src/components/live-preview/LivePreviewPane.tsx +14 -14
- package/src/components/media/focal-point-picker.tsx +9 -9
- package/src/components/media/media-card.tsx +10 -10
- package/src/components/media/media-grid.tsx +3 -3
- package/src/components/media/media-library-dialog.tsx +105 -105
- package/src/components/ui/badge.tsx +5 -5
- package/src/components/ui/button.tsx +11 -11
- package/src/components/ui/calendar.tsx +36 -36
- package/src/components/ui/card.tsx +6 -6
- package/src/components/ui/checkbox.tsx +3 -3
- package/src/components/ui/command.tsx +12 -12
- package/src/components/ui/data-table.tsx +18 -18
- package/src/components/ui/dialog.tsx +9 -9
- package/src/components/ui/dropdown-menu.tsx +16 -16
- package/src/components/ui/form.tsx +4 -4
- package/src/components/ui/input.tsx +3 -3
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/page-header.tsx +6 -6
- package/src/components/ui/pagination.tsx +6 -6
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +2 -2
- package/src/components/ui/radio-group.tsx +4 -4
- package/src/components/ui/render-cell.tsx +16 -16
- package/src/components/ui/scroll-area.tsx +6 -6
- package/src/components/ui/select.tsx +14 -14
- package/src/components/ui/separator.tsx +2 -2
- package/src/components/ui/sheet.tsx +13 -13
- package/src/components/ui/sidebar.tsx +60 -60
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/sonner.tsx +1 -1
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +7 -7
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle.tsx +6 -6
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/index.css +27 -27
- package/src/index.tsx +4 -4
- package/src/lib/utils.ts +7 -3
- package/src/pages/auth/first-user-page.tsx +18 -18
- package/src/pages/auth/login-page.tsx +14 -14
- package/src/pages/collections/edit-page.tsx +37 -37
- package/src/pages/collections/list-page.tsx +23 -23
- package/src/pages/dashboard/dashboard.tsx +49 -49
- package/src/pages/globals/editor-page.tsx +13 -13
- package/src/pages/media/media-page.tsx +106 -106
- package/src/pages/setup/setup-prompt.tsx +73 -44
- package/tailwind.config.ts +1 -0
- package/vite.config.ts +0 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "lucide-react";
|
|
10
10
|
import { cn } from "../../lib/utils";
|
|
11
11
|
import { Button } from "../../components/ui/button";
|
|
12
|
-
import { generateAIPrompt, type SetupPromptConfig } from "@dyrected/
|
|
12
|
+
import { generateAIPrompt, generateFreshSetupPrompt, type SetupPromptConfig } from "@dyrected/sdk";
|
|
13
13
|
|
|
14
14
|
export type { SetupPromptConfig };
|
|
15
15
|
|
|
@@ -19,9 +19,12 @@ export interface SetupPromptProps {
|
|
|
19
19
|
|
|
20
20
|
export function SetupPromptUI({ config }: SetupPromptProps) {
|
|
21
21
|
const [copied, setCopied] = useState<string | null>(null);
|
|
22
|
+
const [isFresh, setIsFresh] = useState(false);
|
|
22
23
|
const [activeTab, setActiveTab] = useState<"next" | "nuxt" | "react" | "vue">("next");
|
|
23
24
|
|
|
24
|
-
const promptText =
|
|
25
|
+
const promptText = isFresh
|
|
26
|
+
? generateFreshSetupPrompt(activeTab, config)
|
|
27
|
+
: generateAIPrompt(activeTab, config);
|
|
25
28
|
|
|
26
29
|
const copyToClipboard = (text: string, id: string) => {
|
|
27
30
|
navigator.clipboard.writeText(text);
|
|
@@ -30,52 +33,54 @@ export function SetupPromptUI({ config }: SetupPromptProps) {
|
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
return (
|
|
33
|
-
<div className="max-w-4xl mx-auto space-y-8 py-8 animate-in slide-in-from-bottom-4 duration-700">
|
|
34
|
-
<div className="text-center space-y-4">
|
|
35
|
-
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 text-primary text-xs font-bold uppercase tracking-wider mb-2">
|
|
36
|
-
<Sparkles className="h-3 w-3" />
|
|
36
|
+
<div className="dy-max-w-4xl dy-mx-auto dy-space-y-8 dy-py-8 dy-animate-in dy-slide-in-from-bottom-4 dy-duration-700">
|
|
37
|
+
<div className="dy-text-center dy-space-y-4">
|
|
38
|
+
<div className="dy-inline-flex dy-items-center dy-gap-2 dy-px-3 dy-py-1 dy-rounded-full dy-bg-primary/10 dy-text-primary dy-text-xs dy-font-bold dy-uppercase dy-tracking-wider dy-mb-2">
|
|
39
|
+
<Sparkles className="dy-h-3 dy-w-3" />
|
|
37
40
|
Integration Guide
|
|
38
41
|
</div>
|
|
39
|
-
<h1 className="text-2xl font-semibold tracking-tight lg:text-5xl text-foreground">
|
|
42
|
+
<h1 className="dy-text-2xl dy-font-semibold dy-tracking-tight lg:dy-text-5xl dy-text-foreground">
|
|
40
43
|
Connect Your Application
|
|
41
44
|
</h1>
|
|
42
|
-
<p className="text-lg text-muted-foreground max-w-2xl mx-auto">
|
|
43
|
-
|
|
45
|
+
<p className="dy-text-lg dy-text-muted-foreground dy-max-w-2xl dy-mx-auto">
|
|
46
|
+
{isFresh
|
|
47
|
+
? "Get a conversational walkthrough to set up Dyrected from scratch."
|
|
48
|
+
: "Use the AI prompt below to set up your frontend automatically, or follow the steps manually."}
|
|
44
49
|
</p>
|
|
45
50
|
</div>
|
|
46
51
|
|
|
47
|
-
<div className="grid gap-6">
|
|
52
|
+
<div className="dy-grid dy-gap-6">
|
|
48
53
|
{/* Site Credentials */}
|
|
49
|
-
<section className="rounded-2xl border bg-card overflow-hidden shadow-xl">
|
|
50
|
-
<div className="p-4 border-b bg-muted/30">
|
|
51
|
-
<h3 className="text-lg font-semibold flex items-center gap-2">
|
|
52
|
-
<ShieldCheck className="h-5 w-5 text-primary" />
|
|
54
|
+
<section className="dy-rounded-2xl dy-border dy-bg-card dy-overflow-hidden dy-shadow-xl">
|
|
55
|
+
<div className="dy-p-4 dy-border-b dy-bg-muted/30">
|
|
56
|
+
<h3 className="dy-text-lg dy-font-semibold dy-flex dy-items-center dy-gap-2">
|
|
57
|
+
<ShieldCheck className="dy-h-5 dy-w-5 dy-text-primary" />
|
|
53
58
|
Site Credentials
|
|
54
59
|
</h3>
|
|
55
60
|
</div>
|
|
56
|
-
<div className="p-4">
|
|
57
|
-
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
61
|
+
<div className="dy-p-4">
|
|
62
|
+
<div className="dy-grid dy-gap-4 sm:dy-grid-cols-2 lg:dy-grid-cols-3">
|
|
58
63
|
{[
|
|
59
64
|
{ label: "Site ID", value: config.siteId, id: "siteId" },
|
|
60
65
|
{ label: "API Key", value: config.apiKey, id: "apiKey" },
|
|
61
66
|
{ label: "Base URL", value: config.baseUrl, id: "baseUrl" },
|
|
62
67
|
].map((item) => (
|
|
63
|
-
<div key={item.id} className="space-y-2">
|
|
64
|
-
<label className="text-xs font-bold text-muted-foreground uppercase">
|
|
68
|
+
<div key={item.id} className="dy-space-y-2">
|
|
69
|
+
<label className="dy-text-xs dy-font-bold dy-text-muted-foreground dy-uppercase">
|
|
65
70
|
{item.label}
|
|
66
71
|
</label>
|
|
67
|
-
<div className="relative group">
|
|
68
|
-
<div className="p-3 pr-10 rounded-lg bg-muted text-sm font-mono truncate border border-transparent group-hover:border-primary/20 transition-all">
|
|
72
|
+
<div className="dy-relative dy-group">
|
|
73
|
+
<div className="dy-p-3 dy-pr-10 dy-rounded-lg dy-bg-muted dy-text-sm dy-font-mono dy-truncate dy-border dy-border-transparent dy-group-hover:dy-border-primary/20 dy-transition-all">
|
|
69
74
|
{item.value}
|
|
70
75
|
</div>
|
|
71
76
|
<button
|
|
72
77
|
onClick={() => copyToClipboard(item.value || "", item.id)}
|
|
73
|
-
className="absolute right-2 top-1/2
|
|
78
|
+
className="dy-absolute dy-right-2 dy-top-1/2 dy--translate-y-1/2 dy-p-1.5 dy-rounded-md hover:dy-bg-background dy-transition-colors dy-text-muted-foreground"
|
|
74
79
|
>
|
|
75
80
|
{copied === item.id ? (
|
|
76
|
-
<Check className="h-4 w-4 text-green-500" />
|
|
81
|
+
<Check className="dy-h-4 dy-w-4 dy-text-green-500" />
|
|
77
82
|
) : (
|
|
78
|
-
<Copy className="h-4 w-4" />
|
|
83
|
+
<Copy className="dy-h-4 dy-w-4" />
|
|
79
84
|
)}
|
|
80
85
|
</button>
|
|
81
86
|
</div>
|
|
@@ -86,64 +91,88 @@ export function SetupPromptUI({ config }: SetupPromptProps) {
|
|
|
86
91
|
</section>
|
|
87
92
|
|
|
88
93
|
{/* AI Prompt */}
|
|
89
|
-
<section className="rounded-2xl border bg-white overflow-hidden shadow-xl ring-1 ring-primary/20">
|
|
90
|
-
<div className="p-6 border-b bg-primary/5 flex items-center justify-between gap-4 flex-wrap">
|
|
91
|
-
<div className="space-y-3">
|
|
92
|
-
<h3 className="text-lg font-semibold flex items-center gap-2">
|
|
93
|
-
<Sparkles className="h-5 w-5 text-primary animate-pulse" />
|
|
94
|
+
<section className="dy-rounded-2xl dy-border dy-bg-white dy-overflow-hidden dy-shadow-xl dy-ring-1 dy-ring-primary/20">
|
|
95
|
+
<div className="dy-p-6 dy-border-b dy-bg-primary/5 dy-flex dy-items-center dy-justify-between dy-gap-4 dy-flex-wrap">
|
|
96
|
+
<div className="dy-space-y-3">
|
|
97
|
+
<h3 className="dy-text-lg dy-font-semibold dy-flex dy-items-center dy-gap-2">
|
|
98
|
+
<Sparkles className="dy-h-5 dy-w-5 dy-text-primary dy-animate-pulse" />
|
|
94
99
|
AI Integration Prompt
|
|
95
100
|
</h3>
|
|
96
|
-
<div className="flex gap-2 bg-muted/50 p-1 rounded-lg w-fit">
|
|
101
|
+
<div className="dy-flex dy-gap-2 dy-bg-muted/50 dy-p-1 dy-rounded-lg dy-w-fit">
|
|
97
102
|
{(["next", "nuxt", "react", "vue"] as const).map((tab) => (
|
|
98
103
|
<button
|
|
99
104
|
key={tab}
|
|
100
105
|
onClick={() => setActiveTab(tab)}
|
|
101
106
|
className={cn(
|
|
102
|
-
"px-4 py-1.5 rounded-md text-xs font-medium transition-all capitalize",
|
|
107
|
+
"dy-px-4 dy-py-1.5 dy-rounded-md dy-text-xs dy-font-medium dy-transition-all dy-capitalize",
|
|
103
108
|
activeTab === tab
|
|
104
|
-
? "bg-background text-foreground shadow-sm"
|
|
105
|
-
: "text-muted-foreground hover:text-foreground"
|
|
109
|
+
? "dy-bg-background dy-text-foreground dy-shadow-sm"
|
|
110
|
+
: "dy-text-muted-foreground hover:dy-text-foreground"
|
|
106
111
|
)}
|
|
107
112
|
>
|
|
108
|
-
{tab === "next" ? "Next.js" : tab === "nuxt" ? "Nuxt" : tab}
|
|
113
|
+
{tab === "next" ? "Next.js" : tab === "nuxt" ? "Nuxt.js" : tab}
|
|
109
114
|
</button>
|
|
110
115
|
))}
|
|
111
116
|
</div>
|
|
112
|
-
<
|
|
117
|
+
<div className="dy-flex dy-gap-2 dy-bg-muted/50 dy-p-1 dy-rounded-lg dy-w-fit">
|
|
118
|
+
<button
|
|
119
|
+
onClick={() => setIsFresh(false)}
|
|
120
|
+
className={cn(
|
|
121
|
+
"dy-px-4 dy-py-1.5 dy-rounded-md dy-text-xs dy-font-medium dy-transition-all",
|
|
122
|
+
!isFresh
|
|
123
|
+
? "dy-bg-background dy-text-foreground dy-shadow-sm"
|
|
124
|
+
: "dy-text-muted-foreground hover:dy-text-foreground"
|
|
125
|
+
)}
|
|
126
|
+
>
|
|
127
|
+
Existing Project
|
|
128
|
+
</button>
|
|
129
|
+
<button
|
|
130
|
+
onClick={() => setIsFresh(true)}
|
|
131
|
+
className={cn(
|
|
132
|
+
"dy-px-4 dy-py-1.5 dy-rounded-md dy-text-xs dy-font-medium dy-transition-all",
|
|
133
|
+
isFresh
|
|
134
|
+
? "dy-bg-background dy-text-foreground dy-shadow-sm"
|
|
135
|
+
: "dy-text-muted-foreground hover:dy-text-foreground"
|
|
136
|
+
)}
|
|
137
|
+
>
|
|
138
|
+
Fresh Installation
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
<p className="dy-text-sm dy-text-muted-foreground">
|
|
113
142
|
Copy and paste this into your AI developer to handle everything automatically
|
|
114
143
|
</p>
|
|
115
144
|
</div>
|
|
116
145
|
<Button
|
|
117
146
|
onClick={() => copyToClipboard(promptText, "ai-developer")}
|
|
118
|
-
className="relative overflow-hidden group shrink-0"
|
|
147
|
+
className="dy-relative dy-overflow-hidden dy-group dy-shrink-0"
|
|
119
148
|
>
|
|
120
|
-
<div className="flex items-center gap-2">
|
|
149
|
+
<div className="dy-flex dy-items-center dy-gap-2">
|
|
121
150
|
{copied === "ai-developer" ? (
|
|
122
|
-
<Check className="h-4 w-4" />
|
|
151
|
+
<Check className="dy-h-4 dy-w-4" />
|
|
123
152
|
) : (
|
|
124
|
-
<Copy className="h-4 w-4" />
|
|
153
|
+
<Copy className="dy-h-4 dy-w-4" />
|
|
125
154
|
)}
|
|
126
155
|
{copied === "ai-developer" ? "Copied!" : "Copy Full Prompt"}
|
|
127
156
|
</div>
|
|
128
157
|
</Button>
|
|
129
158
|
</div>
|
|
130
|
-
<div className="p-6 bg-slate-950 text-slate-300 font-mono text-xs leading-relaxed max-h-[400px] overflow-y-auto scrollbar-thin scrollbar-thumb-white/10">
|
|
131
|
-
<pre className="whitespace-pre-wrap">{promptText}</pre>
|
|
159
|
+
<div className="dy-p-6 dy-bg-slate-950 dy-text-slate-300 dy-font-mono dy-text-xs dy-leading-relaxed dy-max-h-[400px] dy-overflow-y-auto dy-scrollbar-thin dy-scrollbar-thumb-white/10">
|
|
160
|
+
<pre className="dy-whitespace-pre-wrap">{promptText}</pre>
|
|
132
161
|
</div>
|
|
133
162
|
</section>
|
|
134
163
|
</div>
|
|
135
164
|
|
|
136
|
-
<div className="flex justify-center gap-4 pt-4">
|
|
165
|
+
<div className="dy-flex dy-justify-center dy-gap-4 dy-pt-4">
|
|
137
166
|
<Button variant="outline" asChild>
|
|
138
167
|
<a
|
|
139
168
|
href={`${config.baseUrl}/api/docs`}
|
|
140
169
|
target="_blank"
|
|
141
170
|
rel="noopener noreferrer"
|
|
142
|
-
className="flex items-center gap-2"
|
|
171
|
+
className="dy-flex dy-items-center dy-gap-2"
|
|
143
172
|
>
|
|
144
|
-
<Terminal className="h-4 w-4" />
|
|
173
|
+
<Terminal className="dy-h-4 dy-w-4" />
|
|
145
174
|
API Documentation
|
|
146
|
-
<ExternalLink className="h-3 w-3" />
|
|
175
|
+
<ExternalLink className="dy-h-3 dy-w-3" />
|
|
147
176
|
</a>
|
|
148
177
|
</Button>
|
|
149
178
|
</div>
|
package/tailwind.config.ts
CHANGED