@actuate-media/cms-admin 0.72.3 → 0.73.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 +6 -0
- package/dist/__tests__/components/resizable-aside.test.d.ts +2 -0
- package/dist/__tests__/components/resizable-aside.test.d.ts.map +1 -0
- package/dist/__tests__/components/resizable-aside.test.js +77 -0
- package/dist/__tests__/components/resizable-aside.test.js.map +1 -0
- package/dist/actuate-admin.css +1 -1
- package/dist/components/ui/ResizableAside.d.ts +38 -0
- package/dist/components/ui/ResizableAside.d.ts.map +1 -0
- package/dist/components/ui/ResizableAside.js +209 -0
- package/dist/components/ui/ResizableAside.js.map +1 -0
- package/dist/views/page-editor/PageSectionEditor.js +1 -1
- package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
- package/dist/views/page-editor/SectionInspector.d.ts.map +1 -1
- package/dist/views/page-editor/SectionInspector.js +7 -2
- package/dist/views/page-editor/SectionInspector.js.map +1 -1
- package/dist/views/post-editor/PostHeaderPanel.d.ts.map +1 -1
- package/dist/views/post-editor/PostHeaderPanel.js +2 -1
- package/dist/views/post-editor/PostHeaderPanel.js.map +1 -1
- package/dist/views/post-editor/PostSectionEditor.js +1 -1
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
- package/dist/views/post-editor/PostTemplateEditor.js +1 -1
- package/dist/views/post-editor/PostTemplateEditor.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/components/resizable-aside.test.tsx +130 -0
- package/src/components/ui/ResizableAside.tsx +317 -0
- package/src/views/page-editor/PageSectionEditor.tsx +1 -1
- package/src/views/page-editor/SectionInspector.tsx +31 -25
- package/src/views/post-editor/PostHeaderPanel.tsx +15 -11
- package/src/views/post-editor/PostSectionEditor.tsx +1 -1
- package/src/views/post-editor/PostTemplateEditor.tsx +1 -1
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '@dnd-kit/sortable'
|
|
20
20
|
import { CSS } from '@dnd-kit/utilities'
|
|
21
21
|
import { MediaPickerModal } from '../../components/MediaPickerModal.js'
|
|
22
|
+
import { InspectorExpandButton, ResizableAside } from '../../components/ui/ResizableAside.js'
|
|
22
23
|
import { Toggle } from '../../components/ui/Toggle.js'
|
|
23
24
|
import { RichTextField } from '../../fields/RichTextField.js'
|
|
24
25
|
import type { PageSection } from '../../lib/page-editor-service.js'
|
|
@@ -46,6 +47,29 @@ interface SectionInspectorProps {
|
|
|
46
47
|
const LABEL = 'text-foreground mb-1 block text-xs font-medium'
|
|
47
48
|
const INPUT =
|
|
48
49
|
'border-input bg-input-background text-foreground focus-visible:ring-ring w-full rounded-md border px-2.5 py-1.5 text-sm focus-visible:ring-2 focus-visible:outline-none'
|
|
50
|
+
const INSPECTOR_SHELL = 'bg-card border-border flex h-full flex-col border-l'
|
|
51
|
+
|
|
52
|
+
function InspectorHeaderActions({
|
|
53
|
+
onClose,
|
|
54
|
+
closeLabel = 'Close inspector',
|
|
55
|
+
}: {
|
|
56
|
+
onClose: () => void
|
|
57
|
+
closeLabel?: string
|
|
58
|
+
}) {
|
|
59
|
+
return (
|
|
60
|
+
<div className="flex shrink-0 items-center gap-0.5">
|
|
61
|
+
<InspectorExpandButton />
|
|
62
|
+
<button
|
|
63
|
+
type="button"
|
|
64
|
+
onClick={onClose}
|
|
65
|
+
aria-label={closeLabel}
|
|
66
|
+
className="text-muted-foreground hover:text-foreground hover:bg-accent flex h-9 w-9 items-center justify-center rounded-md md:h-7 md:w-7"
|
|
67
|
+
>
|
|
68
|
+
<X className="h-4 w-4" aria-hidden />
|
|
69
|
+
</button>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
49
73
|
|
|
50
74
|
export function SectionInspector({
|
|
51
75
|
section,
|
|
@@ -80,24 +104,17 @@ export function SectionInspector({
|
|
|
80
104
|
// editable controls, so the externally-managed content is never altered here.
|
|
81
105
|
if (section.unmanaged) {
|
|
82
106
|
return (
|
|
83
|
-
<
|
|
107
|
+
<ResizableAside
|
|
84
108
|
role="dialog"
|
|
85
109
|
aria-label={`${section.name} (read-only)`}
|
|
86
|
-
className=
|
|
110
|
+
className={INSPECTOR_SHELL}
|
|
87
111
|
>
|
|
88
112
|
<div className="border-border flex items-center justify-between border-b px-4 py-3">
|
|
89
113
|
<div className="min-w-0">
|
|
90
114
|
<h2 className="text-foreground truncate text-sm font-medium">{section.name}</h2>
|
|
91
115
|
<p className="text-muted-foreground text-xs">Managed outside the editor</p>
|
|
92
116
|
</div>
|
|
93
|
-
<
|
|
94
|
-
type="button"
|
|
95
|
-
onClick={onClose}
|
|
96
|
-
aria-label="Close inspector"
|
|
97
|
-
className="text-muted-foreground hover:text-foreground hover:bg-accent rounded p-1"
|
|
98
|
-
>
|
|
99
|
-
<X className="h-4 w-4" aria-hidden />
|
|
100
|
-
</button>
|
|
117
|
+
<InspectorHeaderActions onClose={onClose} />
|
|
101
118
|
</div>
|
|
102
119
|
<div className="flex-1 space-y-3 overflow-y-auto p-4">
|
|
103
120
|
<div className="border-border bg-muted text-muted-foreground space-y-2 rounded-md border p-3 text-sm">
|
|
@@ -119,29 +136,18 @@ export function SectionInspector({
|
|
|
119
136
|
</p>
|
|
120
137
|
</div>
|
|
121
138
|
</div>
|
|
122
|
-
</
|
|
139
|
+
</ResizableAside>
|
|
123
140
|
)
|
|
124
141
|
}
|
|
125
142
|
|
|
126
143
|
return (
|
|
127
|
-
<
|
|
128
|
-
role="dialog"
|
|
129
|
-
aria-label={`Edit ${section.name}`}
|
|
130
|
-
className="bg-card border-border flex h-full w-80 shrink-0 flex-col border-l"
|
|
131
|
-
>
|
|
144
|
+
<ResizableAside role="dialog" aria-label={`Edit ${section.name}`} className={INSPECTOR_SHELL}>
|
|
132
145
|
<div className="border-border flex items-center justify-between border-b px-4 py-3">
|
|
133
146
|
<div className="min-w-0">
|
|
134
147
|
<h2 className="text-foreground truncate text-sm font-medium">{section.name}</h2>
|
|
135
148
|
<p className="text-muted-foreground text-xs">{def?.name ?? 'Section'}</p>
|
|
136
149
|
</div>
|
|
137
|
-
<
|
|
138
|
-
type="button"
|
|
139
|
-
onClick={onClose}
|
|
140
|
-
aria-label="Close inspector"
|
|
141
|
-
className="text-muted-foreground hover:text-foreground hover:bg-accent rounded p-1"
|
|
142
|
-
>
|
|
143
|
-
<X className="h-4 w-4" aria-hidden />
|
|
144
|
-
</button>
|
|
150
|
+
<InspectorHeaderActions onClose={onClose} />
|
|
145
151
|
</div>
|
|
146
152
|
|
|
147
153
|
<div className="flex-1 space-y-6 overflow-y-auto p-4">
|
|
@@ -316,7 +322,7 @@ export function SectionInspector({
|
|
|
316
322
|
</div>
|
|
317
323
|
</fieldset>
|
|
318
324
|
</div>
|
|
319
|
-
</
|
|
325
|
+
</ResizableAside>
|
|
320
326
|
)
|
|
321
327
|
}
|
|
322
328
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { X } from 'lucide-react'
|
|
4
|
+
import { InspectorExpandButton, ResizableAside } from '../../components/ui/ResizableAside.js'
|
|
4
5
|
import { Toggle } from '../../components/ui/Toggle.js'
|
|
5
6
|
import type { PostHeaderConfig } from '../../lib/post-editor-service.js'
|
|
6
7
|
|
|
@@ -27,24 +28,27 @@ const TOGGLES: Array<{ key: keyof PostHeaderConfig; label: string }> = [
|
|
|
27
28
|
/** Inspector panel for the post header layout (template-level design config). */
|
|
28
29
|
export function PostHeaderPanel({ header, canEdit, onClose, onChange }: PostHeaderPanelProps) {
|
|
29
30
|
return (
|
|
30
|
-
<
|
|
31
|
+
<ResizableAside
|
|
31
32
|
role="dialog"
|
|
32
33
|
aria-label="Edit post header"
|
|
33
|
-
className="bg-card border-border flex h-full
|
|
34
|
+
className="bg-card border-border flex h-full flex-col border-l"
|
|
34
35
|
>
|
|
35
36
|
<div className="border-border flex items-center justify-between border-b px-4 py-3">
|
|
36
37
|
<div className="min-w-0">
|
|
37
38
|
<h2 className="text-foreground truncate text-sm font-medium">Post header</h2>
|
|
38
39
|
<p className="text-muted-foreground text-xs">Layout for every post of this type</p>
|
|
39
40
|
</div>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
<div className="flex shrink-0 items-center gap-0.5">
|
|
42
|
+
<InspectorExpandButton />
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
onClick={onClose}
|
|
46
|
+
aria-label="Close header panel"
|
|
47
|
+
className="text-muted-foreground hover:text-foreground hover:bg-accent flex h-9 w-9 items-center justify-center rounded-md md:h-7 md:w-7"
|
|
48
|
+
>
|
|
49
|
+
<X className="h-4 w-4" aria-hidden />
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
48
52
|
</div>
|
|
49
53
|
|
|
50
54
|
<div className="flex-1 space-y-6 overflow-y-auto p-4">
|
|
@@ -92,6 +96,6 @@ export function PostHeaderPanel({ header, canEdit, onClose, onChange }: PostHead
|
|
|
92
96
|
})}
|
|
93
97
|
</fieldset>
|
|
94
98
|
</div>
|
|
95
|
-
</
|
|
99
|
+
</ResizableAside>
|
|
96
100
|
)
|
|
97
101
|
}
|
|
@@ -248,7 +248,7 @@ export function PostTemplateEditor({
|
|
|
248
248
|
</div>
|
|
249
249
|
</header>
|
|
250
250
|
|
|
251
|
-
<div className="flex flex-1 overflow-hidden">
|
|
251
|
+
<div className="relative flex flex-1 overflow-hidden">
|
|
252
252
|
<SectionsPanel
|
|
253
253
|
sections={template.sections}
|
|
254
254
|
selectedId={selectedSectionId}
|