@actuate-media/cms-admin 0.49.0 → 0.49.3
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 +34 -0
- package/dist/AdminRoot.d.ts.map +1 -1
- package/dist/AdminRoot.js +10 -11
- package/dist/AdminRoot.js.map +1 -1
- package/dist/__tests__/components/modal.render.test.d.ts +2 -0
- package/dist/__tests__/components/modal.render.test.d.ts.map +1 -0
- package/dist/__tests__/components/modal.render.test.js +37 -0
- package/dist/__tests__/components/modal.render.test.js.map +1 -0
- package/dist/actuate-admin.css +1 -1
- package/dist/components/FolderTree.js +19 -19
- package/dist/components/FolderTree.js.map +1 -1
- package/dist/components/MediaPickerModal.d.ts +1 -1
- package/dist/components/MediaPickerModal.d.ts.map +1 -1
- package/dist/components/MediaPickerModal.js +12 -11
- package/dist/components/MediaPickerModal.js.map +1 -1
- package/dist/components/SchedulePublishDialog.d.ts +1 -1
- package/dist/components/SchedulePublishDialog.d.ts.map +1 -1
- package/dist/components/SchedulePublishDialog.js +6 -4
- package/dist/components/SchedulePublishDialog.js.map +1 -1
- package/dist/components/SharePreviewLinkDialog.d.ts +1 -1
- package/dist/components/SharePreviewLinkDialog.d.ts.map +1 -1
- package/dist/components/SharePreviewLinkDialog.js +10 -9
- package/dist/components/SharePreviewLinkDialog.js.map +1 -1
- package/dist/components/VersionHistory.d.ts +1 -1
- package/dist/components/VersionHistory.d.ts.map +1 -1
- package/dist/components/VersionHistory.js +14 -14
- package/dist/components/VersionHistory.js.map +1 -1
- package/dist/components/ui/Modal.d.ts +17 -1
- package/dist/components/ui/Modal.d.ts.map +1 -1
- package/dist/components/ui/Modal.js +16 -15
- package/dist/components/ui/Modal.js.map +1 -1
- package/dist/fields/BlockBuilderField.d.ts.map +1 -1
- package/dist/fields/BlockBuilderField.js +6 -4
- package/dist/fields/BlockBuilderField.js.map +1 -1
- package/dist/views/MediaBrowser.d.ts.map +1 -1
- package/dist/views/MediaBrowser.js +16 -16
- package/dist/views/MediaBrowser.js.map +1 -1
- package/dist/views/Pages/PagesListView.d.ts.map +1 -1
- package/dist/views/Pages/PagesListView.js +3 -3
- package/dist/views/Pages/PagesListView.js.map +1 -1
- package/dist/views/Posts/PostsListView.d.ts.map +1 -1
- package/dist/views/Posts/PostsListView.js +3 -3
- package/dist/views/Posts/PostsListView.js.map +1 -1
- package/dist/views/Redirects.d.ts.map +1 -1
- package/dist/views/Redirects.js +7 -7
- package/dist/views/Redirects.js.map +1 -1
- package/dist/views/ScriptTagEditor.js +4 -4
- package/dist/views/ScriptTagEditor.js.map +1 -1
- package/dist/views/ScriptTags.d.ts.map +1 -1
- package/dist/views/ScriptTags.js +5 -5
- package/dist/views/ScriptTags.js.map +1 -1
- package/dist/views/page-builder/AIGenerateDialog.d.ts +1 -1
- package/dist/views/page-builder/AIGenerateDialog.d.ts.map +1 -1
- package/dist/views/page-builder/AIGenerateDialog.js +23 -23
- package/dist/views/page-builder/AIGenerateDialog.js.map +1 -1
- package/package.json +1 -1
- package/src/AdminRoot.tsx +35 -30
- package/src/__tests__/components/modal.render.test.tsx +57 -0
- package/src/components/FolderTree.tsx +32 -32
- package/src/components/MediaPickerModal.tsx +143 -119
- package/src/components/SchedulePublishDialog.tsx +118 -93
- package/src/components/SharePreviewLinkDialog.tsx +115 -93
- package/src/components/VersionHistory.tsx +98 -82
- package/src/components/ui/Modal.tsx +48 -39
- package/src/fields/BlockBuilderField.tsx +26 -19
- package/src/views/MediaBrowser.tsx +128 -120
- package/src/views/Pages/PagesListView.tsx +123 -115
- package/src/views/Posts/PostsListView.tsx +114 -110
- package/src/views/Redirects.tsx +48 -44
- package/src/views/ScriptTagEditor.tsx +40 -40
- package/src/views/ScriptTags.tsx +34 -30
- package/src/views/page-builder/AIGenerateDialog.tsx +347 -335
package/src/views/ScriptTags.tsx
CHANGED
|
@@ -30,9 +30,9 @@ const PLACEMENT_LABELS: Record<string, string> = {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const PLACEMENT_COLORS: Record<string, string> = {
|
|
33
|
-
head: 'bg-
|
|
34
|
-
body_open: 'bg-
|
|
35
|
-
body_close: 'bg-
|
|
33
|
+
head: 'bg-accent text-accent-foreground',
|
|
34
|
+
body_open: 'bg-primary/15 text-primary',
|
|
35
|
+
body_close: 'bg-success/15 text-success',
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function scopeLabel(tag: ScriptTag): string {
|
|
@@ -73,7 +73,7 @@ export function ScriptTags({ onNavigate }: ScriptTagsProps) {
|
|
|
73
73
|
if (loading) {
|
|
74
74
|
return (
|
|
75
75
|
<div className="flex h-64 items-center justify-center p-3 pr-6 sm:p-4 sm:pr-8">
|
|
76
|
-
<Loader2 className="h-6 w-6 animate-spin
|
|
76
|
+
<Loader2 className="text-primary h-6 w-6 animate-spin" />
|
|
77
77
|
</div>
|
|
78
78
|
)
|
|
79
79
|
}
|
|
@@ -81,12 +81,12 @@ export function ScriptTags({ onNavigate }: ScriptTagsProps) {
|
|
|
81
81
|
return (
|
|
82
82
|
<div className="p-3 pr-6 sm:p-4 sm:pr-8">
|
|
83
83
|
{error && (
|
|
84
|
-
<div className="mb-4 flex items-center gap-3 rounded-lg border
|
|
85
|
-
<AlertTriangle className="h-5 w-5 shrink-0
|
|
86
|
-
<span className="flex-1 text-sm
|
|
84
|
+
<div className="border-destructive/30 bg-destructive/10 mb-4 flex items-center gap-3 rounded-lg border p-3">
|
|
85
|
+
<AlertTriangle className="text-destructive h-5 w-5 shrink-0" />
|
|
86
|
+
<span className="text-destructive flex-1 text-sm">{error}</span>
|
|
87
87
|
<button
|
|
88
88
|
onClick={refetch}
|
|
89
|
-
className="rounded-lg border
|
|
89
|
+
className="border-destructive/40 text-destructive hover:bg-destructive/15 rounded-lg border px-3 py-1 text-sm transition-colors"
|
|
90
90
|
>
|
|
91
91
|
Retry
|
|
92
92
|
</button>
|
|
@@ -95,15 +95,15 @@ export function ScriptTags({ onNavigate }: ScriptTagsProps) {
|
|
|
95
95
|
|
|
96
96
|
<div className="mb-4 flex items-center justify-between">
|
|
97
97
|
<div>
|
|
98
|
-
<h1 className="mb-1 text-2xl font-semibold
|
|
99
|
-
<p className="text-
|
|
98
|
+
<h1 className="text-foreground mb-1 text-2xl font-semibold">Script Tags</h1>
|
|
99
|
+
<p className="text-muted-foreground text-sm">
|
|
100
100
|
Manage tracking codes, analytics, and custom scripts injected into your site
|
|
101
101
|
</p>
|
|
102
102
|
</div>
|
|
103
103
|
<button
|
|
104
104
|
type="button"
|
|
105
105
|
onClick={() => onNavigate?.('/script-tags/new')}
|
|
106
|
-
className="flex items-center gap-2 rounded-lg
|
|
106
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors"
|
|
107
107
|
>
|
|
108
108
|
<Plus className="h-4 w-4" />
|
|
109
109
|
New Tag
|
|
@@ -111,67 +111,71 @@ export function ScriptTags({ onNavigate }: ScriptTagsProps) {
|
|
|
111
111
|
</div>
|
|
112
112
|
|
|
113
113
|
{tags.length === 0 && !error ? (
|
|
114
|
-
<div className="
|
|
115
|
-
<Code2 className="mx-auto mb-3 h-10 w-10
|
|
116
|
-
<h3 className="text-sm font-semibold
|
|
117
|
-
<p className="mt-1 text-sm
|
|
114
|
+
<div className="border-border bg-card rounded-lg border p-12 text-center">
|
|
115
|
+
<Code2 className="text-muted-foreground mx-auto mb-3 h-10 w-10" />
|
|
116
|
+
<h3 className="text-foreground text-sm font-semibold">No script tags yet</h3>
|
|
117
|
+
<p className="text-muted-foreground mt-1 text-sm">
|
|
118
118
|
Add tracking codes like Google Analytics, Tag Manager, or Facebook Pixel.
|
|
119
119
|
</p>
|
|
120
120
|
<button
|
|
121
121
|
type="button"
|
|
122
122
|
onClick={() => onNavigate?.('/script-tags/new')}
|
|
123
|
-
className="mt-4 inline-flex items-center gap-2 rounded-lg
|
|
123
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 mt-4 inline-flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors"
|
|
124
124
|
>
|
|
125
125
|
<Plus className="h-4 w-4" />
|
|
126
126
|
Add Your First Tag
|
|
127
127
|
</button>
|
|
128
128
|
</div>
|
|
129
129
|
) : (
|
|
130
|
-
<div className="overflow-hidden rounded-lg border
|
|
130
|
+
<div className="border-border bg-card overflow-hidden rounded-lg border">
|
|
131
131
|
<table className="w-full text-sm">
|
|
132
132
|
<thead>
|
|
133
|
-
<tr className="border-
|
|
134
|
-
<th className="px-4 py-3 text-left font-medium
|
|
135
|
-
<th className="px-4 py-3 text-left font-medium
|
|
136
|
-
<th className="px-4 py-3 text-left font-medium
|
|
137
|
-
<th className="px-4 py-3 text-center font-medium
|
|
138
|
-
|
|
133
|
+
<tr className="border-border bg-muted border-b">
|
|
134
|
+
<th className="text-muted-foreground px-4 py-3 text-left font-medium">Name</th>
|
|
135
|
+
<th className="text-muted-foreground px-4 py-3 text-left font-medium">Placement</th>
|
|
136
|
+
<th className="text-muted-foreground px-4 py-3 text-left font-medium">Scope</th>
|
|
137
|
+
<th className="text-muted-foreground px-4 py-3 text-center font-medium">
|
|
138
|
+
Priority
|
|
139
|
+
</th>
|
|
140
|
+
<th className="text-muted-foreground px-4 py-3 text-center font-medium">Enabled</th>
|
|
139
141
|
</tr>
|
|
140
142
|
</thead>
|
|
141
143
|
<tbody>
|
|
142
144
|
{tags.map((tag) => (
|
|
143
145
|
<tr
|
|
144
146
|
key={tag.id}
|
|
145
|
-
className="border-
|
|
147
|
+
className="border-border hover:bg-muted border-b transition-colors last:border-0"
|
|
146
148
|
>
|
|
147
149
|
<td className="px-4 py-3">
|
|
148
150
|
<button
|
|
149
151
|
type="button"
|
|
150
152
|
onClick={() => onNavigate?.(`/script-tags/${tag.id}`)}
|
|
151
|
-
className="
|
|
153
|
+
className="text-primary hover:text-primary/80 font-medium hover:underline"
|
|
152
154
|
>
|
|
153
155
|
{tag.name}
|
|
154
156
|
</button>
|
|
155
157
|
</td>
|
|
156
158
|
<td className="px-4 py-3">
|
|
157
159
|
<span
|
|
158
|
-
className={`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${PLACEMENT_COLORS[tag.placement] ?? 'bg-
|
|
160
|
+
className={`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${PLACEMENT_COLORS[tag.placement] ?? 'bg-muted text-foreground'}`}
|
|
159
161
|
>
|
|
160
162
|
{PLACEMENT_LABELS[tag.placement] ?? tag.placement}
|
|
161
163
|
</span>
|
|
162
164
|
</td>
|
|
163
|
-
<td className="px-4 py-3
|
|
164
|
-
<td className="px-4 py-3 text-center font-mono
|
|
165
|
+
<td className="text-muted-foreground px-4 py-3">{scopeLabel(tag)}</td>
|
|
166
|
+
<td className="text-muted-foreground px-4 py-3 text-center font-mono">
|
|
167
|
+
{tag.priority}
|
|
168
|
+
</td>
|
|
165
169
|
<td className="px-4 py-3 text-center">
|
|
166
170
|
<button
|
|
167
171
|
type="button"
|
|
168
172
|
onClick={() => toggleEnabled(tag)}
|
|
169
173
|
disabled={togglingId === tag.id}
|
|
170
|
-
className={`relative h-6 w-11 shrink-0 rounded-full transition-colors ${tag.enabled ? 'bg-
|
|
174
|
+
className={`relative h-6 w-11 shrink-0 rounded-full transition-colors ${tag.enabled ? 'bg-primary' : 'bg-switch-background'}`}
|
|
171
175
|
aria-pressed={tag.enabled}
|
|
172
176
|
>
|
|
173
177
|
<span
|
|
174
|
-
className={`absolute top-0.5 block h-5 w-5 rounded-full
|
|
178
|
+
className={`bg-card absolute top-0.5 block h-5 w-5 rounded-full transition-transform ${
|
|
175
179
|
tag.enabled ? 'translate-x-[22px]' : 'translate-x-0.5'
|
|
176
180
|
}`}
|
|
177
181
|
/>
|