sanity-plugin-seo-copilot 0.2.14 → 0.2.16
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/README.md +63 -50
- package/dist/index.js +868 -797
- package/dist/index.mjs +791 -720
- package/package.json +9 -8
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/sanity.json +0 -3
- package/src/components/ChatPanel.tsx +0 -311
- package/src/components/ConfigContext.tsx +0 -22
- package/src/components/FeedbackButton.tsx +0 -218
- package/src/components/KeywordBadge.tsx +0 -50
- package/src/components/KeywordPanel.tsx +0 -1233
- package/src/components/OnboardingPopup.tsx +0 -108
- package/src/components/PlacementIndicators.tsx +0 -80
- package/src/components/ReportProblemButton.tsx +0 -212
- package/src/components/SEOCopilotPanel.tsx +0 -1287
- package/src/components/ScoreDonut.tsx +0 -158
- package/src/components/SeedKeywordInput.tsx +0 -128
- package/src/components/ShimmerLoader.tsx +0 -123
- package/src/components/TabBar.tsx +0 -373
- package/src/components/styles.ts +0 -158
- package/src/components/tabs/AEOTab.tsx +0 -585
- package/src/components/tabs/LinkingTab.tsx +0 -446
- package/src/components/tabs/MetaTab.tsx +0 -431
- package/src/components/tabs/SummaryTab.tsx +0 -405
- package/src/components/tabs/TechnicalTab.tsx +0 -933
- package/src/hooks/useDocumentContent.ts +0 -48
- package/src/hooks/useKeywordAnalysis.ts +0 -292
- package/src/hooks/useSEOChat.ts +0 -254
- package/src/index.ts +0 -16
- package/src/inspector.ts +0 -58
- package/src/lib/api.ts +0 -260
- package/src/lib/documentExtract.ts +0 -422
- package/src/lib/geoAnalysis.ts +0 -122
- package/src/lib/persistence.ts +0 -69
- package/src/lib/scoring.ts +0 -197
- package/src/lib/summary.ts +0 -645
- package/src/lib/types.ts +0 -212
- package/src/lib/utils.ts +0 -35
- package/v2-incompatible.js +0 -10
|
@@ -1,446 +0,0 @@
|
|
|
1
|
-
import { LoadingBars } from "../SEOCopilotPanel";
|
|
2
|
-
import { FeedbackButton } from "../FeedbackButton";
|
|
3
|
-
import { ScoreDonut, ScoreDonutLegend } from "../ScoreDonut";
|
|
4
|
-
import { MJH_BLUE } from "../styles";
|
|
5
|
-
import type { SEOAnalysis, LinkingSuggestion } from "../../lib/types";
|
|
6
|
-
import { KNOWN_MJH_PUBLICATIONS } from "../../lib/utils";
|
|
7
|
-
|
|
8
|
-
interface LinkingTabProps {
|
|
9
|
-
analysis: SEOAnalysis | null;
|
|
10
|
-
suggestions: LinkingSuggestion[];
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
error?: string | null;
|
|
13
|
-
/** True when the article changed materially since these suggestions were fetched. */
|
|
14
|
-
isStale?: boolean;
|
|
15
|
-
onRefresh: () => void;
|
|
16
|
-
text?: string;
|
|
17
|
-
documentId?: string;
|
|
18
|
-
publication?: string;
|
|
19
|
-
/** Studio origin + basePath (e.g. https://host/studio). When present, each suggestion
|
|
20
|
-
* gets an "Inside Sanity" link that opens that article in a new Studio tab. */
|
|
21
|
-
sanityBaseUrl?: string;
|
|
22
|
-
/** Schema type of the current document, used to build the Sanity edit-intent link. */
|
|
23
|
-
documentType?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Build the public, reader-facing URL for a suggested article. Only constructed for
|
|
27
|
-
// known MJH publications (verified via CDN probe to use www.{pub}.com/view/{slug}).
|
|
28
|
-
// Returns null for unknown publications rather than risking a broken link.
|
|
29
|
-
function buildLiveUrl(publication?: string, slug?: string): string | null {
|
|
30
|
-
if (!slug) return null;
|
|
31
|
-
const pub = (publication || "").trim().toLowerCase();
|
|
32
|
-
if (!KNOWN_MJH_PUBLICATIONS.has(pub)) return null;
|
|
33
|
-
const cleanSlug = slug.replace(/^\/+/, "").split("/").map(encodeURIComponent).join("/");
|
|
34
|
-
return `https://www.${pub}.com/view/${cleanSlug}`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Build a Sanity Studio edit-intent URL that opens the article in a NEW Studio tab,
|
|
38
|
-
// leaving the editor's current tab undisturbed. id-only intent resolves the type
|
|
39
|
-
// itself, but we include type when we know it for a cleaner resolve.
|
|
40
|
-
function buildSanityUrl(baseUrl?: string, id?: string, type?: string): string | null {
|
|
41
|
-
if (!baseUrl || !id) return null;
|
|
42
|
-
const cleanId = id.replace(/^drafts\./, "");
|
|
43
|
-
const base = baseUrl.replace(/\/+$/, "");
|
|
44
|
-
const typePart = type ? `;type=${encodeURIComponent(type)}` : "";
|
|
45
|
-
return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Small outbound-link chip - both targets open in a new tab so the editor's current
|
|
49
|
-
// work is never disturbed.
|
|
50
|
-
function LinkChip({ href, label, color }: { href: string; label: string; color: string }) {
|
|
51
|
-
return (
|
|
52
|
-
<a
|
|
53
|
-
href={href}
|
|
54
|
-
target="_blank"
|
|
55
|
-
rel="noopener noreferrer"
|
|
56
|
-
style={{
|
|
57
|
-
display: "inline-flex",
|
|
58
|
-
alignItems: "center",
|
|
59
|
-
gap: 4,
|
|
60
|
-
padding: "3px 9px",
|
|
61
|
-
borderRadius: 99,
|
|
62
|
-
fontSize: 10.5,
|
|
63
|
-
fontWeight: 700,
|
|
64
|
-
color,
|
|
65
|
-
background: "rgba(255,255,255,0.7)",
|
|
66
|
-
border: `1px solid ${color}33`,
|
|
67
|
-
textDecoration: "none",
|
|
68
|
-
lineHeight: 1.2,
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
{label}
|
|
72
|
-
<svg width="9" height="9" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
73
|
-
<path d="M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" />
|
|
74
|
-
<path d="M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" />
|
|
75
|
-
</svg>
|
|
76
|
-
</a>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// At-a-glance status of whether this suggestion is a real, clickable link. Green when
|
|
81
|
-
// we have a live reader URL the editor can actually link to; muted when there's no live
|
|
82
|
-
// URL (the article can still be referenced inside Sanity, but it isn't directly clickable).
|
|
83
|
-
function ClickableBadge({ clickable }: { clickable: boolean }) {
|
|
84
|
-
return (
|
|
85
|
-
<span
|
|
86
|
-
style={{
|
|
87
|
-
fontSize: 9,
|
|
88
|
-
fontWeight: 700,
|
|
89
|
-
textTransform: "uppercase",
|
|
90
|
-
letterSpacing: "0.04em",
|
|
91
|
-
padding: "2px 7px",
|
|
92
|
-
borderRadius: 99,
|
|
93
|
-
display: "inline-flex",
|
|
94
|
-
alignItems: "center",
|
|
95
|
-
gap: 4,
|
|
96
|
-
background: clickable ? "rgba(22,163,74,0.12)" : "rgba(0,0,0,0.05)",
|
|
97
|
-
color: clickable ? "#16a34a" : "#9ca3af",
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
<span style={{ width: 5, height: 5, borderRadius: "50%", background: "currentColor" }} />
|
|
101
|
-
{clickable ? "Clickable link" : "No live link"}
|
|
102
|
-
</span>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const cardStyle: React.CSSProperties = {
|
|
107
|
-
borderRadius: 14,
|
|
108
|
-
background: "rgba(255,255,255,0.55)",
|
|
109
|
-
backdropFilter: "blur(16px) saturate(170%)",
|
|
110
|
-
WebkitBackdropFilter: "blur(16px) saturate(170%)",
|
|
111
|
-
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.85), inset 1.5px 2px 1px -1px rgba(255,255,255,1), inset -2px -3px 2px -1px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.07), 0 10px 26px rgba(0,0,0,0.08)",
|
|
112
|
-
padding: "14px",
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// Small "AI" pill - inline label marking generative content at the point of generation.
|
|
116
|
-
function AiPill() {
|
|
117
|
-
return (
|
|
118
|
-
<span
|
|
119
|
-
style={{
|
|
120
|
-
fontSize: 8.5,
|
|
121
|
-
fontWeight: 700,
|
|
122
|
-
letterSpacing: "0.06em",
|
|
123
|
-
padding: "1px 5px",
|
|
124
|
-
borderRadius: 99,
|
|
125
|
-
background: "rgba(0,0,0,0.06)",
|
|
126
|
-
color: "#4b5563",
|
|
127
|
-
flexShrink: 0,
|
|
128
|
-
}}
|
|
129
|
-
title="Generated by AI - verify before publishing"
|
|
130
|
-
>
|
|
131
|
-
AI
|
|
132
|
-
</span>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function SectionHeader({
|
|
137
|
-
label,
|
|
138
|
-
iconColor,
|
|
139
|
-
ai,
|
|
140
|
-
action,
|
|
141
|
-
}: {
|
|
142
|
-
label: string;
|
|
143
|
-
iconColor: string;
|
|
144
|
-
ai?: boolean;
|
|
145
|
-
action?: React.ReactNode;
|
|
146
|
-
}) {
|
|
147
|
-
return (
|
|
148
|
-
<div style={{ display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }}>
|
|
149
|
-
<div style={{ width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 }} />
|
|
150
|
-
<span style={{ fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }}>
|
|
151
|
-
{label}
|
|
152
|
-
</span>
|
|
153
|
-
{ai && <AiPill />}
|
|
154
|
-
{action}
|
|
155
|
-
</div>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function formatDate(iso?: string): string {
|
|
160
|
-
if (!iso) return "";
|
|
161
|
-
try {
|
|
162
|
-
return new Date(iso).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" });
|
|
163
|
-
} catch {
|
|
164
|
-
return "";
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function freshnessChip(label: LinkingSuggestion["freshnessLabel"], score: number) {
|
|
169
|
-
const map = {
|
|
170
|
-
fresh: { bg: "rgba(22,163,74,0.1)", color: "#16a34a", text: "Fresh" },
|
|
171
|
-
recent: { bg: "rgba(0,93,172,0.08)", color: MJH_BLUE, text: "Recent" },
|
|
172
|
-
older: { bg: "rgba(230,192,27,0.18)", color: "#8B7310", text: "Older" },
|
|
173
|
-
"very-old": { bg: "rgba(220,38,38,0.1)", color: "#dc2626", text: "Very old" },
|
|
174
|
-
} as const;
|
|
175
|
-
const c = map[label];
|
|
176
|
-
if (!c) return null;
|
|
177
|
-
return (
|
|
178
|
-
<span
|
|
179
|
-
style={{
|
|
180
|
-
fontSize: 9,
|
|
181
|
-
fontWeight: 700,
|
|
182
|
-
textTransform: "uppercase",
|
|
183
|
-
letterSpacing: "0.05em",
|
|
184
|
-
padding: "1px 6px",
|
|
185
|
-
borderRadius: 99,
|
|
186
|
-
background: c.bg,
|
|
187
|
-
color: c.color,
|
|
188
|
-
flexShrink: 0,
|
|
189
|
-
}}
|
|
190
|
-
title={`Freshness score: ${score}/100`}
|
|
191
|
-
>
|
|
192
|
-
{c.text}
|
|
193
|
-
</span>
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function RefreshIcon({ spinning }: { spinning: boolean }) {
|
|
198
|
-
if (spinning) return <LoadingBars size="xs" color="#9ca3af" />;
|
|
199
|
-
return (
|
|
200
|
-
<svg width="12" height="12" viewBox="0 0 20 20" fill="currentColor">
|
|
201
|
-
<path fillRule="evenodd" d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H4.598a.75.75 0 00-.75.75v3.634a.75.75 0 001.5 0v-2.033l.312.311a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm-10.624-2.85a5.5 5.5 0 019.201-2.466l.312.311h-2.433a.75.75 0 000 1.5h3.634a.75.75 0 00.75-.75V3.535a.75.75 0 00-1.5 0v2.033l-.312-.311A7 7 0 002.628 8.395a.75.75 0 001.449.39z" clipRule="evenodd" />
|
|
202
|
-
</svg>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export function LinkingTab({
|
|
207
|
-
analysis,
|
|
208
|
-
suggestions,
|
|
209
|
-
isLoading,
|
|
210
|
-
error,
|
|
211
|
-
isStale,
|
|
212
|
-
onRefresh,
|
|
213
|
-
text,
|
|
214
|
-
documentId,
|
|
215
|
-
publication,
|
|
216
|
-
sanityBaseUrl,
|
|
217
|
-
documentType,
|
|
218
|
-
}: LinkingTabProps) {
|
|
219
|
-
if (!analysis) {
|
|
220
|
-
return (
|
|
221
|
-
<div style={{ padding: 24, textAlign: "center" }}>
|
|
222
|
-
<div style={{ fontSize: 13, color: "#4b5563", fontWeight: 500 }}>Waiting for keyword analysis</div>
|
|
223
|
-
<div style={{ fontSize: 11, color: "#4b5563", marginTop: 4 }}>Linking reads the article keywords and topic to find related published articles. It starts on its own once the Keywords tab finishes.</div>
|
|
224
|
-
</div>
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// Healthy contextual link counts scale with article length (roughly 2-5 per 1,000 words).
|
|
229
|
-
const wordCount = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
230
|
-
const recommendedMin = Math.max(1, Math.round((wordCount / 1000) * 2));
|
|
231
|
-
const recommendedMax = Math.max(2, Math.round((wordCount / 1000) * 5));
|
|
232
|
-
|
|
233
|
-
return (
|
|
234
|
-
<div style={{ padding: 12, display: "flex", flexDirection: "column", gap: 12 }}>
|
|
235
|
-
<div id="anchor-linking-suggestions" style={cardStyle}>
|
|
236
|
-
<SectionHeader
|
|
237
|
-
label="Suggested Links"
|
|
238
|
-
iconColor={MJH_BLUE}
|
|
239
|
-
action={
|
|
240
|
-
<button
|
|
241
|
-
onClick={onRefresh}
|
|
242
|
-
disabled={isLoading}
|
|
243
|
-
style={{
|
|
244
|
-
background: "none",
|
|
245
|
-
border: "none",
|
|
246
|
-
cursor: isLoading ? "wait" : "pointer",
|
|
247
|
-
padding: 2,
|
|
248
|
-
display: "flex",
|
|
249
|
-
color: isLoading ? "#d1d5db" : "#9ca3af",
|
|
250
|
-
fontSize: 10,
|
|
251
|
-
}}
|
|
252
|
-
title="Refresh"
|
|
253
|
-
>
|
|
254
|
-
<RefreshIcon spinning={isLoading} />
|
|
255
|
-
</button>
|
|
256
|
-
}
|
|
257
|
-
/>
|
|
258
|
-
<div style={{ fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }}>
|
|
259
|
-
Other articles on this site that fit this topic.
|
|
260
|
-
{wordCount > 0 && (
|
|
261
|
-
<>
|
|
262
|
-
{" "}For a {wordCount.toLocaleString()}-word article, aim for{" "}
|
|
263
|
-
<strong>{recommendedMin}-{recommendedMax} internal links</strong>.
|
|
264
|
-
</>
|
|
265
|
-
)}
|
|
266
|
-
</div>
|
|
267
|
-
<div style={{ fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }}>
|
|
268
|
-
Each suggestion gets a 0-100% match score from three signals - <strong>topic match</strong>, <strong>freshness</strong>, and <strong>section fit</strong> (where in your article the link belongs). The percentage on each card is the weighted total:
|
|
269
|
-
</div>
|
|
270
|
-
<div style={{ marginBottom: 10 }}>
|
|
271
|
-
<ScoreDonutLegend />
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
{/* Stale banner - article changed since these were generated */}
|
|
275
|
-
{isStale && suggestions.length > 0 && !isLoading && (
|
|
276
|
-
<div
|
|
277
|
-
role="button"
|
|
278
|
-
tabIndex={0}
|
|
279
|
-
onClick={onRefresh}
|
|
280
|
-
onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); onRefresh(); } }}
|
|
281
|
-
style={{
|
|
282
|
-
display: "flex",
|
|
283
|
-
alignItems: "center",
|
|
284
|
-
justifyContent: "space-between",
|
|
285
|
-
gap: 8,
|
|
286
|
-
padding: "7px 10px",
|
|
287
|
-
marginBottom: 10,
|
|
288
|
-
background: "#fffbeb",
|
|
289
|
-
border: "1px solid #fde68a",
|
|
290
|
-
borderRadius: 8,
|
|
291
|
-
cursor: "pointer",
|
|
292
|
-
}}
|
|
293
|
-
>
|
|
294
|
-
<span style={{ fontSize: 11, color: "#92400e" }}>
|
|
295
|
-
Your article changed since these were generated.
|
|
296
|
-
</span>
|
|
297
|
-
<span style={{ fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }}>
|
|
298
|
-
Refresh
|
|
299
|
-
</span>
|
|
300
|
-
</div>
|
|
301
|
-
)}
|
|
302
|
-
|
|
303
|
-
{/* Loading (first run, nothing to show yet) */}
|
|
304
|
-
{isLoading && suggestions.length === 0 && (
|
|
305
|
-
<div style={{ display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }}>
|
|
306
|
-
<LoadingBars size="xs" color={MJH_BLUE} />
|
|
307
|
-
<span style={{ fontSize: 11, color: "#4b5563" }}>Ranking candidates...</span>
|
|
308
|
-
</div>
|
|
309
|
-
)}
|
|
310
|
-
|
|
311
|
-
{/* Error - distinct from "empty", with a real retry affordance */}
|
|
312
|
-
{!isLoading && error && (
|
|
313
|
-
<div
|
|
314
|
-
style={{
|
|
315
|
-
padding: "12px",
|
|
316
|
-
background: "rgba(220,38,38,0.04)",
|
|
317
|
-
border: "1px solid rgba(220,38,38,0.18)",
|
|
318
|
-
borderRadius: 10,
|
|
319
|
-
textAlign: "center",
|
|
320
|
-
}}
|
|
321
|
-
>
|
|
322
|
-
<div style={{ fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }}>
|
|
323
|
-
Couldn't load suggestions
|
|
324
|
-
</div>
|
|
325
|
-
<div style={{ fontSize: 10.5, color: "#4b5563", marginBottom: 8 }}>{error}</div>
|
|
326
|
-
<button
|
|
327
|
-
onClick={onRefresh}
|
|
328
|
-
style={{
|
|
329
|
-
padding: "5px 14px",
|
|
330
|
-
fontSize: 11,
|
|
331
|
-
fontWeight: 700,
|
|
332
|
-
color: "#ffffff",
|
|
333
|
-
background: "#dc2626",
|
|
334
|
-
border: "none",
|
|
335
|
-
borderRadius: 6,
|
|
336
|
-
cursor: "pointer",
|
|
337
|
-
}}
|
|
338
|
-
>
|
|
339
|
-
Try again
|
|
340
|
-
</button>
|
|
341
|
-
</div>
|
|
342
|
-
)}
|
|
343
|
-
|
|
344
|
-
{/* Empty - no error, just nothing matched. */}
|
|
345
|
-
{!isLoading && !error && suggestions.length === 0 && (
|
|
346
|
-
<div style={{ fontSize: 11, color: "#1f2937", padding: "10px 12px", lineHeight: 1.55, background: "rgba(0,93,172,0.04)", borderRadius: 8, border: "1px solid rgba(0,93,172,0.12)" }}>
|
|
347
|
-
<div style={{ fontWeight: 700, marginBottom: 4, color: "#1f2937" }}>No closely related articles found.</div>
|
|
348
|
-
<div style={{ color: "#4b5563" }}>
|
|
349
|
-
Linking searched your publication for articles on this topic and did not find a strong match. As more related content is published, suggestions will appear here.
|
|
350
|
-
</div>
|
|
351
|
-
</div>
|
|
352
|
-
)}
|
|
353
|
-
|
|
354
|
-
{suggestions.length > 0 && (
|
|
355
|
-
<div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
|
|
356
|
-
{suggestions.map((s) => {
|
|
357
|
-
const liveUrl = buildLiveUrl(publication, s.slug);
|
|
358
|
-
const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id); // omit type - resolves by ID, suggested doc type differs from current
|
|
359
|
-
return (
|
|
360
|
-
<div
|
|
361
|
-
key={s._id}
|
|
362
|
-
style={{
|
|
363
|
-
padding: "10px 12px",
|
|
364
|
-
background: "rgba(0,93,172,0.03)",
|
|
365
|
-
borderRadius: 10,
|
|
366
|
-
borderLeft: `2px solid ${MJH_BLUE}`,
|
|
367
|
-
display: "flex",
|
|
368
|
-
gap: 12,
|
|
369
|
-
alignItems: "flex-start",
|
|
370
|
-
}}
|
|
371
|
-
>
|
|
372
|
-
<ScoreDonut
|
|
373
|
-
size={64}
|
|
374
|
-
topic={Math.max(0, Math.min(100, s.topicScore))}
|
|
375
|
-
freshness={Math.max(0, Math.min(100, s.freshnessScore))}
|
|
376
|
-
sectionFit={Math.max(0, Math.min(100, s.sectionFitScore))}
|
|
377
|
-
composite={Math.max(0, Math.min(100, s.compositeScore))}
|
|
378
|
-
/>
|
|
379
|
-
<div style={{ flex: 1, minWidth: 0 }}>
|
|
380
|
-
<div style={{ display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }}>
|
|
381
|
-
{freshnessChip(s.freshnessLabel, s.freshnessScore)}
|
|
382
|
-
{s.publishedAt && (
|
|
383
|
-
<span style={{ fontSize: 10, color: "#4b5563" }}>{formatDate(s.publishedAt)}</span>
|
|
384
|
-
)}
|
|
385
|
-
<ClickableBadge clickable={!!liveUrl} />
|
|
386
|
-
</div>
|
|
387
|
-
<div style={{ fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }}>
|
|
388
|
-
{s.title}
|
|
389
|
-
</div>
|
|
390
|
-
<div style={{ fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }}>
|
|
391
|
-
/{s.slug}
|
|
392
|
-
</div>
|
|
393
|
-
{(liveUrl || sanityUrl) && (
|
|
394
|
-
<div style={{ display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }}>
|
|
395
|
-
{sanityUrl && <LinkChip href={sanityUrl} label="Inside Sanity" color={MJH_BLUE} />}
|
|
396
|
-
{liveUrl && <LinkChip href={liveUrl} label="Live site" color="#4b5563" />}
|
|
397
|
-
</div>
|
|
398
|
-
)}
|
|
399
|
-
{s.relevanceReason && (
|
|
400
|
-
<div style={{ fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }}>
|
|
401
|
-
<span style={{ fontWeight: 700, color: "#4b5563" }}>Why it fits:</span>{" "}
|
|
402
|
-
<span style={{ fontStyle: "italic" }}>{s.relevanceReason}</span>
|
|
403
|
-
</div>
|
|
404
|
-
)}
|
|
405
|
-
{s.anchorQuote && (
|
|
406
|
-
<div
|
|
407
|
-
style={{
|
|
408
|
-
marginTop: 4,
|
|
409
|
-
padding: "6px 9px",
|
|
410
|
-
background: "rgba(0,0,0,0.025)",
|
|
411
|
-
borderRadius: 6,
|
|
412
|
-
borderLeft: "2px solid #cbd5e1",
|
|
413
|
-
fontSize: 11,
|
|
414
|
-
color: "#1f2937",
|
|
415
|
-
lineHeight: 1.5,
|
|
416
|
-
}}
|
|
417
|
-
>
|
|
418
|
-
<div style={{ fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }}>
|
|
419
|
-
Where to link from - paragraph {s.anchorParagraph}
|
|
420
|
-
</div>
|
|
421
|
-
<div style={{ fontStyle: "italic" }}>"{s.anchorQuote}"</div>
|
|
422
|
-
{s.anchorReason && (
|
|
423
|
-
<div style={{ fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }}>
|
|
424
|
-
{s.anchorReason}
|
|
425
|
-
</div>
|
|
426
|
-
)}
|
|
427
|
-
</div>
|
|
428
|
-
)}
|
|
429
|
-
</div>
|
|
430
|
-
<div style={{ flexShrink: 0 }}>
|
|
431
|
-
<FeedbackButton
|
|
432
|
-
suggestionType="internal_link"
|
|
433
|
-
suggestionText={s.title}
|
|
434
|
-
publication={publication}
|
|
435
|
-
documentId={documentId}
|
|
436
|
-
/>
|
|
437
|
-
</div>
|
|
438
|
-
</div>
|
|
439
|
-
);
|
|
440
|
-
})}
|
|
441
|
-
</div>
|
|
442
|
-
)}
|
|
443
|
-
</div>
|
|
444
|
-
</div>
|
|
445
|
-
);
|
|
446
|
-
}
|