@actuate-media/cms-admin 0.74.0 → 0.75.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 +12 -0
- package/dist/__tests__/views/post-fields-modal.render.test.js +3 -6
- package/dist/__tests__/views/post-fields-modal.render.test.js.map +1 -1
- package/dist/__tests__/views/seo-content-pane.render.test.js +2 -0
- package/dist/__tests__/views/seo-content-pane.render.test.js.map +1 -1
- package/dist/actuate-admin.css +1 -1
- package/dist/components/EditorSeoAside.d.ts +7 -4
- package/dist/components/EditorSeoAside.d.ts.map +1 -1
- package/dist/components/EditorSeoAside.js +7 -16
- package/dist/components/EditorSeoAside.js.map +1 -1
- package/dist/components/seo/EditorSeoScoreBadge.d.ts +7 -0
- package/dist/components/seo/EditorSeoScoreBadge.d.ts.map +1 -0
- package/dist/components/seo/EditorSeoScoreBadge.js +9 -0
- package/dist/components/seo/EditorSeoScoreBadge.js.map +1 -0
- package/dist/components/seo/SeoAccordion.d.ts +16 -0
- package/dist/components/seo/SeoAccordion.d.ts.map +1 -0
- package/dist/components/seo/SeoAccordion.js +21 -0
- package/dist/components/seo/SeoAccordion.js.map +1 -0
- package/dist/components/seo/SeoAnalysisList.d.ts +7 -0
- package/dist/components/seo/SeoAnalysisList.d.ts.map +1 -0
- package/dist/components/seo/SeoAnalysisList.js +32 -0
- package/dist/components/seo/SeoAnalysisList.js.map +1 -0
- package/dist/components/seo/SeoEditorPane.d.ts +15 -4
- package/dist/components/seo/SeoEditorPane.d.ts.map +1 -1
- package/dist/components/seo/SeoEditorPane.js +131 -31
- package/dist/components/seo/SeoEditorPane.js.map +1 -1
- package/dist/components/seo/SeoInsightsMetrics.d.ts +6 -0
- package/dist/components/seo/SeoInsightsMetrics.d.ts.map +1 -0
- package/dist/components/seo/SeoInsightsMetrics.js +16 -0
- package/dist/components/seo/SeoInsightsMetrics.js.map +1 -0
- package/dist/components/seo/SeoLinkingSection.d.ts +9 -0
- package/dist/components/seo/SeoLinkingSection.d.ts.map +1 -0
- package/dist/components/seo/SeoLinkingSection.js +44 -0
- package/dist/components/seo/SeoLinkingSection.js.map +1 -0
- package/dist/lib/editor-seo-content.d.ts +16 -0
- package/dist/lib/editor-seo-content.d.ts.map +1 -0
- package/dist/lib/editor-seo-content.js +139 -0
- package/dist/lib/editor-seo-content.js.map +1 -0
- package/dist/lib/seo-service.d.ts +2 -0
- package/dist/lib/seo-service.d.ts.map +1 -1
- package/dist/lib/seo-service.js +5 -0
- package/dist/lib/seo-service.js.map +1 -1
- package/dist/views/page-editor/EditorTopBar.d.ts +3 -1
- package/dist/views/page-editor/EditorTopBar.d.ts.map +1 -1
- package/dist/views/page-editor/EditorTopBar.js +5 -4
- package/dist/views/page-editor/EditorTopBar.js.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -1
- package/dist/views/page-editor/PageSectionEditor.js +13 -1
- package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
- package/dist/views/page-editor/PageSettingsModal.d.ts +1 -1
- package/dist/views/page-editor/PageSettingsModal.d.ts.map +1 -1
- package/dist/views/page-editor/PageSettingsModal.js +2 -13
- package/dist/views/page-editor/PageSettingsModal.js.map +1 -1
- package/dist/views/post-editor/PostFieldsModal.d.ts +1 -1
- package/dist/views/post-editor/PostFieldsModal.d.ts.map +1 -1
- package/dist/views/post-editor/PostFieldsModal.js +17 -79
- 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 +14 -1
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
- package/dist/views/seo/ContentTab.d.ts.map +1 -1
- package/dist/views/seo/ContentTab.js +7 -1
- package/dist/views/seo/ContentTab.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/views/post-fields-modal.render.test.tsx +3 -9
- package/src/__tests__/views/seo-content-pane.render.test.tsx +2 -0
- package/src/components/EditorSeoAside.tsx +27 -108
- package/src/components/seo/EditorSeoScoreBadge.tsx +26 -0
- package/src/components/seo/SeoAccordion.tsx +76 -0
- package/src/components/seo/SeoAnalysisList.tsx +113 -0
- package/src/components/seo/SeoEditorPane.tsx +497 -244
- package/src/components/seo/SeoInsightsMetrics.tsx +109 -0
- package/src/components/seo/SeoLinkingSection.tsx +151 -0
- package/src/lib/editor-seo-content.ts +144 -0
- package/src/lib/seo-service.ts +7 -0
- package/src/views/page-editor/EditorTopBar.tsx +7 -4
- package/src/views/page-editor/PageSectionEditor.tsx +15 -0
- package/src/views/page-editor/PageSettingsModal.tsx +1 -45
- package/src/views/post-editor/PostFieldsModal.tsx +19 -138
- package/src/views/post-editor/PostSectionEditor.tsx +17 -0
- package/src/views/seo/ContentTab.tsx +11 -5
|
@@ -9,16 +9,9 @@ import { Button } from '../../components/ui/Button.js'
|
|
|
9
9
|
import { ConfirmDialog } from '../../components/ui/ConfirmDialog.js'
|
|
10
10
|
import { MediaPickerModal } from '../../components/MediaPickerModal.js'
|
|
11
11
|
import { TagInput } from '../../components/TagInput.js'
|
|
12
|
-
import { SeoCharCount } from '../../components/seo/SeoCharCount.js'
|
|
13
12
|
import { coauthorText } from '../../lib/coauthor-client.js'
|
|
14
|
-
import { generateSeoField } from '../../lib/seo-service.js'
|
|
15
13
|
import type { EditorPost } from '../../lib/post-editor-service.js'
|
|
16
14
|
|
|
17
|
-
const SEO_TITLE_MIN = 30
|
|
18
|
-
const SEO_TITLE_MAX = 60
|
|
19
|
-
const SEO_DESC_MIN = 120
|
|
20
|
-
const SEO_DESC_MAX = 160
|
|
21
|
-
|
|
22
15
|
/**
|
|
23
16
|
* The slice of a collection's field config the modal reads to pick controls:
|
|
24
17
|
* a `select` category renders a dropdown (structured vocabulary), an `array`
|
|
@@ -47,8 +40,6 @@ const INPUT =
|
|
|
47
40
|
|
|
48
41
|
const slugify = normalizeSlug
|
|
49
42
|
|
|
50
|
-
type AiTarget = 'excerpt' | 'seoTitle' | 'seoDescription'
|
|
51
|
-
|
|
52
43
|
type FormSnapshot = {
|
|
53
44
|
title: string
|
|
54
45
|
slug: string
|
|
@@ -56,8 +47,6 @@ type FormSnapshot = {
|
|
|
56
47
|
featuredImage: string
|
|
57
48
|
category: string
|
|
58
49
|
tags: string
|
|
59
|
-
seoTitle: string
|
|
60
|
-
seoDescription: string
|
|
61
50
|
}
|
|
62
51
|
|
|
63
52
|
function snapshotFromPost(post: EditorPost): FormSnapshot {
|
|
@@ -68,8 +57,6 @@ function snapshotFromPost(post: EditorPost): FormSnapshot {
|
|
|
68
57
|
featuredImage: post.featuredImage,
|
|
69
58
|
category: post.category,
|
|
70
59
|
tags: [...post.tags].sort().join('\0'),
|
|
71
|
-
seoTitle: post.seoTitle,
|
|
72
|
-
seoDescription: post.seoDescription,
|
|
73
60
|
}
|
|
74
61
|
}
|
|
75
62
|
|
|
@@ -80,8 +67,6 @@ function snapshotFromFields(input: {
|
|
|
80
67
|
featuredImage: string
|
|
81
68
|
category: string
|
|
82
69
|
tags: string[]
|
|
83
|
-
seoTitle: string
|
|
84
|
-
seoDescription: string
|
|
85
70
|
}): FormSnapshot {
|
|
86
71
|
return {
|
|
87
72
|
...input,
|
|
@@ -132,7 +117,7 @@ function AiFieldButton({
|
|
|
132
117
|
)
|
|
133
118
|
}
|
|
134
119
|
|
|
135
|
-
/** Edits post metadata: title, slug, excerpt, featured image, category, tags
|
|
120
|
+
/** Edits post metadata: title, slug, excerpt, featured image, category, and tags. SEO lives in the SEO tab. */
|
|
136
121
|
export function PostFieldsModal({
|
|
137
122
|
open,
|
|
138
123
|
post,
|
|
@@ -147,11 +132,9 @@ export function PostFieldsModal({
|
|
|
147
132
|
const [featuredImage, setFeaturedImage] = useState(post.featuredImage)
|
|
148
133
|
const [category, setCategory] = useState(post.category)
|
|
149
134
|
const [tags, setTags] = useState<string[]>(post.tags)
|
|
150
|
-
const [seoTitle, setSeoTitle] = useState(post.seoTitle)
|
|
151
|
-
const [seoDescription, setSeoDescription] = useState(post.seoDescription)
|
|
152
135
|
const [slugTouched, setSlugTouched] = useState(Boolean(post.slug))
|
|
153
136
|
const [mediaOpen, setMediaOpen] = useState(false)
|
|
154
|
-
const [aiBusy, setAiBusy] = useState
|
|
137
|
+
const [aiBusy, setAiBusy] = useState(false)
|
|
155
138
|
const [confirmDiscard, setConfirmDiscard] = useState(false)
|
|
156
139
|
const baselineRef = useRef<FormSnapshot | null>(null)
|
|
157
140
|
// Land the user in the Title field (name-it-first flow for new posts).
|
|
@@ -177,10 +160,8 @@ export function PostFieldsModal({
|
|
|
177
160
|
setFeaturedImage(post.featuredImage)
|
|
178
161
|
setCategory(post.category)
|
|
179
162
|
setTags(post.tags)
|
|
180
|
-
setSeoTitle(post.seoTitle)
|
|
181
|
-
setSeoDescription(post.seoDescription)
|
|
182
163
|
setSlugTouched(Boolean(post.slug))
|
|
183
|
-
setAiBusy(
|
|
164
|
+
setAiBusy(false)
|
|
184
165
|
baselineRef.current = snapshotFromPost(post)
|
|
185
166
|
}, [open, post])
|
|
186
167
|
|
|
@@ -193,11 +174,9 @@ export function PostFieldsModal({
|
|
|
193
174
|
featuredImage,
|
|
194
175
|
category,
|
|
195
176
|
tags,
|
|
196
|
-
seoTitle,
|
|
197
|
-
seoDescription,
|
|
198
177
|
})
|
|
199
178
|
return JSON.stringify(current) !== JSON.stringify(baselineRef.current)
|
|
200
|
-
}, [open, title, slug, excerpt, featuredImage, category, tags
|
|
179
|
+
}, [open, title, slug, excerpt, featuredImage, category, tags])
|
|
201
180
|
|
|
202
181
|
function requestDismiss() {
|
|
203
182
|
if (isDirty) {
|
|
@@ -214,7 +193,7 @@ export function PostFieldsModal({
|
|
|
214
193
|
|
|
215
194
|
const slugError = validateSlug(slug)
|
|
216
195
|
|
|
217
|
-
async function
|
|
196
|
+
async function handleAiGenerateExcerpt() {
|
|
218
197
|
const context = buildContentContext(title, post.body, excerpt)
|
|
219
198
|
if (!context.trim()) {
|
|
220
199
|
toast.error(
|
|
@@ -223,77 +202,29 @@ export function PostFieldsModal({
|
|
|
223
202
|
return
|
|
224
203
|
}
|
|
225
204
|
|
|
226
|
-
setAiBusy(
|
|
205
|
+
setAiBusy(true)
|
|
227
206
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
toast.error(outcome.error)
|
|
236
|
-
return
|
|
237
|
-
}
|
|
238
|
-
setExcerpt(outcome.result.text.trim())
|
|
239
|
-
toast.success('Excerpt generated — review before saving.')
|
|
207
|
+
const outcome = await coauthorText('compress', context, {
|
|
208
|
+
instructions:
|
|
209
|
+
'Write a 1–2 sentence excerpt for blog listings and cards. Return only the excerpt text.',
|
|
210
|
+
targetLength: 45,
|
|
211
|
+
})
|
|
212
|
+
if (!outcome.ok) {
|
|
213
|
+
toast.error(outcome.error)
|
|
240
214
|
return
|
|
241
215
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const field = target === 'seoTitle' ? 'metaTitle' : 'metaDescription'
|
|
245
|
-
const result = await generateSeoField(field, {
|
|
246
|
-
entityType: post.postType,
|
|
247
|
-
entityId: post.id,
|
|
248
|
-
})
|
|
249
|
-
if (result.unavailable) {
|
|
250
|
-
toast.error('AI is not configured. Add an AI provider to enable suggestions.')
|
|
251
|
-
return
|
|
252
|
-
}
|
|
253
|
-
if (result.text) {
|
|
254
|
-
if (target === 'seoTitle') setSeoTitle(result.text)
|
|
255
|
-
else setSeoDescription(result.text)
|
|
256
|
-
toast.success('AI suggestion applied — review before saving.')
|
|
257
|
-
} else {
|
|
258
|
-
toast.error('No suggestion was returned.')
|
|
259
|
-
}
|
|
260
|
-
return
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (target === 'seoTitle') {
|
|
264
|
-
const outcome = await coauthorText('rewrite', context, {
|
|
265
|
-
style: 'seo-optimized',
|
|
266
|
-
instructions:
|
|
267
|
-
'Write a single SEO page title under 60 characters. Return only the title — no quotes.',
|
|
268
|
-
})
|
|
269
|
-
if (!outcome.ok) {
|
|
270
|
-
toast.error(outcome.error)
|
|
271
|
-
return
|
|
272
|
-
}
|
|
273
|
-
setSeoTitle(outcome.result.text.trim().slice(0, SEO_TITLE_MAX))
|
|
274
|
-
} else {
|
|
275
|
-
const outcome = await coauthorText('compress', context, {
|
|
276
|
-
instructions:
|
|
277
|
-
'Write a compelling SEO meta description of 120–160 characters for search results. Return only the description.',
|
|
278
|
-
targetLength: 155,
|
|
279
|
-
})
|
|
280
|
-
if (!outcome.ok) {
|
|
281
|
-
toast.error(outcome.error)
|
|
282
|
-
return
|
|
283
|
-
}
|
|
284
|
-
setSeoDescription(outcome.result.text.trim().slice(0, SEO_DESC_MAX))
|
|
285
|
-
}
|
|
286
|
-
toast.success('AI suggestion applied — review before saving.')
|
|
216
|
+
setExcerpt(outcome.result.text.trim())
|
|
217
|
+
toast.success('Excerpt generated — review before saving.')
|
|
287
218
|
} catch {
|
|
288
219
|
toast.error('AI request failed.')
|
|
289
220
|
} finally {
|
|
290
|
-
setAiBusy(
|
|
221
|
+
setAiBusy(false)
|
|
291
222
|
}
|
|
292
223
|
}
|
|
293
224
|
|
|
294
225
|
function handleSave() {
|
|
295
226
|
if (slugError) return
|
|
296
|
-
onSave({ title, slug, excerpt, featuredImage, category, tags
|
|
227
|
+
onSave({ title, slug, excerpt, featuredImage, category, tags })
|
|
297
228
|
onClose()
|
|
298
229
|
}
|
|
299
230
|
|
|
@@ -421,9 +352,9 @@ export function PostFieldsModal({
|
|
|
421
352
|
</label>
|
|
422
353
|
<AiFieldButton
|
|
423
354
|
label="Generate excerpt from content"
|
|
424
|
-
busy={aiBusy
|
|
355
|
+
busy={aiBusy}
|
|
425
356
|
disabled={!canEdit}
|
|
426
|
-
onClick={() => void
|
|
357
|
+
onClick={() => void handleAiGenerateExcerpt()}
|
|
427
358
|
/>
|
|
428
359
|
</div>
|
|
429
360
|
<textarea
|
|
@@ -464,56 +395,6 @@ export function PostFieldsModal({
|
|
|
464
395
|
</div>
|
|
465
396
|
)}
|
|
466
397
|
</div>
|
|
467
|
-
|
|
468
|
-
<div>
|
|
469
|
-
<div className="mb-1 flex items-center justify-between gap-2">
|
|
470
|
-
<div className="flex min-w-0 items-center gap-2">
|
|
471
|
-
<label className={`${LABEL} mb-0`} htmlFor="pf-seo-title">
|
|
472
|
-
SEO title
|
|
473
|
-
</label>
|
|
474
|
-
<AiFieldButton
|
|
475
|
-
label="Generate SEO title from content"
|
|
476
|
-
busy={aiBusy === 'seoTitle'}
|
|
477
|
-
disabled={!canEdit}
|
|
478
|
-
onClick={() => void handleAiGenerate('seoTitle')}
|
|
479
|
-
/>
|
|
480
|
-
</div>
|
|
481
|
-
<SeoCharCount value={seoTitle} min={SEO_TITLE_MIN} max={SEO_TITLE_MAX} />
|
|
482
|
-
</div>
|
|
483
|
-
<input
|
|
484
|
-
id="pf-seo-title"
|
|
485
|
-
className={INPUT}
|
|
486
|
-
value={seoTitle}
|
|
487
|
-
disabled={!canEdit}
|
|
488
|
-
placeholder={title || 'Defaults to the post title'}
|
|
489
|
-
onChange={(e) => setSeoTitle(e.target.value)}
|
|
490
|
-
/>
|
|
491
|
-
</div>
|
|
492
|
-
|
|
493
|
-
<div>
|
|
494
|
-
<div className="mb-1 flex items-center justify-between gap-2">
|
|
495
|
-
<div className="flex min-w-0 items-center gap-2">
|
|
496
|
-
<label className={`${LABEL} mb-0`} htmlFor="pf-seo-desc">
|
|
497
|
-
SEO description
|
|
498
|
-
</label>
|
|
499
|
-
<AiFieldButton
|
|
500
|
-
label="Generate SEO description from content"
|
|
501
|
-
busy={aiBusy === 'seoDescription'}
|
|
502
|
-
disabled={!canEdit}
|
|
503
|
-
onClick={() => void handleAiGenerate('seoDescription')}
|
|
504
|
-
/>
|
|
505
|
-
</div>
|
|
506
|
-
<SeoCharCount value={seoDescription} min={SEO_DESC_MIN} max={SEO_DESC_MAX} />
|
|
507
|
-
</div>
|
|
508
|
-
<textarea
|
|
509
|
-
id="pf-seo-desc"
|
|
510
|
-
className={`${INPUT} min-h-[72px] resize-y`}
|
|
511
|
-
value={seoDescription}
|
|
512
|
-
disabled={!canEdit}
|
|
513
|
-
placeholder={excerpt || 'Summarize the post for search results (120–160 characters)'}
|
|
514
|
-
onChange={(e) => setSeoDescription(e.target.value)}
|
|
515
|
-
/>
|
|
516
|
-
</div>
|
|
517
398
|
</div>
|
|
518
399
|
</Modal>
|
|
519
400
|
|
|
@@ -50,6 +50,7 @@ import { SectionInspector } from '../page-editor/SectionInspector.js'
|
|
|
50
50
|
import { AddSectionModal } from '../page-editor/AddSectionModal.js'
|
|
51
51
|
import { ValidationSummary } from '../page-editor/ValidationSummary.js'
|
|
52
52
|
import { resolveDefaultSitePreview } from '../../lib/editor-preview.js'
|
|
53
|
+
import { computeLiveSeoScore } from '../../lib/editor-seo-content.js'
|
|
53
54
|
import { PostEditorCanvas } from './PostEditorCanvas.js'
|
|
54
55
|
import { PostFieldsModal, type PostFieldConfig } from './PostFieldsModal.js'
|
|
55
56
|
|
|
@@ -158,6 +159,18 @@ export function PostSectionEditor({
|
|
|
158
159
|
[post],
|
|
159
160
|
)
|
|
160
161
|
const publishReady = Boolean(post) && publishCheck.errors.length === 0
|
|
162
|
+
|
|
163
|
+
const liveSeoScore = useMemo(() => {
|
|
164
|
+
if (!post) return 0
|
|
165
|
+
return computeLiveSeoScore({
|
|
166
|
+
title: post.title,
|
|
167
|
+
slug: post.slug,
|
|
168
|
+
seoTitle: post.seoTitle,
|
|
169
|
+
seoDescription: post.seoDescription,
|
|
170
|
+
sections: post.sections,
|
|
171
|
+
bodyHtml: post.body,
|
|
172
|
+
})
|
|
173
|
+
}, [post])
|
|
161
174
|
const publishDisabledReason = publishCheck.errors[0]
|
|
162
175
|
|
|
163
176
|
// ─── Load ──────────────────────────────────────────────────────────
|
|
@@ -560,6 +573,7 @@ export function PostSectionEditor({
|
|
|
560
573
|
onOpenSettings={() => setFieldsOpen(true)}
|
|
561
574
|
onOpenSeo={handleToggleSeo}
|
|
562
575
|
seoOpen={seoOpen}
|
|
576
|
+
seoScore={liveSeoScore}
|
|
563
577
|
onSaveDraft={handleSaveDraft}
|
|
564
578
|
onPublish={requestPublish}
|
|
565
579
|
structuralTypes={structuralTypes}
|
|
@@ -645,8 +659,11 @@ export function PostSectionEditor({
|
|
|
645
659
|
entityType="post"
|
|
646
660
|
entityId={post.id}
|
|
647
661
|
title={post.title}
|
|
662
|
+
slug={post.slug}
|
|
648
663
|
seoTitle={post.seoTitle}
|
|
649
664
|
seoDescription={post.seoDescription}
|
|
665
|
+
sections={post.sections}
|
|
666
|
+
bodyHtml={post.body}
|
|
650
667
|
canEdit={canEdit}
|
|
651
668
|
onClose={() => setSeoOpen(false)}
|
|
652
669
|
onDraftChange={handleFields}
|
|
@@ -34,7 +34,12 @@ const FILTERS: { id: ContentSeoFilter; label: string }[] = [
|
|
|
34
34
|
const inputCls =
|
|
35
35
|
'w-full rounded-md border border-[var(--bdr)] bg-input-background py-2 pl-9 pr-3 text-base text-[var(--txt)] placeholder:text-[var(--sub)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]'
|
|
36
36
|
|
|
37
|
-
type
|
|
37
|
+
type SeoEntityType = 'page' | 'post'
|
|
38
|
+
type Selection = { type: SeoEntityType; id: string } | null
|
|
39
|
+
|
|
40
|
+
function parseEntityType(value: string | null | undefined): SeoEntityType | null {
|
|
41
|
+
return value === 'page' || value === 'post' ? value : null
|
|
42
|
+
}
|
|
38
43
|
|
|
39
44
|
export function ContentTab({
|
|
40
45
|
initialEntityType,
|
|
@@ -46,16 +51,17 @@ export function ContentTab({
|
|
|
46
51
|
const { data, loading, error, refetch } = useSeoResource(fetchSeoContentRecords, [])
|
|
47
52
|
const [search, setSearch] = useState('')
|
|
48
53
|
const [filter, setFilter] = useState<ContentSeoFilter>('all')
|
|
49
|
-
const [selection, setSelection] = useState<Selection>(
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
const [selection, setSelection] = useState<Selection>(() => {
|
|
55
|
+
const type = parseEntityType(initialEntityType)
|
|
56
|
+
return type && initialEntityId ? { type, id: initialEntityId } : null
|
|
57
|
+
})
|
|
52
58
|
|
|
53
59
|
const rows = useMemo(
|
|
54
60
|
() => applyContentSeoQuery(data ?? [], { search, filter }),
|
|
55
61
|
[data, search, filter],
|
|
56
62
|
)
|
|
57
63
|
|
|
58
|
-
const toggleRow = (type:
|
|
64
|
+
const toggleRow = (type: SeoEntityType, id: string) => {
|
|
59
65
|
setSelection((prev) => (prev?.type === type && prev.id === id ? null : { type, id }))
|
|
60
66
|
}
|
|
61
67
|
|