sanity-plugin-seo-copilot 0.2.1 → 0.2.7
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/dist/index.js +1407 -638
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1407 -638
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/KeywordPanel.tsx +170 -5
- package/src/components/OnboardingPopup.tsx +108 -0
- package/src/components/SEOCopilotPanel.tsx +123 -14
- package/src/components/styles.ts +8 -0
- package/src/components/tabs/AEOTab.tsx +9 -3
- package/src/components/tabs/LinkingTab.tsx +77 -4
- package/src/components/tabs/MetaTab.tsx +40 -115
- package/src/components/tabs/SummaryTab.tsx +19 -4
- package/src/components/tabs/TechnicalTab.tsx +200 -29
- package/src/hooks/useDocumentContent.ts +6 -174
- package/src/hooks/useKeywordAnalysis.ts +33 -4
- package/src/hooks/useSEOChat.ts +61 -16
- package/src/lib/api.ts +25 -7
- package/src/lib/documentExtract.ts +268 -0
- package/src/lib/geoAnalysis.ts +16 -3
- package/src/lib/scoring.ts +69 -19
- package/src/lib/summary.ts +169 -28
- package/src/lib/types.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -33,18 +33,21 @@ __export(index_exports, {
|
|
|
33
33
|
seoCopilot: () => seoCopilot
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_sanity4 = require("sanity");
|
|
37
37
|
|
|
38
38
|
// src/inspector.ts
|
|
39
39
|
var import_react19 = require("react");
|
|
40
40
|
|
|
41
41
|
// src/components/SEOCopilotPanel.tsx
|
|
42
42
|
var import_react18 = require("react");
|
|
43
|
+
var import_sanity3 = require("sanity");
|
|
43
44
|
var import_react_dom = require("react-dom");
|
|
44
45
|
|
|
45
46
|
// src/hooks/useDocumentContent.ts
|
|
46
47
|
var import_react = require("react");
|
|
47
48
|
var import_structure = require("sanity/structure");
|
|
49
|
+
|
|
50
|
+
// src/lib/documentExtract.ts
|
|
48
51
|
function extractText(blocks) {
|
|
49
52
|
if (!blocks || !Array.isArray(blocks)) return "";
|
|
50
53
|
const parts = [];
|
|
@@ -106,6 +109,79 @@ function extractBodyLinks(blocks) {
|
|
|
106
109
|
}
|
|
107
110
|
return Array.from(urls);
|
|
108
111
|
}
|
|
112
|
+
function detectSlug(val) {
|
|
113
|
+
if (!val) return void 0;
|
|
114
|
+
const slugTypeFields = ["slug", "url", "urlSlug", "permalink", "pathname"];
|
|
115
|
+
for (const f of slugTypeFields) {
|
|
116
|
+
const obj = val[f];
|
|
117
|
+
if (obj && typeof obj === "object" && typeof obj.current === "string" && obj.current.trim()) {
|
|
118
|
+
return obj.current.trim();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const stringFields = ["urlSlug", "url", "URL", "path", "permalink", "pathname"];
|
|
122
|
+
const slugShape = /^[a-z0-9._~-]+(?:\/[a-z0-9._~-]+)*\/?$/i;
|
|
123
|
+
for (const f of stringFields) {
|
|
124
|
+
const v = val[f];
|
|
125
|
+
if (typeof v === "string") {
|
|
126
|
+
const trimmed = v.trim();
|
|
127
|
+
if (trimmed && !/^https?:\/\//i.test(trimmed) && slugShape.test(trimmed)) {
|
|
128
|
+
return trimmed;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return void 0;
|
|
133
|
+
}
|
|
134
|
+
function detectAuthor(val) {
|
|
135
|
+
if (!val) return { authorIsReference: false };
|
|
136
|
+
const candidateFields = [
|
|
137
|
+
"author",
|
|
138
|
+
"authors",
|
|
139
|
+
"byline",
|
|
140
|
+
"articleAuthor",
|
|
141
|
+
"primaryAuthor",
|
|
142
|
+
"writer",
|
|
143
|
+
"writers",
|
|
144
|
+
"contributor",
|
|
145
|
+
"contributors",
|
|
146
|
+
"authorMapping",
|
|
147
|
+
// MJH schema - array of author references
|
|
148
|
+
"Author",
|
|
149
|
+
"Authors"
|
|
150
|
+
// PascalCase variants
|
|
151
|
+
];
|
|
152
|
+
const dynamic = Object.keys(val).filter(
|
|
153
|
+
// Author/byline-ish names, but never fact-check/reviewer fields, nor image/url/
|
|
154
|
+
// id sidecars (e.g. authorPhoto, authorImageUrl, authorId) that could otherwise
|
|
155
|
+
// be mistaken for a reference-typed author.
|
|
156
|
+
(k) => /author|byline/i.test(k) && !/fact|check|review|photo|image|avatar|picture|url|link|count|id$/i.test(k)
|
|
157
|
+
);
|
|
158
|
+
const fields = Array.from(/* @__PURE__ */ new Set([...candidateFields, ...dynamic]));
|
|
159
|
+
for (const f of fields) {
|
|
160
|
+
const raw = val[f];
|
|
161
|
+
if (!raw) continue;
|
|
162
|
+
const first = Array.isArray(raw) ? raw[0] : raw;
|
|
163
|
+
if (!first) continue;
|
|
164
|
+
if (typeof first === "string") {
|
|
165
|
+
const trimmed = first.trim();
|
|
166
|
+
if (trimmed) return { authorName: trimmed, authorIsReference: false };
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (typeof first === "object" && first !== null) {
|
|
170
|
+
const o = first;
|
|
171
|
+
const name = o.name || o.fullName || o.displayName;
|
|
172
|
+
const creds = o.credentials || o.title || o.suffix;
|
|
173
|
+
const slug = o.slug?.current;
|
|
174
|
+
const bio = o.bioUrl || (slug ? `/author/${slug}` : void 0);
|
|
175
|
+
if (name) {
|
|
176
|
+
return { authorName: name, authorCredentials: creds, authorBioUrl: bio, authorIsReference: false };
|
|
177
|
+
}
|
|
178
|
+
if (typeof o._ref === "string" || o._type === "reference") {
|
|
179
|
+
return { authorIsReference: true };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { authorIsReference: false };
|
|
184
|
+
}
|
|
109
185
|
function extractImageMeta(value) {
|
|
110
186
|
const names = [];
|
|
111
187
|
const titles = [];
|
|
@@ -122,11 +198,60 @@ function extractImageMeta(value) {
|
|
|
122
198
|
if (typeof img.title === "string" && img.title) titles.push(img.title);
|
|
123
199
|
else if (asset && typeof asset.title === "string" && asset.title) titles.push(asset.title);
|
|
124
200
|
}
|
|
201
|
+
const body = value.body;
|
|
202
|
+
if (Array.isArray(body)) {
|
|
203
|
+
for (const blk of body) {
|
|
204
|
+
if (!blk || typeof blk !== "object") continue;
|
|
205
|
+
const b = blk;
|
|
206
|
+
if (b._type !== "figure" && b._type !== "image") continue;
|
|
207
|
+
const asset = b.asset && typeof b.asset === "object" ? b.asset : void 0;
|
|
208
|
+
if (!asset && b._type !== "image") continue;
|
|
209
|
+
count++;
|
|
210
|
+
if (typeof b.alt === "string" && b.alt) names.push(b.alt);
|
|
211
|
+
if (asset && typeof asset.originalFilename === "string" && asset.originalFilename) names.push(asset.originalFilename);
|
|
212
|
+
if (typeof b.title === "string" && b.title) titles.push(b.title);
|
|
213
|
+
else if (asset && typeof asset.title === "string" && asset.title) titles.push(asset.title);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
125
216
|
return { names, titles, count };
|
|
126
217
|
}
|
|
218
|
+
function buildDocumentFields(value) {
|
|
219
|
+
const val = value;
|
|
220
|
+
const title = val?.title;
|
|
221
|
+
const body = val?.body;
|
|
222
|
+
const { authorName, authorCredentials, authorBioUrl, authorIsReference } = detectAuthor(val);
|
|
223
|
+
const imageMeta = val ? extractImageMeta(val) : { names: [], titles: [], count: 0 };
|
|
224
|
+
return {
|
|
225
|
+
title: title || void 0,
|
|
226
|
+
// MJH uses `summary`; standard Sanity SEO plugins use `metaDescription`
|
|
227
|
+
metaDescription: val?.metaDescription || val?.summary || val?.description || val?.seoDescription,
|
|
228
|
+
slug: detectSlug(val),
|
|
229
|
+
imageNames: imageMeta.names,
|
|
230
|
+
imageTitles: imageMeta.titles,
|
|
231
|
+
imageCount: imageMeta.count,
|
|
232
|
+
headings: extractHeadings(body),
|
|
233
|
+
headingsDetailed: extractHeadingsDetailed(body),
|
|
234
|
+
bodyLinks: extractBodyLinks(body),
|
|
235
|
+
contentCategory: val?.contentCategory || val?.category,
|
|
236
|
+
contentPlacement: Array.isArray(val?.contentPlacement) ? val.contentPlacement : void 0,
|
|
237
|
+
authorName,
|
|
238
|
+
authorCredentials,
|
|
239
|
+
authorBioUrl,
|
|
240
|
+
authorIsReference,
|
|
241
|
+
// `published` is MJH's date field; `publishedAt`/`publishDate` cover other schemas
|
|
242
|
+
publishedAt: val?.published || val?.publishedAt || val?.publishDate || val?._createdAt,
|
|
243
|
+
// `updatedOn` is MJH's "Updated On" field. `updatedAt` is the standard Sanity convention.
|
|
244
|
+
// `_updatedAt` is the Sanity-managed timestamp as a final fallback.
|
|
245
|
+
updatedAt: val?.updatedOn || val?.updatedAt || val?._updatedAt,
|
|
246
|
+
lastReviewedAt: val?.lastReviewedAt || val?.lastReviewed || val?.medicallyReviewedAt
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// src/hooks/useDocumentContent.ts
|
|
127
251
|
function useDocumentContent() {
|
|
128
252
|
const { value, ready } = (0, import_structure.useDocumentPane)();
|
|
129
253
|
const documentId = value?._id || void 0;
|
|
254
|
+
const documentType = value?._type || void 0;
|
|
130
255
|
const title = value?.title;
|
|
131
256
|
const body = value?.body;
|
|
132
257
|
const [debouncedText, setDebouncedText] = (0, import_react.useState)("");
|
|
@@ -143,43 +268,7 @@ function useDocumentContent() {
|
|
|
143
268
|
(0, import_react.useEffect)(() => {
|
|
144
269
|
const bodyText = extractText(body);
|
|
145
270
|
const fullText = [title, bodyText].filter(Boolean).join("\n\n");
|
|
146
|
-
const
|
|
147
|
-
let authorName;
|
|
148
|
-
let authorCredentials;
|
|
149
|
-
let authorBioUrl;
|
|
150
|
-
let authorIsReference = false;
|
|
151
|
-
const author = val?.author || Array.isArray(val?.authors) && val.authors[0] || val?.byline;
|
|
152
|
-
if (typeof author === "string") {
|
|
153
|
-
authorName = author;
|
|
154
|
-
} else if (author && typeof author === "object") {
|
|
155
|
-
authorName = author.name || author.fullName || author.displayName;
|
|
156
|
-
authorCredentials = author.credentials || author.title || author.suffix;
|
|
157
|
-
authorBioUrl = author.bioUrl || (author.slug?.current ? `/author/${author.slug.current}` : void 0);
|
|
158
|
-
if (!authorName && typeof author._ref === "string") {
|
|
159
|
-
authorIsReference = true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
const imageMeta = val ? extractImageMeta(val) : { names: [], titles: [], count: 0 };
|
|
163
|
-
const fields = {
|
|
164
|
-
title: title || void 0,
|
|
165
|
-
metaDescription: val?.metaDescription || val?.summary || val?.description || val?.seoDescription,
|
|
166
|
-
slug: val?.slug?.current || void 0,
|
|
167
|
-
imageNames: imageMeta.names,
|
|
168
|
-
imageTitles: imageMeta.titles,
|
|
169
|
-
imageCount: imageMeta.count,
|
|
170
|
-
headings: extractHeadings(body),
|
|
171
|
-
headingsDetailed: extractHeadingsDetailed(body),
|
|
172
|
-
bodyLinks: extractBodyLinks(body),
|
|
173
|
-
contentCategory: val?.contentCategory || val?.category,
|
|
174
|
-
contentPlacement: Array.isArray(val?.contentPlacement) ? val.contentPlacement : void 0,
|
|
175
|
-
authorName,
|
|
176
|
-
authorCredentials,
|
|
177
|
-
authorBioUrl,
|
|
178
|
-
authorIsReference,
|
|
179
|
-
publishedAt: val?.publishedAt || val?.publishDate || val?._createdAt,
|
|
180
|
-
updatedAt: val?.updatedAt || val?._updatedAt,
|
|
181
|
-
lastReviewedAt: val?.lastReviewedAt || val?.lastReviewed || val?.medicallyReviewedAt
|
|
182
|
-
};
|
|
271
|
+
const fields = buildDocumentFields(value);
|
|
183
272
|
setDocumentFields(fields);
|
|
184
273
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
185
274
|
timerRef.current = setTimeout(() => {
|
|
@@ -190,7 +279,7 @@ function useDocumentContent() {
|
|
|
190
279
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
191
280
|
};
|
|
192
281
|
}, [title, body, value]);
|
|
193
|
-
return { text: debouncedText, isLoading, documentFields, documentId };
|
|
282
|
+
return { text: debouncedText, isLoading, documentFields, documentId, documentType };
|
|
194
283
|
}
|
|
195
284
|
|
|
196
285
|
// src/hooks/useKeywordAnalysis.ts
|
|
@@ -213,28 +302,36 @@ function safeParseJson(text) {
|
|
|
213
302
|
throw new Error("Invalid JSON response from server");
|
|
214
303
|
}
|
|
215
304
|
}
|
|
216
|
-
async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, documentFields, focusKeyword) {
|
|
305
|
+
async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, documentFields, focusKeyword, signal) {
|
|
217
306
|
const response = await fetch(`${apiUrl}/api/seo-copilot/analyze`, {
|
|
218
307
|
method: "POST",
|
|
219
308
|
headers: { "Content-Type": "application/json" },
|
|
220
|
-
body: JSON.stringify({ content, mode, publication, seedKeywords, documentFields, focusKeyword })
|
|
309
|
+
body: JSON.stringify({ content, mode, publication, seedKeywords, documentFields, focusKeyword }),
|
|
310
|
+
signal
|
|
221
311
|
});
|
|
222
312
|
const text = await response.text();
|
|
223
313
|
if (!response.ok) {
|
|
224
314
|
const err = safeParseJson(text);
|
|
225
|
-
|
|
315
|
+
console.error("[seo-copilot] analyze error", response.status, err.error);
|
|
316
|
+
if (response.status === 429) throw new Error("Analysis service is busy. Please try again.");
|
|
317
|
+
if (response.status >= 500) throw new Error("Could not reach the SEO service.");
|
|
318
|
+
throw new Error("Something went wrong analyzing this document.");
|
|
226
319
|
}
|
|
227
320
|
return safeParseJson(text);
|
|
228
321
|
}
|
|
229
|
-
async function fetchChatStream(apiUrl, messages, documentContext, publication, keywordPanelData) {
|
|
322
|
+
async function fetchChatStream(apiUrl, messages, documentContext, publication, keywordPanelData, signal) {
|
|
230
323
|
const response = await fetch(`${apiUrl}/api/seo-copilot/chat`, {
|
|
231
324
|
method: "POST",
|
|
232
325
|
headers: { "Content-Type": "application/json" },
|
|
233
|
-
body: JSON.stringify({ messages, documentContext, publication, keywordPanelData })
|
|
326
|
+
body: JSON.stringify({ messages, documentContext, publication, keywordPanelData }),
|
|
327
|
+
signal
|
|
234
328
|
});
|
|
235
329
|
if (!response.ok) {
|
|
236
330
|
const err = await response.json().catch(() => ({ error: "Request failed" }));
|
|
237
|
-
|
|
331
|
+
console.error("[seo-copilot] chat error", response.status, err.error);
|
|
332
|
+
if (response.status === 429) throw new Error("Analysis service is busy. Please try again.");
|
|
333
|
+
if (response.status >= 500) throw new Error("Could not reach the SEO service.");
|
|
334
|
+
throw new Error("Something went wrong. Please try again.");
|
|
238
335
|
}
|
|
239
336
|
return response.body;
|
|
240
337
|
}
|
|
@@ -245,15 +342,19 @@ async function submitFeedback(apiUrl, data) {
|
|
|
245
342
|
body: JSON.stringify(data)
|
|
246
343
|
});
|
|
247
344
|
}
|
|
248
|
-
async function lookupKeywords(apiUrl, keywords) {
|
|
345
|
+
async function lookupKeywords(apiUrl, keywords, signal) {
|
|
249
346
|
const response = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
|
|
250
347
|
method: "POST",
|
|
251
348
|
headers: { "Content-Type": "application/json" },
|
|
252
|
-
body: JSON.stringify({ keywords })
|
|
349
|
+
body: JSON.stringify({ keywords }),
|
|
350
|
+
signal
|
|
253
351
|
});
|
|
254
352
|
if (!response.ok) {
|
|
255
353
|
const err = await response.json().catch(() => ({ error: "Request failed" }));
|
|
256
|
-
|
|
354
|
+
console.error("[seo-copilot] keywords error", response.status, err.error);
|
|
355
|
+
if (response.status === 429) throw new Error("Analysis service is busy. Please try again.");
|
|
356
|
+
if (response.status >= 500) throw new Error("Could not reach the SEO service.");
|
|
357
|
+
throw new Error("Something went wrong. Please try again.");
|
|
257
358
|
}
|
|
258
359
|
return response.json();
|
|
259
360
|
}
|
|
@@ -389,6 +490,9 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
389
490
|
cacheInitializedRef.current = true;
|
|
390
491
|
return;
|
|
391
492
|
}
|
|
493
|
+
docVersionRef.current += 1;
|
|
494
|
+
volumeAbortRef.current?.abort();
|
|
495
|
+
volumeAbortRef.current = null;
|
|
392
496
|
const fresh = loadCached();
|
|
393
497
|
cached.current = fresh;
|
|
394
498
|
setAnalysisRaw(fresh.analysis);
|
|
@@ -425,15 +529,18 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
425
529
|
}
|
|
426
530
|
}, [text, deepAnalysis, aeoTextSnapshot]);
|
|
427
531
|
const lastAnalysisRef = (0, import_react2.useRef)(null);
|
|
532
|
+
const docVersionRef = (0, import_react2.useRef)(0);
|
|
533
|
+
const volumeAbortRef = (0, import_react2.useRef)(null);
|
|
428
534
|
(0, import_react2.useEffect)(() => {
|
|
429
535
|
if ((!text || text.trim().length < 20) && (!effectiveSeeds || effectiveSeeds.length === 0)) {
|
|
430
536
|
setAnalysis(null);
|
|
431
537
|
return;
|
|
432
538
|
}
|
|
433
539
|
let cancelled = false;
|
|
540
|
+
const controller = new AbortController();
|
|
434
541
|
setIsLoading(true);
|
|
435
542
|
setError(null);
|
|
436
|
-
fetchAnalysis(apiUrl, text, "realtime", publication, effectiveSeeds, documentFields, focusPrimary).then((result) => {
|
|
543
|
+
fetchAnalysis(apiUrl, text, "realtime", publication, effectiveSeeds, documentFields, focusPrimary, controller.signal).then((result) => {
|
|
437
544
|
if (cancelled) return;
|
|
438
545
|
const analysisResult = result;
|
|
439
546
|
lastAnalysisRef.current = analysisResult;
|
|
@@ -453,6 +560,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
453
560
|
doVolumeLookup(analysisResult, uncachedTerms);
|
|
454
561
|
}
|
|
455
562
|
}).catch((err) => {
|
|
563
|
+
if (err instanceof Error && err.name === "AbortError") return;
|
|
456
564
|
if (!cancelled) {
|
|
457
565
|
setError(err.message);
|
|
458
566
|
setIsLoading(false);
|
|
@@ -460,10 +568,12 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
460
568
|
});
|
|
461
569
|
return () => {
|
|
462
570
|
cancelled = true;
|
|
571
|
+
controller.abort();
|
|
463
572
|
};
|
|
464
|
-
}, [text, apiUrl, publication, effectiveSeeds?.join(","), focusPrimary]);
|
|
573
|
+
}, [text, apiUrl, publication, effectiveSeeds?.join(","), focusPrimary, JSON.stringify(documentFields)]);
|
|
465
574
|
const doVolumeLookup = (0, import_react2.useCallback)((analysisResult, terms) => {
|
|
466
575
|
setIsVolumesLoading(true);
|
|
576
|
+
const myVersion = docVersionRef.current;
|
|
467
577
|
const lookupTerms = terms || (() => {
|
|
468
578
|
const candidateTerms = (analysisResult.primaryKeywordCandidates || []).map((c) => c.term);
|
|
469
579
|
return [
|
|
@@ -479,7 +589,11 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
479
589
|
setIsVolumesLoading(false);
|
|
480
590
|
return;
|
|
481
591
|
}
|
|
482
|
-
|
|
592
|
+
volumeAbortRef.current?.abort();
|
|
593
|
+
const controller = new AbortController();
|
|
594
|
+
volumeAbortRef.current = controller;
|
|
595
|
+
lookupKeywords(apiUrl, lookupTerms, controller.signal).then(({ results }) => {
|
|
596
|
+
if (docVersionRef.current !== myVersion) return;
|
|
483
597
|
results.forEach((r) => volumeMapRef.current.set(r.keyword.toLowerCase(), r));
|
|
484
598
|
const current = lastAnalysisRef.current || analysisResult;
|
|
485
599
|
const merged = mergeVolumes(current, volumeMapRef.current);
|
|
@@ -491,7 +605,9 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
491
605
|
} catch {
|
|
492
606
|
}
|
|
493
607
|
setIsVolumesLoading(false);
|
|
494
|
-
}).catch(() => {
|
|
608
|
+
}).catch((err) => {
|
|
609
|
+
if (err instanceof Error && err.name === "AbortError") return;
|
|
610
|
+
if (docVersionRef.current !== myVersion) return;
|
|
495
611
|
setIsVolumesLoading(false);
|
|
496
612
|
});
|
|
497
613
|
}, [apiUrl, cacheKey]);
|
|
@@ -506,10 +622,13 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
506
622
|
setError(null);
|
|
507
623
|
setAeoContentChanged(false);
|
|
508
624
|
setAeoTextSnapshot(text);
|
|
625
|
+
const myVersion = docVersionRef.current;
|
|
509
626
|
fetchAnalysis(apiUrl, text, "deep", publication, effectiveSeeds, documentFields, focusPrimary).then((result) => {
|
|
627
|
+
if (docVersionRef.current !== myVersion) return;
|
|
510
628
|
setDeepAnalysis(result);
|
|
511
629
|
setIsDeepLoading(false);
|
|
512
630
|
}).catch((err) => {
|
|
631
|
+
if (docVersionRef.current !== myVersion) return;
|
|
513
632
|
setError(err.message);
|
|
514
633
|
setIsDeepLoading(false);
|
|
515
634
|
});
|
|
@@ -554,16 +673,10 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
554
673
|
}
|
|
555
674
|
}, [chatCacheKey]);
|
|
556
675
|
const [messages, setMessagesRaw] = (0, import_react3.useState)(loadCachedMessages);
|
|
676
|
+
const messagesRef = (0, import_react3.useRef)([]);
|
|
557
677
|
const setMessages = (0, import_react3.useCallback)((msgs) => {
|
|
558
|
-
setMessagesRaw(
|
|
559
|
-
|
|
560
|
-
try {
|
|
561
|
-
localStorage.setItem(chatCacheKey, JSON.stringify(next));
|
|
562
|
-
} catch {
|
|
563
|
-
}
|
|
564
|
-
return next;
|
|
565
|
-
});
|
|
566
|
-
}, [chatCacheKey]);
|
|
678
|
+
setMessagesRaw(msgs);
|
|
679
|
+
}, []);
|
|
567
680
|
const [isStreaming, setIsStreaming] = (0, import_react3.useState)(false);
|
|
568
681
|
const [historyLoaded, setHistoryLoaded] = (0, import_react3.useState)(false);
|
|
569
682
|
const sanityUser = (0, import_sanity.useCurrentUser)();
|
|
@@ -573,6 +686,24 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
573
686
|
userId.current = sanityUser.id;
|
|
574
687
|
}
|
|
575
688
|
}, [sanityUser?.id]);
|
|
689
|
+
(0, import_react3.useEffect)(() => {
|
|
690
|
+
messagesRef.current = messages;
|
|
691
|
+
}, [messages]);
|
|
692
|
+
(0, import_react3.useEffect)(() => {
|
|
693
|
+
const timer = setTimeout(() => {
|
|
694
|
+
try {
|
|
695
|
+
localStorage.setItem(chatCacheKey, JSON.stringify(messages));
|
|
696
|
+
} catch {
|
|
697
|
+
}
|
|
698
|
+
}, 500);
|
|
699
|
+
return () => clearTimeout(timer);
|
|
700
|
+
}, [messages, chatCacheKey]);
|
|
701
|
+
const streamAbortRef = (0, import_react3.useRef)(null);
|
|
702
|
+
(0, import_react3.useEffect)(() => {
|
|
703
|
+
return () => {
|
|
704
|
+
streamAbortRef.current?.abort();
|
|
705
|
+
};
|
|
706
|
+
}, []);
|
|
576
707
|
const saveTimerRef = (0, import_react3.useRef)(null);
|
|
577
708
|
const opVersionRef = (0, import_react3.useRef)(0);
|
|
578
709
|
const didInitRef = (0, import_react3.useRef)(false);
|
|
@@ -582,6 +713,8 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
582
713
|
return;
|
|
583
714
|
}
|
|
584
715
|
opVersionRef.current += 1;
|
|
716
|
+
streamAbortRef.current?.abort();
|
|
717
|
+
streamAbortRef.current = null;
|
|
585
718
|
setMessagesRaw(loadCachedMessages());
|
|
586
719
|
setIsStreaming(false);
|
|
587
720
|
setHistoryLoaded(false);
|
|
@@ -614,17 +747,21 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
614
747
|
}, [apiUrl, documentId, publication]);
|
|
615
748
|
const sendMessage = (0, import_react3.useCallback)(
|
|
616
749
|
async (text) => {
|
|
750
|
+
const myVersion = opVersionRef.current;
|
|
617
751
|
const userMessage = { role: "user", content: text };
|
|
618
|
-
const updatedMessages = [...
|
|
752
|
+
const updatedMessages = [...messagesRef.current, userMessage];
|
|
619
753
|
setMessages(updatedMessages);
|
|
620
754
|
setIsStreaming(true);
|
|
755
|
+
const controller = new AbortController();
|
|
756
|
+
streamAbortRef.current = controller;
|
|
621
757
|
try {
|
|
622
758
|
const stream = await fetchChatStream(
|
|
623
759
|
apiUrl,
|
|
624
760
|
updatedMessages,
|
|
625
761
|
documentText,
|
|
626
762
|
publication,
|
|
627
|
-
keywordPanelData
|
|
763
|
+
keywordPanelData,
|
|
764
|
+
controller.signal
|
|
628
765
|
);
|
|
629
766
|
if (!stream) {
|
|
630
767
|
setIsStreaming(false);
|
|
@@ -633,10 +770,25 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
633
770
|
const reader = stream.getReader();
|
|
634
771
|
const decoder = new TextDecoder();
|
|
635
772
|
let assistantContent = "";
|
|
773
|
+
if (opVersionRef.current !== myVersion) {
|
|
774
|
+
try {
|
|
775
|
+
await reader.cancel();
|
|
776
|
+
} catch {
|
|
777
|
+
}
|
|
778
|
+
setIsStreaming(false);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
636
781
|
setMessages((prev) => [...prev, { role: "assistant", content: "" }]);
|
|
637
782
|
while (true) {
|
|
638
783
|
const { done, value } = await reader.read();
|
|
639
784
|
if (done) break;
|
|
785
|
+
if (opVersionRef.current !== myVersion) {
|
|
786
|
+
try {
|
|
787
|
+
await reader.cancel();
|
|
788
|
+
} catch {
|
|
789
|
+
}
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
640
792
|
const chunk = decoder.decode(value, { stream: true });
|
|
641
793
|
const lines = chunk.split("\n");
|
|
642
794
|
for (const line of lines) {
|
|
@@ -661,21 +813,31 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
661
813
|
}
|
|
662
814
|
}
|
|
663
815
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
816
|
+
if (opVersionRef.current === myVersion) {
|
|
817
|
+
const finalMessages = [
|
|
818
|
+
...updatedMessages,
|
|
819
|
+
{ role: "assistant", content: assistantContent }
|
|
820
|
+
];
|
|
821
|
+
scheduleSave(finalMessages);
|
|
822
|
+
}
|
|
669
823
|
} catch (err) {
|
|
824
|
+
if (err instanceof Error && err.name === "AbortError") {
|
|
825
|
+
setIsStreaming(false);
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
if (opVersionRef.current !== myVersion) {
|
|
829
|
+
setIsStreaming(false);
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
670
832
|
const errorMsg = err instanceof Error ? err.message : "Chat failed";
|
|
671
833
|
setMessages((prev) => [
|
|
672
834
|
...prev,
|
|
673
835
|
{ role: "assistant", content: `Error: ${errorMsg}` }
|
|
674
836
|
]);
|
|
675
837
|
}
|
|
676
|
-
setIsStreaming(false);
|
|
838
|
+
if (opVersionRef.current === myVersion) setIsStreaming(false);
|
|
677
839
|
},
|
|
678
|
-
[
|
|
840
|
+
[apiUrl, documentText, publication, keywordPanelData, scheduleSave]
|
|
679
841
|
);
|
|
680
842
|
const clearChat = (0, import_react3.useCallback)(() => {
|
|
681
843
|
setMessages([]);
|
|
@@ -805,6 +967,14 @@ var INJECTED_CSS = `
|
|
|
805
967
|
0%, 100% { opacity: 0.5; }
|
|
806
968
|
50% { opacity: 1; }
|
|
807
969
|
}
|
|
970
|
+
@keyframes onboard-in {
|
|
971
|
+
from { opacity: 0; transform: translateY(-6px) scale(0.97); }
|
|
972
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
973
|
+
}
|
|
974
|
+
@keyframes onboard-out {
|
|
975
|
+
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
976
|
+
to { opacity: 0; transform: translateY(-6px) scale(0.97); }
|
|
977
|
+
}
|
|
808
978
|
.prose-chat { font-size: 12.5px; line-height: 1.65; color: #475569; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
|
|
809
979
|
.prose-chat h1 { font-size: 14px; font-weight: 700; color: #1e293b; margin: 10px 0 5px 0; line-height: 1.35; }
|
|
810
980
|
.prose-chat h2, .prose-chat h3 { font-size: 13px; font-weight: 700; color: #1e293b; margin: 10px 0 5px 0; line-height: 1.35; }
|
|
@@ -1343,7 +1513,7 @@ function LightbulbButton({ onClick, isLoading }) {
|
|
|
1343
1513
|
whiteSpace: "nowrap",
|
|
1344
1514
|
pointerEvents: "none",
|
|
1345
1515
|
zIndex: 10
|
|
1346
|
-
}, children: "
|
|
1516
|
+
}, children: "See suggestion" })
|
|
1347
1517
|
]
|
|
1348
1518
|
}
|
|
1349
1519
|
);
|
|
@@ -1531,12 +1701,9 @@ function PrimaryKeywordSelector({
|
|
|
1531
1701
|
fontWeight: isSelected ? 600 : 400,
|
|
1532
1702
|
color: isSelected ? "#166534" : "#374151"
|
|
1533
1703
|
}, children: candidate.term }),
|
|
1534
|
-
candidate.volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
1535
|
-
abbrevVol(candidate.volume),
|
|
1536
|
-
"/mo"
|
|
1537
|
-
] }),
|
|
1704
|
+
candidate.volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: candidate.volume === 0 ? "N/A" : `${abbrevVol(candidate.volume)}/mo` }),
|
|
1538
1705
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { style: { fontSize: 10, color: "#1f2937" }, children: [
|
|
1539
|
-
Math.round(candidate.confidence * 100),
|
|
1706
|
+
Math.round((candidate.confidence ?? 0) * 100),
|
|
1540
1707
|
"% confidence"
|
|
1541
1708
|
] })
|
|
1542
1709
|
] }),
|
|
@@ -1549,6 +1716,119 @@ function PrimaryKeywordSelector({
|
|
|
1549
1716
|
}) })
|
|
1550
1717
|
] });
|
|
1551
1718
|
}
|
|
1719
|
+
function SecondaryKeywordSelector({
|
|
1720
|
+
options,
|
|
1721
|
+
selectedTerm,
|
|
1722
|
+
onSelect
|
|
1723
|
+
}) {
|
|
1724
|
+
const [customInputOpen, setCustomInputOpen] = (0, import_react9.useState)(false);
|
|
1725
|
+
const [customValue, setCustomValue] = (0, import_react9.useState)("");
|
|
1726
|
+
const handleCustomSubmit = () => {
|
|
1727
|
+
const trimmed = customValue.trim();
|
|
1728
|
+
if (trimmed) {
|
|
1729
|
+
onSelect(trimmed);
|
|
1730
|
+
setCustomValue("");
|
|
1731
|
+
setCustomInputOpen(false);
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
const opts = selectedTerm && !options.some((o) => o.term === selectedTerm) ? [...options, { term: selectedTerm, volume: null }] : options;
|
|
1735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: cardStyle, children: [
|
|
1736
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1737
|
+
SectionHeader,
|
|
1738
|
+
{
|
|
1739
|
+
label: "Secondary Keyword",
|
|
1740
|
+
iconColor: MJH_BLUE,
|
|
1741
|
+
actionButton: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
1742
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.05em", textTransform: "uppercase", color: "#9ca3af" }, children: "Optional" }),
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PencilButton, { onClick: () => setCustomInputOpen(!customInputOpen), active: customInputOpen })
|
|
1744
|
+
] })
|
|
1745
|
+
}
|
|
1746
|
+
),
|
|
1747
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 8 }, children: "Pick one more keyword to optimize for. Copilot then checks your title, meta, URL, headings, and images against both keywords." }),
|
|
1748
|
+
customInputOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { marginBottom: 8, display: "flex", gap: 6 }, children: [
|
|
1749
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1750
|
+
"input",
|
|
1751
|
+
{
|
|
1752
|
+
type: "text",
|
|
1753
|
+
value: customValue,
|
|
1754
|
+
onChange: (e) => setCustomValue(e.target.value),
|
|
1755
|
+
onKeyDown: (e) => {
|
|
1756
|
+
if (e.key === "Enter") handleCustomSubmit();
|
|
1757
|
+
},
|
|
1758
|
+
placeholder: "Type a custom secondary keyword",
|
|
1759
|
+
autoFocus: true,
|
|
1760
|
+
style: { flex: 1, padding: "5px 8px", fontSize: 12, borderRadius: 8, border: "1px solid #e5e7eb", outline: "none", fontFamily: "inherit" }
|
|
1761
|
+
}
|
|
1762
|
+
),
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1764
|
+
"button",
|
|
1765
|
+
{
|
|
1766
|
+
onClick: handleCustomSubmit,
|
|
1767
|
+
disabled: !customValue.trim(),
|
|
1768
|
+
style: {
|
|
1769
|
+
padding: "5px 10px",
|
|
1770
|
+
fontSize: 11,
|
|
1771
|
+
fontWeight: 600,
|
|
1772
|
+
borderRadius: 6,
|
|
1773
|
+
border: "none",
|
|
1774
|
+
background: customValue.trim() ? MJH_BLUE : "#e5e7eb",
|
|
1775
|
+
color: customValue.trim() ? "#ffffff" : "#9ca3af",
|
|
1776
|
+
cursor: customValue.trim() ? "pointer" : "not-allowed"
|
|
1777
|
+
},
|
|
1778
|
+
children: "Set"
|
|
1779
|
+
}
|
|
1780
|
+
)
|
|
1781
|
+
] }),
|
|
1782
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SecondaryOptionRow, { term: "", label: "None", selected: !selectedTerm, onSelect: () => onSelect("") }),
|
|
1784
|
+
opts.map((o) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1785
|
+
SecondaryOptionRow,
|
|
1786
|
+
{
|
|
1787
|
+
term: o.term,
|
|
1788
|
+
label: o.term,
|
|
1789
|
+
volume: o.volume,
|
|
1790
|
+
selected: o.term === selectedTerm,
|
|
1791
|
+
onSelect: () => onSelect(o.term)
|
|
1792
|
+
},
|
|
1793
|
+
o.term
|
|
1794
|
+
))
|
|
1795
|
+
] })
|
|
1796
|
+
] });
|
|
1797
|
+
}
|
|
1798
|
+
function SecondaryOptionRow({ term, label, volume, selected, onSelect }) {
|
|
1799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1800
|
+
"div",
|
|
1801
|
+
{
|
|
1802
|
+
onClick: onSelect,
|
|
1803
|
+
style: {
|
|
1804
|
+
display: "flex",
|
|
1805
|
+
alignItems: "center",
|
|
1806
|
+
gap: 8,
|
|
1807
|
+
padding: "6px 8px",
|
|
1808
|
+
borderRadius: 8,
|
|
1809
|
+
cursor: "pointer",
|
|
1810
|
+
background: selected ? "rgba(0,93,172,0.06)" : "transparent",
|
|
1811
|
+
border: selected ? "1px solid rgba(0,93,172,0.2)" : "1px solid transparent",
|
|
1812
|
+
transition: "all 150ms"
|
|
1813
|
+
},
|
|
1814
|
+
children: [
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
|
|
1816
|
+
width: 14,
|
|
1817
|
+
height: 14,
|
|
1818
|
+
borderRadius: "50%",
|
|
1819
|
+
border: selected ? "none" : "2px solid #d1d5db",
|
|
1820
|
+
background: selected ? MJH_BLUE : "transparent",
|
|
1821
|
+
flexShrink: 0,
|
|
1822
|
+
display: "flex",
|
|
1823
|
+
alignItems: "center",
|
|
1824
|
+
justifyContent: "center"
|
|
1825
|
+
}, children: selected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 6, height: 6, borderRadius: "50%", background: "#ffffff" } }) }),
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 12, fontWeight: selected ? 600 : 400, color: term ? selected ? "#00468a" : "#374151" : "#6b7280", flex: 1, minWidth: 0 }, children: label }),
|
|
1827
|
+
volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: volume === 0 ? "N/A" : `${abbrevVol(volume)}/mo` })
|
|
1828
|
+
]
|
|
1829
|
+
}
|
|
1830
|
+
);
|
|
1831
|
+
}
|
|
1552
1832
|
var PLACEMENT_FILTERS = [
|
|
1553
1833
|
{ key: "inBody", label: "Body", letter: "B" },
|
|
1554
1834
|
{ key: "inTitle", label: "Title", letter: "T" },
|
|
@@ -1953,10 +2233,7 @@ function SuggestedKeywordsCard({
|
|
|
1953
2233
|
} }),
|
|
1954
2234
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 12, fontWeight: kw.inContent ? 500 : 600, flexGrow: 1, color: "#1f2937" }, children: kw.term }),
|
|
1955
2235
|
enrichingTerms.has(kw.term) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingBars, { size: "xs", color: "#6b7280" }),
|
|
1956
|
-
!enrichingTerms.has(kw.term) && kw.volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
1957
|
-
abbrevVol(kw.volume),
|
|
1958
|
-
"/mo"
|
|
1959
|
-
] }),
|
|
2236
|
+
!enrichingTerms.has(kw.term) && kw.volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 10.5, fontWeight: 600, color: "#1f2937", flexShrink: 0 }, title: "Monthly searches", children: kw.volume === 0 ? "N/A" : `${abbrevVol(kw.volume)}/mo` }),
|
|
1960
2237
|
kw.placement && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PlacementIndicators, { placement: kw.placement }),
|
|
1961
2238
|
!kw.inContent && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LightbulbButton, { onClick: () => fetchHelp(kw.term), isLoading: loadingTerm === kw.term })
|
|
1962
2239
|
] }),
|
|
@@ -2032,6 +2309,8 @@ function KeywordPanel({
|
|
|
2032
2309
|
seedKeywords = [],
|
|
2033
2310
|
onSeedsChange,
|
|
2034
2311
|
onSelectPrimary,
|
|
2312
|
+
secondaryKeyword = "",
|
|
2313
|
+
onSelectSecondary,
|
|
2035
2314
|
documentFields,
|
|
2036
2315
|
documentId,
|
|
2037
2316
|
externalAnalysis
|
|
@@ -2091,7 +2370,36 @@ function KeywordPanel({
|
|
|
2091
2370
|
placement: computePlacementClient(c.term, text, documentFields)
|
|
2092
2371
|
}));
|
|
2093
2372
|
const activeTerm = candidates.find((c) => c.term === selectedPrimaryTerm) ? selectedPrimaryTerm : candidates[0]?.term ?? "";
|
|
2373
|
+
const secondaryOptions = [];
|
|
2374
|
+
const seenSecondary = /* @__PURE__ */ new Set();
|
|
2375
|
+
for (const c of candidates) {
|
|
2376
|
+
const key = c.term.toLowerCase();
|
|
2377
|
+
if (!seenSecondary.has(key)) {
|
|
2378
|
+
seenSecondary.add(key);
|
|
2379
|
+
secondaryOptions.push({ term: c.term, volume: c.volume });
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
for (const kw of suggestedKeywords) {
|
|
2383
|
+
const key = kw.term.toLowerCase();
|
|
2384
|
+
if (!seenSecondary.has(key)) {
|
|
2385
|
+
seenSecondary.add(key);
|
|
2386
|
+
secondaryOptions.push({ term: kw.term, volume: kw.volume });
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2094
2389
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
2390
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
|
|
2391
|
+
...cardStyle,
|
|
2392
|
+
padding: "11px 13px",
|
|
2393
|
+
background: "rgba(0,93,172,0.05)",
|
|
2394
|
+
boxShadow: "inset 0 0 0 1px rgba(0,93,172,0.12)"
|
|
2395
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { fontSize: 11.5, color: "#1f2937", lineHeight: 1.55 }, children: [
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { style: { color: "#00468a" }, children: "Choose your target keywords." }),
|
|
2397
|
+
" Pick one ",
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Primary" }),
|
|
2399
|
+
" keyword (required) and, optionally, one ",
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Secondary" }),
|
|
2401
|
+
" keyword. Copilot optimizes the whole article - title, meta, URL, headings, and images - toward both."
|
|
2402
|
+
] }) }),
|
|
2095
2403
|
onSeedsChange && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SeedKeywordInput, { seeds: seedKeywords, onSeedsChange }),
|
|
2096
2404
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2097
2405
|
PrimaryKeywordSelector,
|
|
@@ -2105,6 +2413,14 @@ function KeywordPanel({
|
|
|
2105
2413
|
publication
|
|
2106
2414
|
}
|
|
2107
2415
|
),
|
|
2416
|
+
onSelectSecondary && secondaryOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2417
|
+
SecondaryKeywordSelector,
|
|
2418
|
+
{
|
|
2419
|
+
options: secondaryOptions,
|
|
2420
|
+
selectedTerm: secondaryKeyword,
|
|
2421
|
+
onSelect: (term) => onSelectSecondary(term)
|
|
2422
|
+
}
|
|
2423
|
+
),
|
|
2108
2424
|
suggestedKeywords.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2109
2425
|
SuggestedKeywordsCard,
|
|
2110
2426
|
{
|
|
@@ -2675,12 +2991,127 @@ function TabBar({ tabs, activeTab, onTabChange }) {
|
|
|
2675
2991
|
);
|
|
2676
2992
|
}
|
|
2677
2993
|
|
|
2994
|
+
// src/components/OnboardingPopup.tsx
|
|
2995
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2996
|
+
function OnboardingInfoButton({ onClick }) {
|
|
2997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2998
|
+
"button",
|
|
2999
|
+
{
|
|
3000
|
+
onClick: (e) => {
|
|
3001
|
+
e.stopPropagation();
|
|
3002
|
+
onClick();
|
|
3003
|
+
},
|
|
3004
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
3005
|
+
style: {
|
|
3006
|
+
background: "rgba(0,93,172,0.08)",
|
|
3007
|
+
border: "none",
|
|
3008
|
+
borderRadius: "50%",
|
|
3009
|
+
width: 20,
|
|
3010
|
+
height: 20,
|
|
3011
|
+
cursor: "pointer",
|
|
3012
|
+
padding: 0,
|
|
3013
|
+
display: "flex",
|
|
3014
|
+
alignItems: "center",
|
|
3015
|
+
justifyContent: "center",
|
|
3016
|
+
color: MJH_BLUE,
|
|
3017
|
+
flexShrink: 0
|
|
3018
|
+
},
|
|
3019
|
+
title: "How SEO Copilot works",
|
|
3020
|
+
"aria-label": "How SEO Copilot works",
|
|
3021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }) })
|
|
3022
|
+
}
|
|
3023
|
+
);
|
|
3024
|
+
}
|
|
3025
|
+
function OnboardingCard({ onDismiss, closing }) {
|
|
3026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3028
|
+
"div",
|
|
3029
|
+
{
|
|
3030
|
+
onClick: onDismiss,
|
|
3031
|
+
style: {
|
|
3032
|
+
position: "absolute",
|
|
3033
|
+
inset: 0,
|
|
3034
|
+
zIndex: 60,
|
|
3035
|
+
background: "transparent",
|
|
3036
|
+
cursor: "pointer"
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
),
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3041
|
+
"div",
|
|
3042
|
+
{
|
|
3043
|
+
onClick: (e) => e.stopPropagation(),
|
|
3044
|
+
style: {
|
|
3045
|
+
position: "absolute",
|
|
3046
|
+
top: 50,
|
|
3047
|
+
right: 10,
|
|
3048
|
+
left: 10,
|
|
3049
|
+
maxWidth: 320,
|
|
3050
|
+
marginLeft: "auto",
|
|
3051
|
+
zIndex: 61,
|
|
3052
|
+
borderRadius: 18,
|
|
3053
|
+
padding: "14px 16px 16px",
|
|
3054
|
+
// Amorphous blue glass
|
|
3055
|
+
background: "linear-gradient(155deg, rgba(0,93,172,0.16), rgba(0,93,172,0.08))",
|
|
3056
|
+
backdropFilter: "blur(20px) saturate(170%)",
|
|
3057
|
+
WebkitBackdropFilter: "blur(20px) saturate(170%)",
|
|
3058
|
+
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.55), inset 1.5px 2px 1px -1px rgba(255,255,255,0.9), 0 10px 30px rgba(0,93,172,0.22), 0 2px 8px rgba(0,0,0,0.12)",
|
|
3059
|
+
animation: `${closing ? "onboard-out" : "onboard-in"} ${closing ? 180 : 240}ms ease-out forwards`
|
|
3060
|
+
},
|
|
3061
|
+
children: [
|
|
3062
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: 13, fontWeight: 800, color: "#00468a", letterSpacing: "-0.01em" }, children: "Welcome to SEO Copilot" }),
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3065
|
+
"button",
|
|
3066
|
+
{
|
|
3067
|
+
onClick: onDismiss,
|
|
3068
|
+
style: { background: "none", border: "none", cursor: "pointer", padding: 2, display: "flex", color: "#00468a", opacity: 0.7 },
|
|
3069
|
+
title: "Dismiss",
|
|
3070
|
+
"aria-label": "Dismiss",
|
|
3071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
|
|
3072
|
+
}
|
|
3073
|
+
)
|
|
3074
|
+
] }),
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { fontSize: 11.5, color: "#13335a", lineHeight: 1.6 }, children: [
|
|
3076
|
+
"Start on the ",
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("strong", { children: "Keywords" }),
|
|
3078
|
+
" tab. Choose one ",
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("strong", { children: "Primary" }),
|
|
3080
|
+
" keyword (required) and, optionally, one ",
|
|
3081
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("strong", { children: "Secondary" }),
|
|
3082
|
+
" keyword. Copilot then optimizes the whole article - title, meta, URL, headings, and images - toward both."
|
|
3083
|
+
] }),
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3085
|
+
"button",
|
|
3086
|
+
{
|
|
3087
|
+
onClick: onDismiss,
|
|
3088
|
+
style: {
|
|
3089
|
+
marginTop: 12,
|
|
3090
|
+
width: "100%",
|
|
3091
|
+
padding: "7px 12px",
|
|
3092
|
+
fontSize: 11.5,
|
|
3093
|
+
fontWeight: 700,
|
|
3094
|
+
color: "#ffffff",
|
|
3095
|
+
background: MJH_BLUE,
|
|
3096
|
+
border: "none",
|
|
3097
|
+
borderRadius: 8,
|
|
3098
|
+
cursor: "pointer"
|
|
3099
|
+
},
|
|
3100
|
+
children: "Got it"
|
|
3101
|
+
}
|
|
3102
|
+
)
|
|
3103
|
+
]
|
|
3104
|
+
}
|
|
3105
|
+
)
|
|
3106
|
+
] });
|
|
3107
|
+
}
|
|
3108
|
+
|
|
2678
3109
|
// src/components/tabs/SummaryTab.tsx
|
|
2679
3110
|
var import_react13 = require("react");
|
|
2680
3111
|
|
|
2681
3112
|
// src/components/ShimmerLoader.tsx
|
|
2682
3113
|
var import_react12 = require("react");
|
|
2683
|
-
var
|
|
3114
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2684
3115
|
var keyframesInjected = false;
|
|
2685
3116
|
var KEYFRAMES = `
|
|
2686
3117
|
@keyframes seo-copilot-text-shimmer {
|
|
@@ -2689,13 +3120,13 @@ var KEYFRAMES = `
|
|
|
2689
3120
|
}
|
|
2690
3121
|
`;
|
|
2691
3122
|
function LoaderBars({ color = MJH_GOLD }) {
|
|
2692
|
-
return /* @__PURE__ */ (0,
|
|
3123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2693
3124
|
"div",
|
|
2694
3125
|
{
|
|
2695
3126
|
role: "status",
|
|
2696
3127
|
"aria-label": "Loading",
|
|
2697
3128
|
style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: 14, flexShrink: 0 },
|
|
2698
|
-
children: [1, 2, 3].map((i) => /* @__PURE__ */ (0,
|
|
3129
|
+
children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2699
3130
|
"div",
|
|
2700
3131
|
{
|
|
2701
3132
|
style: {
|
|
@@ -2735,7 +3166,7 @@ function ShimmerLoader({
|
|
|
2735
3166
|
return () => clearInterval(id);
|
|
2736
3167
|
}, [messages.length, intervalMs]);
|
|
2737
3168
|
const text = messages[idx] || messages[0] || "";
|
|
2738
|
-
return /* @__PURE__ */ (0,
|
|
3169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2739
3170
|
"div",
|
|
2740
3171
|
{
|
|
2741
3172
|
style: {
|
|
@@ -2747,8 +3178,8 @@ function ShimmerLoader({
|
|
|
2747
3178
|
letterSpacing: "0.01em"
|
|
2748
3179
|
},
|
|
2749
3180
|
children: [
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoaderBars, { color: iconColor }),
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2752
3183
|
"span",
|
|
2753
3184
|
{
|
|
2754
3185
|
style: {
|
|
@@ -2778,7 +3209,13 @@ var DEFAULT_GENERATE_ALL_MESSAGES = [
|
|
|
2778
3209
|
];
|
|
2779
3210
|
|
|
2780
3211
|
// src/lib/scoring.ts
|
|
2781
|
-
function
|
|
3212
|
+
function countWholeMatches(haystack, needle) {
|
|
3213
|
+
if (!needle) return 0;
|
|
3214
|
+
const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3215
|
+
const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
|
|
3216
|
+
return m ? m.length : 0;
|
|
3217
|
+
}
|
|
3218
|
+
function calculateContentScoreDetailed(content, analysis, documentFields) {
|
|
2782
3219
|
if (!content || !analysis) {
|
|
2783
3220
|
return { total: 0, components: [] };
|
|
2784
3221
|
}
|
|
@@ -2787,23 +3224,34 @@ function calculateContentScoreDetailed(content, analysis) {
|
|
|
2787
3224
|
const components = [];
|
|
2788
3225
|
const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
|
|
2789
3226
|
if (primaryTerm) {
|
|
2790
|
-
const
|
|
2791
|
-
const
|
|
2792
|
-
|
|
2793
|
-
|
|
3227
|
+
const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
|
|
3228
|
+
const phraseCount = countWholeMatches(lowerContent, primaryTerm);
|
|
3229
|
+
let occurrences = phraseCount;
|
|
3230
|
+
let viaTokens = false;
|
|
3231
|
+
if (phraseCount === 0 && tokens.length > 0) {
|
|
3232
|
+
const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
|
|
3233
|
+
if (counts.every((c) => c > 0)) {
|
|
3234
|
+
occurrences = Math.min(...counts);
|
|
3235
|
+
viaTokens = true;
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
|
|
2794
3239
|
let pts = 0;
|
|
2795
3240
|
let detail;
|
|
2796
|
-
if (
|
|
3241
|
+
if (occurrences === 0) {
|
|
2797
3242
|
detail = `Primary keyword "${primaryTerm}" not found in content`;
|
|
2798
3243
|
} else {
|
|
2799
3244
|
pts += 12;
|
|
2800
|
-
const density = words > 0 ?
|
|
3245
|
+
const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
|
|
2801
3246
|
if (density >= 0.5 && density <= 2.5) {
|
|
2802
3247
|
pts += 13;
|
|
2803
3248
|
detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
|
|
2804
3249
|
} else if (density < 0.5) {
|
|
2805
3250
|
pts += 7;
|
|
2806
3251
|
detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
|
|
3252
|
+
} else if (viaTokens && density <= 6) {
|
|
3253
|
+
pts += 11;
|
|
3254
|
+
detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
|
|
2807
3255
|
} else {
|
|
2808
3256
|
pts += 4;
|
|
2809
3257
|
detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
|
|
@@ -2842,10 +3290,19 @@ function calculateContentScoreDetailed(content, analysis) {
|
|
|
2842
3290
|
wcDetail = `${words} words - start writing`;
|
|
2843
3291
|
}
|
|
2844
3292
|
components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
|
|
2845
|
-
|
|
2846
|
-
|
|
3293
|
+
let hasH1orTitle;
|
|
3294
|
+
let hasSubheadings;
|
|
3295
|
+
if (documentFields) {
|
|
3296
|
+
hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
|
|
3297
|
+
const det = documentFields.headingsDetailed;
|
|
3298
|
+
const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
|
|
3299
|
+
hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
|
|
3300
|
+
} else {
|
|
3301
|
+
hasH1orTitle = /^#\s|<h1/im.test(content);
|
|
3302
|
+
hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
|
|
3303
|
+
}
|
|
2847
3304
|
const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
|
|
2848
|
-
const structureDetail = !hasH1orTitle && !hasSubheadings ? "No
|
|
3305
|
+
const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
|
|
2849
3306
|
components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
|
|
2850
3307
|
const missingCount = (analysis.missingKeywords || []).length;
|
|
2851
3308
|
let mPts = 0;
|
|
@@ -2863,13 +3320,16 @@ function calculateContentScoreDetailed(content, analysis) {
|
|
|
2863
3320
|
mDetail = `${missingCount} suggested keywords missing - significant gaps`;
|
|
2864
3321
|
}
|
|
2865
3322
|
components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail });
|
|
3323
|
+
let qCount;
|
|
3324
|
+
if (documentFields) {
|
|
3325
|
+
qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
|
|
3326
|
+
} else {
|
|
3327
|
+
qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
|
|
3328
|
+
}
|
|
2866
3329
|
let aeoPts = 0;
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
if (qCount
|
|
2870
|
-
else if (qCount === 2) aeoPts += 4;
|
|
2871
|
-
else if (qCount === 1) aeoPts += 2;
|
|
2872
|
-
if (qCount > 0) aeoPts += 4;
|
|
3330
|
+
if (qCount >= 3) aeoPts = 10;
|
|
3331
|
+
else if (qCount === 2) aeoPts = 7;
|
|
3332
|
+
else if (qCount === 1) aeoPts = 4;
|
|
2873
3333
|
const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
|
|
2874
3334
|
components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
|
|
2875
3335
|
const total = components.reduce((sum, c) => sum + c.points, 0);
|
|
@@ -2884,10 +3344,33 @@ function tokensContain(haystack, needle) {
|
|
|
2884
3344
|
const lower = haystack.toLowerCase();
|
|
2885
3345
|
return tokens.every((t) => lower.includes(t));
|
|
2886
3346
|
}
|
|
3347
|
+
function keywordLeadsSlug(slug, primaryKeyword) {
|
|
3348
|
+
const slugWords = slug.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
3349
|
+
const tokens = primaryKeyword.toLowerCase().split(/\s+/).filter((t) => t.length > 1);
|
|
3350
|
+
if (tokens.length === 0 || slugWords.length === 0) return true;
|
|
3351
|
+
let earliest = Infinity;
|
|
3352
|
+
for (const t of tokens) {
|
|
3353
|
+
const idx = slugWords.findIndex((w) => w.includes(t));
|
|
3354
|
+
if (idx >= 0) earliest = Math.min(earliest, idx);
|
|
3355
|
+
}
|
|
3356
|
+
return earliest <= 2;
|
|
3357
|
+
}
|
|
3358
|
+
function isShortFormContent(documentFields, title) {
|
|
3359
|
+
const cat = (documentFields?.contentCategory || "").toLowerCase().trim();
|
|
3360
|
+
if (/^(videos?|podcasts?|episodes?|webinars?|video series|peer exchange)$/.test(cat)) return true;
|
|
3361
|
+
const shortFormCats = /* @__PURE__ */ new Set(["news", "brief", "preview", "recap", "update", "announcement", "roundup", "digest", "interview"]);
|
|
3362
|
+
const catTokens = cat.split(/[^a-z]+/).filter(Boolean);
|
|
3363
|
+
if (catTokens.some((tok) => shortFormCats.has(tok))) return true;
|
|
3364
|
+
const t = (title || "").toLowerCase();
|
|
3365
|
+
if (/\b(preview|recap|roundup|digest)\b/.test(t)) return true;
|
|
3366
|
+
if (/:\s*\d+\s+(trials|things|takeaways|highlights|tips|questions|charts)/.test(t)) return true;
|
|
3367
|
+
return false;
|
|
3368
|
+
}
|
|
2887
3369
|
function buildSummaryItems(input) {
|
|
2888
3370
|
const items = [];
|
|
2889
3371
|
const { analysis, deepAnalysis, documentFields, linkingSuggestions, linkCheckResults, text } = input;
|
|
2890
|
-
const primaryKeyword = analysis?.primaryKeyword?.term;
|
|
3372
|
+
const primaryKeyword = input.primaryKeyword || analysis?.primaryKeyword?.term;
|
|
3373
|
+
const secondaryKeyword = input.secondaryKeyword || "";
|
|
2891
3374
|
const title = documentFields?.title;
|
|
2892
3375
|
if (!title) {
|
|
2893
3376
|
items.push({
|
|
@@ -2983,39 +3466,40 @@ function buildSummaryItems(input) {
|
|
|
2983
3466
|
items.push({
|
|
2984
3467
|
id: "meta-slug-missing",
|
|
2985
3468
|
category: "meta",
|
|
2986
|
-
severity: "
|
|
3469
|
+
severity: "warning",
|
|
2987
3470
|
label: "URL slug missing",
|
|
2988
3471
|
description: "No URL slug set.",
|
|
2989
|
-
howToFix: "Add a
|
|
2990
|
-
jumpTo: { tab: "
|
|
3472
|
+
howToFix: "Add a short, descriptive slug that leads with your primary keyword.",
|
|
3473
|
+
jumpTo: { tab: "technical", anchorId: "anchor-url-slug" }
|
|
2991
3474
|
});
|
|
2992
3475
|
} else {
|
|
2993
|
-
|
|
3476
|
+
const slugAsWords = slug.replace(/-/g, " ");
|
|
3477
|
+
if (primaryKeyword && !tokensContain(slugAsWords, primaryKeyword)) {
|
|
2994
3478
|
items.push({
|
|
2995
|
-
id: "meta-slug-
|
|
3479
|
+
id: "meta-slug-no-keyword",
|
|
2996
3480
|
category: "meta",
|
|
2997
|
-
severity: "
|
|
2998
|
-
label: "
|
|
2999
|
-
description: `
|
|
3000
|
-
howToFix: "
|
|
3001
|
-
jumpTo: { tab: "
|
|
3481
|
+
severity: "opportunity",
|
|
3482
|
+
label: "Primary keyword not in URL",
|
|
3483
|
+
description: `The URL doesn't include "${primaryKeyword}".`,
|
|
3484
|
+
howToFix: "Work the primary keyword into the URL, ideally at the start. Keep the URL short and descriptive.",
|
|
3485
|
+
jumpTo: { tab: "technical", anchorId: "anchor-url-slug" }
|
|
3002
3486
|
});
|
|
3003
|
-
}
|
|
3004
|
-
if (primaryKeyword && !tokensContain(slug.replace(/-/g, " "), primaryKeyword)) {
|
|
3487
|
+
} else if (primaryKeyword && !keywordLeadsSlug(slug, primaryKeyword)) {
|
|
3005
3488
|
items.push({
|
|
3006
|
-
id: "meta-slug-
|
|
3489
|
+
id: "meta-slug-keyword-late",
|
|
3007
3490
|
category: "meta",
|
|
3008
3491
|
severity: "opportunity",
|
|
3009
|
-
label: "Primary keyword
|
|
3010
|
-
description: `
|
|
3011
|
-
howToFix: "
|
|
3012
|
-
jumpTo: { tab: "
|
|
3492
|
+
label: "Primary keyword late in URL",
|
|
3493
|
+
description: `"${primaryKeyword}" is in the URL but not near the start.`,
|
|
3494
|
+
howToFix: "Lead the URL with the primary keyword so it stays visible if the address gets shortened.",
|
|
3495
|
+
jumpTo: { tab: "technical", anchorId: "anchor-url-slug" }
|
|
3013
3496
|
});
|
|
3014
3497
|
}
|
|
3015
3498
|
}
|
|
3016
3499
|
const wordCount2 = text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
|
|
3500
|
+
const isShortForm = isShortFormContent(documentFields, title);
|
|
3017
3501
|
if (wordCount2 === 0) {
|
|
3018
|
-
} else if (wordCount2 < 450) {
|
|
3502
|
+
} else if (wordCount2 < 450 && !isShortForm) {
|
|
3019
3503
|
items.push({
|
|
3020
3504
|
id: "content-too-short",
|
|
3021
3505
|
category: "content",
|
|
@@ -3025,20 +3509,20 @@ function buildSummaryItems(input) {
|
|
|
3025
3509
|
howToFix: "Add more body text. A link or image on its own doesn't count - the article needs real written substance.",
|
|
3026
3510
|
jumpTo: { tab: "technical", anchorId: "anchor-word-count" }
|
|
3027
3511
|
});
|
|
3028
|
-
} else if (wordCount2 < 1500) {
|
|
3512
|
+
} else if (wordCount2 < 1500 && !isShortForm) {
|
|
3029
3513
|
items.push({
|
|
3030
3514
|
id: "content-short-for-clinical",
|
|
3031
3515
|
category: "content",
|
|
3032
|
-
severity: "
|
|
3516
|
+
severity: "opportunity",
|
|
3033
3517
|
label: "Article could be longer",
|
|
3034
|
-
description: `${wordCount2} words. 1,500+
|
|
3035
|
-
howToFix: "
|
|
3518
|
+
description: `${wordCount2} words. For evergreen clinical topics 1,500+ tends to rank better - news, previews, and briefs are fine shorter.`,
|
|
3519
|
+
howToFix: "If this is an in-depth clinical piece, expand with citations, comparative data, or guideline references. For news or previews, this length is appropriate.",
|
|
3036
3520
|
jumpTo: { tab: "technical", anchorId: "anchor-word-count" }
|
|
3037
3521
|
});
|
|
3038
3522
|
}
|
|
3039
3523
|
const headings = documentFields?.headings || [];
|
|
3040
3524
|
const headingsDetailed = documentFields?.headingsDetailed;
|
|
3041
|
-
const h2Count = headingsDetailed ? headingsDetailed.filter((h) => h.level === 2).length : headings.length;
|
|
3525
|
+
const h2Count = headingsDetailed ? headingsDetailed.filter((h) => h.level === 2 || h.level === 3).length : headings.length;
|
|
3042
3526
|
if (headings.length === 0 && wordCount2 > 200 && wordCount2 < 1e3) {
|
|
3043
3527
|
items.push({
|
|
3044
3528
|
id: "headings-missing",
|
|
@@ -3178,7 +3662,7 @@ function buildSummaryItems(input) {
|
|
|
3178
3662
|
}
|
|
3179
3663
|
const imageTitleCount = (documentFields?.imageTitles || []).length;
|
|
3180
3664
|
const totalImageCount = documentFields?.imageCount ?? 0;
|
|
3181
|
-
const missingTitles = totalImageCount > 0 ? totalImageCount - imageTitleCount : 0;
|
|
3665
|
+
const missingTitles = totalImageCount > 0 && imageTitleCount > 0 ? totalImageCount - imageTitleCount : 0;
|
|
3182
3666
|
if (missingTitles > 0) {
|
|
3183
3667
|
items.push({
|
|
3184
3668
|
id: "images-titles-missing",
|
|
@@ -3203,9 +3687,70 @@ function buildSummaryItems(input) {
|
|
|
3203
3687
|
jumpTo: { tab: "keywords" }
|
|
3204
3688
|
});
|
|
3205
3689
|
}
|
|
3690
|
+
const primaryVolume = analysis?.primaryKeyword?.volume;
|
|
3691
|
+
if (deepAnalysis && primaryVolume === 0) {
|
|
3692
|
+
items.push({
|
|
3693
|
+
id: "keywords-primary-zero-volume",
|
|
3694
|
+
category: "keywords",
|
|
3695
|
+
severity: "warning",
|
|
3696
|
+
label: "Primary keyword has no search volume",
|
|
3697
|
+
description: `"${primaryKeyword}" shows no measurable monthly searches, so even ranking #1 brings little traffic.`,
|
|
3698
|
+
howToFix: "Pick a primary people actually search for - check your supporting keywords for higher-volume options, or set a new primary on the Keywords tab.",
|
|
3699
|
+
jumpTo: { tab: "keywords" }
|
|
3700
|
+
});
|
|
3701
|
+
}
|
|
3206
3702
|
}
|
|
3207
|
-
|
|
3208
|
-
|
|
3703
|
+
if (secondaryKeyword) {
|
|
3704
|
+
if (text && !tokensContain(text, secondaryKeyword)) {
|
|
3705
|
+
items.push({
|
|
3706
|
+
id: "secondary-not-in-body",
|
|
3707
|
+
category: "keywords",
|
|
3708
|
+
severity: "opportunity",
|
|
3709
|
+
label: "Secondary keyword not in body",
|
|
3710
|
+
description: `Your secondary keyword "${secondaryKeyword}" doesn't appear in the article body.`,
|
|
3711
|
+
howToFix: "Work the secondary keyword into a body paragraph or two where it reads naturally.",
|
|
3712
|
+
jumpTo: { tab: "keywords" }
|
|
3713
|
+
});
|
|
3714
|
+
}
|
|
3715
|
+
const titleVal = documentFields?.title;
|
|
3716
|
+
if (titleVal && !tokensContain(titleVal, secondaryKeyword)) {
|
|
3717
|
+
items.push({
|
|
3718
|
+
id: "secondary-not-in-title",
|
|
3719
|
+
category: "meta",
|
|
3720
|
+
severity: "opportunity",
|
|
3721
|
+
label: "Secondary keyword not in title",
|
|
3722
|
+
description: `The title leads with the primary keyword but doesn't include "${secondaryKeyword}".`,
|
|
3723
|
+
howToFix: "If it fits naturally, include the secondary keyword in the title too - but never at the cost of the primary leading.",
|
|
3724
|
+
jumpTo: { tab: "meta", anchorId: "anchor-meta-title" }
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3727
|
+
const metaVal = documentFields?.metaDescription;
|
|
3728
|
+
if (metaVal && !tokensContain(metaVal, secondaryKeyword)) {
|
|
3729
|
+
items.push({
|
|
3730
|
+
id: "secondary-not-in-meta",
|
|
3731
|
+
category: "meta",
|
|
3732
|
+
severity: "opportunity",
|
|
3733
|
+
label: "Secondary keyword not in meta description",
|
|
3734
|
+
description: `The meta description doesn't include "${secondaryKeyword}".`,
|
|
3735
|
+
howToFix: "Add the secondary keyword to the meta description if it reads naturally.",
|
|
3736
|
+
jumpTo: { tab: "meta", anchorId: "anchor-meta-description" }
|
|
3737
|
+
});
|
|
3738
|
+
}
|
|
3739
|
+
const slugVal = documentFields?.slug;
|
|
3740
|
+
if (slugVal && !tokensContain(slugVal.replace(/-/g, " "), secondaryKeyword)) {
|
|
3741
|
+
items.push({
|
|
3742
|
+
id: "secondary-not-in-url",
|
|
3743
|
+
category: "meta",
|
|
3744
|
+
severity: "opportunity",
|
|
3745
|
+
label: "Secondary keyword not in URL",
|
|
3746
|
+
description: `The URL doesn't include "${secondaryKeyword}".`,
|
|
3747
|
+
howToFix: "Optionally include the secondary keyword in the URL after the primary - only if the slug stays short and clean.",
|
|
3748
|
+
jumpTo: { tab: "technical", anchorId: "anchor-url-slug" }
|
|
3749
|
+
});
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
const actualQuestionHeadings = (documentFields?.headings || []).filter((h) => h.trim().endsWith("?"));
|
|
3753
|
+
if (deepAnalysis && actualQuestionHeadings.length === 0 && wordCount2 > 300) {
|
|
3209
3754
|
items.push({
|
|
3210
3755
|
id: "aeo-no-question-headings",
|
|
3211
3756
|
category: "aeo",
|
|
@@ -3253,6 +3798,18 @@ function buildSummaryItems(input) {
|
|
|
3253
3798
|
jumpTo: { tab: "technical", anchorId: "anchor-link-check" }
|
|
3254
3799
|
});
|
|
3255
3800
|
}
|
|
3801
|
+
const unverified = linkCheckResults.filter((r) => r.category === "unverified");
|
|
3802
|
+
if (unverified.length > 0) {
|
|
3803
|
+
items.push({
|
|
3804
|
+
id: "unverified-links",
|
|
3805
|
+
category: "technical",
|
|
3806
|
+
severity: "warning",
|
|
3807
|
+
label: `${unverified.length} link${unverified.length === 1 ? "" : "s"} couldn't be auto-verified`,
|
|
3808
|
+
description: `${unverified.length} link${unverified.length === 1 ? " was" : "s were"} blocked by an anti-bot wall (401/403/429) - the URLs may work fine for readers, our server just couldn't confirm.`,
|
|
3809
|
+
howToFix: "Open each one manually in a new tab to confirm it loads, then ignore the warning if it does.",
|
|
3810
|
+
jumpTo: { tab: "technical", anchorId: "anchor-link-check" }
|
|
3811
|
+
});
|
|
3812
|
+
}
|
|
3256
3813
|
}
|
|
3257
3814
|
if (deepAnalysis) {
|
|
3258
3815
|
const readability = deepAnalysis.readabilityNotes || [];
|
|
@@ -3302,7 +3859,7 @@ function buildSummaryItems(input) {
|
|
|
3302
3859
|
}
|
|
3303
3860
|
|
|
3304
3861
|
// src/components/tabs/SummaryTab.tsx
|
|
3305
|
-
var
|
|
3862
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3306
3863
|
var cardStyle2 = {
|
|
3307
3864
|
borderRadius: 14,
|
|
3308
3865
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -3326,9 +3883,9 @@ function scoreColors(score) {
|
|
|
3326
3883
|
}
|
|
3327
3884
|
function ScoreBadge({ score, breakdown }) {
|
|
3328
3885
|
const c = scoreColors(score);
|
|
3329
|
-
return /* @__PURE__ */ (0,
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3331
|
-
/* @__PURE__ */ (0,
|
|
3886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: cardStyle2, children: [
|
|
3887
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
|
|
3888
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3332
3889
|
"div",
|
|
3333
3890
|
{
|
|
3334
3891
|
style: {
|
|
@@ -3344,30 +3901,30 @@ function ScoreBadge({ score, breakdown }) {
|
|
|
3344
3901
|
lineHeight: 1
|
|
3345
3902
|
},
|
|
3346
3903
|
children: [
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3348
|
-
/* @__PURE__ */ (0,
|
|
3904
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 20, fontWeight: 700, color: c.text }, children: score }),
|
|
3905
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 8, fontWeight: 700, color: c.text, opacity: 0.7, letterSpacing: "0.06em", marginTop: 2 }, children: "/ 100" })
|
|
3349
3906
|
]
|
|
3350
3907
|
}
|
|
3351
3908
|
),
|
|
3352
|
-
/* @__PURE__ */ (0,
|
|
3353
|
-
/* @__PURE__ */ (0,
|
|
3354
|
-
/* @__PURE__ */ (0,
|
|
3909
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3910
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 14, fontWeight: 700, color: c.text }, children: c.label })
|
|
3355
3912
|
] })
|
|
3356
3913
|
] }),
|
|
3357
|
-
breakdown.length > 0 && /* @__PURE__ */ (0,
|
|
3914
|
+
breakdown.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
|
|
3358
3915
|
const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
|
|
3359
3916
|
const barColor = pct >= 75 ? "#16a34a" : pct >= 40 ? "#E6C01B" : "#dc2626";
|
|
3360
|
-
return /* @__PURE__ */ (0,
|
|
3361
|
-
/* @__PURE__ */ (0,
|
|
3362
|
-
/* @__PURE__ */ (0,
|
|
3363
|
-
/* @__PURE__ */ (0,
|
|
3917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3918
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
|
|
3919
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
|
|
3920
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { fontSize: 11, color: "#4b5563", fontVariantNumeric: "tabular-nums" }, children: [
|
|
3364
3921
|
comp.points,
|
|
3365
3922
|
" / ",
|
|
3366
3923
|
comp.max
|
|
3367
3924
|
] })
|
|
3368
3925
|
] }),
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3370
|
-
/* @__PURE__ */ (0,
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { width: `${pct}%`, height: "100%", background: barColor, transition: "width 200ms" } }) }),
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
|
|
3371
3928
|
] }, i);
|
|
3372
3929
|
}) })
|
|
3373
3930
|
] });
|
|
@@ -3381,7 +3938,7 @@ function ItemCard({ item, onClick }) {
|
|
|
3381
3938
|
const v = severityVisual(item.severity);
|
|
3382
3939
|
const tab = item.jumpTo.tab;
|
|
3383
3940
|
const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
|
|
3384
|
-
return /* @__PURE__ */ (0,
|
|
3941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3385
3942
|
"div",
|
|
3386
3943
|
{
|
|
3387
3944
|
onClick,
|
|
@@ -3398,8 +3955,8 @@ function ItemCard({ item, onClick }) {
|
|
|
3398
3955
|
cursor: "pointer"
|
|
3399
3956
|
},
|
|
3400
3957
|
children: [
|
|
3401
|
-
/* @__PURE__ */ (0,
|
|
3402
|
-
/* @__PURE__ */ (0,
|
|
3958
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
|
|
3959
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3403
3960
|
"div",
|
|
3404
3961
|
{
|
|
3405
3962
|
style: {
|
|
@@ -3412,12 +3969,12 @@ function ItemCard({ item, onClick }) {
|
|
|
3412
3969
|
}
|
|
3413
3970
|
}
|
|
3414
3971
|
),
|
|
3415
|
-
/* @__PURE__ */ (0,
|
|
3416
|
-
/* @__PURE__ */ (0,
|
|
3417
|
-
/* @__PURE__ */ (0,
|
|
3972
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3973
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
|
|
3974
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
|
|
3418
3975
|
] })
|
|
3419
3976
|
] }),
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3977
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3421
3978
|
"div",
|
|
3422
3979
|
{
|
|
3423
3980
|
style: {
|
|
@@ -3429,12 +3986,12 @@ function ItemCard({ item, onClick }) {
|
|
|
3429
3986
|
lineHeight: 1.55
|
|
3430
3987
|
},
|
|
3431
3988
|
children: [
|
|
3432
|
-
/* @__PURE__ */ (0,
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
|
|
3433
3990
|
item.howToFix
|
|
3434
3991
|
]
|
|
3435
3992
|
}
|
|
3436
3993
|
),
|
|
3437
|
-
item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0,
|
|
3994
|
+
item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
|
|
3438
3995
|
"Go to ",
|
|
3439
3996
|
tabLabel,
|
|
3440
3997
|
" \u203A"
|
|
@@ -3450,7 +4007,7 @@ function FilterChip({
|
|
|
3450
4007
|
count,
|
|
3451
4008
|
dotColor
|
|
3452
4009
|
}) {
|
|
3453
|
-
return /* @__PURE__ */ (0,
|
|
4010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3454
4011
|
"button",
|
|
3455
4012
|
{
|
|
3456
4013
|
onClick,
|
|
@@ -3469,9 +4026,9 @@ function FilterChip({
|
|
|
3469
4026
|
transition: "all 150ms"
|
|
3470
4027
|
},
|
|
3471
4028
|
children: [
|
|
3472
|
-
dotColor && /* @__PURE__ */ (0,
|
|
3473
|
-
/* @__PURE__ */ (0,
|
|
3474
|
-
/* @__PURE__ */ (0,
|
|
4029
|
+
dotColor && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: label }),
|
|
4031
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
|
|
3475
4032
|
]
|
|
3476
4033
|
}
|
|
3477
4034
|
);
|
|
@@ -3483,14 +4040,17 @@ function SummaryTab({
|
|
|
3483
4040
|
documentFields,
|
|
3484
4041
|
linkingSuggestions,
|
|
3485
4042
|
linkCheckResults,
|
|
4043
|
+
primaryKeyword,
|
|
4044
|
+
secondaryKeyword,
|
|
3486
4045
|
isAnyLoading,
|
|
3487
4046
|
onGenerateAll,
|
|
3488
4047
|
onItemClick
|
|
3489
4048
|
}) {
|
|
3490
4049
|
const scoreDetail = (0, import_react13.useMemo)(() => {
|
|
3491
4050
|
if (!analysis) return null;
|
|
3492
|
-
|
|
3493
|
-
|
|
4051
|
+
const scored = primaryKeyword && primaryKeyword !== analysis.primaryKeyword?.term ? { ...analysis, primaryKeyword: { ...analysis.primaryKeyword, term: primaryKeyword } } : analysis;
|
|
4052
|
+
return calculateContentScoreDetailed(text, scored, documentFields);
|
|
4053
|
+
}, [text, analysis, documentFields, primaryKeyword]);
|
|
3494
4054
|
const score = scoreDetail?.total ?? null;
|
|
3495
4055
|
const items = (0, import_react13.useMemo)(
|
|
3496
4056
|
() => buildSummaryItems({
|
|
@@ -3500,9 +4060,11 @@ function SummaryTab({
|
|
|
3500
4060
|
contentScore: score,
|
|
3501
4061
|
linkingSuggestions,
|
|
3502
4062
|
linkCheckResults,
|
|
3503
|
-
text
|
|
4063
|
+
text,
|
|
4064
|
+
primaryKeyword,
|
|
4065
|
+
secondaryKeyword
|
|
3504
4066
|
}),
|
|
3505
|
-
[analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text]
|
|
4067
|
+
[analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
|
|
3506
4068
|
);
|
|
3507
4069
|
const [filter, setFilter] = (0, import_react13.useState)("all");
|
|
3508
4070
|
const counts = (0, import_react13.useMemo)(
|
|
@@ -3516,15 +4078,15 @@ function SummaryTab({
|
|
|
3516
4078
|
);
|
|
3517
4079
|
const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
|
|
3518
4080
|
if (!analysis) {
|
|
3519
|
-
return /* @__PURE__ */ (0,
|
|
3520
|
-
/* @__PURE__ */ (0,
|
|
3521
|
-
/* @__PURE__ */ (0,
|
|
4081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
|
|
3522
4084
|
] });
|
|
3523
4085
|
}
|
|
3524
|
-
return /* @__PURE__ */ (0,
|
|
3525
|
-
score != null && scoreDetail && /* @__PURE__ */ (0,
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3527
|
-
isAnyLoading ? /* @__PURE__ */ (0,
|
|
4086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
4087
|
+
score != null && scoreDetail && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScoreBadge, { score, breakdown: scoreDetail.components }),
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: cardStyle2, children: [
|
|
4089
|
+
isAnyLoading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3528
4090
|
"button",
|
|
3529
4091
|
{
|
|
3530
4092
|
onClick: onGenerateAll,
|
|
@@ -3549,27 +4111,27 @@ function SummaryTab({
|
|
|
3549
4111
|
transition: "all 150ms",
|
|
3550
4112
|
letterSpacing: "0.01em"
|
|
3551
4113
|
},
|
|
3552
|
-
children: "
|
|
4114
|
+
children: "Run all analyses"
|
|
3553
4115
|
}
|
|
3554
4116
|
),
|
|
3555
|
-
/* @__PURE__ */ (0,
|
|
4117
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
|
|
3556
4118
|
"Runs the analyses that fill the ",
|
|
3557
|
-
/* @__PURE__ */ (0,
|
|
4119
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "AEO/GEO" }),
|
|
3558
4120
|
", ",
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
4121
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "Linking" }),
|
|
3560
4122
|
", and ",
|
|
3561
|
-
/* @__PURE__ */ (0,
|
|
4123
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "Other Recs" }),
|
|
3562
4124
|
" tabs. New issues they find appear in this Summary as each one finishes."
|
|
3563
4125
|
] })
|
|
3564
4126
|
] }),
|
|
3565
|
-
/* @__PURE__ */ (0,
|
|
3566
|
-
/* @__PURE__ */ (0,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
/* @__PURE__ */ (0,
|
|
3569
|
-
/* @__PURE__ */ (0,
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
|
|
4130
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
|
|
4131
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
|
|
3570
4132
|
] }),
|
|
3571
|
-
/* @__PURE__ */ (0,
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
4133
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4134
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3573
4135
|
"div",
|
|
3574
4136
|
{
|
|
3575
4137
|
style: {
|
|
@@ -3582,15 +4144,15 @@ function SummaryTab({
|
|
|
3582
4144
|
justifyContent: "center",
|
|
3583
4145
|
margin: "0 auto 8px"
|
|
3584
4146
|
},
|
|
3585
|
-
children: /* @__PURE__ */ (0,
|
|
4147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) })
|
|
3586
4148
|
}
|
|
3587
4149
|
),
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3589
|
-
/* @__PURE__ */ (0,
|
|
3590
|
-
] }) : /* @__PURE__ */ (0,
|
|
3591
|
-
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3593
|
-
/* @__PURE__ */ (0,
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
|
|
4151
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
|
|
4152
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
|
|
4153
|
+
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
|
|
4154
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
4155
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
|
|
3594
4156
|
] })
|
|
3595
4157
|
] });
|
|
3596
4158
|
}
|
|
@@ -3605,9 +4167,12 @@ function wordCount(s) {
|
|
|
3605
4167
|
}
|
|
3606
4168
|
function analyzeHeadings(text, headings) {
|
|
3607
4169
|
if (!text || headings.length === 0) return [];
|
|
4170
|
+
const isQuestion = (h) => /\?\s*$/.test(h.trim());
|
|
4171
|
+
const questionHeadings = headings.filter(isQuestion);
|
|
4172
|
+
if (questionHeadings.length === 0) return [];
|
|
3608
4173
|
const headingSet = new Set(headings.map((h) => h.trim().toLowerCase()));
|
|
3609
4174
|
const lower = text.toLowerCase();
|
|
3610
|
-
return
|
|
4175
|
+
return questionHeadings.map((heading) => {
|
|
3611
4176
|
const needle = heading.trim().toLowerCase();
|
|
3612
4177
|
const idx = lower.indexOf(needle);
|
|
3613
4178
|
if (idx === -1) {
|
|
@@ -3639,7 +4204,7 @@ function analyzeFactDensity(text) {
|
|
|
3639
4204
|
const matches = text.match(new RegExp(FACT_PATTERN.source, "gi")) || [];
|
|
3640
4205
|
const factCount = matches.length;
|
|
3641
4206
|
const factsPer1000 = Math.round(factCount / total * 1e3);
|
|
3642
|
-
const sentences = text.split(/
|
|
4207
|
+
const sentences = text.split(/[.!?]+\s+/).filter((s) => s.trim().length > 0);
|
|
3643
4208
|
let drift = 0;
|
|
3644
4209
|
let runWords = 0;
|
|
3645
4210
|
let runHasFact = false;
|
|
@@ -3654,7 +4219,7 @@ function analyzeFactDensity(text) {
|
|
|
3654
4219
|
}
|
|
3655
4220
|
}
|
|
3656
4221
|
let status;
|
|
3657
|
-
if (factsPer1000 >= 8
|
|
4222
|
+
if (factsPer1000 >= 8) status = "strong";
|
|
3658
4223
|
else if (factsPer1000 >= 4) status = "moderate";
|
|
3659
4224
|
else status = "weak";
|
|
3660
4225
|
return { totalWords: total, factCount, factsPerThousandWords: factsPer1000, driftPassages: drift, status };
|
|
@@ -3667,7 +4232,7 @@ function analyzeGEO(text, headings) {
|
|
|
3667
4232
|
}
|
|
3668
4233
|
|
|
3669
4234
|
// src/components/tabs/AEOTab.tsx
|
|
3670
|
-
var
|
|
4235
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3671
4236
|
var AEO_PURPLE = "#005DAC";
|
|
3672
4237
|
var GEO_TEAL = "#C9A716";
|
|
3673
4238
|
var cardStyle3 = {
|
|
@@ -3679,7 +4244,7 @@ var cardStyle3 = {
|
|
|
3679
4244
|
padding: "14px"
|
|
3680
4245
|
};
|
|
3681
4246
|
function AiPill() {
|
|
3682
|
-
return /* @__PURE__ */ (0,
|
|
4247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3683
4248
|
"span",
|
|
3684
4249
|
{
|
|
3685
4250
|
style: {
|
|
@@ -3698,10 +4263,10 @@ function AiPill() {
|
|
|
3698
4263
|
);
|
|
3699
4264
|
}
|
|
3700
4265
|
function SectionHeader2({ label, iconColor, ai }) {
|
|
3701
|
-
return /* @__PURE__ */ (0,
|
|
3702
|
-
/* @__PURE__ */ (0,
|
|
3703
|
-
/* @__PURE__ */ (0,
|
|
3704
|
-
ai && /* @__PURE__ */ (0,
|
|
4266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
|
|
4269
|
+
ai && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AiPill, {})
|
|
3705
4270
|
] });
|
|
3706
4271
|
}
|
|
3707
4272
|
function CopyButton({ text }) {
|
|
@@ -3714,7 +4279,7 @@ function CopyButton({ text }) {
|
|
|
3714
4279
|
} catch {
|
|
3715
4280
|
}
|
|
3716
4281
|
};
|
|
3717
|
-
return /* @__PURE__ */ (0,
|
|
4282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3718
4283
|
"button",
|
|
3719
4284
|
{
|
|
3720
4285
|
onClick: handleCopy,
|
|
@@ -3733,9 +4298,9 @@ function CopyButton({ text }) {
|
|
|
3733
4298
|
transition: "color 150ms"
|
|
3734
4299
|
},
|
|
3735
4300
|
title: copied ? "Copied!" : "Copy to clipboard",
|
|
3736
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
3737
|
-
/* @__PURE__ */ (0,
|
|
3738
|
-
/* @__PURE__ */ (0,
|
|
4301
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M7 3.5A1.5 1.5 0 018.5 2h3.879a1.5 1.5 0 011.06.44l3.122 3.12A1.5 1.5 0 0117 6.622V12.5a1.5 1.5 0 01-1.5 1.5h-1v-3.379a3 3 0 00-.879-2.121L10.5 5.379A3 3 0 008.379 4.5H7v-1z" }),
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M4.5 6A1.5 1.5 0 003 7.5v9A1.5 1.5 0 004.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L9.44 6.439A1.5 1.5 0 008.378 6H4.5z" })
|
|
3739
4304
|
] })
|
|
3740
4305
|
}
|
|
3741
4306
|
);
|
|
@@ -3743,18 +4308,20 @@ function CopyButton({ text }) {
|
|
|
3743
4308
|
function GEOCard({ geo, publication }) {
|
|
3744
4309
|
const [showDetails, setShowDetails] = usePersistentState("seo-copilot-ui-geo-details", false);
|
|
3745
4310
|
const fd = geo.factDensity;
|
|
3746
|
-
const
|
|
3747
|
-
const
|
|
3748
|
-
const
|
|
4311
|
+
const isShort = fd.totalWords > 0 && fd.totalWords < 600;
|
|
4312
|
+
const effectiveStatus = fd.status === "weak" && isShort ? "moderate" : fd.status;
|
|
4313
|
+
const fdColor = effectiveStatus === "strong" ? "#16a34a" : effectiveStatus === "moderate" ? "#8B7310" : "#dc2626";
|
|
4314
|
+
const fdLabel = fd.status === "strong" ? "Strong" : fd.status === "moderate" ? "Moderate" : isShort ? "Light (short-form)" : "Weak";
|
|
4315
|
+
const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
|
|
3749
4316
|
const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
|
|
3750
4317
|
const totalHeadings = geo.headingAudit.length;
|
|
3751
|
-
return /* @__PURE__ */ (0,
|
|
3752
|
-
/* @__PURE__ */ (0,
|
|
3753
|
-
/* @__PURE__ */ (0,
|
|
3754
|
-
/* @__PURE__ */ (0,
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle3, children: [
|
|
4319
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
|
|
3755
4322
|
] }),
|
|
3756
|
-
/* @__PURE__ */ (0,
|
|
3757
|
-
/* @__PURE__ */ (0,
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10, lineHeight: 1.5 }, children: "How easy this article is for ChatGPT, Perplexity, Gemini, and Google's AI Overviews to cite." }),
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3758
4325
|
"div",
|
|
3759
4326
|
{
|
|
3760
4327
|
style: {
|
|
@@ -3767,7 +4334,7 @@ function GEOCard({ geo, publication }) {
|
|
|
3767
4334
|
marginBottom: 8
|
|
3768
4335
|
},
|
|
3769
4336
|
children: [
|
|
3770
|
-
/* @__PURE__ */ (0,
|
|
4337
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3771
4338
|
"div",
|
|
3772
4339
|
{
|
|
3773
4340
|
style: {
|
|
@@ -3783,17 +4350,17 @@ function GEOCard({ geo, publication }) {
|
|
|
3783
4350
|
boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
|
|
3784
4351
|
},
|
|
3785
4352
|
children: [
|
|
3786
|
-
/* @__PURE__ */ (0,
|
|
3787
|
-
/* @__PURE__ */ (0,
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
|
|
4354
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
|
|
3788
4355
|
]
|
|
3789
4356
|
}
|
|
3790
4357
|
),
|
|
3791
|
-
/* @__PURE__ */ (0,
|
|
3792
|
-
/* @__PURE__ */ (0,
|
|
4358
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4359
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
|
|
3793
4360
|
"Fact density: ",
|
|
3794
4361
|
fdLabel
|
|
3795
4362
|
] }),
|
|
3796
|
-
/* @__PURE__ */ (0,
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
|
|
3797
4364
|
fd.factCount,
|
|
3798
4365
|
" specific stat",
|
|
3799
4366
|
fd.factCount === 1 ? "" : "s",
|
|
@@ -3803,13 +4370,13 @@ function GEOCard({ geo, publication }) {
|
|
|
3803
4370
|
fd.factsPerThousandWords,
|
|
3804
4371
|
" per 1,000 words).",
|
|
3805
4372
|
" ",
|
|
3806
|
-
fd.status === "strong" ? "AI engines prefer this density." : fd.status === "moderate" ? "Aim for 8+ per 1,000 words with named sources (NEJM, JAMA, FDA, trial numbers, p-values)." : "Vague claims get skipped. Add specific numbers, trial citations, or dates."
|
|
4373
|
+
fd.status === "strong" ? "AI engines prefer this density." : fd.status === "moderate" ? "Aim for 8+ per 1,000 words with named sources (NEJM, JAMA, FDA, trial numbers, p-values)." : isShort ? "Short-form content naturally has fewer stats - fine for news and previews. Add a citation or two where you can." : "Vague claims get skipped. Add specific numbers, trial citations, or dates."
|
|
3807
4374
|
] })
|
|
3808
4375
|
] })
|
|
3809
4376
|
]
|
|
3810
4377
|
}
|
|
3811
4378
|
),
|
|
3812
|
-
fd.driftPassages > 0 && /* @__PURE__ */ (0,
|
|
4379
|
+
fd.driftPassages > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3813
4380
|
"div",
|
|
3814
4381
|
{
|
|
3815
4382
|
style: {
|
|
@@ -3823,15 +4390,15 @@ function GEOCard({ geo, publication }) {
|
|
|
3823
4390
|
lineHeight: 1.45
|
|
3824
4391
|
},
|
|
3825
4392
|
children: [
|
|
3826
|
-
/* @__PURE__ */ (0,
|
|
4393
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: fd.driftPassages }),
|
|
3827
4394
|
" passage",
|
|
3828
4395
|
fd.driftPassages === 1 ? "" : "s",
|
|
3829
4396
|
" over 200 words with no specific stats or citations. AI engines tend to skip these."
|
|
3830
4397
|
]
|
|
3831
4398
|
}
|
|
3832
4399
|
),
|
|
3833
|
-
totalHeadings > 0 && /* @__PURE__ */ (0,
|
|
3834
|
-
/* @__PURE__ */ (0,
|
|
4400
|
+
totalHeadings > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { marginTop: 4 }, children: [
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3835
4402
|
"button",
|
|
3836
4403
|
{
|
|
3837
4404
|
onClick: () => setShowDetails((v) => !v),
|
|
@@ -3850,22 +4417,22 @@ function GEOCard({ geo, publication }) {
|
|
|
3850
4417
|
color: GEO_TEAL
|
|
3851
4418
|
},
|
|
3852
4419
|
children: [
|
|
3853
|
-
/* @__PURE__ */ (0,
|
|
4420
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
|
|
3854
4421
|
"Short-answer paragraphs: ",
|
|
3855
4422
|
goodCount,
|
|
3856
4423
|
"/",
|
|
3857
4424
|
totalHeadings,
|
|
3858
4425
|
" headings have one"
|
|
3859
4426
|
] }),
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
4427
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
|
|
3861
4428
|
]
|
|
3862
4429
|
}
|
|
3863
4430
|
),
|
|
3864
|
-
showDetails && /* @__PURE__ */ (0,
|
|
3865
|
-
/* @__PURE__ */ (0,
|
|
4431
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4432
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 4 }, children: "Aim for a 40-60 word answer right after each heading. That's the chunk AI engines extract." }),
|
|
3866
4433
|
geo.headingAudit.map((h, i) => {
|
|
3867
4434
|
const c = h.status === "good" ? { bg: "rgba(22,163,74,0.08)", color: "#16a34a", label: `${h.words} words \u2713` } : h.status === "too-short" ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - too short` } : h.status === "too-long" ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - condense to 40-60` } : { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "no body content" };
|
|
3868
|
-
return /* @__PURE__ */ (0,
|
|
4435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3869
4436
|
"div",
|
|
3870
4437
|
{
|
|
3871
4438
|
style: {
|
|
@@ -3879,8 +4446,8 @@ function GEOCard({ geo, publication }) {
|
|
|
3879
4446
|
gap: 8
|
|
3880
4447
|
},
|
|
3881
4448
|
children: [
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
|
|
4450
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
|
|
3884
4451
|
]
|
|
3885
4452
|
},
|
|
3886
4453
|
i
|
|
@@ -3917,8 +4484,8 @@ function AEOTab({
|
|
|
3917
4484
|
originalHeading: void 0,
|
|
3918
4485
|
rationale: h.rationale
|
|
3919
4486
|
})) ?? [];
|
|
3920
|
-
return /* @__PURE__ */ (0,
|
|
3921
|
-
aeoContentChanged && /* @__PURE__ */ (0,
|
|
4487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
4488
|
+
aeoContentChanged && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3922
4489
|
"div",
|
|
3923
4490
|
{
|
|
3924
4491
|
onClick: runDeepAnalysis,
|
|
@@ -3933,30 +4500,30 @@ function AEOTab({
|
|
|
3933
4500
|
cursor: "pointer"
|
|
3934
4501
|
},
|
|
3935
4502
|
children: [
|
|
3936
|
-
/* @__PURE__ */ (0,
|
|
3937
|
-
/* @__PURE__ */ (0,
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
|
|
3938
4505
|
]
|
|
3939
4506
|
}
|
|
3940
4507
|
),
|
|
3941
|
-
hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
3942
|
-
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
3943
|
-
/* @__PURE__ */ (0,
|
|
4508
|
+
hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GEOCard, { geo, publication }),
|
|
4509
|
+
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
|
|
4510
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
|
|
3944
4511
|
" needs at least 150 words to read fact density.",
|
|
3945
|
-
/* @__PURE__ */ (0,
|
|
3946
|
-
/* @__PURE__ */ (0,
|
|
4512
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
|
|
4513
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: { color: "#4b5563" }, children: [
|
|
3947
4514
|
"Current: ",
|
|
3948
4515
|
geoWordCount,
|
|
3949
4516
|
" word",
|
|
3950
4517
|
geoWordCount === 1 ? "" : "s"
|
|
3951
4518
|
] })
|
|
3952
4519
|
] }) }),
|
|
3953
|
-
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0,
|
|
3954
|
-
/* @__PURE__ */ (0,
|
|
3955
|
-
/* @__PURE__ */ (0,
|
|
4520
|
+
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
|
|
4521
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
|
|
3956
4523
|
] }),
|
|
3957
|
-
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0,
|
|
3958
|
-
/* @__PURE__ */ (0,
|
|
3959
|
-
/* @__PURE__ */ (0,
|
|
4524
|
+
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3960
4527
|
"button",
|
|
3961
4528
|
{
|
|
3962
4529
|
onClick: runDeepAnalysis,
|
|
@@ -3976,11 +4543,11 @@ function AEOTab({
|
|
|
3976
4543
|
}
|
|
3977
4544
|
)
|
|
3978
4545
|
] }),
|
|
3979
|
-
deepAnalysis && !aeo && /* @__PURE__ */ (0,
|
|
3980
|
-
questionHeadings.length > 0 && /* @__PURE__ */ (0,
|
|
3981
|
-
/* @__PURE__ */ (0,
|
|
3982
|
-
/* @__PURE__ */ (0,
|
|
3983
|
-
/* @__PURE__ */ (0,
|
|
4546
|
+
deepAnalysis && !aeo && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
|
|
4547
|
+
questionHeadings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle3, children: [
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3984
4551
|
"div",
|
|
3985
4552
|
{
|
|
3986
4553
|
style: {
|
|
@@ -3990,26 +4557,26 @@ function AEOTab({
|
|
|
3990
4557
|
borderLeft: `3px solid ${AEO_PURPLE}`
|
|
3991
4558
|
},
|
|
3992
4559
|
children: [
|
|
3993
|
-
/* @__PURE__ */ (0,
|
|
3994
|
-
/* @__PURE__ */ (0,
|
|
3995
|
-
h.originalHeading && /* @__PURE__ */ (0,
|
|
3996
|
-
/* @__PURE__ */ (0,
|
|
4560
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1 }, children: [
|
|
4562
|
+
h.originalHeading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
|
|
4563
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
|
|
3997
4564
|
] }),
|
|
3998
|
-
/* @__PURE__ */ (0,
|
|
3999
|
-
/* @__PURE__ */ (0,
|
|
4000
|
-
/* @__PURE__ */ (0,
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
4566
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton, { text: h.heading }),
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
|
|
4001
4568
|
] })
|
|
4002
4569
|
] }),
|
|
4003
|
-
/* @__PURE__ */ (0,
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
|
|
4004
4571
|
]
|
|
4005
4572
|
},
|
|
4006
4573
|
i
|
|
4007
4574
|
)) })
|
|
4008
4575
|
] }),
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4010
|
-
/* @__PURE__ */ (0,
|
|
4011
|
-
/* @__PURE__ */ (0,
|
|
4012
|
-
!contentSuggestions && !isCSLoading && /* @__PURE__ */ (0,
|
|
4576
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle3, children: [
|
|
4577
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
|
|
4578
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10 }, children: "Short, citable blocks to use inside or alongside the article - takeaways, infographic ideas, and bullet points." }),
|
|
4579
|
+
!contentSuggestions && !isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4013
4580
|
"button",
|
|
4014
4581
|
{
|
|
4015
4582
|
onClick: loadContentSuggestions,
|
|
@@ -4033,15 +4600,15 @@ function AEOTab({
|
|
|
4033
4600
|
children: "Generate suggestions"
|
|
4034
4601
|
}
|
|
4035
4602
|
),
|
|
4036
|
-
isCSLoading && /* @__PURE__ */ (0,
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
4038
|
-
/* @__PURE__ */ (0,
|
|
4603
|
+
isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
|
|
4604
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
|
|
4039
4606
|
] }),
|
|
4040
|
-
csError && /* @__PURE__ */ (0,
|
|
4041
|
-
contentSuggestions && /* @__PURE__ */ (0,
|
|
4042
|
-
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4044
|
-
/* @__PURE__ */ (0,
|
|
4607
|
+
csError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
|
|
4608
|
+
contentSuggestions && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
|
|
4609
|
+
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
|
|
4611
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4045
4612
|
"div",
|
|
4046
4613
|
{
|
|
4047
4614
|
style: {
|
|
@@ -4054,19 +4621,19 @@ function AEOTab({
|
|
|
4054
4621
|
alignItems: "flex-start"
|
|
4055
4622
|
},
|
|
4056
4623
|
children: [
|
|
4057
|
-
/* @__PURE__ */ (0,
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
4060
|
-
/* @__PURE__ */ (0,
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton, { text: kt }),
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
|
|
4061
4628
|
] })
|
|
4062
4629
|
]
|
|
4063
4630
|
},
|
|
4064
4631
|
i
|
|
4065
4632
|
)) })
|
|
4066
4633
|
] }),
|
|
4067
|
-
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0,
|
|
4068
|
-
/* @__PURE__ */ (0,
|
|
4069
|
-
/* @__PURE__ */ (0,
|
|
4634
|
+
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4070
4637
|
"div",
|
|
4071
4638
|
{
|
|
4072
4639
|
style: {
|
|
@@ -4076,23 +4643,23 @@ function AEOTab({
|
|
|
4076
4643
|
borderLeft: `2px solid ${AEO_PURPLE}`
|
|
4077
4644
|
},
|
|
4078
4645
|
children: [
|
|
4079
|
-
/* @__PURE__ */ (0,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4646
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
|
|
4082
4649
|
] }),
|
|
4083
|
-
/* @__PURE__ */ (0,
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
|
|
4084
4651
|
]
|
|
4085
4652
|
},
|
|
4086
4653
|
i
|
|
4087
4654
|
)) })
|
|
4088
4655
|
] }),
|
|
4089
|
-
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0,
|
|
4090
|
-
/* @__PURE__ */ (0,
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
/* @__PURE__ */ (0,
|
|
4093
|
-
/* @__PURE__ */ (0,
|
|
4094
|
-
/* @__PURE__ */ (0,
|
|
4095
|
-
/* @__PURE__ */ (0,
|
|
4656
|
+
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
4657
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
|
|
4658
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
|
|
4660
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4096
4663
|
FeedbackButton,
|
|
4097
4664
|
{
|
|
4098
4665
|
suggestionType: "aeo_bullets",
|
|
@@ -4103,7 +4670,7 @@ function AEOTab({
|
|
|
4103
4670
|
] })
|
|
4104
4671
|
] })
|
|
4105
4672
|
] }),
|
|
4106
|
-
/* @__PURE__ */ (0,
|
|
4673
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4107
4674
|
"button",
|
|
4108
4675
|
{
|
|
4109
4676
|
onClick: loadContentSuggestions,
|
|
@@ -4133,7 +4700,7 @@ function AEOTab({
|
|
|
4133
4700
|
|
|
4134
4701
|
// src/components/ScoreDonut.tsx
|
|
4135
4702
|
var import_react15 = require("react");
|
|
4136
|
-
var
|
|
4703
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4137
4704
|
var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
|
|
4138
4705
|
var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
|
|
4139
4706
|
var TRACK = "#eef2f7";
|
|
@@ -4158,7 +4725,7 @@ function ScoreDonut({
|
|
|
4158
4725
|
const topicLen = seg(cTopic);
|
|
4159
4726
|
const freshLen = seg(cFresh);
|
|
4160
4727
|
const sectionLen = seg(cSection);
|
|
4161
|
-
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0,
|
|
4728
|
+
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4162
4729
|
"circle",
|
|
4163
4730
|
{
|
|
4164
4731
|
cx: size / 2,
|
|
@@ -4172,20 +4739,20 @@ function ScoreDonut({
|
|
|
4172
4739
|
strokeDashoffset: -offset
|
|
4173
4740
|
}
|
|
4174
4741
|
);
|
|
4175
|
-
return /* @__PURE__ */ (0,
|
|
4742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4176
4743
|
"div",
|
|
4177
4744
|
{
|
|
4178
4745
|
style: { position: "relative", width: size, height: size, flexShrink: 0 },
|
|
4179
4746
|
onMouseEnter: () => setHovered(true),
|
|
4180
4747
|
onMouseLeave: () => setHovered(false),
|
|
4181
4748
|
children: [
|
|
4182
|
-
/* @__PURE__ */ (0,
|
|
4183
|
-
/* @__PURE__ */ (0,
|
|
4184
|
-
/* @__PURE__ */ (0,
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4186
|
-
/* @__PURE__ */ (0,
|
|
4749
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
|
|
4750
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
|
|
4751
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
|
|
4752
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
|
|
4753
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
|
|
4187
4754
|
] }),
|
|
4188
|
-
/* @__PURE__ */ (0,
|
|
4755
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4189
4756
|
"div",
|
|
4190
4757
|
{
|
|
4191
4758
|
style: {
|
|
@@ -4199,15 +4766,15 @@ function ScoreDonut({
|
|
|
4199
4766
|
lineHeight: 1
|
|
4200
4767
|
},
|
|
4201
4768
|
children: [
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4769
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
|
|
4203
4770
|
compositeValue,
|
|
4204
4771
|
"%"
|
|
4205
4772
|
] }),
|
|
4206
|
-
/* @__PURE__ */ (0,
|
|
4773
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
|
|
4207
4774
|
]
|
|
4208
4775
|
}
|
|
4209
4776
|
),
|
|
4210
|
-
hovered && /* @__PURE__ */ (0,
|
|
4777
|
+
hovered && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4211
4778
|
"div",
|
|
4212
4779
|
{
|
|
4213
4780
|
role: "tooltip",
|
|
@@ -4228,9 +4795,9 @@ function ScoreDonut({
|
|
|
4228
4795
|
pointerEvents: "none"
|
|
4229
4796
|
},
|
|
4230
4797
|
children: [
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
|
|
4799
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
|
|
4234
4801
|
]
|
|
4235
4802
|
}
|
|
4236
4803
|
)
|
|
@@ -4239,31 +4806,76 @@ function ScoreDonut({
|
|
|
4239
4806
|
);
|
|
4240
4807
|
}
|
|
4241
4808
|
function SubScoreRow({ color, label, value }) {
|
|
4242
|
-
return /* @__PURE__ */ (0,
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4244
|
-
/* @__PURE__ */ (0,
|
|
4245
|
-
/* @__PURE__ */ (0,
|
|
4809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
|
|
4811
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { flex: 1 }, children: label }),
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
|
|
4246
4813
|
Math.round(value),
|
|
4247
4814
|
"/100"
|
|
4248
4815
|
] })
|
|
4249
4816
|
] });
|
|
4250
4817
|
}
|
|
4251
4818
|
function ScoreDonutLegend() {
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
4253
|
-
/* @__PURE__ */ (0,
|
|
4254
|
-
/* @__PURE__ */ (0,
|
|
4255
|
-
/* @__PURE__ */ (0,
|
|
4819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
|
|
4821
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
|
|
4822
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
|
|
4256
4823
|
] });
|
|
4257
4824
|
}
|
|
4258
4825
|
function LegendDot({ color, label }) {
|
|
4259
|
-
return /* @__PURE__ */ (0,
|
|
4260
|
-
/* @__PURE__ */ (0,
|
|
4826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
4827
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
|
|
4261
4828
|
label
|
|
4262
4829
|
] });
|
|
4263
4830
|
}
|
|
4264
4831
|
|
|
4265
4832
|
// src/components/tabs/LinkingTab.tsx
|
|
4266
|
-
var
|
|
4833
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4834
|
+
function buildLiveUrl(publication, slug) {
|
|
4835
|
+
if (!slug) return null;
|
|
4836
|
+
const pub = (publication || "").trim().toLowerCase();
|
|
4837
|
+
if (!/^[a-z0-9-]+$/.test(pub)) return null;
|
|
4838
|
+
const cleanSlug = slug.replace(/^\/+/, "");
|
|
4839
|
+
return `https://www.${pub}.com/view/${cleanSlug}`;
|
|
4840
|
+
}
|
|
4841
|
+
function buildSanityUrl(baseUrl, id, type) {
|
|
4842
|
+
if (!baseUrl || !id) return null;
|
|
4843
|
+
const cleanId = id.replace(/^drafts\./, "");
|
|
4844
|
+
const base = baseUrl.replace(/\/+$/, "");
|
|
4845
|
+
const typePart = type ? `;type=${encodeURIComponent(type)}` : "";
|
|
4846
|
+
return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
|
|
4847
|
+
}
|
|
4848
|
+
function LinkChip({ href, label, color }) {
|
|
4849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4850
|
+
"a",
|
|
4851
|
+
{
|
|
4852
|
+
href,
|
|
4853
|
+
target: "_blank",
|
|
4854
|
+
rel: "noopener noreferrer",
|
|
4855
|
+
style: {
|
|
4856
|
+
display: "inline-flex",
|
|
4857
|
+
alignItems: "center",
|
|
4858
|
+
gap: 4,
|
|
4859
|
+
padding: "3px 9px",
|
|
4860
|
+
borderRadius: 99,
|
|
4861
|
+
fontSize: 10.5,
|
|
4862
|
+
fontWeight: 700,
|
|
4863
|
+
color,
|
|
4864
|
+
background: "rgba(255,255,255,0.7)",
|
|
4865
|
+
border: `1px solid ${color}33`,
|
|
4866
|
+
textDecoration: "none",
|
|
4867
|
+
lineHeight: 1.2
|
|
4868
|
+
},
|
|
4869
|
+
children: [
|
|
4870
|
+
label,
|
|
4871
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
|
|
4872
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" }),
|
|
4873
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" })
|
|
4874
|
+
] })
|
|
4875
|
+
]
|
|
4876
|
+
}
|
|
4877
|
+
);
|
|
4878
|
+
}
|
|
4267
4879
|
var cardStyle4 = {
|
|
4268
4880
|
borderRadius: 14,
|
|
4269
4881
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -4273,7 +4885,7 @@ var cardStyle4 = {
|
|
|
4273
4885
|
padding: "14px"
|
|
4274
4886
|
};
|
|
4275
4887
|
function AiPill2() {
|
|
4276
|
-
return /* @__PURE__ */ (0,
|
|
4888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4277
4889
|
"span",
|
|
4278
4890
|
{
|
|
4279
4891
|
style: {
|
|
@@ -4297,10 +4909,10 @@ function SectionHeader3({
|
|
|
4297
4909
|
ai,
|
|
4298
4910
|
action
|
|
4299
4911
|
}) {
|
|
4300
|
-
return /* @__PURE__ */ (0,
|
|
4301
|
-
/* @__PURE__ */ (0,
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4303
|
-
ai && /* @__PURE__ */ (0,
|
|
4912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
|
|
4913
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
|
|
4914
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
|
|
4915
|
+
ai && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AiPill2, {}),
|
|
4304
4916
|
action
|
|
4305
4917
|
] });
|
|
4306
4918
|
}
|
|
@@ -4320,7 +4932,7 @@ function freshnessChip(label, score) {
|
|
|
4320
4932
|
"very-old": { bg: "rgba(220,38,38,0.1)", color: "#dc2626", text: "Very old" }
|
|
4321
4933
|
};
|
|
4322
4934
|
const c = map[label];
|
|
4323
|
-
return /* @__PURE__ */ (0,
|
|
4935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4324
4936
|
"span",
|
|
4325
4937
|
{
|
|
4326
4938
|
style: {
|
|
@@ -4340,8 +4952,8 @@ function freshnessChip(label, score) {
|
|
|
4340
4952
|
);
|
|
4341
4953
|
}
|
|
4342
4954
|
function RefreshIcon({ spinning }) {
|
|
4343
|
-
if (spinning) return /* @__PURE__ */ (0,
|
|
4344
|
-
return /* @__PURE__ */ (0,
|
|
4955
|
+
if (spinning) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingBars, { size: "xs", color: "#9ca3af" });
|
|
4956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" }) });
|
|
4345
4957
|
}
|
|
4346
4958
|
function LinkingTab({
|
|
4347
4959
|
analysis,
|
|
@@ -4352,24 +4964,26 @@ function LinkingTab({
|
|
|
4352
4964
|
onRefresh,
|
|
4353
4965
|
text,
|
|
4354
4966
|
documentId,
|
|
4355
|
-
publication
|
|
4967
|
+
publication,
|
|
4968
|
+
sanityBaseUrl,
|
|
4969
|
+
documentType
|
|
4356
4970
|
}) {
|
|
4357
4971
|
if (!analysis) {
|
|
4358
|
-
return /* @__PURE__ */ (0,
|
|
4359
|
-
/* @__PURE__ */ (0,
|
|
4360
|
-
/* @__PURE__ */ (0,
|
|
4972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
|
|
4974
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Linking reads the article keywords and topic to find related published articles. It starts on its own once the Keywords tab finishes." })
|
|
4361
4975
|
] });
|
|
4362
4976
|
}
|
|
4363
4977
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
4364
4978
|
const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
|
|
4365
4979
|
const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
|
|
4366
|
-
return /* @__PURE__ */ (0,
|
|
4367
|
-
/* @__PURE__ */ (0,
|
|
4980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
|
|
4981
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4368
4982
|
SectionHeader3,
|
|
4369
4983
|
{
|
|
4370
4984
|
label: "Suggested Links",
|
|
4371
4985
|
iconColor: MJH_BLUE,
|
|
4372
|
-
action: /* @__PURE__ */ (0,
|
|
4986
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4373
4987
|
"button",
|
|
4374
4988
|
{
|
|
4375
4989
|
onClick: onRefresh,
|
|
@@ -4384,20 +4998,20 @@ function LinkingTab({
|
|
|
4384
4998
|
fontSize: 10
|
|
4385
4999
|
},
|
|
4386
5000
|
title: "Refresh",
|
|
4387
|
-
children: /* @__PURE__ */ (0,
|
|
5001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RefreshIcon, { spinning: isLoading })
|
|
4388
5002
|
}
|
|
4389
5003
|
)
|
|
4390
5004
|
}
|
|
4391
5005
|
),
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
|
|
4393
5007
|
"Other articles on this site that fit this topic.",
|
|
4394
|
-
wordCount2 > 0 && /* @__PURE__ */ (0,
|
|
5008
|
+
wordCount2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
4395
5009
|
" ",
|
|
4396
5010
|
"For a ",
|
|
4397
5011
|
wordCount2.toLocaleString(),
|
|
4398
5012
|
"-word article, aim for",
|
|
4399
5013
|
" ",
|
|
4400
|
-
/* @__PURE__ */ (0,
|
|
5014
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("strong", { children: [
|
|
4401
5015
|
recommendedMin,
|
|
4402
5016
|
"-",
|
|
4403
5017
|
recommendedMax,
|
|
@@ -4406,17 +5020,17 @@ function LinkingTab({
|
|
|
4406
5020
|
"."
|
|
4407
5021
|
] })
|
|
4408
5022
|
] }),
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
|
|
4410
5024
|
"Each suggestion gets a 0-100% match score from three signals - ",
|
|
4411
|
-
/* @__PURE__ */ (0,
|
|
5025
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "topic match" }),
|
|
4412
5026
|
", ",
|
|
4413
|
-
/* @__PURE__ */ (0,
|
|
5027
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "freshness" }),
|
|
4414
5028
|
", and ",
|
|
4415
|
-
/* @__PURE__ */ (0,
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "section fit" }),
|
|
4416
5030
|
" (where in your article the link belongs). The percentage on each card is the weighted total:"
|
|
4417
5031
|
] }),
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4419
|
-
isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0,
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScoreDonutLegend, {}) }),
|
|
5033
|
+
isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4420
5034
|
"div",
|
|
4421
5035
|
{
|
|
4422
5036
|
onClick: onRefresh,
|
|
@@ -4433,16 +5047,16 @@ function LinkingTab({
|
|
|
4433
5047
|
cursor: "pointer"
|
|
4434
5048
|
},
|
|
4435
5049
|
children: [
|
|
4436
|
-
/* @__PURE__ */ (0,
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
5050
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
|
|
5051
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
|
|
4438
5052
|
]
|
|
4439
5053
|
}
|
|
4440
5054
|
),
|
|
4441
|
-
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
5055
|
+
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
5057
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
|
|
4444
5058
|
] }),
|
|
4445
|
-
!isLoading && error && /* @__PURE__ */ (0,
|
|
5059
|
+
!isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4446
5060
|
"div",
|
|
4447
5061
|
{
|
|
4448
5062
|
style: {
|
|
@@ -4453,9 +5067,9 @@ function LinkingTab({
|
|
|
4453
5067
|
textAlign: "center"
|
|
4454
5068
|
},
|
|
4455
5069
|
children: [
|
|
4456
|
-
/* @__PURE__ */ (0,
|
|
4457
|
-
/* @__PURE__ */ (0,
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
|
|
5071
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
|
|
5072
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4459
5073
|
"button",
|
|
4460
5074
|
{
|
|
4461
5075
|
onClick: onRefresh,
|
|
@@ -4475,11 +5089,11 @@ function LinkingTab({
|
|
|
4475
5089
|
]
|
|
4476
5090
|
}
|
|
4477
5091
|
),
|
|
4478
|
-
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
4479
|
-
/* @__PURE__ */ (0,
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
5092
|
+
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("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)" }, children: [
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
|
|
5094
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "#4b5563" }, children: "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." })
|
|
4481
5095
|
] }),
|
|
4482
|
-
suggestions.length > 0 && /* @__PURE__ */ (0,
|
|
5096
|
+
suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4483
5097
|
"div",
|
|
4484
5098
|
{
|
|
4485
5099
|
style: {
|
|
@@ -4492,7 +5106,7 @@ function LinkingTab({
|
|
|
4492
5106
|
alignItems: "flex-start"
|
|
4493
5107
|
},
|
|
4494
5108
|
children: [
|
|
4495
|
-
/* @__PURE__ */ (0,
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4496
5110
|
ScoreDonut,
|
|
4497
5111
|
{
|
|
4498
5112
|
size: 64,
|
|
@@ -4502,22 +5116,31 @@ function LinkingTab({
|
|
|
4502
5116
|
composite: s.compositeScore
|
|
4503
5117
|
}
|
|
4504
5118
|
),
|
|
4505
|
-
/* @__PURE__ */ (0,
|
|
4506
|
-
/* @__PURE__ */ (0,
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
|
|
4507
5121
|
freshnessChip(s.freshnessLabel, s.freshnessScore),
|
|
4508
|
-
s.publishedAt && /* @__PURE__ */ (0,
|
|
5122
|
+
s.publishedAt && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) })
|
|
4509
5123
|
] }),
|
|
4510
|
-
/* @__PURE__ */ (0,
|
|
4511
|
-
/* @__PURE__ */ (0,
|
|
5124
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
|
|
5125
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
|
|
4512
5126
|
"/",
|
|
4513
5127
|
s.slug
|
|
4514
5128
|
] }),
|
|
4515
|
-
|
|
4516
|
-
|
|
5129
|
+
(() => {
|
|
5130
|
+
const liveUrl = buildLiveUrl(publication, s.slug);
|
|
5131
|
+
const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id, documentType);
|
|
5132
|
+
if (!liveUrl && !sanityUrl) return null;
|
|
5133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
|
|
5134
|
+
sanityUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
|
|
5135
|
+
liveUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
|
|
5136
|
+
] });
|
|
5137
|
+
})(),
|
|
5138
|
+
s.relevanceReason && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
|
|
4517
5140
|
" ",
|
|
4518
|
-
/* @__PURE__ */ (0,
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
|
|
4519
5142
|
] }),
|
|
4520
|
-
s.anchorQuote && /* @__PURE__ */ (0,
|
|
5143
|
+
s.anchorQuote && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4521
5144
|
"div",
|
|
4522
5145
|
{
|
|
4523
5146
|
style: {
|
|
@@ -4531,21 +5154,21 @@ function LinkingTab({
|
|
|
4531
5154
|
lineHeight: 1.5
|
|
4532
5155
|
},
|
|
4533
5156
|
children: [
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
5157
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
|
|
4535
5158
|
"Where to link from - paragraph ",
|
|
4536
5159
|
s.anchorParagraph
|
|
4537
5160
|
] }),
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontStyle: "italic" }, children: [
|
|
4539
5162
|
'"',
|
|
4540
5163
|
s.anchorQuote,
|
|
4541
5164
|
'"'
|
|
4542
5165
|
] }),
|
|
4543
|
-
s.anchorReason && /* @__PURE__ */ (0,
|
|
5166
|
+
s.anchorReason && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
|
|
4544
5167
|
]
|
|
4545
5168
|
}
|
|
4546
5169
|
)
|
|
4547
5170
|
] }),
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
5171
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4549
5172
|
FeedbackButton,
|
|
4550
5173
|
{
|
|
4551
5174
|
suggestionType: "internal_link",
|
|
@@ -4563,7 +5186,7 @@ function LinkingTab({
|
|
|
4563
5186
|
|
|
4564
5187
|
// src/components/tabs/MetaTab.tsx
|
|
4565
5188
|
var import_react16 = require("react");
|
|
4566
|
-
var
|
|
5189
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4567
5190
|
function containsKeywordTokens(haystack, needle) {
|
|
4568
5191
|
if (!needle) return true;
|
|
4569
5192
|
const tokens = needle.toLowerCase().split(/\s+/).filter((t) => t.length > 1);
|
|
@@ -4586,7 +5209,7 @@ function StatusBadge({ status }) {
|
|
|
4586
5209
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
4587
5210
|
};
|
|
4588
5211
|
const c = map[status];
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
5212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4590
5213
|
"span",
|
|
4591
5214
|
{
|
|
4592
5215
|
style: {
|
|
@@ -4605,12 +5228,12 @@ function StatusBadge({ status }) {
|
|
|
4605
5228
|
);
|
|
4606
5229
|
}
|
|
4607
5230
|
function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
4608
|
-
return /* @__PURE__ */ (0,
|
|
4609
|
-
/* @__PURE__ */ (0,
|
|
4610
|
-
/* @__PURE__ */ (0,
|
|
4611
|
-
/* @__PURE__ */ (0,
|
|
5231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { id: anchorId, style: cardStyle5, children: [
|
|
5232
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
5233
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
|
|
5234
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StatusBadge, { status })
|
|
4612
5235
|
] }),
|
|
4613
|
-
/* @__PURE__ */ (0,
|
|
5236
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4614
5237
|
"div",
|
|
4615
5238
|
{
|
|
4616
5239
|
style: {
|
|
@@ -4623,7 +5246,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
|
4623
5246
|
children: value
|
|
4624
5247
|
}
|
|
4625
5248
|
),
|
|
4626
|
-
recommendation && /* @__PURE__ */ (0,
|
|
5249
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4627
5250
|
"div",
|
|
4628
5251
|
{
|
|
4629
5252
|
style: {
|
|
@@ -4642,23 +5265,37 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
|
4642
5265
|
footer
|
|
4643
5266
|
] });
|
|
4644
5267
|
}
|
|
4645
|
-
function
|
|
5268
|
+
function keywordCoverageNote(haystack, primaryKeyword, secondaryKeyword) {
|
|
5269
|
+
const hasPrimary = primaryKeyword ? containsKeywordTokens(haystack, primaryKeyword) : true;
|
|
5270
|
+
const hasSecondary = secondaryKeyword ? containsKeywordTokens(haystack, secondaryKeyword) : true;
|
|
5271
|
+
if (primaryKeyword && !hasPrimary && secondaryKeyword && !hasSecondary) {
|
|
5272
|
+
return `Neither your primary keyword "${primaryKeyword}" nor your secondary keyword "${secondaryKeyword}" appears here.`;
|
|
5273
|
+
}
|
|
5274
|
+
if (primaryKeyword && !hasPrimary) {
|
|
5275
|
+
return `Your primary keyword "${primaryKeyword}" isn't included${secondaryKeyword ? ` (secondary keyword "${secondaryKeyword}" ${hasSecondary ? "is" : "isn't"}).` : "."}`;
|
|
5276
|
+
}
|
|
5277
|
+
if (secondaryKeyword && !hasSecondary) {
|
|
5278
|
+
return `Your primary keyword "${primaryKeyword}" is included, but your secondary keyword "${secondaryKeyword}" is not. Work it in if it reads naturally.`;
|
|
5279
|
+
}
|
|
5280
|
+
return "";
|
|
5281
|
+
}
|
|
5282
|
+
function metaDescriptionAudit(meta, primaryKeyword, secondaryKeyword) {
|
|
4646
5283
|
if (!meta) {
|
|
4647
5284
|
return {
|
|
4648
5285
|
label: "Meta Description",
|
|
4649
5286
|
value: "Missing",
|
|
4650
5287
|
status: "error",
|
|
4651
|
-
recommendation:
|
|
5288
|
+
recommendation: `Add a 120-160 character meta description that includes your primary keyword${secondaryKeyword ? " (and your secondary keyword if it fits)" : ""}.`
|
|
4652
5289
|
};
|
|
4653
5290
|
}
|
|
4654
5291
|
const len = meta.length;
|
|
4655
|
-
const
|
|
5292
|
+
const kwNote = keywordCoverageNote(meta, primaryKeyword, secondaryKeyword);
|
|
4656
5293
|
if (len < 120) {
|
|
4657
5294
|
return {
|
|
4658
5295
|
label: "Meta Description",
|
|
4659
5296
|
value: `${meta} (${len} chars)`,
|
|
4660
5297
|
status: "warning",
|
|
4661
|
-
recommendation: `
|
|
5298
|
+
recommendation: `A little short - aim for 120-160 characters.${kwNote ? ` ${kwNote}` : ""}`
|
|
4662
5299
|
};
|
|
4663
5300
|
}
|
|
4664
5301
|
if (len > 160) {
|
|
@@ -4666,15 +5303,15 @@ function metaDescriptionAudit(meta, primaryKeyword) {
|
|
|
4666
5303
|
label: "Meta Description",
|
|
4667
5304
|
value: `${meta} (${len} chars)`,
|
|
4668
5305
|
status: "warning",
|
|
4669
|
-
recommendation: `
|
|
5306
|
+
recommendation: `Over 160 characters - Google may shorten it in search, so trim it a little.${kwNote ? ` ${kwNote}` : ""}`
|
|
4670
5307
|
};
|
|
4671
5308
|
}
|
|
4672
|
-
if (
|
|
5309
|
+
if (kwNote) {
|
|
4673
5310
|
return {
|
|
4674
5311
|
label: "Meta Description",
|
|
4675
5312
|
value: `${meta} (${len} chars)`,
|
|
4676
5313
|
status: "warning",
|
|
4677
|
-
recommendation: `Length is good
|
|
5314
|
+
recommendation: `Length is good. ${kwNote}`
|
|
4678
5315
|
};
|
|
4679
5316
|
}
|
|
4680
5317
|
return {
|
|
@@ -4722,88 +5359,6 @@ function titleAudit(title, primaryKeyword) {
|
|
|
4722
5359
|
}
|
|
4723
5360
|
return { label: "Title Tag", value: `${title} (${len} chars)`, status: "good" };
|
|
4724
5361
|
}
|
|
4725
|
-
function urlAudit(slug, primaryKeyword) {
|
|
4726
|
-
if (!slug) {
|
|
4727
|
-
return { label: "URL Slug", value: "Missing", status: "error", recommendation: "Add a clean, hyphenated URL slug containing the primary keyword. Aim for 3-5 words." };
|
|
4728
|
-
}
|
|
4729
|
-
const issues = [];
|
|
4730
|
-
if (slug.length > 60) issues.push("longer than 60 characters - aim for 3-5 words");
|
|
4731
|
-
if (/[A-Z]/.test(slug)) issues.push("contains uppercase letters");
|
|
4732
|
-
if (/_/.test(slug)) issues.push("uses underscores instead of hyphens");
|
|
4733
|
-
if (/[^a-zA-Z0-9-/]/.test(slug.replace(/^\//, ""))) issues.push("contains special characters");
|
|
4734
|
-
if (primaryKeyword && !containsKeywordTokens(slug.replace(/-/g, " "), primaryKeyword)) {
|
|
4735
|
-
issues.push(`missing primary keyword "${primaryKeyword}"`);
|
|
4736
|
-
}
|
|
4737
|
-
if (issues.length === 0) {
|
|
4738
|
-
return { label: "URL Slug", value: `/${slug}`, status: "good" };
|
|
4739
|
-
}
|
|
4740
|
-
return {
|
|
4741
|
-
label: "URL Slug",
|
|
4742
|
-
value: `/${slug}`,
|
|
4743
|
-
status: "warning",
|
|
4744
|
-
recommendation: `Issues: ${issues.join(", ")}.`
|
|
4745
|
-
};
|
|
4746
|
-
}
|
|
4747
|
-
function SlugRedirectNotice() {
|
|
4748
|
-
const [expanded, setExpanded] = (0, import_react16.useState)(false);
|
|
4749
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4750
|
-
"div",
|
|
4751
|
-
{
|
|
4752
|
-
style: {
|
|
4753
|
-
marginTop: 10,
|
|
4754
|
-
paddingTop: 10,
|
|
4755
|
-
borderTop: "1px solid rgba(0,0,0,0.07)"
|
|
4756
|
-
},
|
|
4757
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4758
|
-
"div",
|
|
4759
|
-
{
|
|
4760
|
-
style: {
|
|
4761
|
-
padding: "8px 10px",
|
|
4762
|
-
background: "rgba(245,158,11,0.08)",
|
|
4763
|
-
borderLeft: "2px solid #f59e0b",
|
|
4764
|
-
borderRadius: 6
|
|
4765
|
-
},
|
|
4766
|
-
children: [
|
|
4767
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
|
|
4768
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
|
|
4769
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
|
|
4770
|
-
] }),
|
|
4771
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: "If the page has been published and indexed, you MUST add a 301 redirect from the old slug to the new one before changing it. For a brand-new page that's never been published, no redirect needed." }),
|
|
4772
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4773
|
-
"button",
|
|
4774
|
-
{
|
|
4775
|
-
onClick: () => setExpanded((v) => !v),
|
|
4776
|
-
style: {
|
|
4777
|
-
display: "flex",
|
|
4778
|
-
alignItems: "center",
|
|
4779
|
-
gap: 3,
|
|
4780
|
-
marginTop: 6,
|
|
4781
|
-
padding: 0,
|
|
4782
|
-
background: "none",
|
|
4783
|
-
border: "none",
|
|
4784
|
-
cursor: "pointer",
|
|
4785
|
-
fontSize: 10.5,
|
|
4786
|
-
fontWeight: 700,
|
|
4787
|
-
color: "#b45309",
|
|
4788
|
-
fontFamily: "inherit"
|
|
4789
|
-
},
|
|
4790
|
-
children: [
|
|
4791
|
-
expanded ? "Show less" : "Learn more",
|
|
4792
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
|
|
4793
|
-
]
|
|
4794
|
-
}
|
|
4795
|
-
),
|
|
4796
|
-
expanded && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
|
|
4797
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
|
|
4798
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
|
|
4799
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: "Set this up using vanity redirects in Sanity." })
|
|
4800
|
-
] })
|
|
4801
|
-
]
|
|
4802
|
-
}
|
|
4803
|
-
)
|
|
4804
|
-
}
|
|
4805
|
-
);
|
|
4806
|
-
}
|
|
4807
5362
|
function daysSince(iso) {
|
|
4808
5363
|
if (!iso) return null;
|
|
4809
5364
|
const t = new Date(iso).getTime();
|
|
@@ -4812,20 +5367,17 @@ function daysSince(iso) {
|
|
|
4812
5367
|
}
|
|
4813
5368
|
function formatDateShort(iso) {
|
|
4814
5369
|
if (!iso) return "";
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
return "";
|
|
4819
|
-
}
|
|
5370
|
+
const d = new Date(iso);
|
|
5371
|
+
if (isNaN(d.getTime())) return "";
|
|
5372
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
4820
5373
|
}
|
|
4821
|
-
function MetaTab({ documentFields, primaryKeyword, isLoading }) {
|
|
5374
|
+
function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }) {
|
|
4822
5375
|
const audits = (0, import_react16.useMemo)(() => {
|
|
4823
5376
|
const list = [];
|
|
4824
5377
|
list.push(titleAudit(documentFields?.title, primaryKeyword));
|
|
4825
|
-
list.push(metaDescriptionAudit(documentFields?.metaDescription, primaryKeyword));
|
|
4826
|
-
list.push(urlAudit(documentFields?.slug, primaryKeyword));
|
|
5378
|
+
list.push(metaDescriptionAudit(documentFields?.metaDescription, primaryKeyword, secondaryKeyword));
|
|
4827
5379
|
return list;
|
|
4828
|
-
}, [documentFields, primaryKeyword]);
|
|
5380
|
+
}, [documentFields, primaryKeyword, secondaryKeyword]);
|
|
4829
5381
|
const eeatItems = (0, import_react16.useMemo)(() => {
|
|
4830
5382
|
const items = [];
|
|
4831
5383
|
const author = documentFields?.authorName;
|
|
@@ -4835,7 +5387,7 @@ function MetaTab({ documentFields, primaryKeyword, isLoading }) {
|
|
|
4835
5387
|
if (!author && authorIsRef) {
|
|
4836
5388
|
items.push({ label: "Author Byline", value: "Set (reference)", status: "good", recommendation: "Author is linked as a reference, so we can't read credentials from this view. Open the linked author page to confirm name, credentials, and bio are set." });
|
|
4837
5389
|
} else if (!author) {
|
|
4838
|
-
items.push({ label: "Author Byline", value: "Missing", status: "
|
|
5390
|
+
items.push({ label: "Author Byline", value: "Missing", status: "warning", recommendation: "Add a named author with credentials - healthcare (YMYL) content with visible authorship earns more trust from Google's E-E-A-T signals. Wire or news briefs published without a byline can disregard this." });
|
|
4839
5391
|
} else if (!creds) {
|
|
4840
5392
|
items.push({ label: "Author Byline", value: author, status: "warning", recommendation: "Author shown but credentials (MD, PharmD, RN, etc.) aren't visible. Add credential suffixes." });
|
|
4841
5393
|
} else if (!bio) {
|
|
@@ -4852,6 +5404,8 @@ function MetaTab({ documentFields, primaryKeyword, isLoading }) {
|
|
|
4852
5404
|
const freshness = Math.min(...[daysUpd, daysRev, daysPub].filter((d) => d !== null));
|
|
4853
5405
|
if (!published) {
|
|
4854
5406
|
items.push({ label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date. Required for healthcare content to be cited by Google and AI search." });
|
|
5407
|
+
} else if (daysPub === null) {
|
|
5408
|
+
items.push({ label: "Publish Date", value: "Unrecognized format", status: "warning", recommendation: "A publish date is set but couldn't be read as a valid date. Check the field value." });
|
|
4855
5409
|
} else {
|
|
4856
5410
|
items.push({ label: "Publish Date", value: formatDateShort(published), status: "good" });
|
|
4857
5411
|
}
|
|
@@ -4868,33 +5422,32 @@ function MetaTab({ documentFields, primaryKeyword, isLoading }) {
|
|
|
4868
5422
|
}, [documentFields]);
|
|
4869
5423
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
|
|
4870
5424
|
if (isLoading && !hasAnyField) {
|
|
4871
|
-
return /* @__PURE__ */ (0,
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4873
|
-
/* @__PURE__ */ (0,
|
|
5425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
|
|
5427
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
|
|
4874
5428
|
] });
|
|
4875
5429
|
}
|
|
4876
|
-
const auditAnchors = ["anchor-meta-title", "anchor-meta-description"
|
|
4877
|
-
return /* @__PURE__ */ (0,
|
|
4878
|
-
audits.map((a, i) => /* @__PURE__ */ (0,
|
|
5430
|
+
const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
|
|
5431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
5432
|
+
audits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4879
5433
|
AuditCard,
|
|
4880
5434
|
{
|
|
4881
5435
|
anchorId: auditAnchors[i],
|
|
4882
5436
|
label: a.label,
|
|
4883
5437
|
value: a.value,
|
|
4884
5438
|
status: a.status,
|
|
4885
|
-
recommendation: a.recommendation
|
|
4886
|
-
footer: a.label === "URL Slug" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SlugRedirectNotice, {}) : void 0
|
|
5439
|
+
recommendation: a.recommendation
|
|
4887
5440
|
},
|
|
4888
5441
|
i
|
|
4889
5442
|
)),
|
|
4890
|
-
eeatItems.length > 0 && /* @__PURE__ */ (0,
|
|
4891
|
-
/* @__PURE__ */ (0,
|
|
4892
|
-
/* @__PURE__ */ (0,
|
|
4893
|
-
/* @__PURE__ */ (0,
|
|
4894
|
-
/* @__PURE__ */ (0,
|
|
5443
|
+
eeatItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
|
|
5445
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
|
|
5446
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
|
|
5447
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
|
|
4895
5448
|
] }),
|
|
4896
|
-
/* @__PURE__ */ (0,
|
|
4897
|
-
eeatItems.map((item, i) => /* @__PURE__ */ (0,
|
|
5449
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 10, color: "#4b5563", padding: "0 4px", marginTop: -4 }, children: "Google looks for a named author with credentials and recent updates on healthcare content." }),
|
|
5450
|
+
eeatItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4898
5451
|
AuditCard,
|
|
4899
5452
|
{
|
|
4900
5453
|
label: item.label,
|
|
@@ -4910,7 +5463,85 @@ function MetaTab({ documentFields, primaryKeyword, isLoading }) {
|
|
|
4910
5463
|
|
|
4911
5464
|
// src/components/tabs/TechnicalTab.tsx
|
|
4912
5465
|
var import_react17 = require("react");
|
|
4913
|
-
var
|
|
5466
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5467
|
+
function containsKeywordTokens2(haystack, needle) {
|
|
5468
|
+
if (!needle) return true;
|
|
5469
|
+
const tokens = needle.toLowerCase().split(/\s+/).filter((t) => t.length > 1);
|
|
5470
|
+
if (tokens.length === 0) return true;
|
|
5471
|
+
const lower = haystack.toLowerCase();
|
|
5472
|
+
return tokens.every((t) => lower.includes(t));
|
|
5473
|
+
}
|
|
5474
|
+
function keywordLeadsUrl(slug, primaryKeyword) {
|
|
5475
|
+
if (!primaryKeyword) return true;
|
|
5476
|
+
const slugWords = slug.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
5477
|
+
const tokens = primaryKeyword.toLowerCase().split(/\s+/).filter((t) => t.length > 1);
|
|
5478
|
+
if (tokens.length === 0 || slugWords.length === 0) return true;
|
|
5479
|
+
let earliest = Infinity;
|
|
5480
|
+
for (const t of tokens) {
|
|
5481
|
+
const idx = slugWords.findIndex((w) => w.includes(t));
|
|
5482
|
+
if (idx >= 0) earliest = Math.min(earliest, idx);
|
|
5483
|
+
}
|
|
5484
|
+
return earliest <= 2;
|
|
5485
|
+
}
|
|
5486
|
+
function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
5487
|
+
const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
|
|
5488
|
+
if (!slug) {
|
|
5489
|
+
return {
|
|
5490
|
+
label: "URL Slug",
|
|
5491
|
+
value: "Missing",
|
|
5492
|
+
status: "warning",
|
|
5493
|
+
recommendation: `Add a URL slug that leads with your primary keyword. ${SHORT_DESC}`
|
|
5494
|
+
};
|
|
5495
|
+
}
|
|
5496
|
+
const slugAsWords = slug.replace(/-/g, " ");
|
|
5497
|
+
const hasPrimary = primaryKeyword ? containsKeywordTokens2(slugAsWords, primaryKeyword) : true;
|
|
5498
|
+
const leads = primaryKeyword ? keywordLeadsUrl(slug, primaryKeyword) : true;
|
|
5499
|
+
const hasSecondary = secondaryKeyword ? containsKeywordTokens2(slugAsWords, secondaryKeyword) : true;
|
|
5500
|
+
if (primaryKeyword && !hasPrimary) {
|
|
5501
|
+
const secNote = secondaryKeyword && !hasSecondary ? ` Your secondary keyword "${secondaryKeyword}" could follow it.` : "";
|
|
5502
|
+
return {
|
|
5503
|
+
label: "URL Slug",
|
|
5504
|
+
value: `/${slug}`,
|
|
5505
|
+
status: "warning",
|
|
5506
|
+
recommendation: `Work your primary keyword "${primaryKeyword}" into the URL, ideally at the start - if the address gets shortened, a leading keyword still shows.${secNote} ${SHORT_DESC}`
|
|
5507
|
+
};
|
|
5508
|
+
}
|
|
5509
|
+
if (primaryKeyword && hasPrimary && !leads) {
|
|
5510
|
+
return {
|
|
5511
|
+
label: "URL Slug",
|
|
5512
|
+
value: `/${slug}`,
|
|
5513
|
+
status: "warning",
|
|
5514
|
+
recommendation: `Your primary keyword is in the URL but not at the start. Leading with it reads better and holds up if the address gets shortened. ${SHORT_DESC}`
|
|
5515
|
+
};
|
|
5516
|
+
}
|
|
5517
|
+
return { label: "URL Slug", value: `/${slug}`, status: "good" };
|
|
5518
|
+
}
|
|
5519
|
+
function SlugRedirectNotice() {
|
|
5520
|
+
const [expanded, setExpanded] = (0, import_react17.useState)(false);
|
|
5521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
|
|
5522
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
|
|
5523
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
|
|
5524
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
|
|
5525
|
+
] }),
|
|
5526
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: "If the page has been published and indexed, you MUST add a 301 redirect from the old slug to the new one before changing it. For a brand-new page that's never been published, no redirect needed." }),
|
|
5527
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5528
|
+
"button",
|
|
5529
|
+
{
|
|
5530
|
+
onClick: () => setExpanded((v) => !v),
|
|
5531
|
+
style: { display: "flex", alignItems: "center", gap: 3, marginTop: 6, padding: 0, background: "none", border: "none", cursor: "pointer", fontSize: 10.5, fontWeight: 700, color: "#b45309", fontFamily: "inherit" },
|
|
5532
|
+
children: [
|
|
5533
|
+
expanded ? "Show less" : "Learn more",
|
|
5534
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
|
|
5535
|
+
]
|
|
5536
|
+
}
|
|
5537
|
+
),
|
|
5538
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
|
|
5540
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Set this up using vanity redirects in Sanity." })
|
|
5542
|
+
] })
|
|
5543
|
+
] }) });
|
|
5544
|
+
}
|
|
4914
5545
|
var cardStyle6 = {
|
|
4915
5546
|
borderRadius: 14,
|
|
4916
5547
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -4926,7 +5557,7 @@ function StatusBadge2({ status }) {
|
|
|
4926
5557
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
4927
5558
|
};
|
|
4928
5559
|
const c = map[status];
|
|
4929
|
-
return /* @__PURE__ */ (0,
|
|
5560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4930
5561
|
"span",
|
|
4931
5562
|
{
|
|
4932
5563
|
style: {
|
|
@@ -4949,14 +5580,15 @@ function AuditCard2({
|
|
|
4949
5580
|
value,
|
|
4950
5581
|
status,
|
|
4951
5582
|
recommendation,
|
|
4952
|
-
anchorId
|
|
5583
|
+
anchorId,
|
|
5584
|
+
footer
|
|
4953
5585
|
}) {
|
|
4954
|
-
return /* @__PURE__ */ (0,
|
|
4955
|
-
/* @__PURE__ */ (0,
|
|
4956
|
-
/* @__PURE__ */ (0,
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
5586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: anchorId, style: cardStyle6, children: [
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
5588
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
|
|
5589
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatusBadge2, { status })
|
|
4958
5590
|
] }),
|
|
4959
|
-
/* @__PURE__ */ (0,
|
|
5591
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4960
5592
|
"div",
|
|
4961
5593
|
{
|
|
4962
5594
|
style: {
|
|
@@ -4969,7 +5601,7 @@ function AuditCard2({
|
|
|
4969
5601
|
children: value
|
|
4970
5602
|
}
|
|
4971
5603
|
),
|
|
4972
|
-
recommendation && /* @__PURE__ */ (0,
|
|
5604
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4973
5605
|
"div",
|
|
4974
5606
|
{
|
|
4975
5607
|
style: {
|
|
@@ -4984,7 +5616,8 @@ function AuditCard2({
|
|
|
4984
5616
|
},
|
|
4985
5617
|
children: recommendation
|
|
4986
5618
|
}
|
|
4987
|
-
)
|
|
5619
|
+
),
|
|
5620
|
+
footer
|
|
4988
5621
|
] });
|
|
4989
5622
|
}
|
|
4990
5623
|
var IMAGE_EXT_RE = /\.(jpe?g|png|gif|webp|svg|tiff?|bmp)$/i;
|
|
@@ -5040,9 +5673,11 @@ function imageFilenameAudit(filenames) {
|
|
|
5040
5673
|
function imageAltTextAudit(altTexts) {
|
|
5041
5674
|
if (altTexts.length === 0) return null;
|
|
5042
5675
|
const issues = [];
|
|
5676
|
+
let audited = 0;
|
|
5043
5677
|
for (const alt of altTexts) {
|
|
5044
5678
|
const trimmed = alt.trim();
|
|
5045
5679
|
if (!trimmed) continue;
|
|
5680
|
+
audited++;
|
|
5046
5681
|
const len = trimmed.length;
|
|
5047
5682
|
const wc = trimmed.split(/\s+/).filter(Boolean).length;
|
|
5048
5683
|
if (len > 125) {
|
|
@@ -5051,10 +5686,11 @@ function imageAltTextAudit(altTexts) {
|
|
|
5051
5686
|
issues.push({ alt: trimmed, reason: "just one word - use 2-5 descriptive keywords" });
|
|
5052
5687
|
}
|
|
5053
5688
|
}
|
|
5689
|
+
if (audited === 0) return null;
|
|
5054
5690
|
if (issues.length === 0) {
|
|
5055
5691
|
return {
|
|
5056
5692
|
label: "Image Alt Text",
|
|
5057
|
-
value: `${
|
|
5693
|
+
value: `${audited} alt text${audited === 1 ? "" : "s"} look well-formed`,
|
|
5058
5694
|
status: "good"
|
|
5059
5695
|
};
|
|
5060
5696
|
}
|
|
@@ -5064,7 +5700,7 @@ function imageAltTextAudit(altTexts) {
|
|
|
5064
5700
|
}).join("; ");
|
|
5065
5701
|
return {
|
|
5066
5702
|
label: "Image Alt Text",
|
|
5067
|
-
value: `${issues.length} of ${
|
|
5703
|
+
value: `${issues.length} of ${audited} alt text${audited === 1 ? "" : "s"} need attention`,
|
|
5068
5704
|
status: "warning",
|
|
5069
5705
|
recommendation: `${examples}. Alt text should be 2-5 descriptive keywords that describe the image, ideally including the primary keyword, and stay under 125 characters.`
|
|
5070
5706
|
};
|
|
@@ -5072,6 +5708,7 @@ function imageAltTextAudit(altTexts) {
|
|
|
5072
5708
|
function imageTitleAudit(titles, imageCount) {
|
|
5073
5709
|
if (imageCount <= 0) return null;
|
|
5074
5710
|
const withTitle = titles.length;
|
|
5711
|
+
if (withTitle === 0) return null;
|
|
5075
5712
|
const missing = imageCount - withTitle;
|
|
5076
5713
|
if (missing > 0) {
|
|
5077
5714
|
return {
|
|
@@ -5098,30 +5735,30 @@ function imageTitleAudit(titles, imageCount) {
|
|
|
5098
5735
|
}
|
|
5099
5736
|
function computeHeadingStructureAudits(headings, wordCount2) {
|
|
5100
5737
|
const audits = [];
|
|
5101
|
-
const
|
|
5738
|
+
const sectionCount = headings.filter((h) => h.level === 2 || h.level === 3).length;
|
|
5102
5739
|
let densityFired = false;
|
|
5103
|
-
if (wordCount2 >= 1e3 &&
|
|
5740
|
+
if (wordCount2 >= 1e3 && sectionCount === 0) {
|
|
5104
5741
|
audits.push({
|
|
5105
5742
|
label: "Section Headings",
|
|
5106
|
-
value: `No
|
|
5743
|
+
value: `No section headings in a ${wordCount2}-word article`,
|
|
5107
5744
|
status: "error",
|
|
5108
|
-
recommendation: "Articles this long need section headings. Add 2-3 H2 headings to break the body into scannable sections."
|
|
5745
|
+
recommendation: "Articles this long need section headings. Add 2-3 H2 (or H3) headings to break the body into scannable sections."
|
|
5109
5746
|
});
|
|
5110
5747
|
densityFired = true;
|
|
5111
|
-
} else if (wordCount2 >= 2500 &&
|
|
5748
|
+
} else if (wordCount2 >= 2500 && sectionCount < 5) {
|
|
5112
5749
|
audits.push({
|
|
5113
5750
|
label: "Section Headings",
|
|
5114
|
-
value: `${
|
|
5751
|
+
value: `${sectionCount} section heading${sectionCount === 1 ? "" : "s"} for a ${wordCount2}-word article`,
|
|
5115
5752
|
status: "warning",
|
|
5116
|
-
recommendation: "Long articles read best with 1
|
|
5753
|
+
recommendation: "Long articles read best with 1 section heading per 300-400 words. Break the content into more named sections so readers and search engines can navigate it."
|
|
5117
5754
|
});
|
|
5118
5755
|
densityFired = true;
|
|
5119
|
-
} else if (wordCount2 >= 1500 &&
|
|
5756
|
+
} else if (wordCount2 >= 1500 && sectionCount < 3) {
|
|
5120
5757
|
audits.push({
|
|
5121
5758
|
label: "Section Headings",
|
|
5122
|
-
value: `${
|
|
5759
|
+
value: `${sectionCount} section heading${sectionCount === 1 ? "" : "s"} for a ${wordCount2}-word article`,
|
|
5123
5760
|
status: "warning",
|
|
5124
|
-
recommendation: "Articles above 1,500 words usually need at least 3
|
|
5761
|
+
recommendation: "Articles above 1,500 words usually need at least 3 named sections. Add section breaks so the outline is scannable."
|
|
5125
5762
|
});
|
|
5126
5763
|
densityFired = true;
|
|
5127
5764
|
}
|
|
@@ -5194,13 +5831,14 @@ function LinkCheckCard({
|
|
|
5194
5831
|
const redirects = results.filter((r) => r.category === "redirect").length;
|
|
5195
5832
|
const broken = results.filter((r) => r.category === "broken").length;
|
|
5196
5833
|
const errored = results.filter((r) => r.category === "error").length;
|
|
5834
|
+
const unverified = results.filter((r) => r.category === "unverified").length;
|
|
5197
5835
|
const issues = results.filter((r) => r.category !== "ok");
|
|
5198
|
-
return { total, valid, redirects, broken, errored, issues };
|
|
5836
|
+
return { total, valid, redirects, broken, errored, unverified, issues };
|
|
5199
5837
|
}, [results]);
|
|
5200
|
-
return /* @__PURE__ */ (0,
|
|
5201
|
-
/* @__PURE__ */ (0,
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5203
|
-
hasRun && !isLoading && /* @__PURE__ */ (0,
|
|
5838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: "anchor-link-check", style: cardStyle6, children: [
|
|
5839
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
5840
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
|
|
5841
|
+
hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5204
5842
|
"button",
|
|
5205
5843
|
{
|
|
5206
5844
|
onClick: onCheck,
|
|
@@ -5218,8 +5856,8 @@ function LinkCheckCard({
|
|
|
5218
5856
|
}
|
|
5219
5857
|
)
|
|
5220
5858
|
] }),
|
|
5221
|
-
/* @__PURE__ */ (0,
|
|
5222
|
-
urls.length > 0 && !hasRun && !isLoading && /* @__PURE__ */ (0,
|
|
5859
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginBottom: 10 }, children: urls.length === 0 ? "No external links found in the body." : `${urls.length} link${urls.length === 1 ? "" : "s"} found in the body.` }),
|
|
5860
|
+
urls.length > 0 && !hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5223
5861
|
"button",
|
|
5224
5862
|
{
|
|
5225
5863
|
onClick: onCheck,
|
|
@@ -5244,9 +5882,9 @@ function LinkCheckCard({
|
|
|
5244
5882
|
]
|
|
5245
5883
|
}
|
|
5246
5884
|
),
|
|
5247
|
-
isLoading && /* @__PURE__ */ (0,
|
|
5248
|
-
/* @__PURE__ */ (0,
|
|
5249
|
-
/* @__PURE__ */ (0,
|
|
5885
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
|
|
5886
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
5887
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
|
|
5250
5888
|
"Checking ",
|
|
5251
5889
|
urls.length,
|
|
5252
5890
|
" link",
|
|
@@ -5254,7 +5892,7 @@ function LinkCheckCard({
|
|
|
5254
5892
|
"..."
|
|
5255
5893
|
] })
|
|
5256
5894
|
] }),
|
|
5257
|
-
error && !isLoading && /* @__PURE__ */ (0,
|
|
5895
|
+
error && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5258
5896
|
"div",
|
|
5259
5897
|
{
|
|
5260
5898
|
style: {
|
|
@@ -5268,7 +5906,7 @@ function LinkCheckCard({
|
|
|
5268
5906
|
},
|
|
5269
5907
|
children: [
|
|
5270
5908
|
error,
|
|
5271
|
-
/* @__PURE__ */ (0,
|
|
5909
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5272
5910
|
"button",
|
|
5273
5911
|
{
|
|
5274
5912
|
onClick: onCheck,
|
|
@@ -5290,15 +5928,37 @@ function LinkCheckCard({
|
|
|
5290
5928
|
]
|
|
5291
5929
|
}
|
|
5292
5930
|
),
|
|
5293
|
-
hasRun && !isLoading && !error && /* @__PURE__ */ (0,
|
|
5294
|
-
/* @__PURE__ */ (0,
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5297
|
-
/* @__PURE__ */ (0,
|
|
5298
|
-
/* @__PURE__ */ (0,
|
|
5931
|
+
hasRun && !isLoading && !error && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5932
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "grid", gridTemplateColumns: counts.unverified > 0 ? "repeat(5, 1fr)" : "repeat(4, 1fr)", gap: 6 }, children: [
|
|
5933
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Checked", value: counts.total, color: "#475569" }),
|
|
5934
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Valid", value: counts.valid, color: "#16a34a" }),
|
|
5935
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Redirects", value: counts.redirects, color: "#8B7310" }),
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Broken", value: counts.broken + counts.errored, color: "#dc2626" }),
|
|
5937
|
+
counts.unverified > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Blocked", value: counts.unverified, color: "#b45309" })
|
|
5299
5938
|
] }),
|
|
5300
|
-
counts.
|
|
5301
|
-
|
|
5939
|
+
counts.unverified > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5940
|
+
"div",
|
|
5941
|
+
{
|
|
5942
|
+
style: {
|
|
5943
|
+
marginTop: 8,
|
|
5944
|
+
padding: "6px 10px",
|
|
5945
|
+
background: "rgba(245,158,11,0.08)",
|
|
5946
|
+
border: "1px solid rgba(245,158,11,0.25)",
|
|
5947
|
+
borderRadius: 6,
|
|
5948
|
+
fontSize: 10.5,
|
|
5949
|
+
color: "#92400e",
|
|
5950
|
+
lineHeight: 1.45
|
|
5951
|
+
},
|
|
5952
|
+
children: [
|
|
5953
|
+
counts.unverified,
|
|
5954
|
+
" link",
|
|
5955
|
+
counts.unverified === 1 ? "" : "s",
|
|
5956
|
+
" were blocked from our auto-check (likely anti-bot rules on the destination site). They may still work fine for human readers - click each to confirm."
|
|
5957
|
+
]
|
|
5958
|
+
}
|
|
5959
|
+
),
|
|
5960
|
+
counts.issues.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
5961
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em" }, children: [
|
|
5302
5962
|
counts.issues.length,
|
|
5303
5963
|
" link",
|
|
5304
5964
|
counts.issues.length === 1 ? "" : "s",
|
|
@@ -5306,8 +5966,8 @@ function LinkCheckCard({
|
|
|
5306
5966
|
counts.issues.length === 1 ? "s" : "",
|
|
5307
5967
|
" attention"
|
|
5308
5968
|
] }),
|
|
5309
|
-
counts.issues.map((r) => /* @__PURE__ */ (0,
|
|
5310
|
-
] }) : /* @__PURE__ */ (0,
|
|
5969
|
+
counts.issues.map((r) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LinkIssueRow, { result: r }, r.url))
|
|
5970
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5311
5971
|
"div",
|
|
5312
5972
|
{
|
|
5313
5973
|
style: {
|
|
@@ -5334,7 +5994,7 @@ function LinkCheckCard({
|
|
|
5334
5994
|
] });
|
|
5335
5995
|
}
|
|
5336
5996
|
function StatTile({ label, value, color }) {
|
|
5337
|
-
return /* @__PURE__ */ (0,
|
|
5997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5338
5998
|
"div",
|
|
5339
5999
|
{
|
|
5340
6000
|
style: {
|
|
@@ -5344,8 +6004,8 @@ function StatTile({ label, value, color }) {
|
|
|
5344
6004
|
textAlign: "center"
|
|
5345
6005
|
},
|
|
5346
6006
|
children: [
|
|
5347
|
-
/* @__PURE__ */ (0,
|
|
5348
|
-
/* @__PURE__ */ (0,
|
|
6007
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 18, fontWeight: 700, color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: value }),
|
|
6008
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", marginTop: 4 }, children: label })
|
|
5349
6009
|
]
|
|
5350
6010
|
}
|
|
5351
6011
|
);
|
|
@@ -5355,10 +6015,13 @@ function LinkIssueRow({ result }) {
|
|
|
5355
6015
|
ok: { bg: "rgba(22,163,74,0.06)", color: "#16a34a", label: "OK" },
|
|
5356
6016
|
redirect: { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: result.status > 0 ? String(result.status) : "REDIR" },
|
|
5357
6017
|
broken: { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: result.status > 0 ? String(result.status) : "404" },
|
|
6018
|
+
// Amber for unverified - the link may work fine, our server just couldn't confirm.
|
|
6019
|
+
unverified: { bg: "rgba(245,158,11,0.10)", color: "#b45309", label: result.status > 0 ? String(result.status) : "BLOCKED" },
|
|
5358
6020
|
error: { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "ERR" }
|
|
5359
6021
|
};
|
|
5360
6022
|
const c = map[result.category];
|
|
5361
|
-
|
|
6023
|
+
const tooltip = result.category === "unverified" ? `${result.url} (couldn't auto-check; likely anti-bot blocking - open manually to verify)` : result.error ? `${result.url} (${result.error})` : result.url;
|
|
6024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5362
6025
|
"a",
|
|
5363
6026
|
{
|
|
5364
6027
|
href: result.url,
|
|
@@ -5374,7 +6037,7 @@ function LinkIssueRow({ result }) {
|
|
|
5374
6037
|
textDecoration: "none"
|
|
5375
6038
|
},
|
|
5376
6039
|
children: [
|
|
5377
|
-
/* @__PURE__ */ (0,
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5378
6041
|
"span",
|
|
5379
6042
|
{
|
|
5380
6043
|
style: {
|
|
@@ -5391,7 +6054,7 @@ function LinkIssueRow({ result }) {
|
|
|
5391
6054
|
children: c.label
|
|
5392
6055
|
}
|
|
5393
6056
|
),
|
|
5394
|
-
/* @__PURE__ */ (0,
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5395
6058
|
"span",
|
|
5396
6059
|
{
|
|
5397
6060
|
style: {
|
|
@@ -5404,7 +6067,7 @@ function LinkIssueRow({ result }) {
|
|
|
5404
6067
|
textOverflow: "ellipsis",
|
|
5405
6068
|
whiteSpace: "nowrap"
|
|
5406
6069
|
},
|
|
5407
|
-
title:
|
|
6070
|
+
title: tooltip,
|
|
5408
6071
|
children: result.url
|
|
5409
6072
|
}
|
|
5410
6073
|
)
|
|
@@ -5415,6 +6078,8 @@ function LinkIssueRow({ result }) {
|
|
|
5415
6078
|
function TechnicalTab({
|
|
5416
6079
|
text,
|
|
5417
6080
|
documentFields,
|
|
6081
|
+
primaryKeyword,
|
|
6082
|
+
secondaryKeyword,
|
|
5418
6083
|
isLoading,
|
|
5419
6084
|
linkCheckResults,
|
|
5420
6085
|
isLinkCheckLoading,
|
|
@@ -5422,6 +6087,10 @@ function TechnicalTab({
|
|
|
5422
6087
|
hasRunLinkCheck,
|
|
5423
6088
|
onCheckLinks
|
|
5424
6089
|
}) {
|
|
6090
|
+
const urlSlugAudit = (0, import_react17.useMemo)(
|
|
6091
|
+
() => urlAudit(documentFields?.slug, primaryKeyword, secondaryKeyword),
|
|
6092
|
+
[documentFields?.slug, primaryKeyword, secondaryKeyword]
|
|
6093
|
+
);
|
|
5425
6094
|
const headings = documentFields?.headings || [];
|
|
5426
6095
|
const headingsDetailed = documentFields?.headingsDetailed;
|
|
5427
6096
|
const headingsForStructure = headingsDetailed ? headingsDetailed : headings.map((text2) => ({ text: text2, level: 2 }));
|
|
@@ -5456,12 +6125,8 @@ function TechnicalTab({
|
|
|
5456
6125
|
status: "warning",
|
|
5457
6126
|
recommendation: "Add at least one hero image with descriptive alt text. Articles with images perform better on both reader engagement and search."
|
|
5458
6127
|
} : null;
|
|
5459
|
-
const
|
|
5460
|
-
|
|
5461
|
-
value: "0 words",
|
|
5462
|
-
status: "error",
|
|
5463
|
-
recommendation: "Start writing. A link or image on its own doesn't count - the body needs real written substance."
|
|
5464
|
-
} : wordCount2 < 450 ? {
|
|
6128
|
+
const isShortForm = isShortFormContent(documentFields, documentFields?.title);
|
|
6129
|
+
const wordAudit = wordCount2 === 0 ? null : isShortForm ? { label: "Word Count", value: `${wordCount2} words`, status: "good" } : wordCount2 < 450 ? {
|
|
5465
6130
|
label: "Word Count",
|
|
5466
6131
|
value: `${wordCount2} words`,
|
|
5467
6132
|
status: "error",
|
|
@@ -5475,13 +6140,24 @@ function TechnicalTab({
|
|
|
5475
6140
|
const bodyLinks = documentFields?.bodyLinks || [];
|
|
5476
6141
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
|
|
5477
6142
|
if (isLoading && !hasAnyField) {
|
|
5478
|
-
return /* @__PURE__ */ (0,
|
|
5479
|
-
/* @__PURE__ */ (0,
|
|
5480
|
-
/* @__PURE__ */ (0,
|
|
6143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
|
|
5481
6146
|
] });
|
|
5482
6147
|
}
|
|
5483
|
-
return /* @__PURE__ */ (0,
|
|
5484
|
-
/* @__PURE__ */ (0,
|
|
6148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6150
|
+
AuditCard2,
|
|
6151
|
+
{
|
|
6152
|
+
anchorId: "anchor-url-slug",
|
|
6153
|
+
label: urlSlugAudit.label,
|
|
6154
|
+
value: urlSlugAudit.value,
|
|
6155
|
+
status: urlSlugAudit.status,
|
|
6156
|
+
recommendation: urlSlugAudit.recommendation,
|
|
6157
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SlugRedirectNotice, {})
|
|
6158
|
+
}
|
|
6159
|
+
),
|
|
6160
|
+
wordAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5485
6161
|
AuditCard2,
|
|
5486
6162
|
{
|
|
5487
6163
|
anchorId: "anchor-word-count",
|
|
@@ -5491,7 +6167,7 @@ function TechnicalTab({
|
|
|
5491
6167
|
recommendation: wordAudit.recommendation
|
|
5492
6168
|
}
|
|
5493
6169
|
),
|
|
5494
|
-
structureAudits.map((a, i) => /* @__PURE__ */ (0,
|
|
6170
|
+
structureAudits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5495
6171
|
AuditCard2,
|
|
5496
6172
|
{
|
|
5497
6173
|
anchorId: i === 0 ? "anchor-headings-structure" : void 0,
|
|
@@ -5502,10 +6178,10 @@ function TechnicalTab({
|
|
|
5502
6178
|
},
|
|
5503
6179
|
`structure-${i}`
|
|
5504
6180
|
)),
|
|
5505
|
-
headings.length > 0 && /* @__PURE__ */ (0,
|
|
5506
|
-
/* @__PURE__ */ (0,
|
|
5507
|
-
/* @__PURE__ */ (0,
|
|
5508
|
-
(headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => /* @__PURE__ */ (0,
|
|
6181
|
+
headings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
|
|
6182
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
|
|
6183
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
6184
|
+
(headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5509
6185
|
"div",
|
|
5510
6186
|
{
|
|
5511
6187
|
style: {
|
|
@@ -5516,7 +6192,7 @@ function TechnicalTab({
|
|
|
5516
6192
|
paddingLeft: Math.max(0, (h.level - 2) * 12)
|
|
5517
6193
|
},
|
|
5518
6194
|
children: [
|
|
5519
|
-
/* @__PURE__ */ (0,
|
|
6195
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", marginRight: 6 }, children: [
|
|
5520
6196
|
"H",
|
|
5521
6197
|
h.level
|
|
5522
6198
|
] }),
|
|
@@ -5525,14 +6201,14 @@ function TechnicalTab({
|
|
|
5525
6201
|
},
|
|
5526
6202
|
i
|
|
5527
6203
|
)),
|
|
5528
|
-
headings.length > 12 && /* @__PURE__ */ (0,
|
|
6204
|
+
headings.length > 12 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
|
|
5529
6205
|
"+ ",
|
|
5530
6206
|
headings.length - 12,
|
|
5531
6207
|
" more"
|
|
5532
6208
|
] })
|
|
5533
6209
|
] })
|
|
5534
6210
|
] }),
|
|
5535
|
-
imagesAudit && /* @__PURE__ */ (0,
|
|
6211
|
+
imagesAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5536
6212
|
AuditCard2,
|
|
5537
6213
|
{
|
|
5538
6214
|
anchorId: "anchor-images",
|
|
@@ -5542,7 +6218,7 @@ function TechnicalTab({
|
|
|
5542
6218
|
recommendation: imagesAudit.recommendation
|
|
5543
6219
|
}
|
|
5544
6220
|
),
|
|
5545
|
-
filenameAudit && /* @__PURE__ */ (0,
|
|
6221
|
+
filenameAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5546
6222
|
AuditCard2,
|
|
5547
6223
|
{
|
|
5548
6224
|
anchorId: "anchor-image-filenames",
|
|
@@ -5552,7 +6228,7 @@ function TechnicalTab({
|
|
|
5552
6228
|
recommendation: filenameAudit.recommendation
|
|
5553
6229
|
}
|
|
5554
6230
|
),
|
|
5555
|
-
altTextAudit && /* @__PURE__ */ (0,
|
|
6231
|
+
altTextAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5556
6232
|
AuditCard2,
|
|
5557
6233
|
{
|
|
5558
6234
|
anchorId: "anchor-image-alt",
|
|
@@ -5562,7 +6238,7 @@ function TechnicalTab({
|
|
|
5562
6238
|
recommendation: altTextAudit.recommendation
|
|
5563
6239
|
}
|
|
5564
6240
|
),
|
|
5565
|
-
imgTitleAudit && /* @__PURE__ */ (0,
|
|
6241
|
+
imgTitleAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5566
6242
|
AuditCard2,
|
|
5567
6243
|
{
|
|
5568
6244
|
anchorId: "anchor-image-titles",
|
|
@@ -5572,7 +6248,7 @@ function TechnicalTab({
|
|
|
5572
6248
|
recommendation: imgTitleAudit.recommendation
|
|
5573
6249
|
}
|
|
5574
6250
|
),
|
|
5575
|
-
/* @__PURE__ */ (0,
|
|
6251
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5576
6252
|
LinkCheckCard,
|
|
5577
6253
|
{
|
|
5578
6254
|
urls: bodyLinks,
|
|
@@ -5587,12 +6263,12 @@ function TechnicalTab({
|
|
|
5587
6263
|
}
|
|
5588
6264
|
|
|
5589
6265
|
// src/components/SEOCopilotPanel.tsx
|
|
5590
|
-
var
|
|
6266
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5591
6267
|
function LogoIcon2() {
|
|
5592
|
-
return /* @__PURE__ */ (0,
|
|
5593
|
-
/* @__PURE__ */ (0,
|
|
5594
|
-
/* @__PURE__ */ (0,
|
|
5595
|
-
/* @__PURE__ */ (0,
|
|
6268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
|
|
6269
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
|
|
6271
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
|
|
5596
6272
|
] });
|
|
5597
6273
|
}
|
|
5598
6274
|
function PanelContent({
|
|
@@ -5610,8 +6286,12 @@ function PanelContent({
|
|
|
5610
6286
|
docLoading,
|
|
5611
6287
|
documentFields,
|
|
5612
6288
|
documentId,
|
|
6289
|
+
documentType,
|
|
6290
|
+
sanityBaseUrl,
|
|
5613
6291
|
selectedPrimary,
|
|
5614
6292
|
onSelectPrimary,
|
|
6293
|
+
selectedSecondary,
|
|
6294
|
+
onSelectSecondary,
|
|
5615
6295
|
activeTab,
|
|
5616
6296
|
onActiveTabChange,
|
|
5617
6297
|
chatOpen,
|
|
@@ -5629,6 +6309,7 @@ function PanelContent({
|
|
|
5629
6309
|
const isLoading = externalAnalysis.isLoading;
|
|
5630
6310
|
const keywordAnalysisState = externalAnalysis;
|
|
5631
6311
|
const effectivePrimary = selectedPrimary || externalAnalysis.analysis?.primaryKeyword?.term || "";
|
|
6312
|
+
const effectiveSecondary = selectedSecondary || "";
|
|
5632
6313
|
const containerRef = (0, import_react18.useRef)(null);
|
|
5633
6314
|
const dragging = (0, import_react18.useRef)(false);
|
|
5634
6315
|
const onMouseDown = (0, import_react18.useCallback)(() => {
|
|
@@ -5656,6 +6337,68 @@ function PanelContent({
|
|
|
5656
6337
|
};
|
|
5657
6338
|
}, [onSplitPercentChange]);
|
|
5658
6339
|
const headerCursor = isFloating ? "grab" : "default";
|
|
6340
|
+
const onboardSite = publication || "default";
|
|
6341
|
+
const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
|
|
6342
|
+
const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
|
|
6343
|
+
const [popupMode, setPopupMode] = (0, import_react18.useState)("hidden");
|
|
6344
|
+
const [popupClosing, setPopupClosing] = (0, import_react18.useState)(false);
|
|
6345
|
+
const onboardTimerRef = (0, import_react18.useRef)(null);
|
|
6346
|
+
(0, import_react18.useEffect)(() => {
|
|
6347
|
+
let onboarded = false;
|
|
6348
|
+
let shownThisSession = false;
|
|
6349
|
+
try {
|
|
6350
|
+
onboarded = localStorage.getItem(onboardKey) === "1";
|
|
6351
|
+
} catch {
|
|
6352
|
+
}
|
|
6353
|
+
try {
|
|
6354
|
+
shownThisSession = sessionStorage.getItem(onboardSessionKey) === "1";
|
|
6355
|
+
} catch {
|
|
6356
|
+
}
|
|
6357
|
+
if (!onboarded && !shownThisSession) {
|
|
6358
|
+
setPopupMode("auto");
|
|
6359
|
+
try {
|
|
6360
|
+
sessionStorage.setItem(onboardSessionKey, "1");
|
|
6361
|
+
} catch {
|
|
6362
|
+
}
|
|
6363
|
+
onboardTimerRef.current = setTimeout(() => {
|
|
6364
|
+
setPopupClosing(true);
|
|
6365
|
+
setTimeout(() => {
|
|
6366
|
+
setPopupMode("hidden");
|
|
6367
|
+
setPopupClosing(false);
|
|
6368
|
+
}, 180);
|
|
6369
|
+
}, 5e3);
|
|
6370
|
+
}
|
|
6371
|
+
return () => {
|
|
6372
|
+
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6373
|
+
};
|
|
6374
|
+
}, [onboardKey, onboardSessionKey]);
|
|
6375
|
+
const markOnboarded = (0, import_react18.useCallback)(() => {
|
|
6376
|
+
try {
|
|
6377
|
+
localStorage.setItem(onboardKey, "1");
|
|
6378
|
+
} catch {
|
|
6379
|
+
}
|
|
6380
|
+
}, [onboardKey]);
|
|
6381
|
+
const dismissPopup = (0, import_react18.useCallback)(() => {
|
|
6382
|
+
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6383
|
+
markOnboarded();
|
|
6384
|
+
setPopupClosing(true);
|
|
6385
|
+
setTimeout(() => {
|
|
6386
|
+
setPopupMode("hidden");
|
|
6387
|
+
setPopupClosing(false);
|
|
6388
|
+
}, 180);
|
|
6389
|
+
}, [markOnboarded]);
|
|
6390
|
+
const openPopupPersistent = (0, import_react18.useCallback)(() => {
|
|
6391
|
+
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6392
|
+
markOnboarded();
|
|
6393
|
+
setPopupClosing(false);
|
|
6394
|
+
setPopupMode("persistent");
|
|
6395
|
+
}, [markOnboarded]);
|
|
6396
|
+
const handleTabChange = (0, import_react18.useCallback)((id) => {
|
|
6397
|
+
markOnboarded();
|
|
6398
|
+
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6399
|
+
setPopupMode((m) => m === "hidden" ? m : "hidden");
|
|
6400
|
+
onActiveTabChange(id);
|
|
6401
|
+
}, [markOnboarded, onActiveTabChange]);
|
|
5659
6402
|
const tabDefs = [
|
|
5660
6403
|
{ id: "summary", label: "Summary", isHub: true, loading: summaryOps.isAnyLoading },
|
|
5661
6404
|
{ id: "keywords", label: "Keywords", loading: keywordAnalysisState.isLoading || keywordAnalysisState.isVolumesLoading },
|
|
@@ -5664,7 +6407,7 @@ function PanelContent({
|
|
|
5664
6407
|
{ id: "meta", label: "Meta", beta: true },
|
|
5665
6408
|
{ id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
|
|
5666
6409
|
];
|
|
5667
|
-
return /* @__PURE__ */ (0,
|
|
6410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5668
6411
|
"div",
|
|
5669
6412
|
{
|
|
5670
6413
|
className: "seo-copilot-panel",
|
|
@@ -5675,11 +6418,13 @@ function PanelContent({
|
|
|
5675
6418
|
// backgroundColor (longhand) so the sheen background-image in INJECTED_CSS isn't reset
|
|
5676
6419
|
backgroundColor: PANEL_BG,
|
|
5677
6420
|
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif",
|
|
5678
|
-
opacity: 1
|
|
6421
|
+
opacity: 1,
|
|
6422
|
+
position: "relative"
|
|
5679
6423
|
},
|
|
5680
6424
|
children: [
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
5682
|
-
/* @__PURE__ */ (0,
|
|
6425
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
|
|
6426
|
+
popupMode !== "hidden" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
|
|
6427
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5683
6428
|
"div",
|
|
5684
6429
|
{
|
|
5685
6430
|
onMouseDown: isFloating ? onDragStart : void 0,
|
|
@@ -5697,15 +6442,16 @@ function PanelContent({
|
|
|
5697
6442
|
flexShrink: 0
|
|
5698
6443
|
},
|
|
5699
6444
|
children: [
|
|
5700
|
-
/* @__PURE__ */ (0,
|
|
5701
|
-
/* @__PURE__ */ (0,
|
|
5702
|
-
/* @__PURE__ */ (0,
|
|
5703
|
-
/* @__PURE__ */ (0,
|
|
5704
|
-
/* @__PURE__ */ (0,
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
6446
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LogoIcon2, {}),
|
|
6447
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
|
|
6448
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: MJH_GOLD }, children: "SEO" }),
|
|
6449
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: MJH_SLATE }, children: " copilot" })
|
|
5705
6450
|
] })
|
|
5706
6451
|
] }),
|
|
5707
|
-
/* @__PURE__ */ (0,
|
|
5708
|
-
|
|
6452
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
|
|
6453
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(OnboardingInfoButton, { onClick: openPopupPersistent }),
|
|
6454
|
+
isFloating && onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5709
6455
|
"button",
|
|
5710
6456
|
{
|
|
5711
6457
|
onClick: (e) => {
|
|
@@ -5727,16 +6473,16 @@ function PanelContent({
|
|
|
5727
6473
|
fontWeight: 600,
|
|
5728
6474
|
transition: "all 150ms"
|
|
5729
6475
|
},
|
|
5730
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
5731
|
-
/* @__PURE__ */ (0,
|
|
6476
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
6477
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M3.28 2.22a.75.75 0 00-1.06 1.06L5.44 6.5H3.75a.75.75 0 000 1.5h4.5A.75.75 0 009 7.25v-4.5a.75.75 0 00-1.5 0v1.69L4.28 1.22a.75.75 0 00-1 1zM16.72 17.78a.75.75 0 001.06-1.06L14.56 13.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5a.75.75 0 001.5 0v-1.69l3.22 3.22z" }) }),
|
|
5732
6478
|
"Exit fullscreen"
|
|
5733
|
-
] }) : /* @__PURE__ */ (0,
|
|
5734
|
-
/* @__PURE__ */ (0,
|
|
6479
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
6480
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M13.28 7.78l3.22-3.22v1.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h1.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25a.75.75 0 001.5 0v-1.69l3.22 3.22a.75.75 0 001.06-1.06L4.56 14.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5z" }) }),
|
|
5735
6481
|
"Fullscreen"
|
|
5736
6482
|
] })
|
|
5737
6483
|
}
|
|
5738
6484
|
),
|
|
5739
|
-
isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
6485
|
+
isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5740
6486
|
"button",
|
|
5741
6487
|
{
|
|
5742
6488
|
onClick: (e) => {
|
|
@@ -5759,7 +6505,7 @@ function PanelContent({
|
|
|
5759
6505
|
transition: "all 150ms"
|
|
5760
6506
|
},
|
|
5761
6507
|
children: [
|
|
5762
|
-
/* @__PURE__ */ (0,
|
|
6508
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5763
6509
|
"path",
|
|
5764
6510
|
{
|
|
5765
6511
|
fillRule: "evenodd",
|
|
@@ -5771,7 +6517,7 @@ function PanelContent({
|
|
|
5771
6517
|
]
|
|
5772
6518
|
}
|
|
5773
6519
|
),
|
|
5774
|
-
!isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
6520
|
+
!isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5775
6521
|
"button",
|
|
5776
6522
|
{
|
|
5777
6523
|
onClick: (e) => {
|
|
@@ -5790,13 +6536,13 @@ function PanelContent({
|
|
|
5790
6536
|
transition: "color 150ms"
|
|
5791
6537
|
},
|
|
5792
6538
|
title: "Pop out",
|
|
5793
|
-
children: /* @__PURE__ */ (0,
|
|
5794
|
-
/* @__PURE__ */ (0,
|
|
5795
|
-
/* @__PURE__ */ (0,
|
|
6539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
6540
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M4.25 5.5a.75.75 0 00-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 00.75-.75v-4a.75.75 0 011.5 0v4A2.25 2.25 0 0112.75 17h-8.5A2.25 2.25 0 012 14.75v-8.5A2.25 2.25 0 014.25 4h5a.75.75 0 010 1.5h-5z" }),
|
|
6541
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M6.194 12.753a.75.75 0 001.06.053L16.5 4.44v2.81a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.553l-9.056 8.194a.75.75 0 00-.053 1.06z" })
|
|
5796
6542
|
] })
|
|
5797
6543
|
}
|
|
5798
6544
|
),
|
|
5799
|
-
isLoading && /* @__PURE__ */ (0,
|
|
6545
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5800
6546
|
"div",
|
|
5801
6547
|
{
|
|
5802
6548
|
style: {
|
|
@@ -5808,7 +6554,7 @@ function PanelContent({
|
|
|
5808
6554
|
}
|
|
5809
6555
|
}
|
|
5810
6556
|
),
|
|
5811
|
-
onClose && /* @__PURE__ */ (0,
|
|
6557
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5812
6558
|
"button",
|
|
5813
6559
|
{
|
|
5814
6560
|
onClick: (e) => {
|
|
@@ -5827,11 +6573,11 @@ function PanelContent({
|
|
|
5827
6573
|
transition: "color 150ms"
|
|
5828
6574
|
},
|
|
5829
6575
|
title: "Close",
|
|
5830
|
-
children: /* @__PURE__ */ (0,
|
|
6576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
|
|
5831
6577
|
}
|
|
5832
6578
|
)
|
|
5833
6579
|
] }),
|
|
5834
|
-
/* @__PURE__ */ (0,
|
|
6580
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5835
6581
|
"div",
|
|
5836
6582
|
{
|
|
5837
6583
|
style: {
|
|
@@ -5850,8 +6596,8 @@ function PanelContent({
|
|
|
5850
6596
|
]
|
|
5851
6597
|
}
|
|
5852
6598
|
),
|
|
5853
|
-
/* @__PURE__ */ (0,
|
|
5854
|
-
/* @__PURE__ */ (0,
|
|
6599
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
|
|
6600
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5855
6601
|
"div",
|
|
5856
6602
|
{
|
|
5857
6603
|
style: {
|
|
@@ -5867,8 +6613,8 @@ function PanelContent({
|
|
|
5867
6613
|
children: "Recommendations are generated by AI. Verify details before publishing."
|
|
5868
6614
|
}
|
|
5869
6615
|
),
|
|
5870
|
-
/* @__PURE__ */ (0,
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
6616
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
6617
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5872
6618
|
"div",
|
|
5873
6619
|
{
|
|
5874
6620
|
style: {
|
|
@@ -5879,7 +6625,7 @@ function PanelContent({
|
|
|
5879
6625
|
background: RECS_ZONE_BG
|
|
5880
6626
|
},
|
|
5881
6627
|
children: [
|
|
5882
|
-
/* @__PURE__ */ (0,
|
|
6628
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5883
6629
|
KeywordPanel,
|
|
5884
6630
|
{
|
|
5885
6631
|
text,
|
|
@@ -5887,19 +6633,23 @@ function PanelContent({
|
|
|
5887
6633
|
seedKeywords,
|
|
5888
6634
|
onSeedsChange,
|
|
5889
6635
|
onSelectPrimary,
|
|
6636
|
+
secondaryKeyword: effectiveSecondary,
|
|
6637
|
+
onSelectSecondary,
|
|
5890
6638
|
documentFields,
|
|
5891
6639
|
documentId,
|
|
5892
6640
|
externalAnalysis: keywordAnalysisState
|
|
5893
6641
|
},
|
|
5894
6642
|
documentId || "default"
|
|
5895
6643
|
) }),
|
|
5896
|
-
/* @__PURE__ */ (0,
|
|
6644
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5897
6645
|
SummaryTab,
|
|
5898
6646
|
{
|
|
5899
6647
|
text,
|
|
5900
6648
|
analysis: keywordAnalysisState.analysis,
|
|
5901
6649
|
deepAnalysis: keywordAnalysisState.deepAnalysis,
|
|
5902
6650
|
documentFields,
|
|
6651
|
+
primaryKeyword: effectivePrimary,
|
|
6652
|
+
secondaryKeyword: effectiveSecondary,
|
|
5903
6653
|
linkingSuggestions: linkingOps.suggestions,
|
|
5904
6654
|
linkCheckResults: technicalOps.linkCheckResults,
|
|
5905
6655
|
isAnyLoading: summaryOps.isAnyLoading,
|
|
@@ -5907,7 +6657,7 @@ function PanelContent({
|
|
|
5907
6657
|
onItemClick: summaryOps.onItemClick
|
|
5908
6658
|
}
|
|
5909
6659
|
) }),
|
|
5910
|
-
/* @__PURE__ */ (0,
|
|
6660
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5911
6661
|
AEOTab,
|
|
5912
6662
|
{
|
|
5913
6663
|
text,
|
|
@@ -5924,7 +6674,7 @@ function PanelContent({
|
|
|
5924
6674
|
loadContentSuggestions: aeoOps.loadContentSuggestions
|
|
5925
6675
|
}
|
|
5926
6676
|
) }),
|
|
5927
|
-
/* @__PURE__ */ (0,
|
|
6677
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5928
6678
|
LinkingTab,
|
|
5929
6679
|
{
|
|
5930
6680
|
analysis: keywordAnalysisState.analysis,
|
|
@@ -5935,16 +6685,20 @@ function PanelContent({
|
|
|
5935
6685
|
onRefresh: linkingOps.refresh,
|
|
5936
6686
|
documentId,
|
|
5937
6687
|
publication,
|
|
5938
|
-
text
|
|
6688
|
+
text,
|
|
6689
|
+
sanityBaseUrl,
|
|
6690
|
+
documentType
|
|
5939
6691
|
}
|
|
5940
6692
|
) }),
|
|
5941
|
-
/* @__PURE__ */ (0,
|
|
5942
|
-
/* @__PURE__ */ (0,
|
|
6693
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
|
|
6694
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5943
6695
|
TechnicalTab,
|
|
5944
6696
|
{
|
|
5945
6697
|
text,
|
|
5946
6698
|
documentFields,
|
|
5947
6699
|
isLoading: docLoading,
|
|
6700
|
+
primaryKeyword: effectivePrimary,
|
|
6701
|
+
secondaryKeyword: effectiveSecondary,
|
|
5948
6702
|
linkCheckResults: technicalOps.linkCheckResults,
|
|
5949
6703
|
isLinkCheckLoading: technicalOps.isLinkCheckLoading,
|
|
5950
6704
|
linkCheckError: technicalOps.linkCheckError,
|
|
@@ -5955,7 +6709,7 @@ function PanelContent({
|
|
|
5955
6709
|
]
|
|
5956
6710
|
}
|
|
5957
6711
|
),
|
|
5958
|
-
chatOpen && /* @__PURE__ */ (0,
|
|
6712
|
+
chatOpen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5959
6713
|
"div",
|
|
5960
6714
|
{
|
|
5961
6715
|
onMouseDown,
|
|
@@ -5968,10 +6722,10 @@ function PanelContent({
|
|
|
5968
6722
|
justifyContent: "center",
|
|
5969
6723
|
flexShrink: 0
|
|
5970
6724
|
},
|
|
5971
|
-
children: /* @__PURE__ */ (0,
|
|
6725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
|
|
5972
6726
|
}
|
|
5973
6727
|
),
|
|
5974
|
-
/* @__PURE__ */ (0,
|
|
6728
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5975
6729
|
"div",
|
|
5976
6730
|
{
|
|
5977
6731
|
style: {
|
|
@@ -5984,7 +6738,7 @@ function PanelContent({
|
|
|
5984
6738
|
background: CHAT_ZONE_BG
|
|
5985
6739
|
},
|
|
5986
6740
|
children: [
|
|
5987
|
-
/* @__PURE__ */ (0,
|
|
6741
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5988
6742
|
"button",
|
|
5989
6743
|
{
|
|
5990
6744
|
onClick: () => onChatOpenChange(!chatOpen),
|
|
@@ -6005,7 +6759,7 @@ function PanelContent({
|
|
|
6005
6759
|
flexShrink: 0
|
|
6006
6760
|
},
|
|
6007
6761
|
children: [
|
|
6008
|
-
/* @__PURE__ */ (0,
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6009
6763
|
"span",
|
|
6010
6764
|
{
|
|
6011
6765
|
style: {
|
|
@@ -6018,7 +6772,7 @@ function PanelContent({
|
|
|
6018
6772
|
children: "Chat"
|
|
6019
6773
|
}
|
|
6020
6774
|
),
|
|
6021
|
-
/* @__PURE__ */ (0,
|
|
6775
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6022
6776
|
"svg",
|
|
6023
6777
|
{
|
|
6024
6778
|
width: "12",
|
|
@@ -6026,7 +6780,7 @@ function PanelContent({
|
|
|
6026
6780
|
viewBox: "0 0 20 20",
|
|
6027
6781
|
fill: "rgba(0,0,0,0.55)",
|
|
6028
6782
|
style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
|
|
6029
|
-
children: /* @__PURE__ */ (0,
|
|
6783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6030
6784
|
"path",
|
|
6031
6785
|
{
|
|
6032
6786
|
fillRule: "evenodd",
|
|
@@ -6039,7 +6793,7 @@ function PanelContent({
|
|
|
6039
6793
|
]
|
|
6040
6794
|
}
|
|
6041
6795
|
),
|
|
6042
|
-
/* @__PURE__ */ (0,
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6043
6797
|
"div",
|
|
6044
6798
|
{
|
|
6045
6799
|
style: {
|
|
@@ -6049,7 +6803,7 @@ function PanelContent({
|
|
|
6049
6803
|
flexDirection: "column",
|
|
6050
6804
|
minHeight: 0
|
|
6051
6805
|
},
|
|
6052
|
-
children: /* @__PURE__ */ (0,
|
|
6806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6053
6807
|
ChatPanel,
|
|
6054
6808
|
{
|
|
6055
6809
|
messages: chatState.messages,
|
|
@@ -6082,8 +6836,15 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6082
6836
|
);
|
|
6083
6837
|
const dragOffset = (0, import_react18.useRef)(null);
|
|
6084
6838
|
const resizeStart = (0, import_react18.useRef)(null);
|
|
6085
|
-
const { text, isLoading: docLoading, documentFields, documentId } = useDocumentContent();
|
|
6839
|
+
const { text, isLoading: docLoading, documentFields, documentId, documentType } = useDocumentContent();
|
|
6086
6840
|
const { apiUrl } = useConfig();
|
|
6841
|
+
const workspace = (0, import_sanity3.useWorkspace)();
|
|
6842
|
+
const effectivePublication = config.publication || workspace?.dataset;
|
|
6843
|
+
const sanityBaseUrl = (0, import_react18.useMemo)(() => {
|
|
6844
|
+
if (typeof window === "undefined") return void 0;
|
|
6845
|
+
const basePath = (workspace?.basePath || "/").replace(/\/+$/, "");
|
|
6846
|
+
return `${window.location.origin}${basePath}`;
|
|
6847
|
+
}, [workspace?.basePath]);
|
|
6087
6848
|
const seedCacheKey = documentId ? `seo-copilot-cache-${documentId}` : "seo-copilot-cache-v2";
|
|
6088
6849
|
const loadSeedsFromCache = (0, import_react18.useCallback)(() => {
|
|
6089
6850
|
try {
|
|
@@ -6107,6 +6868,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6107
6868
|
);
|
|
6108
6869
|
const selectedPrimaryKey = documentId ? `seo-copilot-primary-${documentId}` : "seo-copilot-primary-default";
|
|
6109
6870
|
const [selectedPrimary, setSelectedPrimary] = usePersistentState(selectedPrimaryKey, void 0);
|
|
6871
|
+
const selectedSecondaryKey = documentId ? `seo-copilot-secondary-${documentId}` : "seo-copilot-secondary-default";
|
|
6872
|
+
const [selectedSecondary, setSelectedSecondary] = usePersistentState(selectedSecondaryKey, "");
|
|
6110
6873
|
const seedsInitializedRef = (0, import_react18.useRef)(false);
|
|
6111
6874
|
(0, import_react18.useEffect)(() => {
|
|
6112
6875
|
if (!seedsInitializedRef.current) {
|
|
@@ -6118,7 +6881,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6118
6881
|
const [activeTab, setActiveTab] = (0, import_react18.useState)("keywords");
|
|
6119
6882
|
const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
|
|
6120
6883
|
const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
|
|
6121
|
-
const keywordAnalysisState = useKeywordAnalysis(text, apiUrl,
|
|
6884
|
+
const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId);
|
|
6122
6885
|
const effectivePrimary = selectedPrimary || keywordAnalysisState.analysis?.primaryKeyword?.term || "";
|
|
6123
6886
|
const keywordPanelData = (0, import_react18.useMemo)(() => {
|
|
6124
6887
|
const analysis = keywordAnalysisState.analysis;
|
|
@@ -6135,7 +6898,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6135
6898
|
} : void 0
|
|
6136
6899
|
};
|
|
6137
6900
|
}, [keywordAnalysisState.analysis, keywordAnalysisState.deepAnalysis]);
|
|
6138
|
-
const chatHookState = useSEOChat(apiUrl, text,
|
|
6901
|
+
const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
|
|
6139
6902
|
const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
|
|
6140
6903
|
const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
|
|
6141
6904
|
const [isCSLoading, setIsCSLoading] = (0, import_react18.useState)(false);
|
|
@@ -6156,7 +6919,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6156
6919
|
setIsCSLoading(true);
|
|
6157
6920
|
setCsError(null);
|
|
6158
6921
|
try {
|
|
6159
|
-
const data = await fetchContentSuggestions(apiUrl, text, effectivePrimary,
|
|
6922
|
+
const data = await fetchContentSuggestions(apiUrl, text, effectivePrimary, effectivePublication);
|
|
6160
6923
|
if (aeoOpVersionRef.current !== myVersion) return;
|
|
6161
6924
|
if (data.keyTakeaways.length === 0 && data.infographicOpportunities.length === 0 && data.bulletListItems.length === 0) {
|
|
6162
6925
|
setCsError("No suggestions returned. Try again with more content.");
|
|
@@ -6169,7 +6932,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6169
6932
|
}
|
|
6170
6933
|
if (aeoOpVersionRef.current !== myVersion) return;
|
|
6171
6934
|
setIsCSLoading(false);
|
|
6172
|
-
}, [apiUrl, text, effectivePrimary,
|
|
6935
|
+
}, [apiUrl, text, effectivePrimary, effectivePublication]);
|
|
6173
6936
|
const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
|
|
6174
6937
|
const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
|
|
6175
6938
|
const [isLinkingLoading, setIsLinkingLoading] = (0, import_react18.useState)(false);
|
|
@@ -6189,8 +6952,10 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6189
6952
|
lastLinkingFetchKey.current = "";
|
|
6190
6953
|
}, [documentId]);
|
|
6191
6954
|
const supportingKeywordsForLinking = (0, import_react18.useMemo)(() => {
|
|
6192
|
-
|
|
6193
|
-
|
|
6955
|
+
const base = (keywordAnalysisState.analysis?.supportingKeywords || []).map((kw) => kw.term).filter(Boolean);
|
|
6956
|
+
const merged = selectedSecondary ? [selectedSecondary, ...base.filter((t) => t.toLowerCase() !== selectedSecondary.toLowerCase())] : base;
|
|
6957
|
+
return merged.slice(0, 5);
|
|
6958
|
+
}, [keywordAnalysisState.analysis, selectedSecondary]);
|
|
6194
6959
|
const refreshLinkingSuggestions = (0, import_react18.useCallback)(async () => {
|
|
6195
6960
|
if (!text || text.trim().length < 50) return;
|
|
6196
6961
|
if (!effectivePrimary) return;
|
|
@@ -6204,7 +6969,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6204
6969
|
effectivePrimary,
|
|
6205
6970
|
supportingKeywordsForLinking,
|
|
6206
6971
|
documentId,
|
|
6207
|
-
|
|
6972
|
+
effectivePublication
|
|
6208
6973
|
);
|
|
6209
6974
|
if (linkingVersionRef.current !== myVersion) return;
|
|
6210
6975
|
setLinkingSuggestions(suggestions);
|
|
@@ -6215,7 +6980,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6215
6980
|
}
|
|
6216
6981
|
if (linkingVersionRef.current !== myVersion) return;
|
|
6217
6982
|
setIsLinkingLoading(false);
|
|
6218
|
-
}, [apiUrl, text, effectivePrimary, supportingKeywordsForLinking, documentId,
|
|
6983
|
+
}, [apiUrl, text, effectivePrimary, supportingKeywordsForLinking, documentId, effectivePublication]);
|
|
6219
6984
|
const isLinkingStale = (0, import_react18.useMemo)(() => {
|
|
6220
6985
|
if (!linkingFetchedText || linkingSuggestions.length === 0) return false;
|
|
6221
6986
|
if (Math.abs(text.length - linkingFetchedText.length) > 150) return true;
|
|
@@ -6326,10 +7091,10 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6326
7091
|
},
|
|
6327
7092
|
[floatSize]
|
|
6328
7093
|
);
|
|
6329
|
-
const panelContent = /* @__PURE__ */ (0,
|
|
7094
|
+
const panelContent = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6330
7095
|
PanelContent,
|
|
6331
7096
|
{
|
|
6332
|
-
initialPublication:
|
|
7097
|
+
initialPublication: effectivePublication,
|
|
6333
7098
|
isFloating,
|
|
6334
7099
|
isFullscreen,
|
|
6335
7100
|
onToggleFloat: () => {
|
|
@@ -6346,8 +7111,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6346
7111
|
docLoading,
|
|
6347
7112
|
documentFields,
|
|
6348
7113
|
documentId,
|
|
7114
|
+
documentType,
|
|
7115
|
+
sanityBaseUrl,
|
|
6349
7116
|
selectedPrimary,
|
|
6350
7117
|
onSelectPrimary: setSelectedPrimary,
|
|
7118
|
+
selectedSecondary,
|
|
7119
|
+
onSelectSecondary: setSelectedSecondary,
|
|
6351
7120
|
activeTab,
|
|
6352
7121
|
onActiveTabChange: setActiveTab,
|
|
6353
7122
|
chatOpen,
|
|
@@ -6409,7 +7178,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6409
7178
|
}
|
|
6410
7179
|
}
|
|
6411
7180
|
);
|
|
6412
|
-
const floatingPanel = /* @__PURE__ */ (0,
|
|
7181
|
+
const floatingPanel = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6413
7182
|
"div",
|
|
6414
7183
|
{
|
|
6415
7184
|
style: {
|
|
@@ -6427,7 +7196,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6427
7196
|
},
|
|
6428
7197
|
children: [
|
|
6429
7198
|
panelContent,
|
|
6430
|
-
!isFullscreen && /* @__PURE__ */ (0,
|
|
7199
|
+
!isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6431
7200
|
"div",
|
|
6432
7201
|
{
|
|
6433
7202
|
onMouseDown: handleResizeStart,
|
|
@@ -6442,9 +7211,9 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6442
7211
|
alignItems: "center",
|
|
6443
7212
|
justifyContent: "center"
|
|
6444
7213
|
},
|
|
6445
|
-
children: /* @__PURE__ */ (0,
|
|
6446
|
-
/* @__PURE__ */ (0,
|
|
6447
|
-
/* @__PURE__ */ (0,
|
|
7214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
|
|
7215
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
7216
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
6448
7217
|
] })
|
|
6449
7218
|
}
|
|
6450
7219
|
)
|
|
@@ -6452,8 +7221,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6452
7221
|
}
|
|
6453
7222
|
);
|
|
6454
7223
|
if (isFloating) {
|
|
6455
|
-
return /* @__PURE__ */ (0,
|
|
6456
|
-
/* @__PURE__ */ (0,
|
|
7224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
7225
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6457
7226
|
"div",
|
|
6458
7227
|
{
|
|
6459
7228
|
style: {
|
|
@@ -6463,30 +7232,30 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6463
7232
|
alignItems: "center",
|
|
6464
7233
|
justifyContent: "center"
|
|
6465
7234
|
},
|
|
6466
|
-
children: /* @__PURE__ */ (0,
|
|
7235
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
|
|
6467
7236
|
}
|
|
6468
7237
|
),
|
|
6469
7238
|
typeof document !== "undefined" && (0, import_react_dom.createPortal)(floatingPanel, document.body)
|
|
6470
7239
|
] });
|
|
6471
7240
|
}
|
|
6472
|
-
return /* @__PURE__ */ (0,
|
|
7241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
|
|
6473
7242
|
}
|
|
6474
7243
|
function SEOCopilotPanel({ config, onClose }) {
|
|
6475
|
-
return /* @__PURE__ */ (0,
|
|
7244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6476
7245
|
import_react18.Suspense,
|
|
6477
7246
|
{
|
|
6478
|
-
fallback: /* @__PURE__ */ (0,
|
|
6479
|
-
/* @__PURE__ */ (0,
|
|
6480
|
-
/* @__PURE__ */ (0,
|
|
7247
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
7248
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingBars, {}),
|
|
7249
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
|
|
6481
7250
|
] }),
|
|
6482
|
-
children: /* @__PURE__ */ (0,
|
|
7251
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SEOCopilotInner, { config, onClose }) })
|
|
6483
7252
|
}
|
|
6484
7253
|
);
|
|
6485
7254
|
}
|
|
6486
7255
|
function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
6487
7256
|
const barWidth = size === "xs" ? 4 : 6;
|
|
6488
7257
|
const containerHeight = size === "xs" ? 10 : 14;
|
|
6489
|
-
return /* @__PURE__ */ (0,
|
|
7258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6490
7259
|
"div",
|
|
6491
7260
|
{
|
|
6492
7261
|
style: {
|
|
@@ -6554,7 +7323,7 @@ function seoCopilotInspector(config) {
|
|
|
6554
7323
|
}
|
|
6555
7324
|
|
|
6556
7325
|
// src/index.ts
|
|
6557
|
-
var seoCopilot = (0,
|
|
7326
|
+
var seoCopilot = (0, import_sanity4.definePlugin)((config) => ({
|
|
6558
7327
|
name: "seo-copilot",
|
|
6559
7328
|
document: {
|
|
6560
7329
|
inspectors: (prev) => {
|