@actuate-media/cms-admin 0.71.1 → 0.72.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/CHANGELOG.md +24 -0
- package/dist/__tests__/components/author-avatar.test.d.ts +2 -0
- package/dist/__tests__/components/author-avatar.test.d.ts.map +1 -0
- package/dist/__tests__/components/author-avatar.test.js +36 -0
- package/dist/__tests__/components/author-avatar.test.js.map +1 -0
- package/dist/__tests__/lib/cv.test.js +9 -0
- package/dist/__tests__/lib/cv.test.js.map +1 -1
- package/dist/__tests__/views/page-section-editor.test.js +11 -0
- package/dist/__tests__/views/page-section-editor.test.js.map +1 -1
- package/dist/__tests__/views/pages-list-view.test.js +60 -0
- package/dist/__tests__/views/pages-list-view.test.js.map +1 -1
- package/dist/__tests__/views/post-section-editor.test.js +14 -0
- package/dist/__tests__/views/post-section-editor.test.js.map +1 -1
- package/dist/actuate-admin.css +1 -1
- package/dist/components/ui/AuthorAvatar.d.ts +11 -0
- package/dist/components/ui/AuthorAvatar.d.ts.map +1 -0
- package/dist/components/ui/AuthorAvatar.js +47 -0
- package/dist/components/ui/AuthorAvatar.js.map +1 -0
- package/dist/components/ui/Modal.d.ts +8 -2
- package/dist/components/ui/Modal.d.ts.map +1 -1
- package/dist/components/ui/Modal.js +9 -2
- package/dist/components/ui/Modal.js.map +1 -1
- package/dist/lib/cv.d.ts.map +1 -1
- package/dist/lib/cv.js +9 -1
- package/dist/lib/cv.js.map +1 -1
- package/dist/views/Dashboard.d.ts.map +1 -1
- package/dist/views/Dashboard.js +3 -29
- package/dist/views/Dashboard.js.map +1 -1
- package/dist/views/Pages/PagesListView.d.ts.map +1 -1
- package/dist/views/Pages/PagesListView.js +82 -12
- package/dist/views/Pages/PagesListView.js.map +1 -1
- package/dist/views/Pages/PagesTreeTable.d.ts.map +1 -1
- package/dist/views/Pages/PagesTreeTable.js +2 -1
- package/dist/views/Pages/PagesTreeTable.js.map +1 -1
- package/dist/views/Posts/PostsListView.d.ts.map +1 -1
- package/dist/views/Posts/PostsListView.js +2 -1
- package/dist/views/Posts/PostsListView.js.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.js +4 -0
- package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
- package/dist/views/page-editor/PageSettingsModal.d.ts.map +1 -1
- package/dist/views/page-editor/PageSettingsModal.js +8 -2
- package/dist/views/page-editor/PageSettingsModal.js.map +1 -1
- package/dist/views/post-editor/PostFieldsModal.d.ts.map +1 -1
- package/dist/views/post-editor/PostFieldsModal.js +4 -2
- package/dist/views/post-editor/PostFieldsModal.js.map +1 -1
- package/dist/views/post-editor/PostSectionEditor.d.ts.map +1 -1
- package/dist/views/post-editor/PostSectionEditor.js +5 -1
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/components/author-avatar.test.tsx +40 -0
- package/src/__tests__/lib/cv.test.ts +10 -0
- package/src/__tests__/views/page-section-editor.test.tsx +15 -0
- package/src/__tests__/views/pages-list-view.test.tsx +81 -0
- package/src/__tests__/views/post-section-editor.test.tsx +26 -0
- package/src/components/ui/AuthorAvatar.tsx +69 -0
- package/src/components/ui/Modal.tsx +29 -3
- package/src/lib/cv.ts +8 -1
- package/src/views/Dashboard.tsx +3 -32
- package/src/views/Pages/PagesListView.tsx +216 -63
- package/src/views/Pages/PagesTreeTable.tsx +2 -6
- package/src/views/Posts/PostsListView.tsx +2 -6
- package/src/views/page-editor/PageSectionEditor.tsx +4 -0
- package/src/views/page-editor/PageSettingsModal.tsx +27 -4
- package/src/views/post-editor/PostFieldsModal.tsx +6 -1
- package/src/views/post-editor/PostSectionEditor.tsx +6 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useEffect, useState } from 'react'
|
|
3
|
+
import { useEffect, useRef, useState } from 'react'
|
|
4
4
|
import { normalizeSlug, validateSlug } from '@actuate-media/cms-core/client'
|
|
5
5
|
import { Modal } from '../../components/ui/Modal.js'
|
|
6
6
|
import { Button } from '../../components/ui/Button.js'
|
|
@@ -62,6 +62,8 @@ export function PostFieldsModal({
|
|
|
62
62
|
const [seoDescription, setSeoDescription] = useState(post.seoDescription)
|
|
63
63
|
const [slugTouched, setSlugTouched] = useState(Boolean(post.slug))
|
|
64
64
|
const [mediaOpen, setMediaOpen] = useState(false)
|
|
65
|
+
// Land the user in the Title field (name-it-first flow for new posts).
|
|
66
|
+
const titleRef = useRef<HTMLInputElement | null>(null)
|
|
65
67
|
|
|
66
68
|
const categoryField = fields?.category
|
|
67
69
|
const categoryOptions =
|
|
@@ -103,6 +105,7 @@ export function PostFieldsModal({
|
|
|
103
105
|
open={open}
|
|
104
106
|
onClose={onClose}
|
|
105
107
|
title="Post details"
|
|
108
|
+
initialFocusRef={titleRef}
|
|
106
109
|
actions={
|
|
107
110
|
<>
|
|
108
111
|
<Button variant="ghost" onClick={onClose}>
|
|
@@ -121,9 +124,11 @@ export function PostFieldsModal({
|
|
|
121
124
|
</label>
|
|
122
125
|
<input
|
|
123
126
|
id="pf-title"
|
|
127
|
+
ref={titleRef}
|
|
124
128
|
className={INPUT}
|
|
125
129
|
value={title}
|
|
126
130
|
disabled={!canEdit}
|
|
131
|
+
placeholder="e.g. Announcing our new product"
|
|
127
132
|
onChange={(e) => handleTitle(e.target.value)}
|
|
128
133
|
/>
|
|
129
134
|
</div>
|
|
@@ -191,7 +191,12 @@ export function PostSectionEditor({
|
|
|
191
191
|
if (cancelled) return
|
|
192
192
|
setPost(p)
|
|
193
193
|
setSelectedId(null)
|
|
194
|
-
if (!documentId)
|
|
194
|
+
if (!documentId) {
|
|
195
|
+
setDirty(true)
|
|
196
|
+
// Name-it-first flow (matches the Page editor): a new post opens
|
|
197
|
+
// straight into the fields modal so title/slug are set up front.
|
|
198
|
+
setFieldsOpen(true)
|
|
199
|
+
}
|
|
195
200
|
})
|
|
196
201
|
.catch((err) => {
|
|
197
202
|
if (!cancelled) setLoadError(err instanceof Error ? err.message : 'Failed to load post')
|