sanity-plugin-seo-copilot 0.2.13 → 0.2.14
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 +1253 -865
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1226 -838
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ReportProblemButton.tsx +212 -0
- package/src/components/SEOCopilotPanel.tsx +8 -0
- package/src/components/tabs/AEOTab.tsx +2 -0
- package/src/components/tabs/LinkingTab.tsx +39 -13
- package/src/components/tabs/MetaTab.tsx +122 -24
- package/src/components/tabs/SummaryTab.tsx +21 -15
- package/src/components/tabs/TechnicalTab.tsx +276 -269
- package/src/lib/api.ts +18 -2
- package/src/lib/documentExtract.ts +168 -14
- package/src/lib/scoring.ts +4 -4
- package/src/lib/summary.ts +22 -13
- package/src/lib/types.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -33,14 +33,14 @@ __export(index_exports, {
|
|
|
33
33
|
seoCopilot: () => seoCopilot
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_sanity5 = require("sanity");
|
|
37
37
|
|
|
38
38
|
// src/inspector.ts
|
|
39
|
-
var
|
|
39
|
+
var import_react20 = require("react");
|
|
40
40
|
|
|
41
41
|
// src/components/SEOCopilotPanel.tsx
|
|
42
|
-
var
|
|
43
|
-
var
|
|
42
|
+
var import_react19 = require("react");
|
|
43
|
+
var import_sanity4 = require("sanity");
|
|
44
44
|
var import_react_dom = require("react-dom");
|
|
45
45
|
|
|
46
46
|
// src/hooks/useDocumentContent.ts
|
|
@@ -84,30 +84,83 @@ function extractHeadingsDetailed(blocks) {
|
|
|
84
84
|
}
|
|
85
85
|
return out;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
87
|
+
function normalizeLink(raw) {
|
|
88
|
+
const s = raw.trim().replace(/[.,;:!?]+$/, "");
|
|
89
|
+
if (!s) return null;
|
|
90
|
+
if (/^https?:\/\//i.test(s)) return s;
|
|
91
|
+
if (/^www\.\S+\.\S+/i.test(s) || /^[a-z0-9-]+(\.[a-z0-9-]+)+(\/|$)/i.test(s)) return `https://${s}`;
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
var UNSTYLED_HEADING_SCAN_CAP = 600;
|
|
95
|
+
function extractUnstyledHeadings(blocks) {
|
|
96
|
+
if (!Array.isArray(blocks)) return [];
|
|
97
|
+
const items = blocks.slice(0, UNSTYLED_HEADING_SCAN_CAP).map((b) => {
|
|
98
|
+
if (!b || b._type !== "block") return null;
|
|
99
|
+
const style = b.style || "normal";
|
|
100
|
+
const text = (b.children || []).map((c) => c.text || "").join("").trim();
|
|
101
|
+
return {
|
|
102
|
+
isHeading: /^h[1-6]$/.test(style),
|
|
103
|
+
isPlain: style === "normal",
|
|
104
|
+
isList: typeof b.listItem === "string" && b.listItem.length > 0,
|
|
105
|
+
text,
|
|
106
|
+
words: text ? text.split(/\s+/).filter(Boolean).length : 0
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
const out = [];
|
|
110
|
+
for (let i = 0; i < items.length; i++) {
|
|
111
|
+
const it = items[i];
|
|
112
|
+
if (!it || it.isHeading || it.isList || !it.isPlain) continue;
|
|
113
|
+
if (it.words < 2 || it.words > 9) continue;
|
|
114
|
+
if (/[.!?]$/.test(it.text)) continue;
|
|
115
|
+
if (!/[A-Za-z]/.test(it.text)) continue;
|
|
116
|
+
if (/https?:\/\/|doi:|\baccessed\b|image credit|stock\.adobe|^figure\b|^table\b|^source[:s]?\b|^references?\b/i.test(it.text)) continue;
|
|
117
|
+
let next = null;
|
|
118
|
+
for (let j = i + 1; j < items.length; j++) {
|
|
119
|
+
if (items[j] && items[j].text) {
|
|
120
|
+
next = items[j];
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (!next || next.isHeading || next.words < 12) continue;
|
|
125
|
+
out.push(it.text);
|
|
126
|
+
if (out.length >= 8) break;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
function extractBodyLinksDetailed(blocks) {
|
|
131
|
+
const linked = /* @__PURE__ */ new Set();
|
|
132
|
+
const all = /* @__PURE__ */ new Set();
|
|
133
|
+
const anchorByUrl = /* @__PURE__ */ new Map();
|
|
89
134
|
if (Array.isArray(blocks)) {
|
|
90
135
|
for (const block of blocks) {
|
|
91
136
|
if (block._type === "block" && Array.isArray(block.markDefs)) {
|
|
92
137
|
for (const md of block.markDefs) {
|
|
93
138
|
const href = md.href || md.url;
|
|
94
|
-
if (typeof href
|
|
95
|
-
|
|
96
|
-
|
|
139
|
+
if (typeof href !== "string") continue;
|
|
140
|
+
const n = normalizeLink(href);
|
|
141
|
+
if (!n) continue;
|
|
142
|
+
linked.add(n);
|
|
143
|
+
all.add(n);
|
|
144
|
+
const anchor = (block.children || []).filter((c) => Array.isArray(c.marks) && md._key && c.marks.includes(md._key)).map((c) => c.text || "").join("").trim();
|
|
145
|
+
if (anchor && !anchorByUrl.has(n)) anchorByUrl.set(n, anchor);
|
|
97
146
|
}
|
|
98
147
|
}
|
|
99
148
|
}
|
|
100
|
-
}
|
|
101
|
-
if (Array.isArray(blocks)) {
|
|
102
149
|
for (const block of blocks) {
|
|
103
150
|
if (block._type === "block" && Array.isArray(block.children)) {
|
|
104
151
|
const blockText = block.children.map((c) => c.text || "").join(" ");
|
|
105
|
-
const matches = blockText.match(/https
|
|
106
|
-
if (matches)
|
|
152
|
+
const matches = blockText.match(/(?:https?:\/\/|www\.)[^\s"'<>)\]]+/gi);
|
|
153
|
+
if (matches) for (const u of matches) {
|
|
154
|
+
const n = normalizeLink(u);
|
|
155
|
+
if (n) all.add(n);
|
|
156
|
+
}
|
|
107
157
|
}
|
|
108
158
|
}
|
|
109
159
|
}
|
|
110
|
-
return
|
|
160
|
+
return [...all].map((url) => ({ url, hyperlinked: linked.has(url), anchorText: anchorByUrl.get(url) }));
|
|
161
|
+
}
|
|
162
|
+
function extractBodyLinks(blocks) {
|
|
163
|
+
return extractBodyLinksDetailed(blocks).map((l) => l.url);
|
|
111
164
|
}
|
|
112
165
|
function detectSlug(val) {
|
|
113
166
|
if (!val) return void 0;
|
|
@@ -182,6 +235,86 @@ function detectAuthor(val) {
|
|
|
182
235
|
}
|
|
183
236
|
return { authorIsReference: false };
|
|
184
237
|
}
|
|
238
|
+
var FACT_CHECK_STATUS_WORDS = /* @__PURE__ */ new Set([
|
|
239
|
+
"pending",
|
|
240
|
+
"approved",
|
|
241
|
+
"rejected",
|
|
242
|
+
"done",
|
|
243
|
+
"complete",
|
|
244
|
+
"completed",
|
|
245
|
+
"in review",
|
|
246
|
+
"in progress",
|
|
247
|
+
"not started",
|
|
248
|
+
"draft",
|
|
249
|
+
"review",
|
|
250
|
+
"reviewed",
|
|
251
|
+
"unreviewed",
|
|
252
|
+
"checked",
|
|
253
|
+
"unchecked",
|
|
254
|
+
"verified",
|
|
255
|
+
"unverified",
|
|
256
|
+
"true",
|
|
257
|
+
"false",
|
|
258
|
+
"yes",
|
|
259
|
+
"no",
|
|
260
|
+
"n/a",
|
|
261
|
+
"na",
|
|
262
|
+
"none",
|
|
263
|
+
"tbd",
|
|
264
|
+
"todo",
|
|
265
|
+
"to do"
|
|
266
|
+
]);
|
|
267
|
+
function isLikelyPersonName(s) {
|
|
268
|
+
const t = s.trim().toLowerCase();
|
|
269
|
+
if (!t || FACT_CHECK_STATUS_WORDS.has(t)) return false;
|
|
270
|
+
return /[a-z]/i.test(s);
|
|
271
|
+
}
|
|
272
|
+
function detectFactChecker(val) {
|
|
273
|
+
if (!val) return { factCheckerIsReference: false };
|
|
274
|
+
const candidateFields = [
|
|
275
|
+
"factChecker",
|
|
276
|
+
"factCheckers",
|
|
277
|
+
"factCheckedBy",
|
|
278
|
+
"reviewer",
|
|
279
|
+
"reviewers",
|
|
280
|
+
"reviewedBy",
|
|
281
|
+
"medicalReviewer",
|
|
282
|
+
"medicallyReviewedBy"
|
|
283
|
+
];
|
|
284
|
+
const dynamic = Object.keys(val).filter(
|
|
285
|
+
(k) => (
|
|
286
|
+
// Require "checker"/"checked by"/"reviewer"/"reviewed by" - NOT a bare "check" flag.
|
|
287
|
+
/factchecker|fact.?checked.?by|reviewer|reviewed.?by/i.test(k) && // never date/timestamp fields (lastReviewedAt, medicallyReviewedAt, reviewedDate),
|
|
288
|
+
// free-text/status/flag sidecars (reviewerNotes, reviewStatus), nor image/url/id fields.
|
|
289
|
+
!/at$|date$|on$|url|link|count|note|comment|status|flag|bool|photo|image|avatar|picture|id$/i.test(k)
|
|
290
|
+
)
|
|
291
|
+
);
|
|
292
|
+
const fields = Array.from(/* @__PURE__ */ new Set([...candidateFields, ...dynamic]));
|
|
293
|
+
for (const f of fields) {
|
|
294
|
+
const raw = val[f];
|
|
295
|
+
if (!raw) continue;
|
|
296
|
+
if (Array.isArray(raw)) {
|
|
297
|
+
const names = raw.filter((x) => typeof x === "string" && isLikelyPersonName(x)).map((x) => x.trim());
|
|
298
|
+
if (names.length > 0) return { factCheckerName: names.slice(0, 3).join(", "), factCheckerIsReference: false };
|
|
299
|
+
}
|
|
300
|
+
const first = Array.isArray(raw) ? raw[0] : raw;
|
|
301
|
+
if (!first) continue;
|
|
302
|
+
if (typeof first === "string") {
|
|
303
|
+
const trimmed = first.trim();
|
|
304
|
+
if (trimmed && isLikelyPersonName(trimmed)) return { factCheckerName: trimmed, factCheckerIsReference: false };
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (typeof first === "object" && first !== null) {
|
|
308
|
+
const o = first;
|
|
309
|
+
const name = [o.name, o.fullName, o.displayName].find((v) => typeof v === "string" && isLikelyPersonName(v));
|
|
310
|
+
if (name) return { factCheckerName: name, factCheckerIsReference: false };
|
|
311
|
+
if (typeof o._ref === "string" || o._type === "reference") {
|
|
312
|
+
return { factCheckerIsReference: true };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return { factCheckerIsReference: false };
|
|
317
|
+
}
|
|
185
318
|
function extractImageMeta(value) {
|
|
186
319
|
const names = [];
|
|
187
320
|
const titles = [];
|
|
@@ -220,6 +353,7 @@ function buildDocumentFields(value) {
|
|
|
220
353
|
const title = typeof val?.title === "string" ? val.title : void 0;
|
|
221
354
|
const body = val?.body;
|
|
222
355
|
const { authorName, authorCredentials, authorBioUrl, authorIsReference } = detectAuthor(val);
|
|
356
|
+
const { factCheckerName, factCheckerIsReference } = detectFactChecker(val);
|
|
223
357
|
const imageMeta = val ? extractImageMeta(val) : { names: [], titles: [], count: 0 };
|
|
224
358
|
return {
|
|
225
359
|
title: title || void 0,
|
|
@@ -231,13 +365,17 @@ function buildDocumentFields(value) {
|
|
|
231
365
|
imageCount: imageMeta.count,
|
|
232
366
|
headings: extractHeadings(body),
|
|
233
367
|
headingsDetailed: extractHeadingsDetailed(body),
|
|
368
|
+
unstyledHeadings: extractUnstyledHeadings(body),
|
|
234
369
|
bodyLinks: extractBodyLinks(body),
|
|
370
|
+
bodyLinksDetailed: extractBodyLinksDetailed(body),
|
|
235
371
|
contentCategory: typeof val?.contentCategory === "string" ? val.contentCategory : typeof val?.category === "string" ? val.category : void 0,
|
|
236
372
|
contentPlacement: Array.isArray(val?.contentPlacement) ? val.contentPlacement : void 0,
|
|
237
373
|
authorName,
|
|
238
374
|
authorCredentials,
|
|
239
375
|
authorBioUrl,
|
|
240
376
|
authorIsReference,
|
|
377
|
+
factCheckerName,
|
|
378
|
+
factCheckerIsReference,
|
|
241
379
|
// `published` is MJH's date field; `publishedAt`/`publishDate` cover other schemas
|
|
242
380
|
publishedAt: [val?.publishedAt, val?.publishDate, val?.published, val?._createdAt].find((v) => typeof v === "string" && v.trim().length > 0),
|
|
243
381
|
// `updatedOn` is MJH's "Updated On" field. `updatedAt` is the standard Sanity convention.
|
|
@@ -332,11 +470,12 @@ async function fetchChatStream(apiUrl, messages, documentContext, publication, k
|
|
|
332
470
|
return response.body;
|
|
333
471
|
}
|
|
334
472
|
async function submitFeedback(apiUrl, data) {
|
|
335
|
-
await fetch(`${apiUrl}/api/seo-copilot/feedback`, {
|
|
473
|
+
const res = await fetch(`${apiUrl}/api/seo-copilot/feedback`, {
|
|
336
474
|
method: "POST",
|
|
337
475
|
headers: { "Content-Type": "application/json" },
|
|
338
476
|
body: JSON.stringify(data)
|
|
339
477
|
});
|
|
478
|
+
if (!res.ok) throw new Error(`Feedback submit failed: HTTP ${res.status}`);
|
|
340
479
|
}
|
|
341
480
|
async function lookupKeywords(apiUrl, keywords, signal) {
|
|
342
481
|
const response = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
|
|
@@ -3153,12 +3292,219 @@ function OnboardingCard({ onDismiss, closing }) {
|
|
|
3153
3292
|
] });
|
|
3154
3293
|
}
|
|
3155
3294
|
|
|
3295
|
+
// src/components/ReportProblemButton.tsx
|
|
3296
|
+
var import_react12 = require("react");
|
|
3297
|
+
var import_sanity3 = require("sanity");
|
|
3298
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3299
|
+
function ReportProblemButton({ activeTab, publication, documentId, documentType, primaryKeyword }) {
|
|
3300
|
+
const { apiUrl } = useConfig();
|
|
3301
|
+
const sanityUser = (0, import_sanity3.useCurrentUser)();
|
|
3302
|
+
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
3303
|
+
const [text, setText] = (0, import_react12.useState)("");
|
|
3304
|
+
const [submitting, setSubmitting] = (0, import_react12.useState)(false);
|
|
3305
|
+
const [submitted, setSubmitted] = (0, import_react12.useState)(false);
|
|
3306
|
+
const [failed, setFailed] = (0, import_react12.useState)(false);
|
|
3307
|
+
const popRef = (0, import_react12.useRef)(null);
|
|
3308
|
+
const textareaRef = (0, import_react12.useRef)(null);
|
|
3309
|
+
const closeTimer = (0, import_react12.useRef)(null);
|
|
3310
|
+
const mounted = (0, import_react12.useRef)(true);
|
|
3311
|
+
(0, import_react12.useEffect)(() => () => {
|
|
3312
|
+
mounted.current = false;
|
|
3313
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
3314
|
+
}, []);
|
|
3315
|
+
(0, import_react12.useEffect)(() => {
|
|
3316
|
+
if (!open) return;
|
|
3317
|
+
const handler = (e) => {
|
|
3318
|
+
if (popRef.current && !popRef.current.contains(e.target)) setOpen(false);
|
|
3319
|
+
};
|
|
3320
|
+
document.addEventListener("mousedown", handler);
|
|
3321
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
3322
|
+
}, [open]);
|
|
3323
|
+
(0, import_react12.useEffect)(() => {
|
|
3324
|
+
if (open) setTimeout(() => textareaRef.current?.focus(), 50);
|
|
3325
|
+
}, [open]);
|
|
3326
|
+
const handleSubmit = async () => {
|
|
3327
|
+
const trimmed = text.trim();
|
|
3328
|
+
if (!trimmed || submitting) return;
|
|
3329
|
+
setFailed(false);
|
|
3330
|
+
setSubmitting(true);
|
|
3331
|
+
try {
|
|
3332
|
+
await submitFeedback(apiUrl, {
|
|
3333
|
+
suggestion_type: "bug_report",
|
|
3334
|
+
suggestion_text: trimmed.slice(0, 1e4),
|
|
3335
|
+
vote: "down",
|
|
3336
|
+
document_id: documentId,
|
|
3337
|
+
publication,
|
|
3338
|
+
user_id: sanityUser?.id,
|
|
3339
|
+
context: {
|
|
3340
|
+
surface: "sanity-plugin",
|
|
3341
|
+
activeTab,
|
|
3342
|
+
primaryKeyword: primaryKeyword || void 0,
|
|
3343
|
+
documentType,
|
|
3344
|
+
url: typeof window !== "undefined" && /^https?:\/\//i.test(window.location.href) ? window.location.href.slice(0, 500) : void 0,
|
|
3345
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent.slice(0, 500) : void 0,
|
|
3346
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3347
|
+
}
|
|
3348
|
+
});
|
|
3349
|
+
} catch (e) {
|
|
3350
|
+
console.error("[SEO Copilot] failed to send problem report:", e);
|
|
3351
|
+
if (mounted.current) {
|
|
3352
|
+
setSubmitting(false);
|
|
3353
|
+
setFailed(true);
|
|
3354
|
+
}
|
|
3355
|
+
return;
|
|
3356
|
+
}
|
|
3357
|
+
if (!mounted.current) return;
|
|
3358
|
+
setSubmitting(false);
|
|
3359
|
+
setSubmitted(true);
|
|
3360
|
+
closeTimer.current = setTimeout(() => {
|
|
3361
|
+
if (!mounted.current) return;
|
|
3362
|
+
setOpen(false);
|
|
3363
|
+
setSubmitted(false);
|
|
3364
|
+
setText("");
|
|
3365
|
+
}, 1500);
|
|
3366
|
+
};
|
|
3367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { position: "relative", display: "flex" }, children: [
|
|
3368
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3369
|
+
"button",
|
|
3370
|
+
{
|
|
3371
|
+
type: "button",
|
|
3372
|
+
onClick: (e) => {
|
|
3373
|
+
e.stopPropagation();
|
|
3374
|
+
if (closeTimer.current) {
|
|
3375
|
+
clearTimeout(closeTimer.current);
|
|
3376
|
+
closeTimer.current = null;
|
|
3377
|
+
}
|
|
3378
|
+
setOpen((o) => !o);
|
|
3379
|
+
},
|
|
3380
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
3381
|
+
"aria-label": "Report a problem",
|
|
3382
|
+
title: "Report a problem",
|
|
3383
|
+
style: {
|
|
3384
|
+
display: "inline-flex",
|
|
3385
|
+
alignItems: "center",
|
|
3386
|
+
gap: 4,
|
|
3387
|
+
padding: "3px 8px",
|
|
3388
|
+
borderRadius: 99,
|
|
3389
|
+
border: `1px solid ${open ? MJH_BLUE : "#d1d5db"}`,
|
|
3390
|
+
background: open ? "rgba(0,93,172,0.08)" : "rgba(255,255,255,0.6)",
|
|
3391
|
+
cursor: "pointer",
|
|
3392
|
+
fontSize: 10,
|
|
3393
|
+
fontWeight: 600,
|
|
3394
|
+
color: open ? MJH_BLUE : "#6b7280",
|
|
3395
|
+
whiteSpace: "nowrap",
|
|
3396
|
+
transition: "all 150ms"
|
|
3397
|
+
},
|
|
3398
|
+
children: [
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 2.75a.75.75 0 00-1.5 0v14.5a.75.75 0 001.5 0v-4.392l1.657-.348a6.449 6.449 0 014.271.572 7.948 7.948 0 005.965.524l2.078-.64A.75.75 0 0017.5 12.25v-8.5a.75.75 0 00-.904-.734l-1.74.348a7.948 7.948 0 01-5.965-.524 6.449 6.449 0 00-4.271-.572L3 2.842V2.75z" }) }),
|
|
3400
|
+
"Report a problem"
|
|
3401
|
+
]
|
|
3402
|
+
}
|
|
3403
|
+
),
|
|
3404
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3405
|
+
"div",
|
|
3406
|
+
{
|
|
3407
|
+
ref: popRef,
|
|
3408
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
3409
|
+
style: {
|
|
3410
|
+
position: "absolute",
|
|
3411
|
+
top: "100%",
|
|
3412
|
+
right: 0,
|
|
3413
|
+
marginTop: 6,
|
|
3414
|
+
width: 260,
|
|
3415
|
+
padding: 12,
|
|
3416
|
+
borderRadius: 10,
|
|
3417
|
+
background: "#ffffff",
|
|
3418
|
+
boxShadow: "0 6px 22px rgba(0,0,0,0.16), 0 1px 4px rgba(0,0,0,0.1)",
|
|
3419
|
+
border: "1px solid #e5e7eb",
|
|
3420
|
+
zIndex: 100
|
|
3421
|
+
},
|
|
3422
|
+
children: submitted ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, color: "#16a34a", textAlign: "center", padding: "6px 0", fontWeight: 600 }, children: "Thanks - we got it." }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
3423
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 3 }, children: "Report a problem" }),
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 10.5, color: "#6b7280", marginBottom: 8, lineHeight: 1.45 }, children: "Beta - tell us what went wrong. We also note which tab you're on to help us track it down." }),
|
|
3425
|
+
failed && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 10.5, color: "#dc2626", marginBottom: 8, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - please try again." }),
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3427
|
+
"textarea",
|
|
3428
|
+
{
|
|
3429
|
+
ref: textareaRef,
|
|
3430
|
+
value: text,
|
|
3431
|
+
onChange: (e) => setText(e.target.value),
|
|
3432
|
+
onKeyDown: (e) => {
|
|
3433
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
3434
|
+
e.preventDefault();
|
|
3435
|
+
handleSubmit();
|
|
3436
|
+
}
|
|
3437
|
+
},
|
|
3438
|
+
placeholder: "What happened? The more detail, the better.",
|
|
3439
|
+
rows: 4,
|
|
3440
|
+
maxLength: 4e3,
|
|
3441
|
+
style: {
|
|
3442
|
+
width: "100%",
|
|
3443
|
+
padding: "6px 8px",
|
|
3444
|
+
fontSize: 11,
|
|
3445
|
+
borderRadius: 6,
|
|
3446
|
+
border: "1px solid #e5e7eb",
|
|
3447
|
+
outline: "none",
|
|
3448
|
+
fontFamily: "inherit",
|
|
3449
|
+
resize: "vertical",
|
|
3450
|
+
boxSizing: "border-box",
|
|
3451
|
+
lineHeight: 1.5
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
),
|
|
3455
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 8, gap: 6 }, children: [
|
|
3456
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3457
|
+
"button",
|
|
3458
|
+
{
|
|
3459
|
+
type: "button",
|
|
3460
|
+
onClick: () => {
|
|
3461
|
+
setOpen(false);
|
|
3462
|
+
setText("");
|
|
3463
|
+
},
|
|
3464
|
+
style: {
|
|
3465
|
+
padding: "4px 10px",
|
|
3466
|
+
fontSize: 10.5,
|
|
3467
|
+
borderRadius: 5,
|
|
3468
|
+
border: "1px solid #e5e7eb",
|
|
3469
|
+
background: "#ffffff",
|
|
3470
|
+
color: "#4b5563",
|
|
3471
|
+
cursor: "pointer"
|
|
3472
|
+
},
|
|
3473
|
+
children: "Cancel"
|
|
3474
|
+
}
|
|
3475
|
+
),
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3477
|
+
"button",
|
|
3478
|
+
{
|
|
3479
|
+
type: "button",
|
|
3480
|
+
onClick: handleSubmit,
|
|
3481
|
+
disabled: !text.trim() || submitting,
|
|
3482
|
+
style: {
|
|
3483
|
+
padding: "4px 12px",
|
|
3484
|
+
fontSize: 10.5,
|
|
3485
|
+
borderRadius: 5,
|
|
3486
|
+
border: "none",
|
|
3487
|
+
background: !text.trim() || submitting ? "#cbd5e1" : MJH_BLUE,
|
|
3488
|
+
color: "#ffffff",
|
|
3489
|
+
cursor: !text.trim() || submitting ? "default" : "pointer",
|
|
3490
|
+
fontWeight: 700
|
|
3491
|
+
},
|
|
3492
|
+
children: submitting ? "Sending..." : "Send"
|
|
3493
|
+
}
|
|
3494
|
+
)
|
|
3495
|
+
] })
|
|
3496
|
+
] })
|
|
3497
|
+
}
|
|
3498
|
+
)
|
|
3499
|
+
] });
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3156
3502
|
// src/components/tabs/SummaryTab.tsx
|
|
3157
|
-
var
|
|
3503
|
+
var import_react14 = require("react");
|
|
3158
3504
|
|
|
3159
3505
|
// src/components/ShimmerLoader.tsx
|
|
3160
|
-
var
|
|
3161
|
-
var
|
|
3506
|
+
var import_react13 = require("react");
|
|
3507
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3162
3508
|
var keyframesInjected = false;
|
|
3163
3509
|
var KEYFRAMES = `
|
|
3164
3510
|
@keyframes seo-copilot-text-shimmer {
|
|
@@ -3167,13 +3513,13 @@ var KEYFRAMES = `
|
|
|
3167
3513
|
}
|
|
3168
3514
|
`;
|
|
3169
3515
|
function LoaderBars({ color = MJH_GOLD }) {
|
|
3170
|
-
return /* @__PURE__ */ (0,
|
|
3516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3171
3517
|
"div",
|
|
3172
3518
|
{
|
|
3173
3519
|
role: "status",
|
|
3174
3520
|
"aria-label": "Loading",
|
|
3175
3521
|
style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: 14, flexShrink: 0 },
|
|
3176
|
-
children: [1, 2, 3].map((i) => /* @__PURE__ */ (0,
|
|
3522
|
+
children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3177
3523
|
"div",
|
|
3178
3524
|
{
|
|
3179
3525
|
style: {
|
|
@@ -3195,8 +3541,8 @@ function ShimmerLoader({
|
|
|
3195
3541
|
textSize = 14,
|
|
3196
3542
|
iconColor = MJH_GOLD
|
|
3197
3543
|
}) {
|
|
3198
|
-
const [idx, setIdx] = (0,
|
|
3199
|
-
(0,
|
|
3544
|
+
const [idx, setIdx] = (0, import_react13.useState)(0);
|
|
3545
|
+
(0, import_react13.useEffect)(() => {
|
|
3200
3546
|
if (typeof window !== "undefined" && !keyframesInjected) {
|
|
3201
3547
|
keyframesInjected = true;
|
|
3202
3548
|
const style = document.createElement("style");
|
|
@@ -3205,7 +3551,7 @@ function ShimmerLoader({
|
|
|
3205
3551
|
document.head.appendChild(style);
|
|
3206
3552
|
}
|
|
3207
3553
|
}, []);
|
|
3208
|
-
(0,
|
|
3554
|
+
(0, import_react13.useEffect)(() => {
|
|
3209
3555
|
if (messages.length <= 1) return;
|
|
3210
3556
|
const id = setInterval(() => {
|
|
3211
3557
|
setIdx((i) => (i + 1) % messages.length);
|
|
@@ -3213,7 +3559,7 @@ function ShimmerLoader({
|
|
|
3213
3559
|
return () => clearInterval(id);
|
|
3214
3560
|
}, [messages.length, intervalMs]);
|
|
3215
3561
|
const text = messages[idx] || messages[0] || "";
|
|
3216
|
-
return /* @__PURE__ */ (0,
|
|
3562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3217
3563
|
"div",
|
|
3218
3564
|
{
|
|
3219
3565
|
style: {
|
|
@@ -3225,8 +3571,8 @@ function ShimmerLoader({
|
|
|
3225
3571
|
letterSpacing: "0.01em"
|
|
3226
3572
|
},
|
|
3227
3573
|
children: [
|
|
3228
|
-
/* @__PURE__ */ (0,
|
|
3229
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoaderBars, { color: iconColor }),
|
|
3575
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3230
3576
|
"span",
|
|
3231
3577
|
{
|
|
3232
3578
|
style: {
|
|
@@ -3304,9 +3650,9 @@ function calculateContentScoreDetailed(content, analysis, documentFields) {
|
|
|
3304
3650
|
detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
|
|
3305
3651
|
}
|
|
3306
3652
|
}
|
|
3307
|
-
components.push({ label: "Primary keyword", points: pts, max: 25, detail });
|
|
3653
|
+
components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
|
|
3308
3654
|
} else {
|
|
3309
|
-
components.push({ label: "Primary keyword", points: 0, max: 25, detail: "No primary keyword identified yet" });
|
|
3655
|
+
components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
|
|
3310
3656
|
}
|
|
3311
3657
|
const supportingKws = analysis.supportingKeywords || [];
|
|
3312
3658
|
if (supportingKws.length > 0) {
|
|
@@ -3314,13 +3660,13 @@ function calculateContentScoreDetailed(content, analysis, documentFields) {
|
|
|
3314
3660
|
const coverageRatio = inContentCount / supportingKws.length;
|
|
3315
3661
|
const pts = Math.round(coverageRatio * 25);
|
|
3316
3662
|
components.push({
|
|
3317
|
-
label: "Supporting
|
|
3663
|
+
label: "Supporting keyword coverage",
|
|
3318
3664
|
points: pts,
|
|
3319
3665
|
max: 25,
|
|
3320
3666
|
detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
|
|
3321
3667
|
});
|
|
3322
3668
|
} else {
|
|
3323
|
-
components.push({ label: "Supporting
|
|
3669
|
+
components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
|
|
3324
3670
|
}
|
|
3325
3671
|
let wcPts = 0;
|
|
3326
3672
|
let wcDetail;
|
|
@@ -3630,18 +3976,6 @@ function buildSummaryItems(input) {
|
|
|
3630
3976
|
});
|
|
3631
3977
|
}
|
|
3632
3978
|
if (headingsDetailed) {
|
|
3633
|
-
const bodyH1 = headingsDetailed.filter((h) => h.level === 1).length;
|
|
3634
|
-
if (bodyH1 > 0) {
|
|
3635
|
-
items.push({
|
|
3636
|
-
id: "headings-h1-in-body",
|
|
3637
|
-
category: "headings",
|
|
3638
|
-
severity: "warning",
|
|
3639
|
-
label: "H1 inside the body",
|
|
3640
|
-
description: `${bodyH1} H1 heading${bodyH1 === 1 ? "" : "s"} in the body of the article.`,
|
|
3641
|
-
howToFix: "The article title is your H1. Body headings should start at H2 so the outline isn't ambiguous.",
|
|
3642
|
-
jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
|
|
3643
|
-
});
|
|
3644
|
-
}
|
|
3645
3979
|
let prevLevel = 0;
|
|
3646
3980
|
let skips = 0;
|
|
3647
3981
|
for (const h of headingsDetailed) {
|
|
@@ -3671,6 +4005,23 @@ function buildSummaryItems(input) {
|
|
|
3671
4005
|
jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
|
|
3672
4006
|
});
|
|
3673
4007
|
}
|
|
4008
|
+
const subheads = headingsDetailed.filter((h) => h.level >= 2);
|
|
4009
|
+
if (subheads.length > 0 && (primaryKeyword || secondaryKeyword)) {
|
|
4010
|
+
const subText = subheads.map((h) => h.text).join(" ");
|
|
4011
|
+
const hasP = primaryKeyword ? containsKeywordTokens(subText, primaryKeyword) : false;
|
|
4012
|
+
const hasS = secondaryKeyword ? containsKeywordTokens(subText, secondaryKeyword) : false;
|
|
4013
|
+
if (!hasP && !hasS) {
|
|
4014
|
+
items.push({
|
|
4015
|
+
id: "headings-keyword-missing",
|
|
4016
|
+
category: "headings",
|
|
4017
|
+
severity: "opportunity",
|
|
4018
|
+
label: "Keyword missing from subheadings",
|
|
4019
|
+
description: "No H2/H3 subheading uses your primary or secondary keyword.",
|
|
4020
|
+
howToFix: "Work your primary or secondary keyword into at least one subheading - keywords in headers reinforce relevance for readers and search.",
|
|
4021
|
+
jumpTo: { tab: "technical", anchorId: "anchor-headings-keyword" }
|
|
4022
|
+
});
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
3674
4025
|
}
|
|
3675
4026
|
const images = documentFields?.imageNames || [];
|
|
3676
4027
|
if (images.length === 0 && wordCount2 > 300) {
|
|
@@ -3923,7 +4274,7 @@ function buildSummaryItems(input) {
|
|
|
3923
4274
|
}
|
|
3924
4275
|
|
|
3925
4276
|
// src/components/tabs/SummaryTab.tsx
|
|
3926
|
-
var
|
|
4277
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3927
4278
|
var cardStyle2 = {
|
|
3928
4279
|
borderRadius: 14,
|
|
3929
4280
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -3945,11 +4296,16 @@ function scoreColors(score) {
|
|
|
3945
4296
|
if (score >= 40) return { bg: "rgba(230,192,27,0.15)", text: "#8B7310", label: "Decent" };
|
|
3946
4297
|
return { bg: "rgba(220,38,38,0.08)", text: "#dc2626", label: "Needs work" };
|
|
3947
4298
|
}
|
|
4299
|
+
function componentTier(pct) {
|
|
4300
|
+
if (pct >= 75) return { label: "Strong", color: "#16a34a", bar: "#16a34a" };
|
|
4301
|
+
if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
|
|
4302
|
+
return { label: "Low", color: "#dc2626", bar: "#dc2626" };
|
|
4303
|
+
}
|
|
3948
4304
|
function ScoreBadge({ score, breakdown }) {
|
|
3949
4305
|
const c = scoreColors(score);
|
|
3950
|
-
return /* @__PURE__ */ (0,
|
|
3951
|
-
/* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle2, children: [
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3953
4309
|
"div",
|
|
3954
4310
|
{
|
|
3955
4311
|
style: {
|
|
@@ -3958,37 +4314,28 @@ function ScoreBadge({ score, breakdown }) {
|
|
|
3958
4314
|
borderRadius: "50%",
|
|
3959
4315
|
background: c.bg,
|
|
3960
4316
|
display: "flex",
|
|
3961
|
-
flexDirection: "column",
|
|
3962
4317
|
alignItems: "center",
|
|
3963
4318
|
justifyContent: "center",
|
|
3964
|
-
flexShrink: 0
|
|
3965
|
-
lineHeight: 1
|
|
4319
|
+
flexShrink: 0
|
|
3966
4320
|
},
|
|
3967
|
-
children:
|
|
3968
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 20, fontWeight: 700, color: c.text }, children: score }),
|
|
3969
|
-
/* @__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" })
|
|
3970
|
-
]
|
|
4321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
|
|
3971
4322
|
}
|
|
3972
4323
|
),
|
|
3973
|
-
/* @__PURE__ */ (0,
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
|
|
3976
4327
|
] })
|
|
3977
4328
|
] }),
|
|
3978
|
-
breakdown.length > 0 && /* @__PURE__ */ (0,
|
|
4329
|
+
breakdown.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
|
|
3979
4330
|
const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
|
|
3980
|
-
const
|
|
3981
|
-
return /* @__PURE__ */ (0,
|
|
3982
|
-
/* @__PURE__ */ (0,
|
|
3983
|
-
/* @__PURE__ */ (0,
|
|
3984
|
-
/* @__PURE__ */ (0,
|
|
3985
|
-
comp.points,
|
|
3986
|
-
" / ",
|
|
3987
|
-
comp.max
|
|
3988
|
-
] })
|
|
4331
|
+
const tier = componentTier(pct);
|
|
4332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
|
|
3989
4336
|
] }),
|
|
3990
|
-
/* @__PURE__ */ (0,
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
4337
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
|
|
4338
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
|
|
3992
4339
|
] }, i);
|
|
3993
4340
|
}) })
|
|
3994
4341
|
] });
|
|
@@ -4002,7 +4349,7 @@ function ItemCard({ item, onClick }) {
|
|
|
4002
4349
|
const v = severityVisual(item.severity);
|
|
4003
4350
|
const tab = item.jumpTo.tab;
|
|
4004
4351
|
const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
|
|
4005
|
-
return /* @__PURE__ */ (0,
|
|
4352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4006
4353
|
"div",
|
|
4007
4354
|
{
|
|
4008
4355
|
onClick,
|
|
@@ -4019,8 +4366,8 @@ function ItemCard({ item, onClick }) {
|
|
|
4019
4366
|
cursor: "pointer"
|
|
4020
4367
|
},
|
|
4021
4368
|
children: [
|
|
4022
|
-
/* @__PURE__ */ (0,
|
|
4023
|
-
/* @__PURE__ */ (0,
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4024
4371
|
"div",
|
|
4025
4372
|
{
|
|
4026
4373
|
style: {
|
|
@@ -4033,12 +4380,12 @@ function ItemCard({ item, onClick }) {
|
|
|
4033
4380
|
}
|
|
4034
4381
|
}
|
|
4035
4382
|
),
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
4038
|
-
/* @__PURE__ */ (0,
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4384
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
|
|
4039
4386
|
] })
|
|
4040
4387
|
] }),
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4388
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4042
4389
|
"div",
|
|
4043
4390
|
{
|
|
4044
4391
|
style: {
|
|
@@ -4050,12 +4397,12 @@ function ItemCard({ item, onClick }) {
|
|
|
4050
4397
|
lineHeight: 1.55
|
|
4051
4398
|
},
|
|
4052
4399
|
children: [
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4400
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
|
|
4054
4401
|
item.howToFix
|
|
4055
4402
|
]
|
|
4056
4403
|
}
|
|
4057
4404
|
),
|
|
4058
|
-
item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0,
|
|
4405
|
+
item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
|
|
4059
4406
|
"Go to ",
|
|
4060
4407
|
tabLabel,
|
|
4061
4408
|
" \u203A"
|
|
@@ -4071,7 +4418,7 @@ function FilterChip({
|
|
|
4071
4418
|
count,
|
|
4072
4419
|
dotColor
|
|
4073
4420
|
}) {
|
|
4074
|
-
return /* @__PURE__ */ (0,
|
|
4421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4075
4422
|
"button",
|
|
4076
4423
|
{
|
|
4077
4424
|
onClick,
|
|
@@ -4090,9 +4437,9 @@ function FilterChip({
|
|
|
4090
4437
|
transition: "all 150ms"
|
|
4091
4438
|
},
|
|
4092
4439
|
children: [
|
|
4093
|
-
dotColor && /* @__PURE__ */ (0,
|
|
4094
|
-
/* @__PURE__ */ (0,
|
|
4095
|
-
/* @__PURE__ */ (0,
|
|
4440
|
+
dotColor && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: label }),
|
|
4442
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
|
|
4096
4443
|
]
|
|
4097
4444
|
}
|
|
4098
4445
|
);
|
|
@@ -4110,13 +4457,13 @@ function SummaryTab({
|
|
|
4110
4457
|
onGenerateAll,
|
|
4111
4458
|
onItemClick
|
|
4112
4459
|
}) {
|
|
4113
|
-
const scoreDetail = (0,
|
|
4460
|
+
const scoreDetail = (0, import_react14.useMemo)(() => {
|
|
4114
4461
|
if (!analysis) return null;
|
|
4115
4462
|
const scored = primaryKeyword && analysis.primaryKeyword && primaryKeyword !== analysis.primaryKeyword.term ? { ...analysis, primaryKeyword: { ...analysis.primaryKeyword, term: primaryKeyword } } : analysis;
|
|
4116
4463
|
return calculateContentScoreDetailed(text, scored, documentFields);
|
|
4117
4464
|
}, [text, analysis, documentFields, primaryKeyword]);
|
|
4118
4465
|
const score = scoreDetail?.total ?? null;
|
|
4119
|
-
const items = (0,
|
|
4466
|
+
const items = (0, import_react14.useMemo)(
|
|
4120
4467
|
() => buildSummaryItems({
|
|
4121
4468
|
analysis,
|
|
4122
4469
|
deepAnalysis,
|
|
@@ -4130,8 +4477,8 @@ function SummaryTab({
|
|
|
4130
4477
|
}),
|
|
4131
4478
|
[analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
|
|
4132
4479
|
);
|
|
4133
|
-
const [filter, setFilter] = (0,
|
|
4134
|
-
const counts = (0,
|
|
4480
|
+
const [filter, setFilter] = (0, import_react14.useState)("all");
|
|
4481
|
+
const counts = (0, import_react14.useMemo)(
|
|
4135
4482
|
() => ({
|
|
4136
4483
|
all: items.length,
|
|
4137
4484
|
error: items.filter((i) => i.severity === "error").length,
|
|
@@ -4142,15 +4489,15 @@ function SummaryTab({
|
|
|
4142
4489
|
);
|
|
4143
4490
|
const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
|
|
4144
4491
|
if (!analysis) {
|
|
4145
|
-
return /* @__PURE__ */ (0,
|
|
4146
|
-
/* @__PURE__ */ (0,
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
4493
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
|
|
4148
4495
|
] });
|
|
4149
4496
|
}
|
|
4150
|
-
return /* @__PURE__ */ (0,
|
|
4151
|
-
score != null && scoreDetail && /* @__PURE__ */ (0,
|
|
4152
|
-
/* @__PURE__ */ (0,
|
|
4153
|
-
isAnyLoading ? /* @__PURE__ */ (0,
|
|
4497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
4498
|
+
score != null && scoreDetail && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScoreBadge, { score, breakdown: scoreDetail.components }),
|
|
4499
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle2, children: [
|
|
4500
|
+
isAnyLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4154
4501
|
"button",
|
|
4155
4502
|
{
|
|
4156
4503
|
onClick: onGenerateAll,
|
|
@@ -4178,24 +4525,24 @@ function SummaryTab({
|
|
|
4178
4525
|
children: "Run all analyses"
|
|
4179
4526
|
}
|
|
4180
4527
|
),
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4528
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
|
|
4182
4529
|
"Runs the analyses that fill the ",
|
|
4183
|
-
/* @__PURE__ */ (0,
|
|
4530
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "AEO/GEO" }),
|
|
4184
4531
|
", ",
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4532
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "Linking" }),
|
|
4186
4533
|
", and ",
|
|
4187
|
-
/* @__PURE__ */ (0,
|
|
4534
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "Other Recs" }),
|
|
4188
4535
|
" tabs. New issues they find appear in this Summary as each one finishes."
|
|
4189
4536
|
] })
|
|
4190
4537
|
] }),
|
|
4191
|
-
/* @__PURE__ */ (0,
|
|
4192
|
-
/* @__PURE__ */ (0,
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4195
|
-
/* @__PURE__ */ (0,
|
|
4538
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
|
|
4539
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
|
|
4540
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
|
|
4541
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
|
|
4542
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
|
|
4196
4543
|
] }),
|
|
4197
|
-
/* @__PURE__ */ (0,
|
|
4198
|
-
/* @__PURE__ */ (0,
|
|
4544
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4199
4546
|
"div",
|
|
4200
4547
|
{
|
|
4201
4548
|
style: {
|
|
@@ -4208,21 +4555,21 @@ function SummaryTab({
|
|
|
4208
4555
|
justifyContent: "center",
|
|
4209
4556
|
margin: "0 auto 8px"
|
|
4210
4557
|
},
|
|
4211
|
-
children: /* @__PURE__ */ (0,
|
|
4558
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", 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" }) })
|
|
4212
4559
|
}
|
|
4213
4560
|
),
|
|
4214
|
-
/* @__PURE__ */ (0,
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
] }) : /* @__PURE__ */ (0,
|
|
4217
|
-
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0,
|
|
4218
|
-
/* @__PURE__ */ (0,
|
|
4219
|
-
/* @__PURE__ */ (0,
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
|
|
4563
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
|
|
4564
|
+
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
4566
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
|
|
4220
4567
|
] })
|
|
4221
4568
|
] });
|
|
4222
4569
|
}
|
|
4223
4570
|
|
|
4224
4571
|
// src/components/tabs/AEOTab.tsx
|
|
4225
|
-
var
|
|
4572
|
+
var import_react15 = require("react");
|
|
4226
4573
|
|
|
4227
4574
|
// src/lib/geoAnalysis.ts
|
|
4228
4575
|
var FACT_PATTERN = /\d+(?:\.\d+)?\s*%|\b\d{1,3}(?:,\d{3})+\b|\bn\s*=\s*\d+\b|\bp\s*[<=]\s*0?\.\d+\b|\b\d+(?:\.\d+)?\s*(?:patients|participants|subjects|cases|deaths|adverse events|mg|mcg|hours|days|weeks|months|years|fold|x)\b|\b(?:NEJM|JAMA|FDA|EMA|CDC|WHO|NIH|ACC|ASCO|ASH|ESMO|AHA|ACS)\b|\bet al\.?\b|\b(?:phase|stage)\s+(?:I{1,3}V?|1|2|3|4)\b/i;
|
|
@@ -4296,7 +4643,7 @@ function analyzeGEO(text, headings) {
|
|
|
4296
4643
|
}
|
|
4297
4644
|
|
|
4298
4645
|
// src/components/tabs/AEOTab.tsx
|
|
4299
|
-
var
|
|
4646
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4300
4647
|
var AEO_PURPLE = "#005DAC";
|
|
4301
4648
|
var GEO_TEAL = "#C9A716";
|
|
4302
4649
|
var cardStyle3 = {
|
|
@@ -4308,7 +4655,7 @@ var cardStyle3 = {
|
|
|
4308
4655
|
padding: "14px"
|
|
4309
4656
|
};
|
|
4310
4657
|
function AiPill() {
|
|
4311
|
-
return /* @__PURE__ */ (0,
|
|
4658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4312
4659
|
"span",
|
|
4313
4660
|
{
|
|
4314
4661
|
style: {
|
|
@@ -4327,16 +4674,16 @@ function AiPill() {
|
|
|
4327
4674
|
);
|
|
4328
4675
|
}
|
|
4329
4676
|
function SectionHeader2({ label, iconColor, ai }) {
|
|
4330
|
-
return /* @__PURE__ */ (0,
|
|
4331
|
-
/* @__PURE__ */ (0,
|
|
4332
|
-
/* @__PURE__ */ (0,
|
|
4333
|
-
ai && /* @__PURE__ */ (0,
|
|
4677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
|
|
4679
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
|
|
4680
|
+
ai && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AiPill, {})
|
|
4334
4681
|
] });
|
|
4335
4682
|
}
|
|
4336
4683
|
function CopyButton({ text }) {
|
|
4337
|
-
const [copied, setCopied] = (0,
|
|
4338
|
-
const copyTimerRef = (0,
|
|
4339
|
-
(0,
|
|
4684
|
+
const [copied, setCopied] = (0, import_react15.useState)(false);
|
|
4685
|
+
const copyTimerRef = (0, import_react15.useRef)(null);
|
|
4686
|
+
(0, import_react15.useEffect)(() => {
|
|
4340
4687
|
return () => {
|
|
4341
4688
|
if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
|
|
4342
4689
|
};
|
|
@@ -4349,7 +4696,7 @@ function CopyButton({ text }) {
|
|
|
4349
4696
|
} catch {
|
|
4350
4697
|
}
|
|
4351
4698
|
};
|
|
4352
|
-
return /* @__PURE__ */ (0,
|
|
4699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4353
4700
|
"button",
|
|
4354
4701
|
{
|
|
4355
4702
|
onClick: handleCopy,
|
|
@@ -4368,9 +4715,9 @@ function CopyButton({ text }) {
|
|
|
4368
4715
|
transition: "color 150ms"
|
|
4369
4716
|
},
|
|
4370
4717
|
title: copied ? "Copied!" : "Copy to clipboard",
|
|
4371
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
4372
|
-
/* @__PURE__ */ (0,
|
|
4373
|
-
/* @__PURE__ */ (0,
|
|
4718
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.jsxs)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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" }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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" })
|
|
4374
4721
|
] })
|
|
4375
4722
|
}
|
|
4376
4723
|
);
|
|
@@ -4385,13 +4732,13 @@ function GEOCard({ geo, publication }) {
|
|
|
4385
4732
|
const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
|
|
4386
4733
|
const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
|
|
4387
4734
|
const totalHeadings = geo.headingAudit.length;
|
|
4388
|
-
return /* @__PURE__ */ (0,
|
|
4389
|
-
/* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4391
|
-
/* @__PURE__ */ (0,
|
|
4735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle3, children: [
|
|
4736
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
|
|
4738
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
|
|
4392
4739
|
] }),
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
4394
|
-
/* @__PURE__ */ (0,
|
|
4740
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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." }),
|
|
4741
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4395
4742
|
"div",
|
|
4396
4743
|
{
|
|
4397
4744
|
style: {
|
|
@@ -4404,7 +4751,7 @@ function GEOCard({ geo, publication }) {
|
|
|
4404
4751
|
marginBottom: 8
|
|
4405
4752
|
},
|
|
4406
4753
|
children: [
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4754
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4408
4755
|
"div",
|
|
4409
4756
|
{
|
|
4410
4757
|
style: {
|
|
@@ -4420,17 +4767,17 @@ function GEOCard({ geo, publication }) {
|
|
|
4420
4767
|
boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
|
|
4421
4768
|
},
|
|
4422
4769
|
children: [
|
|
4423
|
-
/* @__PURE__ */ (0,
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
|
|
4425
4772
|
]
|
|
4426
4773
|
}
|
|
4427
4774
|
),
|
|
4428
|
-
/* @__PURE__ */ (0,
|
|
4429
|
-
/* @__PURE__ */ (0,
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4776
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
|
|
4430
4777
|
"Fact density: ",
|
|
4431
4778
|
fdLabel
|
|
4432
4779
|
] }),
|
|
4433
|
-
/* @__PURE__ */ (0,
|
|
4780
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
|
|
4434
4781
|
fd.factCount,
|
|
4435
4782
|
" specific stat",
|
|
4436
4783
|
fd.factCount === 1 ? "" : "s",
|
|
@@ -4446,7 +4793,7 @@ function GEOCard({ geo, publication }) {
|
|
|
4446
4793
|
]
|
|
4447
4794
|
}
|
|
4448
4795
|
),
|
|
4449
|
-
fd.driftPassages > 0 && /* @__PURE__ */ (0,
|
|
4796
|
+
fd.driftPassages > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4450
4797
|
"div",
|
|
4451
4798
|
{
|
|
4452
4799
|
style: {
|
|
@@ -4460,15 +4807,15 @@ function GEOCard({ geo, publication }) {
|
|
|
4460
4807
|
lineHeight: 1.45
|
|
4461
4808
|
},
|
|
4462
4809
|
children: [
|
|
4463
|
-
/* @__PURE__ */ (0,
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: fd.driftPassages }),
|
|
4464
4811
|
" passage",
|
|
4465
4812
|
fd.driftPassages === 1 ? "" : "s",
|
|
4466
4813
|
" over 200 words with no specific stats or citations. AI engines tend to skip these."
|
|
4467
4814
|
]
|
|
4468
4815
|
}
|
|
4469
4816
|
),
|
|
4470
|
-
totalHeadings > 0 && /* @__PURE__ */ (0,
|
|
4471
|
-
/* @__PURE__ */ (0,
|
|
4817
|
+
totalHeadings > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { marginTop: 4 }, children: [
|
|
4818
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4472
4819
|
"button",
|
|
4473
4820
|
{
|
|
4474
4821
|
onClick: () => setShowDetails((v) => !v),
|
|
@@ -4487,22 +4834,22 @@ function GEOCard({ geo, publication }) {
|
|
|
4487
4834
|
color: GEO_TEAL
|
|
4488
4835
|
},
|
|
4489
4836
|
children: [
|
|
4490
|
-
/* @__PURE__ */ (0,
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
|
|
4491
4838
|
"Short-answer paragraphs: ",
|
|
4492
4839
|
goodCount,
|
|
4493
4840
|
"/",
|
|
4494
4841
|
totalHeadings,
|
|
4495
4842
|
" headings have one"
|
|
4496
4843
|
] }),
|
|
4497
|
-
/* @__PURE__ */ (0,
|
|
4844
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.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" }) })
|
|
4498
4845
|
]
|
|
4499
4846
|
}
|
|
4500
4847
|
),
|
|
4501
|
-
showDetails && /* @__PURE__ */ (0,
|
|
4502
|
-
/* @__PURE__ */ (0,
|
|
4848
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4849
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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." }),
|
|
4503
4850
|
geo.headingAudit.map((h, i) => {
|
|
4504
4851
|
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" };
|
|
4505
|
-
return /* @__PURE__ */ (0,
|
|
4852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4506
4853
|
"div",
|
|
4507
4854
|
{
|
|
4508
4855
|
style: {
|
|
@@ -4516,8 +4863,8 @@ function GEOCard({ geo, publication }) {
|
|
|
4516
4863
|
gap: 8
|
|
4517
4864
|
},
|
|
4518
4865
|
children: [
|
|
4519
|
-
/* @__PURE__ */ (0,
|
|
4520
|
-
/* @__PURE__ */ (0,
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
|
|
4521
4868
|
]
|
|
4522
4869
|
},
|
|
4523
4870
|
i
|
|
@@ -4540,7 +4887,7 @@ function AEOTab({
|
|
|
4540
4887
|
csError,
|
|
4541
4888
|
loadContentSuggestions
|
|
4542
4889
|
}) {
|
|
4543
|
-
const geo = (0,
|
|
4890
|
+
const geo = (0, import_react15.useMemo)(() => analyzeGEO(text, headings), [text, headings]);
|
|
4544
4891
|
const geoWordCount = text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
|
|
4545
4892
|
const hasEnoughTextForGEO = geoWordCount >= 150;
|
|
4546
4893
|
const hasEnoughText = text && text.trim().length >= 50;
|
|
@@ -4554,8 +4901,8 @@ function AEOTab({
|
|
|
4554
4901
|
originalHeading: void 0,
|
|
4555
4902
|
rationale: h.rationale
|
|
4556
4903
|
})) ?? [];
|
|
4557
|
-
return /* @__PURE__ */ (0,
|
|
4558
|
-
aeoContentChanged && /* @__PURE__ */ (0,
|
|
4904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
4905
|
+
aeoContentChanged && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4559
4906
|
"div",
|
|
4560
4907
|
{
|
|
4561
4908
|
onClick: runDeepAnalysis,
|
|
@@ -4578,30 +4925,30 @@ function AEOTab({
|
|
|
4578
4925
|
cursor: "pointer"
|
|
4579
4926
|
},
|
|
4580
4927
|
children: [
|
|
4581
|
-
/* @__PURE__ */ (0,
|
|
4582
|
-
/* @__PURE__ */ (0,
|
|
4928
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
|
|
4929
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
|
|
4583
4930
|
]
|
|
4584
4931
|
}
|
|
4585
4932
|
),
|
|
4586
|
-
hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
4587
|
-
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
4588
|
-
/* @__PURE__ */ (0,
|
|
4933
|
+
hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GEOCard, { geo, publication }),
|
|
4934
|
+
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
|
|
4935
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
|
|
4589
4936
|
" needs at least 150 words to read fact density.",
|
|
4590
|
-
/* @__PURE__ */ (0,
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
4937
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("br", {}),
|
|
4938
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { color: "#4b5563" }, children: [
|
|
4592
4939
|
"Current: ",
|
|
4593
4940
|
geoWordCount,
|
|
4594
4941
|
" word",
|
|
4595
4942
|
geoWordCount === 1 ? "" : "s"
|
|
4596
4943
|
] })
|
|
4597
4944
|
] }) }),
|
|
4598
|
-
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0,
|
|
4599
|
-
/* @__PURE__ */ (0,
|
|
4600
|
-
/* @__PURE__ */ (0,
|
|
4945
|
+
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
|
|
4946
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
|
|
4947
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
|
|
4601
4948
|
] }),
|
|
4602
|
-
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0,
|
|
4603
|
-
/* @__PURE__ */ (0,
|
|
4604
|
-
/* @__PURE__ */ (0,
|
|
4949
|
+
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
|
|
4950
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
|
|
4951
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4605
4952
|
"button",
|
|
4606
4953
|
{
|
|
4607
4954
|
onClick: runDeepAnalysis,
|
|
@@ -4621,11 +4968,11 @@ function AEOTab({
|
|
|
4621
4968
|
}
|
|
4622
4969
|
)
|
|
4623
4970
|
] }),
|
|
4624
|
-
deepAnalysis && !aeo && /* @__PURE__ */ (0,
|
|
4625
|
-
questionHeadings.length > 0 && /* @__PURE__ */ (0,
|
|
4626
|
-
/* @__PURE__ */ (0,
|
|
4627
|
-
/* @__PURE__ */ (0,
|
|
4628
|
-
/* @__PURE__ */ (0,
|
|
4971
|
+
deepAnalysis && !aeo && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
|
|
4972
|
+
questionHeadings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle3, children: [
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
|
|
4974
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
|
|
4975
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4629
4976
|
"div",
|
|
4630
4977
|
{
|
|
4631
4978
|
style: {
|
|
@@ -4635,26 +4982,26 @@ function AEOTab({
|
|
|
4635
4982
|
borderLeft: `3px solid ${AEO_PURPLE}`
|
|
4636
4983
|
},
|
|
4637
4984
|
children: [
|
|
4638
|
-
/* @__PURE__ */ (0,
|
|
4639
|
-
/* @__PURE__ */ (0,
|
|
4640
|
-
h.originalHeading && /* @__PURE__ */ (0,
|
|
4641
|
-
/* @__PURE__ */ (0,
|
|
4985
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
4986
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1 }, children: [
|
|
4987
|
+
h.originalHeading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
|
|
4642
4989
|
] }),
|
|
4643
|
-
/* @__PURE__ */ (0,
|
|
4644
|
-
/* @__PURE__ */ (0,
|
|
4645
|
-
/* @__PURE__ */ (0,
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
4991
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyButton, { text: h.heading }),
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
|
|
4646
4993
|
] })
|
|
4647
4994
|
] }),
|
|
4648
|
-
/* @__PURE__ */ (0,
|
|
4995
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
|
|
4649
4996
|
]
|
|
4650
4997
|
},
|
|
4651
4998
|
i
|
|
4652
4999
|
)) })
|
|
4653
5000
|
] }),
|
|
4654
|
-
/* @__PURE__ */ (0,
|
|
4655
|
-
/* @__PURE__ */ (0,
|
|
4656
|
-
/* @__PURE__ */ (0,
|
|
4657
|
-
!contentSuggestions && !isCSLoading && /* @__PURE__ */ (0,
|
|
5001
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle3, children: [
|
|
5002
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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." }),
|
|
5004
|
+
!contentSuggestions && !isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4658
5005
|
"button",
|
|
4659
5006
|
{
|
|
4660
5007
|
onClick: loadContentSuggestions,
|
|
@@ -4678,15 +5025,15 @@ function AEOTab({
|
|
|
4678
5025
|
children: "Generate suggestions"
|
|
4679
5026
|
}
|
|
4680
5027
|
),
|
|
4681
|
-
isCSLoading && /* @__PURE__ */ (0,
|
|
4682
|
-
/* @__PURE__ */ (0,
|
|
4683
|
-
/* @__PURE__ */ (0,
|
|
5028
|
+
isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
|
|
5030
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
|
|
4684
5031
|
] }),
|
|
4685
|
-
csError && /* @__PURE__ */ (0,
|
|
4686
|
-
contentSuggestions && /* @__PURE__ */ (0,
|
|
4687
|
-
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0,
|
|
4688
|
-
/* @__PURE__ */ (0,
|
|
4689
|
-
/* @__PURE__ */ (0,
|
|
5032
|
+
csError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
|
|
5033
|
+
contentSuggestions && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
|
|
5034
|
+
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
|
|
5036
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4690
5037
|
"div",
|
|
4691
5038
|
{
|
|
4692
5039
|
style: {
|
|
@@ -4699,19 +5046,19 @@ function AEOTab({
|
|
|
4699
5046
|
alignItems: "flex-start"
|
|
4700
5047
|
},
|
|
4701
5048
|
children: [
|
|
4702
|
-
/* @__PURE__ */ (0,
|
|
4703
|
-
/* @__PURE__ */ (0,
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
/* @__PURE__ */ (0,
|
|
5049
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
|
|
5050
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
5051
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyButton, { text: kt }),
|
|
5052
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
|
|
4706
5053
|
] })
|
|
4707
5054
|
]
|
|
4708
5055
|
},
|
|
4709
5056
|
i
|
|
4710
5057
|
)) })
|
|
4711
5058
|
] }),
|
|
4712
|
-
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0,
|
|
4713
|
-
/* @__PURE__ */ (0,
|
|
4714
|
-
/* @__PURE__ */ (0,
|
|
5059
|
+
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
5060
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
|
|
5061
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4715
5062
|
"div",
|
|
4716
5063
|
{
|
|
4717
5064
|
style: {
|
|
@@ -4721,23 +5068,23 @@ function AEOTab({
|
|
|
4721
5068
|
borderLeft: `2px solid ${AEO_PURPLE}`
|
|
4722
5069
|
},
|
|
4723
5070
|
children: [
|
|
4724
|
-
/* @__PURE__ */ (0,
|
|
4725
|
-
/* @__PURE__ */ (0,
|
|
4726
|
-
/* @__PURE__ */ (0,
|
|
5071
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
5072
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
|
|
4727
5074
|
] }),
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
5075
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
|
|
4729
5076
|
]
|
|
4730
5077
|
},
|
|
4731
5078
|
i
|
|
4732
5079
|
)) })
|
|
4733
5080
|
] }),
|
|
4734
|
-
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0,
|
|
4735
|
-
/* @__PURE__ */ (0,
|
|
4736
|
-
/* @__PURE__ */ (0,
|
|
4737
|
-
/* @__PURE__ */ (0,
|
|
4738
|
-
/* @__PURE__ */ (0,
|
|
4739
|
-
/* @__PURE__ */ (0,
|
|
4740
|
-
/* @__PURE__ */ (0,
|
|
5081
|
+
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
5082
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
5084
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
|
|
5085
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
5086
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
|
|
5087
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4741
5088
|
FeedbackButton,
|
|
4742
5089
|
{
|
|
4743
5090
|
suggestionType: "aeo_bullets",
|
|
@@ -4748,7 +5095,7 @@ function AEOTab({
|
|
|
4748
5095
|
] })
|
|
4749
5096
|
] })
|
|
4750
5097
|
] }),
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4752
5099
|
"button",
|
|
4753
5100
|
{
|
|
4754
5101
|
onClick: loadContentSuggestions,
|
|
@@ -4777,8 +5124,8 @@ function AEOTab({
|
|
|
4777
5124
|
}
|
|
4778
5125
|
|
|
4779
5126
|
// src/components/ScoreDonut.tsx
|
|
4780
|
-
var
|
|
4781
|
-
var
|
|
5127
|
+
var import_react16 = require("react");
|
|
5128
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4782
5129
|
var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
|
|
4783
5130
|
var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
|
|
4784
5131
|
var TRACK = "#eef2f7";
|
|
@@ -4790,7 +5137,7 @@ function ScoreDonut({
|
|
|
4790
5137
|
sectionFit,
|
|
4791
5138
|
composite
|
|
4792
5139
|
}) {
|
|
4793
|
-
const [hovered, setHovered] = (0,
|
|
5140
|
+
const [hovered, setHovered] = (0, import_react16.useState)(false);
|
|
4794
5141
|
const radius = (size - strokeWidth) / 2;
|
|
4795
5142
|
const circumference = 2 * Math.PI * radius;
|
|
4796
5143
|
const cTopic = topic * W.topic;
|
|
@@ -4803,7 +5150,7 @@ function ScoreDonut({
|
|
|
4803
5150
|
const topicLen = seg(cTopic);
|
|
4804
5151
|
const freshLen = seg(cFresh);
|
|
4805
5152
|
const sectionLen = seg(cSection);
|
|
4806
|
-
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0,
|
|
5153
|
+
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4807
5154
|
"circle",
|
|
4808
5155
|
{
|
|
4809
5156
|
cx: size / 2,
|
|
@@ -4817,20 +5164,20 @@ function ScoreDonut({
|
|
|
4817
5164
|
strokeDashoffset: -offset
|
|
4818
5165
|
}
|
|
4819
5166
|
);
|
|
4820
|
-
return /* @__PURE__ */ (0,
|
|
5167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4821
5168
|
"div",
|
|
4822
5169
|
{
|
|
4823
5170
|
style: { position: "relative", width: size, height: size, flexShrink: 0 },
|
|
4824
5171
|
onMouseEnter: () => setHovered(true),
|
|
4825
5172
|
onMouseLeave: () => setHovered(false),
|
|
4826
5173
|
children: [
|
|
4827
|
-
/* @__PURE__ */ (0,
|
|
4828
|
-
/* @__PURE__ */ (0,
|
|
4829
|
-
/* @__PURE__ */ (0,
|
|
4830
|
-
/* @__PURE__ */ (0,
|
|
4831
|
-
/* @__PURE__ */ (0,
|
|
5174
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
|
|
5175
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
|
|
5176
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
|
|
5177
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
|
|
5178
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
|
|
4832
5179
|
] }),
|
|
4833
|
-
/* @__PURE__ */ (0,
|
|
5180
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4834
5181
|
"div",
|
|
4835
5182
|
{
|
|
4836
5183
|
style: {
|
|
@@ -4844,15 +5191,15 @@ function ScoreDonut({
|
|
|
4844
5191
|
lineHeight: 1
|
|
4845
5192
|
},
|
|
4846
5193
|
children: [
|
|
4847
|
-
/* @__PURE__ */ (0,
|
|
5194
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
|
|
4848
5195
|
compositeValue,
|
|
4849
5196
|
"%"
|
|
4850
5197
|
] }),
|
|
4851
|
-
/* @__PURE__ */ (0,
|
|
5198
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
|
|
4852
5199
|
]
|
|
4853
5200
|
}
|
|
4854
5201
|
),
|
|
4855
|
-
hovered && /* @__PURE__ */ (0,
|
|
5202
|
+
hovered && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4856
5203
|
"div",
|
|
4857
5204
|
{
|
|
4858
5205
|
role: "tooltip",
|
|
@@ -4873,9 +5220,9 @@ function ScoreDonut({
|
|
|
4873
5220
|
pointerEvents: "none"
|
|
4874
5221
|
},
|
|
4875
5222
|
children: [
|
|
4876
|
-
/* @__PURE__ */ (0,
|
|
4877
|
-
/* @__PURE__ */ (0,
|
|
4878
|
-
/* @__PURE__ */ (0,
|
|
5223
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
|
|
5224
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
|
|
5225
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
|
|
4879
5226
|
]
|
|
4880
5227
|
}
|
|
4881
5228
|
)
|
|
@@ -4884,31 +5231,31 @@ function ScoreDonut({
|
|
|
4884
5231
|
);
|
|
4885
5232
|
}
|
|
4886
5233
|
function SubScoreRow({ color, label, value }) {
|
|
4887
|
-
return /* @__PURE__ */ (0,
|
|
4888
|
-
/* @__PURE__ */ (0,
|
|
4889
|
-
/* @__PURE__ */ (0,
|
|
4890
|
-
/* @__PURE__ */ (0,
|
|
5234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
5235
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
|
|
5236
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { flex: 1 }, children: label }),
|
|
5237
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
|
|
4891
5238
|
Math.round(value),
|
|
4892
5239
|
"/100"
|
|
4893
5240
|
] })
|
|
4894
5241
|
] });
|
|
4895
5242
|
}
|
|
4896
5243
|
function ScoreDonutLegend() {
|
|
4897
|
-
return /* @__PURE__ */ (0,
|
|
4898
|
-
/* @__PURE__ */ (0,
|
|
4899
|
-
/* @__PURE__ */ (0,
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
5244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
|
|
5245
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
|
|
5246
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
|
|
5247
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
|
|
4901
5248
|
] });
|
|
4902
5249
|
}
|
|
4903
5250
|
function LegendDot({ color, label }) {
|
|
4904
|
-
return /* @__PURE__ */ (0,
|
|
4905
|
-
/* @__PURE__ */ (0,
|
|
5251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
5252
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
|
|
4906
5253
|
label
|
|
4907
5254
|
] });
|
|
4908
5255
|
}
|
|
4909
5256
|
|
|
4910
5257
|
// src/components/tabs/LinkingTab.tsx
|
|
4911
|
-
var
|
|
5258
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4912
5259
|
function buildLiveUrl(publication, slug) {
|
|
4913
5260
|
if (!slug) return null;
|
|
4914
5261
|
const pub = (publication || "").trim().toLowerCase();
|
|
@@ -4924,7 +5271,7 @@ function buildSanityUrl(baseUrl, id, type) {
|
|
|
4924
5271
|
return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
|
|
4925
5272
|
}
|
|
4926
5273
|
function LinkChip({ href, label, color }) {
|
|
4927
|
-
return /* @__PURE__ */ (0,
|
|
5274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4928
5275
|
"a",
|
|
4929
5276
|
{
|
|
4930
5277
|
href,
|
|
@@ -4946,14 +5293,38 @@ function LinkChip({ href, label, color }) {
|
|
|
4946
5293
|
},
|
|
4947
5294
|
children: [
|
|
4948
5295
|
label,
|
|
4949
|
-
/* @__PURE__ */ (0,
|
|
4950
|
-
/* @__PURE__ */ (0,
|
|
4951
|
-
/* @__PURE__ */ (0,
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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" }),
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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" })
|
|
4952
5299
|
] })
|
|
4953
5300
|
]
|
|
4954
5301
|
}
|
|
4955
5302
|
);
|
|
4956
5303
|
}
|
|
5304
|
+
function ClickableBadge({ clickable }) {
|
|
5305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5306
|
+
"span",
|
|
5307
|
+
{
|
|
5308
|
+
style: {
|
|
5309
|
+
fontSize: 9,
|
|
5310
|
+
fontWeight: 700,
|
|
5311
|
+
textTransform: "uppercase",
|
|
5312
|
+
letterSpacing: "0.04em",
|
|
5313
|
+
padding: "2px 7px",
|
|
5314
|
+
borderRadius: 99,
|
|
5315
|
+
display: "inline-flex",
|
|
5316
|
+
alignItems: "center",
|
|
5317
|
+
gap: 4,
|
|
5318
|
+
background: clickable ? "rgba(22,163,74,0.12)" : "rgba(0,0,0,0.05)",
|
|
5319
|
+
color: clickable ? "#16a34a" : "#9ca3af"
|
|
5320
|
+
},
|
|
5321
|
+
children: [
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
|
|
5323
|
+
clickable ? "Clickable link" : "No live link"
|
|
5324
|
+
]
|
|
5325
|
+
}
|
|
5326
|
+
);
|
|
5327
|
+
}
|
|
4957
5328
|
var cardStyle4 = {
|
|
4958
5329
|
borderRadius: 14,
|
|
4959
5330
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -4963,7 +5334,7 @@ var cardStyle4 = {
|
|
|
4963
5334
|
padding: "14px"
|
|
4964
5335
|
};
|
|
4965
5336
|
function AiPill2() {
|
|
4966
|
-
return /* @__PURE__ */ (0,
|
|
5337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4967
5338
|
"span",
|
|
4968
5339
|
{
|
|
4969
5340
|
style: {
|
|
@@ -4987,10 +5358,10 @@ function SectionHeader3({
|
|
|
4987
5358
|
ai,
|
|
4988
5359
|
action
|
|
4989
5360
|
}) {
|
|
4990
|
-
return /* @__PURE__ */ (0,
|
|
4991
|
-
/* @__PURE__ */ (0,
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
4993
|
-
ai && /* @__PURE__ */ (0,
|
|
5361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
|
|
5362
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
|
|
5363
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
|
|
5364
|
+
ai && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AiPill2, {}),
|
|
4994
5365
|
action
|
|
4995
5366
|
] });
|
|
4996
5367
|
}
|
|
@@ -5011,7 +5382,7 @@ function freshnessChip(label, score) {
|
|
|
5011
5382
|
};
|
|
5012
5383
|
const c = map[label];
|
|
5013
5384
|
if (!c) return null;
|
|
5014
|
-
return /* @__PURE__ */ (0,
|
|
5385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5015
5386
|
"span",
|
|
5016
5387
|
{
|
|
5017
5388
|
style: {
|
|
@@ -5031,8 +5402,8 @@ function freshnessChip(label, score) {
|
|
|
5031
5402
|
);
|
|
5032
5403
|
}
|
|
5033
5404
|
function RefreshIcon({ spinning }) {
|
|
5034
|
-
if (spinning) return /* @__PURE__ */ (0,
|
|
5035
|
-
return /* @__PURE__ */ (0,
|
|
5405
|
+
if (spinning) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingBars, { size: "xs", color: "#9ca3af" });
|
|
5406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.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" }) });
|
|
5036
5407
|
}
|
|
5037
5408
|
function LinkingTab({
|
|
5038
5409
|
analysis,
|
|
@@ -5048,21 +5419,21 @@ function LinkingTab({
|
|
|
5048
5419
|
documentType
|
|
5049
5420
|
}) {
|
|
5050
5421
|
if (!analysis) {
|
|
5051
|
-
return /* @__PURE__ */ (0,
|
|
5052
|
-
/* @__PURE__ */ (0,
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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." })
|
|
5054
5425
|
] });
|
|
5055
5426
|
}
|
|
5056
5427
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
5057
5428
|
const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
|
|
5058
5429
|
const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
|
|
5059
|
-
return /* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
|
|
5431
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5061
5432
|
SectionHeader3,
|
|
5062
5433
|
{
|
|
5063
5434
|
label: "Suggested Links",
|
|
5064
5435
|
iconColor: MJH_BLUE,
|
|
5065
|
-
action: /* @__PURE__ */ (0,
|
|
5436
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5066
5437
|
"button",
|
|
5067
5438
|
{
|
|
5068
5439
|
onClick: onRefresh,
|
|
@@ -5077,20 +5448,20 @@ function LinkingTab({
|
|
|
5077
5448
|
fontSize: 10
|
|
5078
5449
|
},
|
|
5079
5450
|
title: "Refresh",
|
|
5080
|
-
children: /* @__PURE__ */ (0,
|
|
5451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RefreshIcon, { spinning: isLoading })
|
|
5081
5452
|
}
|
|
5082
5453
|
)
|
|
5083
5454
|
}
|
|
5084
5455
|
),
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5456
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
|
|
5086
5457
|
"Other articles on this site that fit this topic.",
|
|
5087
|
-
wordCount2 > 0 && /* @__PURE__ */ (0,
|
|
5458
|
+
wordCount2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
5088
5459
|
" ",
|
|
5089
5460
|
"For a ",
|
|
5090
5461
|
wordCount2.toLocaleString(),
|
|
5091
5462
|
"-word article, aim for",
|
|
5092
5463
|
" ",
|
|
5093
|
-
/* @__PURE__ */ (0,
|
|
5464
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
|
|
5094
5465
|
recommendedMin,
|
|
5095
5466
|
"-",
|
|
5096
5467
|
recommendedMax,
|
|
@@ -5099,17 +5470,17 @@ function LinkingTab({
|
|
|
5099
5470
|
"."
|
|
5100
5471
|
] })
|
|
5101
5472
|
] }),
|
|
5102
|
-
/* @__PURE__ */ (0,
|
|
5473
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
|
|
5103
5474
|
"Each suggestion gets a 0-100% match score from three signals - ",
|
|
5104
|
-
/* @__PURE__ */ (0,
|
|
5475
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "topic match" }),
|
|
5105
5476
|
", ",
|
|
5106
|
-
/* @__PURE__ */ (0,
|
|
5477
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "freshness" }),
|
|
5107
5478
|
", and ",
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
5479
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "section fit" }),
|
|
5109
5480
|
" (where in your article the link belongs). The percentage on each card is the weighted total:"
|
|
5110
5481
|
] }),
|
|
5111
|
-
/* @__PURE__ */ (0,
|
|
5112
|
-
isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0,
|
|
5482
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ScoreDonutLegend, {}) }),
|
|
5483
|
+
isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5113
5484
|
"div",
|
|
5114
5485
|
{
|
|
5115
5486
|
role: "button",
|
|
@@ -5134,16 +5505,16 @@ function LinkingTab({
|
|
|
5134
5505
|
cursor: "pointer"
|
|
5135
5506
|
},
|
|
5136
5507
|
children: [
|
|
5137
|
-
/* @__PURE__ */ (0,
|
|
5138
|
-
/* @__PURE__ */ (0,
|
|
5508
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
|
|
5509
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
|
|
5139
5510
|
]
|
|
5140
5511
|
}
|
|
5141
5512
|
),
|
|
5142
|
-
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
5143
|
-
/* @__PURE__ */ (0,
|
|
5144
|
-
/* @__PURE__ */ (0,
|
|
5513
|
+
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
5515
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
|
|
5145
5516
|
] }),
|
|
5146
|
-
!isLoading && error && /* @__PURE__ */ (0,
|
|
5517
|
+
!isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5147
5518
|
"div",
|
|
5148
5519
|
{
|
|
5149
5520
|
style: {
|
|
@@ -5154,9 +5525,9 @@ function LinkingTab({
|
|
|
5154
5525
|
textAlign: "center"
|
|
5155
5526
|
},
|
|
5156
5527
|
children: [
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
|
|
5529
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5160
5531
|
"button",
|
|
5161
5532
|
{
|
|
5162
5533
|
onClick: onRefresh,
|
|
@@ -5176,104 +5547,162 @@ function LinkingTab({
|
|
|
5176
5547
|
]
|
|
5177
5548
|
}
|
|
5178
5549
|
),
|
|
5179
|
-
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
5180
|
-
/* @__PURE__ */ (0,
|
|
5181
|
-
/* @__PURE__ */ (0,
|
|
5550
|
+
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.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: [
|
|
5551
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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." })
|
|
5182
5553
|
] }),
|
|
5183
|
-
suggestions.length > 0 && /* @__PURE__ */ (0,
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
sanityUrl && /* @__PURE__ */ (0,
|
|
5222
|
-
liveUrl && /* @__PURE__ */ (0,
|
|
5223
|
-
] })
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5554
|
+
suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
|
|
5555
|
+
const liveUrl = buildLiveUrl(publication, s.slug);
|
|
5556
|
+
const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
|
|
5557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5558
|
+
"div",
|
|
5559
|
+
{
|
|
5560
|
+
style: {
|
|
5561
|
+
padding: "10px 12px",
|
|
5562
|
+
background: "rgba(0,93,172,0.03)",
|
|
5563
|
+
borderRadius: 10,
|
|
5564
|
+
borderLeft: `2px solid ${MJH_BLUE}`,
|
|
5565
|
+
display: "flex",
|
|
5566
|
+
gap: 12,
|
|
5567
|
+
alignItems: "flex-start"
|
|
5568
|
+
},
|
|
5569
|
+
children: [
|
|
5570
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5571
|
+
ScoreDonut,
|
|
5572
|
+
{
|
|
5573
|
+
size: 64,
|
|
5574
|
+
topic: Math.max(0, Math.min(100, s.topicScore)),
|
|
5575
|
+
freshness: Math.max(0, Math.min(100, s.freshnessScore)),
|
|
5576
|
+
sectionFit: Math.max(0, Math.min(100, s.sectionFitScore)),
|
|
5577
|
+
composite: Math.max(0, Math.min(100, s.compositeScore))
|
|
5578
|
+
}
|
|
5579
|
+
),
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5581
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
|
|
5582
|
+
freshnessChip(s.freshnessLabel, s.freshnessScore),
|
|
5583
|
+
s.publishedAt && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ClickableBadge, { clickable: !!liveUrl })
|
|
5585
|
+
] }),
|
|
5586
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
|
|
5588
|
+
"/",
|
|
5589
|
+
s.slug
|
|
5590
|
+
] }),
|
|
5591
|
+
(liveUrl || sanityUrl) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
|
|
5592
|
+
sanityUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
|
|
5593
|
+
liveUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
|
|
5594
|
+
] }),
|
|
5595
|
+
s.relevanceReason && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
|
|
5597
|
+
" ",
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
|
|
5599
|
+
] }),
|
|
5600
|
+
s.anchorQuote && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5601
|
+
"div",
|
|
5602
|
+
{
|
|
5603
|
+
style: {
|
|
5604
|
+
marginTop: 4,
|
|
5605
|
+
padding: "6px 9px",
|
|
5606
|
+
background: "rgba(0,0,0,0.025)",
|
|
5607
|
+
borderRadius: 6,
|
|
5608
|
+
borderLeft: "2px solid #cbd5e1",
|
|
5609
|
+
fontSize: 11,
|
|
5610
|
+
color: "#1f2937",
|
|
5611
|
+
lineHeight: 1.5
|
|
5612
|
+
},
|
|
5613
|
+
children: [
|
|
5614
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
|
|
5615
|
+
"Where to link from - paragraph ",
|
|
5616
|
+
s.anchorParagraph
|
|
5617
|
+
] }),
|
|
5618
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontStyle: "italic" }, children: [
|
|
5619
|
+
'"',
|
|
5620
|
+
s.anchorQuote,
|
|
5621
|
+
'"'
|
|
5622
|
+
] }),
|
|
5623
|
+
s.anchorReason && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
|
|
5624
|
+
]
|
|
5625
|
+
}
|
|
5626
|
+
)
|
|
5229
5627
|
] }),
|
|
5230
|
-
|
|
5231
|
-
|
|
5628
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5629
|
+
FeedbackButton,
|
|
5232
5630
|
{
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
borderRadius: 6,
|
|
5238
|
-
borderLeft: "2px solid #cbd5e1",
|
|
5239
|
-
fontSize: 11,
|
|
5240
|
-
color: "#1f2937",
|
|
5241
|
-
lineHeight: 1.5
|
|
5242
|
-
},
|
|
5243
|
-
children: [
|
|
5244
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
|
|
5245
|
-
"Where to link from - paragraph ",
|
|
5246
|
-
s.anchorParagraph
|
|
5247
|
-
] }),
|
|
5248
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontStyle: "italic" }, children: [
|
|
5249
|
-
'"',
|
|
5250
|
-
s.anchorQuote,
|
|
5251
|
-
'"'
|
|
5252
|
-
] }),
|
|
5253
|
-
s.anchorReason && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
|
|
5254
|
-
]
|
|
5631
|
+
suggestionType: "internal_link",
|
|
5632
|
+
suggestionText: s.title,
|
|
5633
|
+
publication,
|
|
5634
|
+
documentId
|
|
5255
5635
|
}
|
|
5256
|
-
)
|
|
5257
|
-
]
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
suggestionText: s.title,
|
|
5263
|
-
publication,
|
|
5264
|
-
documentId
|
|
5265
|
-
}
|
|
5266
|
-
) })
|
|
5267
|
-
]
|
|
5268
|
-
},
|
|
5269
|
-
s._id
|
|
5270
|
-
)) })
|
|
5636
|
+
) })
|
|
5637
|
+
]
|
|
5638
|
+
},
|
|
5639
|
+
s._id
|
|
5640
|
+
);
|
|
5641
|
+
}) })
|
|
5271
5642
|
] }) });
|
|
5272
5643
|
}
|
|
5273
5644
|
|
|
5274
5645
|
// src/components/tabs/MetaTab.tsx
|
|
5275
|
-
var
|
|
5276
|
-
var
|
|
5646
|
+
var import_react17 = require("react");
|
|
5647
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5648
|
+
var GOOGLE_EEAT_URL = "https://developers.google.com/search/docs/fundamentals/creating-helpful-content#eat";
|
|
5649
|
+
function ExternalLinkChip({ href, label }) {
|
|
5650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5651
|
+
"a",
|
|
5652
|
+
{
|
|
5653
|
+
href,
|
|
5654
|
+
target: "_blank",
|
|
5655
|
+
rel: "noopener noreferrer",
|
|
5656
|
+
style: {
|
|
5657
|
+
display: "inline-flex",
|
|
5658
|
+
alignItems: "center",
|
|
5659
|
+
gap: 4,
|
|
5660
|
+
marginTop: 8,
|
|
5661
|
+
padding: "3px 9px",
|
|
5662
|
+
borderRadius: 99,
|
|
5663
|
+
fontSize: 10.5,
|
|
5664
|
+
fontWeight: 700,
|
|
5665
|
+
color: MJH_BLUE,
|
|
5666
|
+
background: "rgba(255,255,255,0.7)",
|
|
5667
|
+
border: `1px solid ${MJH_BLUE}33`,
|
|
5668
|
+
textDecoration: "none",
|
|
5669
|
+
lineHeight: 1.2
|
|
5670
|
+
},
|
|
5671
|
+
children: [
|
|
5672
|
+
label,
|
|
5673
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
|
|
5674
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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" }),
|
|
5675
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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" })
|
|
5676
|
+
] })
|
|
5677
|
+
]
|
|
5678
|
+
}
|
|
5679
|
+
);
|
|
5680
|
+
}
|
|
5681
|
+
function FreshnessNotice() {
|
|
5682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5683
|
+
"div",
|
|
5684
|
+
{
|
|
5685
|
+
style: {
|
|
5686
|
+
padding: "9px 12px",
|
|
5687
|
+
background: "rgba(0,93,172,0.05)",
|
|
5688
|
+
border: "1px solid rgba(0,93,172,0.15)",
|
|
5689
|
+
borderLeft: `3px solid ${MJH_BLUE}`,
|
|
5690
|
+
borderRadius: 8,
|
|
5691
|
+
fontSize: 11,
|
|
5692
|
+
color: "#1f2937",
|
|
5693
|
+
lineHeight: 1.5
|
|
5694
|
+
},
|
|
5695
|
+
children: [
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
|
|
5697
|
+
"Planning to update this article after it's published? Set the ",
|
|
5698
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "Updated on" }),
|
|
5699
|
+
" date in Sanity (e.g. \u201CUpdated: February 19, 2026\u201D). It surfaces the article in ",
|
|
5700
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "Latest Updated Articles" }),
|
|
5701
|
+
" and increases its visibility in search engine results."
|
|
5702
|
+
]
|
|
5703
|
+
}
|
|
5704
|
+
);
|
|
5705
|
+
}
|
|
5277
5706
|
var cardStyle5 = {
|
|
5278
5707
|
borderRadius: 14,
|
|
5279
5708
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -5289,7 +5718,7 @@ function StatusBadge({ status }) {
|
|
|
5289
5718
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
5290
5719
|
};
|
|
5291
5720
|
const c = map[status];
|
|
5292
|
-
return /* @__PURE__ */ (0,
|
|
5721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5293
5722
|
"span",
|
|
5294
5723
|
{
|
|
5295
5724
|
style: {
|
|
@@ -5308,12 +5737,12 @@ function StatusBadge({ status }) {
|
|
|
5308
5737
|
);
|
|
5309
5738
|
}
|
|
5310
5739
|
function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
5311
|
-
return /* @__PURE__ */ (0,
|
|
5312
|
-
/* @__PURE__ */ (0,
|
|
5313
|
-
/* @__PURE__ */ (0,
|
|
5314
|
-
/* @__PURE__ */ (0,
|
|
5740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: anchorId, style: cardStyle5, children: [
|
|
5741
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
5742
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
|
|
5743
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatusBadge, { status })
|
|
5315
5744
|
] }),
|
|
5316
|
-
/* @__PURE__ */ (0,
|
|
5745
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5317
5746
|
"div",
|
|
5318
5747
|
{
|
|
5319
5748
|
style: {
|
|
@@ -5326,7 +5755,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
|
5326
5755
|
children: value
|
|
5327
5756
|
}
|
|
5328
5757
|
),
|
|
5329
|
-
recommendation && /* @__PURE__ */ (0,
|
|
5758
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5330
5759
|
"div",
|
|
5331
5760
|
{
|
|
5332
5761
|
style: {
|
|
@@ -5452,13 +5881,13 @@ function formatDateShort(iso) {
|
|
|
5452
5881
|
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
5453
5882
|
}
|
|
5454
5883
|
function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }) {
|
|
5455
|
-
const audits = (0,
|
|
5884
|
+
const audits = (0, import_react17.useMemo)(() => {
|
|
5456
5885
|
const list = [];
|
|
5457
5886
|
list.push(titleAudit(documentFields?.title, primaryKeyword));
|
|
5458
5887
|
list.push(metaDescriptionAudit(documentFields?.metaDescription, primaryKeyword, secondaryKeyword));
|
|
5459
5888
|
return list;
|
|
5460
5889
|
}, [documentFields, primaryKeyword, secondaryKeyword]);
|
|
5461
|
-
const eeatItems = (0,
|
|
5890
|
+
const eeatItems = (0, import_react17.useMemo)(() => {
|
|
5462
5891
|
const items = [];
|
|
5463
5892
|
const author = documentFields?.authorName;
|
|
5464
5893
|
const creds = documentFields?.authorCredentials;
|
|
@@ -5475,41 +5904,66 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5475
5904
|
} else {
|
|
5476
5905
|
items.push({ label: "Author Byline", value: `${author}, ${creds}`, status: "good" });
|
|
5477
5906
|
}
|
|
5478
|
-
|
|
5479
|
-
const
|
|
5480
|
-
const
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
if (!published) {
|
|
5486
|
-
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." });
|
|
5487
|
-
} else if (daysPub === null) {
|
|
5488
|
-
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." });
|
|
5907
|
+
items[0].footer = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
|
|
5908
|
+
const factChecker = documentFields?.factCheckerName;
|
|
5909
|
+
const factCheckerRef = documentFields?.factCheckerIsReference;
|
|
5910
|
+
if (factChecker) {
|
|
5911
|
+
items.push({ label: "Fact-Checker", value: factChecker, status: "good" });
|
|
5912
|
+
} else if (factCheckerRef) {
|
|
5913
|
+
items.push({ label: "Fact-Checker", value: "Set (reference)", status: "good", recommendation: "A fact-checker is linked as a reference. Open the linked person to confirm the name shows on the published page." });
|
|
5489
5914
|
} else {
|
|
5490
|
-
items.push({ label: "
|
|
5915
|
+
items.push({ label: "Fact-Checker", value: "Not set", status: "warning", recommendation: 'Add a second named person as a fact-checker, separate from the author. A visible "Fact checked by" line is a strong trust signal for healthcare content.' });
|
|
5491
5916
|
}
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5917
|
+
const dated = [];
|
|
5918
|
+
const addDate = (verb, days) => {
|
|
5919
|
+
if (days !== null) dated.push({ verb, days });
|
|
5920
|
+
};
|
|
5921
|
+
addDate("Updated", daysSince(documentFields?.updatedAt));
|
|
5922
|
+
addDate("Reviewed", daysSince(documentFields?.lastReviewedAt));
|
|
5923
|
+
addDate("Published", daysSince(documentFields?.publishedAt));
|
|
5924
|
+
if (dated.length > 0) {
|
|
5925
|
+
const freshest = dated.reduce((a, b) => b.days < a.days ? b : a);
|
|
5926
|
+
const days = freshest.days;
|
|
5927
|
+
const ago = days <= 0 ? "today" : days === 1 ? "1 day ago" : `${days} days ago`;
|
|
5928
|
+
const value = `${freshest.verb} ${ago}`;
|
|
5929
|
+
if (days <= 14) {
|
|
5930
|
+
items.push({ label: "Content Freshness", value, status: "good", recommendation: "Recent content gets cited and ranked more. Re-set the Updated-on date whenever you revise to keep it fresh." });
|
|
5931
|
+
} else if (days <= 90) {
|
|
5932
|
+
items.push({ label: "Content Freshness", value, status: "warning", recommendation: "Content older than two weeks gets cited less by AI search. If it's still accurate, refresh a stat and set the Updated-on date in Sanity." });
|
|
5497
5933
|
} else {
|
|
5498
|
-
items.push({ label: "
|
|
5934
|
+
items.push({ label: "Content Freshness", value, status: "error", recommendation: "Over 90 days old. Review the facts, update what's stale, and set the Updated-on date in Sanity." });
|
|
5499
5935
|
}
|
|
5500
5936
|
}
|
|
5501
5937
|
return items;
|
|
5502
5938
|
}, [documentFields]);
|
|
5939
|
+
const publishDateItem = (0, import_react17.useMemo)(() => {
|
|
5940
|
+
const published = documentFields?.publishedAt;
|
|
5941
|
+
const daysPub = daysSince(published);
|
|
5942
|
+
if (!published) return { 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." };
|
|
5943
|
+
if (daysPub === null) return { 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." };
|
|
5944
|
+
return { label: "Publish Date", value: formatDateShort(published), status: "good" };
|
|
5945
|
+
}, [documentFields]);
|
|
5503
5946
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
|
|
5504
5947
|
if (isLoading && !hasAnyField) {
|
|
5505
|
-
return /* @__PURE__ */ (0,
|
|
5506
|
-
/* @__PURE__ */ (0,
|
|
5507
|
-
/* @__PURE__ */ (0,
|
|
5948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
5949
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
|
|
5950
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
|
|
5508
5951
|
] });
|
|
5509
5952
|
}
|
|
5510
5953
|
const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
|
|
5511
|
-
return /* @__PURE__ */ (0,
|
|
5512
|
-
|
|
5954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
5955
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FreshnessNotice, {}),
|
|
5956
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5957
|
+
AuditCard,
|
|
5958
|
+
{
|
|
5959
|
+
anchorId: "anchor-publish-date",
|
|
5960
|
+
label: publishDateItem.label,
|
|
5961
|
+
value: publishDateItem.value,
|
|
5962
|
+
status: publishDateItem.status,
|
|
5963
|
+
recommendation: publishDateItem.recommendation
|
|
5964
|
+
}
|
|
5965
|
+
),
|
|
5966
|
+
audits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5513
5967
|
AuditCard,
|
|
5514
5968
|
{
|
|
5515
5969
|
anchorId: auditAnchors[i],
|
|
@@ -5520,20 +5974,21 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5520
5974
|
},
|
|
5521
5975
|
i
|
|
5522
5976
|
)),
|
|
5523
|
-
eeatItems.length > 0 && /* @__PURE__ */ (0,
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5525
|
-
/* @__PURE__ */ (0,
|
|
5526
|
-
/* @__PURE__ */ (0,
|
|
5527
|
-
/* @__PURE__ */ (0,
|
|
5977
|
+
eeatItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5978
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
|
|
5979
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
|
|
5980
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
|
|
5981
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
|
|
5528
5982
|
] }),
|
|
5529
|
-
/* @__PURE__ */ (0,
|
|
5530
|
-
eeatItems.map((item, i) => /* @__PURE__ */ (0,
|
|
5983
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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." }),
|
|
5984
|
+
eeatItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5531
5985
|
AuditCard,
|
|
5532
5986
|
{
|
|
5533
5987
|
label: item.label,
|
|
5534
5988
|
value: item.value,
|
|
5535
5989
|
status: item.status,
|
|
5536
|
-
recommendation: item.recommendation
|
|
5990
|
+
recommendation: item.recommendation,
|
|
5991
|
+
footer: item.footer
|
|
5537
5992
|
},
|
|
5538
5993
|
`eeat-${i}`
|
|
5539
5994
|
))
|
|
@@ -5542,8 +5997,8 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5542
5997
|
}
|
|
5543
5998
|
|
|
5544
5999
|
// src/components/tabs/TechnicalTab.tsx
|
|
5545
|
-
var
|
|
5546
|
-
var
|
|
6000
|
+
var import_react18 = require("react");
|
|
6001
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5547
6002
|
function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
5548
6003
|
const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
|
|
5549
6004
|
if (!slug) {
|
|
@@ -5578,28 +6033,28 @@ function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
|
5578
6033
|
return { label: "URL Slug", value: `/${slug}`, status: "good" };
|
|
5579
6034
|
}
|
|
5580
6035
|
function SlugRedirectNotice() {
|
|
5581
|
-
const [expanded, setExpanded] = (0,
|
|
5582
|
-
return /* @__PURE__ */ (0,
|
|
5583
|
-
/* @__PURE__ */ (0,
|
|
5584
|
-
/* @__PURE__ */ (0,
|
|
5585
|
-
/* @__PURE__ */ (0,
|
|
6036
|
+
const [expanded, setExpanded] = (0, import_react18.useState)(false);
|
|
6037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
|
|
6038
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
|
|
6039
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.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" }) }),
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
|
|
5586
6041
|
] }),
|
|
5587
|
-
/* @__PURE__ */ (0,
|
|
5588
|
-
/* @__PURE__ */ (0,
|
|
6042
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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." }),
|
|
6043
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5589
6044
|
"button",
|
|
5590
6045
|
{
|
|
5591
6046
|
onClick: () => setExpanded((v) => !v),
|
|
5592
6047
|
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" },
|
|
5593
6048
|
children: [
|
|
5594
6049
|
expanded ? "Show less" : "Learn more",
|
|
5595
|
-
/* @__PURE__ */ (0,
|
|
6050
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.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" }) })
|
|
5596
6051
|
]
|
|
5597
6052
|
}
|
|
5598
6053
|
),
|
|
5599
|
-
expanded && /* @__PURE__ */ (0,
|
|
5600
|
-
/* @__PURE__ */ (0,
|
|
5601
|
-
/* @__PURE__ */ (0,
|
|
5602
|
-
/* @__PURE__ */ (0,
|
|
6054
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
|
|
6055
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
|
|
6056
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: "Set this up using vanity redirects in Sanity." })
|
|
5603
6058
|
] })
|
|
5604
6059
|
] }) });
|
|
5605
6060
|
}
|
|
@@ -5618,7 +6073,7 @@ function StatusBadge2({ status }) {
|
|
|
5618
6073
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
5619
6074
|
};
|
|
5620
6075
|
const c = map[status];
|
|
5621
|
-
return /* @__PURE__ */ (0,
|
|
6076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5622
6077
|
"span",
|
|
5623
6078
|
{
|
|
5624
6079
|
style: {
|
|
@@ -5644,12 +6099,12 @@ function AuditCard2({
|
|
|
5644
6099
|
anchorId,
|
|
5645
6100
|
footer
|
|
5646
6101
|
}) {
|
|
5647
|
-
return /* @__PURE__ */ (0,
|
|
5648
|
-
/* @__PURE__ */ (0,
|
|
5649
|
-
/* @__PURE__ */ (0,
|
|
5650
|
-
/* @__PURE__ */ (0,
|
|
6102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: anchorId, style: cardStyle6, children: [
|
|
6103
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
6104
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
|
|
6105
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StatusBadge2, { status })
|
|
5651
6106
|
] }),
|
|
5652
|
-
/* @__PURE__ */ (0,
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5653
6108
|
"div",
|
|
5654
6109
|
{
|
|
5655
6110
|
style: {
|
|
@@ -5662,7 +6117,7 @@ function AuditCard2({
|
|
|
5662
6117
|
children: value
|
|
5663
6118
|
}
|
|
5664
6119
|
),
|
|
5665
|
-
recommendation && /* @__PURE__ */ (0,
|
|
6120
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5666
6121
|
"div",
|
|
5667
6122
|
{
|
|
5668
6123
|
style: {
|
|
@@ -5794,7 +6249,7 @@ function imageTitleAudit(titles, imageCount) {
|
|
|
5794
6249
|
status: "good"
|
|
5795
6250
|
};
|
|
5796
6251
|
}
|
|
5797
|
-
function computeHeadingStructureAudits(headings, wordCount2) {
|
|
6252
|
+
function computeHeadingStructureAudits(headings, wordCount2, primaryKeyword, secondaryKeyword, unstyledHeadings) {
|
|
5798
6253
|
const audits = [];
|
|
5799
6254
|
const sectionCount = headings.filter((h) => h.level === 2 || h.level === 3).length;
|
|
5800
6255
|
let densityFired = false;
|
|
@@ -5823,26 +6278,27 @@ function computeHeadingStructureAudits(headings, wordCount2) {
|
|
|
5823
6278
|
});
|
|
5824
6279
|
densityFired = true;
|
|
5825
6280
|
}
|
|
6281
|
+
if (unstyledHeadings && unstyledHeadings.length > 0) {
|
|
6282
|
+
const n = unstyledHeadings.length;
|
|
6283
|
+
const examples = unstyledHeadings.slice(0, 2).map((t) => `"${t}"`).join(", ");
|
|
6284
|
+
audits.push({
|
|
6285
|
+
label: "Looks Like a Heading",
|
|
6286
|
+
value: `${n} line${n === 1 ? "" : "s"} read${n === 1 ? "s" : ""} like a heading but ${n === 1 ? "isn't" : "aren't"} styled`,
|
|
6287
|
+
status: "warning",
|
|
6288
|
+
recommendation: `${examples}${n > 2 ? ", and more," : ""} ${n === 1 ? "looks" : "look"} like a section heading typed as plain text. In Sanity, select the line and apply the "Heading 2" style so it counts as a real heading.`
|
|
6289
|
+
});
|
|
6290
|
+
}
|
|
5826
6291
|
if (headings.length === 0) {
|
|
5827
6292
|
if (!densityFired) {
|
|
5828
6293
|
audits.push({
|
|
5829
6294
|
label: "Heading Structure",
|
|
5830
6295
|
value: "No headings in body",
|
|
5831
6296
|
status: "warning",
|
|
5832
|
-
recommendation: "
|
|
6297
|
+
recommendation: "Consider adding H2-H6 subheadings to structure the article into scannable sections."
|
|
5833
6298
|
});
|
|
5834
6299
|
}
|
|
5835
6300
|
return audits;
|
|
5836
6301
|
}
|
|
5837
|
-
const h1s = headings.filter((h) => h.level === 1);
|
|
5838
|
-
if (h1s.length > 0) {
|
|
5839
|
-
audits.push({
|
|
5840
|
-
label: "H1 in body",
|
|
5841
|
-
value: `${h1s.length} H1 heading${h1s.length === 1 ? "" : "s"} in the body`,
|
|
5842
|
-
status: "warning",
|
|
5843
|
-
recommendation: "The article title is your H1. Body headings should start at H2 so the outline isn't ambiguous."
|
|
5844
|
-
});
|
|
5845
|
-
}
|
|
5846
6302
|
let prevLevel = 0;
|
|
5847
6303
|
const skips = [];
|
|
5848
6304
|
for (const h of headings) {
|
|
@@ -5876,266 +6332,171 @@ function computeHeadingStructureAudits(headings, wordCount2) {
|
|
|
5876
6332
|
status: "good"
|
|
5877
6333
|
});
|
|
5878
6334
|
}
|
|
6335
|
+
const subheads = headings.filter((h) => h.level >= 2);
|
|
6336
|
+
const subheadingText = subheads.map((h) => h.text).join(" ");
|
|
6337
|
+
const hasPrimaryInHeads = primaryKeyword ? containsKeywordTokens(subheadingText, primaryKeyword) : false;
|
|
6338
|
+
const hasSecondaryInHeads = secondaryKeyword ? containsKeywordTokens(subheadingText, secondaryKeyword) : false;
|
|
6339
|
+
if (subheads.length > 0 && (primaryKeyword || secondaryKeyword) && !hasPrimaryInHeads && !hasSecondaryInHeads) {
|
|
6340
|
+
const kw = [
|
|
6341
|
+
primaryKeyword ? `primary keyword "${primaryKeyword}"` : "",
|
|
6342
|
+
secondaryKeyword ? `secondary keyword "${secondaryKeyword}"` : ""
|
|
6343
|
+
].filter(Boolean).join(" or ");
|
|
6344
|
+
audits.push({
|
|
6345
|
+
label: "Keywords in Headings",
|
|
6346
|
+
value: "No subheading uses your target keyword",
|
|
6347
|
+
status: "warning",
|
|
6348
|
+
recommendation: `Work your ${kw} into at least one H2 or H3. Keywords in headers reinforce relevance for readers and search engines.`
|
|
6349
|
+
});
|
|
6350
|
+
}
|
|
5879
6351
|
return audits;
|
|
5880
6352
|
}
|
|
6353
|
+
function HealthBadge({ result }) {
|
|
6354
|
+
const map = {
|
|
6355
|
+
ok: { color: "#16a34a", label: "OK" },
|
|
6356
|
+
redirect: { color: "#8B7310", label: result.status > 0 ? String(result.status) : "REDIR" },
|
|
6357
|
+
broken: { color: "#dc2626", label: result.status > 0 ? String(result.status) : "404" },
|
|
6358
|
+
unverified: { color: "#b45309", label: result.status > 0 ? String(result.status) : "BLOCKED" },
|
|
6359
|
+
error: { color: "#dc2626", label: "ERR" }
|
|
6360
|
+
};
|
|
6361
|
+
const c = map[result.category];
|
|
6362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.04em", padding: "2px 6px", borderRadius: 99, background: "#ffffff", color: c.color, fontVariantNumeric: "tabular-nums", flexShrink: 0, marginTop: 1 }, children: c.label });
|
|
6363
|
+
}
|
|
5881
6364
|
function LinkCheckCard({
|
|
5882
6365
|
urls,
|
|
6366
|
+
linksDetailed,
|
|
5883
6367
|
results,
|
|
5884
6368
|
isLoading,
|
|
5885
6369
|
error,
|
|
5886
6370
|
hasRun,
|
|
5887
6371
|
onCheck
|
|
5888
6372
|
}) {
|
|
5889
|
-
const
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
title: "Run again",
|
|
5916
|
-
children: "Re-check"
|
|
5917
|
-
}
|
|
5918
|
-
)
|
|
5919
|
-
] }),
|
|
5920
|
-
/* @__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.` }),
|
|
5921
|
-
urls.length > 0 && !hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5922
|
-
"button",
|
|
6373
|
+
const [openBucket, setOpenBucket] = (0, import_react18.useState)(null);
|
|
6374
|
+
const haveTypes = !!linksDetailed;
|
|
6375
|
+
const detailByUrl = (0, import_react18.useMemo)(
|
|
6376
|
+
() => new Map((linksDetailed || []).map((d) => [d.url, d])),
|
|
6377
|
+
[linksDetailed]
|
|
6378
|
+
);
|
|
6379
|
+
const resultByUrl = (0, import_react18.useMemo)(() => new Map(results.map((r) => [r.url, r])), [results]);
|
|
6380
|
+
const blockedUrls = results.filter((r) => r.category === "unverified").map((r) => r.url);
|
|
6381
|
+
const tiles = (0, import_react18.useMemo)(() => {
|
|
6382
|
+
const hyper = (linksDetailed || []).filter((l) => l.hyperlinked).map((l) => l.url);
|
|
6383
|
+
const plain = (linksDetailed || []).filter((l) => !l.hyperlinked).map((l) => l.url);
|
|
6384
|
+
const working = results.filter((r) => r.category === "ok" || r.category === "redirect").map((r) => r.url);
|
|
6385
|
+
const broken = results.filter((r) => r.category === "broken" || r.category === "error").map((r) => r.url);
|
|
6386
|
+
const t = [];
|
|
6387
|
+
if (hasRun) t.push({ key: "working", label: "Working", color: "#16a34a", urls: working });
|
|
6388
|
+
if (haveTypes) t.push({ key: "linked", label: "Linked", color: "#16a34a", urls: hyper });
|
|
6389
|
+
if (hasRun) t.push({ key: "broken", label: "Broken", color: "#dc2626", urls: broken });
|
|
6390
|
+
if (haveTypes) t.push({ key: "notlinked", label: "Not linked", color: "#dc2626", urls: plain, note: "Not links yet - hyperlink these so readers can click them and search engines can follow them." });
|
|
6391
|
+
return t;
|
|
6392
|
+
}, [haveTypes, linksDetailed, hasRun, results]);
|
|
6393
|
+
const open = tiles.find((t) => t.key === openBucket) || null;
|
|
6394
|
+
const renderLinkRow = (url) => {
|
|
6395
|
+
const d = detailByUrl.get(url);
|
|
6396
|
+
const r = resultByUrl.get(url);
|
|
6397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6398
|
+
"a",
|
|
5923
6399
|
{
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
fontSize: 11,
|
|
5929
|
-
fontWeight: 700,
|
|
5930
|
-
color: "#1f2937",
|
|
5931
|
-
background: MJH_GOLD,
|
|
5932
|
-
border: "none",
|
|
5933
|
-
borderRadius: 6,
|
|
5934
|
-
cursor: "pointer",
|
|
5935
|
-
letterSpacing: "0.01em"
|
|
5936
|
-
},
|
|
6400
|
+
href: url,
|
|
6401
|
+
target: "_blank",
|
|
6402
|
+
rel: "noopener noreferrer",
|
|
6403
|
+
style: { display: "flex", gap: 8, alignItems: "flex-start", padding: "6px 8px", background: "rgba(0,0,0,0.025)", borderRadius: 6, textDecoration: "none", marginTop: 4 },
|
|
5937
6404
|
children: [
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
6405
|
+
r && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HealthBadge, { result: r }),
|
|
6406
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { minWidth: 0, flex: 1 }, children: [
|
|
6407
|
+
d?.anchorText && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
|
|
6408
|
+
"\u201C",
|
|
6409
|
+
d.anchorText,
|
|
6410
|
+
"\u201D"
|
|
6411
|
+
] }),
|
|
6412
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
|
|
6413
|
+
] })
|
|
5943
6414
|
]
|
|
5944
|
-
}
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
6415
|
+
},
|
|
6416
|
+
url
|
|
6417
|
+
);
|
|
6418
|
+
};
|
|
6419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: "anchor-link-check", style: cardStyle6, children: [
|
|
6420
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
6421
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
|
|
6422
|
+
hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { onClick: onCheck, style: { background: "none", border: "none", fontSize: 10, fontWeight: 600, color: MJH_BLUE, cursor: "pointer", padding: "2px 4px" }, title: "Run again", children: "Re-check" })
|
|
6423
|
+
] }),
|
|
6424
|
+
urls.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
6425
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
|
|
5950
6426
|
urls.length,
|
|
5951
6427
|
" link",
|
|
5952
6428
|
urls.length === 1 ? "" : "s",
|
|
5953
|
-
"
|
|
5954
|
-
|
|
5955
|
-
] }),
|
|
5956
|
-
error && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5957
|
-
"div",
|
|
5958
|
-
{
|
|
5959
|
-
style: {
|
|
5960
|
-
padding: "10px 12px",
|
|
5961
|
-
background: "rgba(220,38,38,0.04)",
|
|
5962
|
-
border: "1px solid rgba(220,38,38,0.18)",
|
|
5963
|
-
borderRadius: 8,
|
|
5964
|
-
fontSize: 11,
|
|
5965
|
-
color: "#b91c1c",
|
|
5966
|
-
lineHeight: 1.5
|
|
5967
|
-
},
|
|
5968
|
-
children: [
|
|
5969
|
-
error,
|
|
5970
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5971
|
-
"button",
|
|
5972
|
-
{
|
|
5973
|
-
onClick: onCheck,
|
|
5974
|
-
style: {
|
|
5975
|
-
display: "block",
|
|
5976
|
-
marginTop: 6,
|
|
5977
|
-
padding: "4px 10px",
|
|
5978
|
-
fontSize: 11,
|
|
5979
|
-
fontWeight: 700,
|
|
5980
|
-
color: "#ffffff",
|
|
5981
|
-
background: "#dc2626",
|
|
5982
|
-
border: "none",
|
|
5983
|
-
borderRadius: 5,
|
|
5984
|
-
cursor: "pointer"
|
|
5985
|
-
},
|
|
5986
|
-
children: "Try again"
|
|
5987
|
-
}
|
|
5988
|
-
)
|
|
5989
|
-
]
|
|
5990
|
-
}
|
|
5991
|
-
),
|
|
5992
|
-
hasRun && !isLoading && !error && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5993
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "grid", gridTemplateColumns: counts.unverified > 0 ? "repeat(5, 1fr)" : "repeat(4, 1fr)", gap: 6 }, children: [
|
|
5994
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Checked", value: counts.total, color: "#475569" }),
|
|
5995
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Valid", value: counts.valid, color: "#16a34a" }),
|
|
5996
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Redirects", value: counts.redirects, color: "#8B7310" }),
|
|
5997
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Broken", value: counts.broken + counts.errored, color: "#dc2626" }),
|
|
5998
|
-
counts.unverified > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Blocked", value: counts.unverified, color: "#b45309" })
|
|
6429
|
+
" in the body.",
|
|
6430
|
+
tiles.length > 0 ? " Tap a box to see which." : ""
|
|
5999
6431
|
] }),
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6432
|
+
tiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
|
|
6433
|
+
const empty = t.urls.length === 0;
|
|
6434
|
+
const active = openBucket === t.key && !empty;
|
|
6435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6436
|
+
"button",
|
|
6437
|
+
{
|
|
6438
|
+
type: "button",
|
|
6439
|
+
onClick: () => !empty && setOpenBucket(active ? null : t.key),
|
|
6440
|
+
"aria-expanded": active,
|
|
6441
|
+
"aria-label": `${t.urls.length} ${t.label} links`,
|
|
6442
|
+
style: {
|
|
6443
|
+
padding: "8px 4px",
|
|
6444
|
+
background: active ? "rgba(0,93,172,0.08)" : "rgba(0,0,0,0.025)",
|
|
6445
|
+
border: active ? `1px solid ${MJH_BLUE}55` : "1px solid transparent",
|
|
6446
|
+
borderRadius: 8,
|
|
6447
|
+
textAlign: "center",
|
|
6448
|
+
cursor: empty ? "default" : "pointer",
|
|
6449
|
+
opacity: empty ? 0.5 : 1
|
|
6450
|
+
},
|
|
6451
|
+
children: [
|
|
6452
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
|
|
6453
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
|
|
6454
|
+
]
|
|
6012
6455
|
},
|
|
6456
|
+
t.key
|
|
6457
|
+
);
|
|
6458
|
+
}) }),
|
|
6459
|
+
open && open.urls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { marginTop: 8 }, children: [
|
|
6460
|
+
open.note && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 10.5, color: "#92400e", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, padding: "6px 9px", lineHeight: 1.45, marginBottom: 2 }, children: open.note }),
|
|
6461
|
+
open.urls.map(renderLinkRow)
|
|
6462
|
+
] }),
|
|
6463
|
+
hasRun && blockedUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { marginTop: 8, padding: "6px 10px", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, fontSize: 10.5, color: "#92400e", lineHeight: 1.45 }, children: [
|
|
6464
|
+
blockedUrls.length,
|
|
6465
|
+
" link",
|
|
6466
|
+
blockedUrls.length === 1 ? "" : "s",
|
|
6467
|
+
" couldn't be auto-checked (the destination blocks our checker) - open them to confirm."
|
|
6468
|
+
] }),
|
|
6469
|
+
!hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6470
|
+
"button",
|
|
6471
|
+
{
|
|
6472
|
+
onClick: onCheck,
|
|
6473
|
+
style: { width: "100%", marginTop: 10, padding: "8px 12px", fontSize: 11, fontWeight: 700, color: "#1f2937", background: MJH_GOLD, border: "none", borderRadius: 6, cursor: "pointer", letterSpacing: "0.01em" },
|
|
6013
6474
|
children: [
|
|
6014
|
-
|
|
6475
|
+
"Check ",
|
|
6476
|
+
urls.length,
|
|
6015
6477
|
" link",
|
|
6016
|
-
|
|
6017
|
-
"
|
|
6478
|
+
urls.length === 1 ? "" : "s",
|
|
6479
|
+
" for broken / redirects"
|
|
6018
6480
|
]
|
|
6019
6481
|
}
|
|
6020
6482
|
),
|
|
6021
|
-
|
|
6022
|
-
/* @__PURE__ */ (0,
|
|
6023
|
-
|
|
6483
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
|
|
6484
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
|
|
6486
|
+
"Checking ",
|
|
6487
|
+
urls.length,
|
|
6024
6488
|
" link",
|
|
6025
|
-
|
|
6026
|
-
"
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
{
|
|
6034
|
-
style: {
|
|
6035
|
-
marginTop: 12,
|
|
6036
|
-
padding: "8px 10px",
|
|
6037
|
-
background: "rgba(22,163,74,0.05)",
|
|
6038
|
-
border: "1px solid rgba(22,163,74,0.15)",
|
|
6039
|
-
borderRadius: 8,
|
|
6040
|
-
fontSize: 11,
|
|
6041
|
-
color: "#16a34a",
|
|
6042
|
-
fontWeight: 600,
|
|
6043
|
-
textAlign: "center"
|
|
6044
|
-
},
|
|
6045
|
-
children: [
|
|
6046
|
-
"All ",
|
|
6047
|
-
counts.total,
|
|
6048
|
-
" link",
|
|
6049
|
-
counts.total === 1 ? "" : "s",
|
|
6050
|
-
" resolve cleanly."
|
|
6051
|
-
]
|
|
6052
|
-
}
|
|
6053
|
-
)
|
|
6489
|
+
urls.length === 1 ? "" : "s",
|
|
6490
|
+
"..."
|
|
6491
|
+
] })
|
|
6492
|
+
] }),
|
|
6493
|
+
error && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { marginTop: 10, padding: "10px 12px", background: "rgba(220,38,38,0.04)", border: "1px solid rgba(220,38,38,0.18)", borderRadius: 8, fontSize: 11, color: "#b91c1c", lineHeight: 1.5 }, children: [
|
|
6494
|
+
error,
|
|
6495
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { onClick: onCheck, style: { display: "block", marginTop: 6, padding: "4px 10px", fontSize: 11, fontWeight: 700, color: "#ffffff", background: "#dc2626", border: "none", borderRadius: 5, cursor: "pointer" }, children: "Try again" })
|
|
6496
|
+
] })
|
|
6054
6497
|
] })
|
|
6055
6498
|
] });
|
|
6056
6499
|
}
|
|
6057
|
-
function StatTile({ label, value, color }) {
|
|
6058
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6059
|
-
"div",
|
|
6060
|
-
{
|
|
6061
|
-
style: {
|
|
6062
|
-
padding: "8px 4px",
|
|
6063
|
-
background: "rgba(0,0,0,0.025)",
|
|
6064
|
-
borderRadius: 8,
|
|
6065
|
-
textAlign: "center"
|
|
6066
|
-
},
|
|
6067
|
-
children: [
|
|
6068
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 18, fontWeight: 700, color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: value }),
|
|
6069
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", marginTop: 4 }, children: label })
|
|
6070
|
-
]
|
|
6071
|
-
}
|
|
6072
|
-
);
|
|
6073
|
-
}
|
|
6074
|
-
function LinkIssueRow({ result }) {
|
|
6075
|
-
const map = {
|
|
6076
|
-
ok: { bg: "rgba(22,163,74,0.06)", color: "#16a34a", label: "OK" },
|
|
6077
|
-
redirect: { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: result.status > 0 ? String(result.status) : "REDIR" },
|
|
6078
|
-
broken: { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: result.status > 0 ? String(result.status) : "404" },
|
|
6079
|
-
// Amber for unverified - the link may work fine, our server just couldn't confirm.
|
|
6080
|
-
unverified: { bg: "rgba(245,158,11,0.10)", color: "#b45309", label: result.status > 0 ? String(result.status) : "BLOCKED" },
|
|
6081
|
-
error: { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "ERR" }
|
|
6082
|
-
};
|
|
6083
|
-
const c = map[result.category];
|
|
6084
|
-
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;
|
|
6085
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6086
|
-
"a",
|
|
6087
|
-
{
|
|
6088
|
-
href: result.url,
|
|
6089
|
-
target: "_blank",
|
|
6090
|
-
rel: "noopener noreferrer",
|
|
6091
|
-
style: {
|
|
6092
|
-
display: "flex",
|
|
6093
|
-
alignItems: "center",
|
|
6094
|
-
gap: 8,
|
|
6095
|
-
padding: "6px 10px",
|
|
6096
|
-
background: c.bg,
|
|
6097
|
-
borderRadius: 6,
|
|
6098
|
-
textDecoration: "none"
|
|
6099
|
-
},
|
|
6100
|
-
children: [
|
|
6101
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6102
|
-
"span",
|
|
6103
|
-
{
|
|
6104
|
-
style: {
|
|
6105
|
-
fontSize: 9,
|
|
6106
|
-
fontWeight: 700,
|
|
6107
|
-
letterSpacing: "0.04em",
|
|
6108
|
-
padding: "2px 6px",
|
|
6109
|
-
borderRadius: 99,
|
|
6110
|
-
background: "#ffffff",
|
|
6111
|
-
color: c.color,
|
|
6112
|
-
fontVariantNumeric: "tabular-nums",
|
|
6113
|
-
flexShrink: 0
|
|
6114
|
-
},
|
|
6115
|
-
children: c.label
|
|
6116
|
-
}
|
|
6117
|
-
),
|
|
6118
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6119
|
-
"span",
|
|
6120
|
-
{
|
|
6121
|
-
style: {
|
|
6122
|
-
fontSize: 11,
|
|
6123
|
-
color: "#1f2937",
|
|
6124
|
-
fontFamily: "ui-monospace, SFMono-Regular, monospace",
|
|
6125
|
-
flex: 1,
|
|
6126
|
-
minWidth: 0,
|
|
6127
|
-
overflow: "hidden",
|
|
6128
|
-
textOverflow: "ellipsis",
|
|
6129
|
-
whiteSpace: "nowrap"
|
|
6130
|
-
},
|
|
6131
|
-
title: tooltip,
|
|
6132
|
-
children: result.url
|
|
6133
|
-
}
|
|
6134
|
-
)
|
|
6135
|
-
]
|
|
6136
|
-
}
|
|
6137
|
-
);
|
|
6138
|
-
}
|
|
6139
6500
|
function TechnicalTab({
|
|
6140
6501
|
text,
|
|
6141
6502
|
documentFields,
|
|
@@ -6148,37 +6509,37 @@ function TechnicalTab({
|
|
|
6148
6509
|
hasRunLinkCheck,
|
|
6149
6510
|
onCheckLinks
|
|
6150
6511
|
}) {
|
|
6151
|
-
const urlSlugAudit = (0,
|
|
6512
|
+
const urlSlugAudit = (0, import_react18.useMemo)(
|
|
6152
6513
|
() => urlAudit(documentFields?.slug, primaryKeyword, secondaryKeyword),
|
|
6153
6514
|
[documentFields?.slug, primaryKeyword, secondaryKeyword]
|
|
6154
6515
|
);
|
|
6155
6516
|
const headings = documentFields?.headings || [];
|
|
6156
6517
|
const headingsDetailed = documentFields?.headingsDetailed;
|
|
6157
|
-
const headingsForStructure = (0,
|
|
6518
|
+
const headingsForStructure = (0, import_react18.useMemo)(
|
|
6158
6519
|
() => headingsDetailed ? headingsDetailed : headings.map((text2) => ({ text: text2, level: 2 })),
|
|
6159
6520
|
[headingsDetailed, headings]
|
|
6160
6521
|
);
|
|
6161
6522
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
6162
|
-
const structureAudits = (0,
|
|
6163
|
-
() => computeHeadingStructureAudits(headingsForStructure, wordCount2),
|
|
6164
|
-
[headingsForStructure, wordCount2]
|
|
6523
|
+
const structureAudits = (0, import_react18.useMemo)(
|
|
6524
|
+
() => computeHeadingStructureAudits(headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings),
|
|
6525
|
+
[headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings]
|
|
6165
6526
|
);
|
|
6166
6527
|
const imageNames = documentFields?.imageNames || [];
|
|
6167
|
-
const { filenames: imageFilenames, altTexts: imageAltTexts } = (0,
|
|
6528
|
+
const { filenames: imageFilenames, altTexts: imageAltTexts } = (0, import_react18.useMemo)(
|
|
6168
6529
|
() => classifyImageNames(imageNames),
|
|
6169
6530
|
[imageNames]
|
|
6170
6531
|
);
|
|
6171
|
-
const filenameAudit = (0,
|
|
6532
|
+
const filenameAudit = (0, import_react18.useMemo)(
|
|
6172
6533
|
() => imageFilenameAudit(imageFilenames),
|
|
6173
6534
|
[imageFilenames]
|
|
6174
6535
|
);
|
|
6175
|
-
const altTextAudit = (0,
|
|
6536
|
+
const altTextAudit = (0, import_react18.useMemo)(
|
|
6176
6537
|
() => imageAltTextAudit(imageAltTexts),
|
|
6177
6538
|
[imageAltTexts]
|
|
6178
6539
|
);
|
|
6179
6540
|
const imageTitles = documentFields?.imageTitles || [];
|
|
6180
6541
|
const imageCount = documentFields?.imageCount ?? 0;
|
|
6181
|
-
const imgTitleAudit = (0,
|
|
6542
|
+
const imgTitleAudit = (0, import_react18.useMemo)(
|
|
6182
6543
|
() => imageTitleAudit(imageTitles, imageCount),
|
|
6183
6544
|
[imageTitles, imageCount]
|
|
6184
6545
|
);
|
|
@@ -6202,15 +6563,16 @@ function TechnicalTab({
|
|
|
6202
6563
|
recommendation: "Above the 450-word floor. For competitive clinical content, push past 1,500 words."
|
|
6203
6564
|
} : { label: "Word Count", value: `${wordCount2} words`, status: "good" };
|
|
6204
6565
|
const bodyLinks = documentFields?.bodyLinks || [];
|
|
6566
|
+
const bodyLinksDetailed = documentFields?.bodyLinksDetailed;
|
|
6205
6567
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
|
|
6206
6568
|
if (isLoading && !hasAnyField) {
|
|
6207
|
-
return /* @__PURE__ */ (0,
|
|
6208
|
-
/* @__PURE__ */ (0,
|
|
6209
|
-
/* @__PURE__ */ (0,
|
|
6569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
6570
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
|
|
6571
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
|
|
6210
6572
|
] });
|
|
6211
6573
|
}
|
|
6212
|
-
return /* @__PURE__ */ (0,
|
|
6213
|
-
/* @__PURE__ */ (0,
|
|
6574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
6575
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6214
6576
|
AuditCard2,
|
|
6215
6577
|
{
|
|
6216
6578
|
anchorId: "anchor-url-slug",
|
|
@@ -6218,10 +6580,22 @@ function TechnicalTab({
|
|
|
6218
6580
|
value: urlSlugAudit.value,
|
|
6219
6581
|
status: urlSlugAudit.status,
|
|
6220
6582
|
recommendation: urlSlugAudit.recommendation,
|
|
6221
|
-
footer: /* @__PURE__ */ (0,
|
|
6583
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SlugRedirectNotice, {})
|
|
6222
6584
|
}
|
|
6223
6585
|
),
|
|
6224
|
-
|
|
6586
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6587
|
+
LinkCheckCard,
|
|
6588
|
+
{
|
|
6589
|
+
urls: bodyLinks,
|
|
6590
|
+
linksDetailed: bodyLinksDetailed,
|
|
6591
|
+
results: linkCheckResults,
|
|
6592
|
+
isLoading: isLinkCheckLoading,
|
|
6593
|
+
error: linkCheckError,
|
|
6594
|
+
hasRun: hasRunLinkCheck,
|
|
6595
|
+
onCheck: onCheckLinks
|
|
6596
|
+
}
|
|
6597
|
+
),
|
|
6598
|
+
wordAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6225
6599
|
AuditCard2,
|
|
6226
6600
|
{
|
|
6227
6601
|
anchorId: "anchor-word-count",
|
|
@@ -6231,48 +6605,63 @@ function TechnicalTab({
|
|
|
6231
6605
|
recommendation: wordAudit.recommendation
|
|
6232
6606
|
}
|
|
6233
6607
|
),
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6608
|
+
(() => {
|
|
6609
|
+
const structIdx = structureAudits.findIndex(
|
|
6610
|
+
(a) => a.label !== "Keywords in Headings" && a.label !== "Looks Like a Heading"
|
|
6611
|
+
);
|
|
6612
|
+
return structureAudits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6613
|
+
AuditCard2,
|
|
6614
|
+
{
|
|
6615
|
+
anchorId: a.label === "Keywords in Headings" ? "anchor-headings-keyword" : a.label === "Looks Like a Heading" ? "anchor-headings-unstyled" : i === structIdx ? "anchor-headings-structure" : void 0,
|
|
6616
|
+
label: a.label,
|
|
6617
|
+
value: a.value,
|
|
6618
|
+
status: a.status,
|
|
6619
|
+
recommendation: a.recommendation
|
|
6620
|
+
},
|
|
6621
|
+
`structure-${i}`
|
|
6622
|
+
));
|
|
6623
|
+
})(),
|
|
6624
|
+
(headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
|
|
6625
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
|
|
6626
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
6627
|
+
documentFields?.title && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
|
|
6628
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
|
|
6629
|
+
documentFields.title,
|
|
6630
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
|
|
6631
|
+
] }),
|
|
6632
|
+
(headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => {
|
|
6633
|
+
const isH1 = h.level === 1;
|
|
6634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6635
|
+
"div",
|
|
6636
|
+
{
|
|
6637
|
+
style: {
|
|
6638
|
+
fontSize: 11,
|
|
6639
|
+
color: !h.text ? "#dc2626" : isH1 ? MJH_BLUE : "#4b5563",
|
|
6640
|
+
fontWeight: isH1 ? 700 : 400,
|
|
6641
|
+
fontStyle: h.text ? "normal" : "italic",
|
|
6642
|
+
lineHeight: 1.4,
|
|
6643
|
+
paddingLeft: Math.max(0, (h.level - 2) * 12)
|
|
6644
|
+
},
|
|
6645
|
+
children: [
|
|
6646
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
|
|
6647
|
+
"H",
|
|
6648
|
+
h.level
|
|
6649
|
+
] }),
|
|
6650
|
+
h.text || "(empty)"
|
|
6651
|
+
]
|
|
6257
6652
|
},
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
] }),
|
|
6263
|
-
h.text || "(empty)"
|
|
6264
|
-
]
|
|
6265
|
-
},
|
|
6266
|
-
i
|
|
6267
|
-
)),
|
|
6268
|
-
(headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
|
|
6653
|
+
i
|
|
6654
|
+
);
|
|
6655
|
+
}),
|
|
6656
|
+
(headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
|
|
6269
6657
|
"+ ",
|
|
6270
6658
|
(headingsDetailed ?? headings).length - 12,
|
|
6271
6659
|
" more"
|
|
6272
6660
|
] })
|
|
6273
|
-
] })
|
|
6661
|
+
] }),
|
|
6662
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 10, color: "#6b7280", marginTop: 8, lineHeight: 1.4 }, children: headings.length > 0 ? "The title above is your H1; the tool scans the H2-H6 tags below it. Tip: work your primary and/or secondary keyword into a header where it reads naturally." : "The title above is your H1, and there are no H2-H6 subheadings yet. Tip: work your primary and/or secondary keyword into the title where it reads naturally." })
|
|
6274
6663
|
] }),
|
|
6275
|
-
imagesAudit && /* @__PURE__ */ (0,
|
|
6664
|
+
imagesAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6276
6665
|
AuditCard2,
|
|
6277
6666
|
{
|
|
6278
6667
|
anchorId: "anchor-images",
|
|
@@ -6282,7 +6671,7 @@ function TechnicalTab({
|
|
|
6282
6671
|
recommendation: imagesAudit.recommendation
|
|
6283
6672
|
}
|
|
6284
6673
|
),
|
|
6285
|
-
filenameAudit && /* @__PURE__ */ (0,
|
|
6674
|
+
filenameAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6286
6675
|
AuditCard2,
|
|
6287
6676
|
{
|
|
6288
6677
|
anchorId: "anchor-image-filenames",
|
|
@@ -6292,7 +6681,7 @@ function TechnicalTab({
|
|
|
6292
6681
|
recommendation: filenameAudit.recommendation
|
|
6293
6682
|
}
|
|
6294
6683
|
),
|
|
6295
|
-
altTextAudit && /* @__PURE__ */ (0,
|
|
6684
|
+
altTextAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6296
6685
|
AuditCard2,
|
|
6297
6686
|
{
|
|
6298
6687
|
anchorId: "anchor-image-alt",
|
|
@@ -6302,7 +6691,7 @@ function TechnicalTab({
|
|
|
6302
6691
|
recommendation: altTextAudit.recommendation
|
|
6303
6692
|
}
|
|
6304
6693
|
),
|
|
6305
|
-
imgTitleAudit && /* @__PURE__ */ (0,
|
|
6694
|
+
imgTitleAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6306
6695
|
AuditCard2,
|
|
6307
6696
|
{
|
|
6308
6697
|
anchorId: "anchor-image-titles",
|
|
@@ -6311,28 +6700,17 @@ function TechnicalTab({
|
|
|
6311
6700
|
status: imgTitleAudit.status,
|
|
6312
6701
|
recommendation: imgTitleAudit.recommendation
|
|
6313
6702
|
}
|
|
6314
|
-
),
|
|
6315
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6316
|
-
LinkCheckCard,
|
|
6317
|
-
{
|
|
6318
|
-
urls: bodyLinks,
|
|
6319
|
-
results: linkCheckResults,
|
|
6320
|
-
isLoading: isLinkCheckLoading,
|
|
6321
|
-
error: linkCheckError,
|
|
6322
|
-
hasRun: hasRunLinkCheck,
|
|
6323
|
-
onCheck: onCheckLinks
|
|
6324
|
-
}
|
|
6325
6703
|
)
|
|
6326
6704
|
] });
|
|
6327
6705
|
}
|
|
6328
6706
|
|
|
6329
6707
|
// src/components/SEOCopilotPanel.tsx
|
|
6330
|
-
var
|
|
6708
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6331
6709
|
function LogoIcon2() {
|
|
6332
|
-
return /* @__PURE__ */ (0,
|
|
6333
|
-
/* @__PURE__ */ (0,
|
|
6334
|
-
/* @__PURE__ */ (0,
|
|
6335
|
-
/* @__PURE__ */ (0,
|
|
6710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
|
|
6711
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
|
|
6712
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
|
|
6713
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
|
|
6336
6714
|
] });
|
|
6337
6715
|
}
|
|
6338
6716
|
function PanelContent({
|
|
@@ -6374,14 +6752,14 @@ function PanelContent({
|
|
|
6374
6752
|
const keywordAnalysisState = externalAnalysis;
|
|
6375
6753
|
const effectivePrimary = selectedPrimary || externalAnalysis.analysis?.primaryKeyword?.term || "";
|
|
6376
6754
|
const effectiveSecondary = selectedSecondary || "";
|
|
6377
|
-
const containerRef = (0,
|
|
6378
|
-
const dragging = (0,
|
|
6379
|
-
const onMouseDown = (0,
|
|
6755
|
+
const containerRef = (0, import_react19.useRef)(null);
|
|
6756
|
+
const dragging = (0, import_react19.useRef)(false);
|
|
6757
|
+
const onMouseDown = (0, import_react19.useCallback)(() => {
|
|
6380
6758
|
dragging.current = true;
|
|
6381
6759
|
document.body.style.cursor = "row-resize";
|
|
6382
6760
|
document.body.style.userSelect = "none";
|
|
6383
6761
|
}, []);
|
|
6384
|
-
(0,
|
|
6762
|
+
(0, import_react19.useEffect)(() => {
|
|
6385
6763
|
const onMouseMove = (e) => {
|
|
6386
6764
|
if (!dragging.current || !containerRef.current) return;
|
|
6387
6765
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -6404,11 +6782,11 @@ function PanelContent({
|
|
|
6404
6782
|
const onboardSite = publication || "default";
|
|
6405
6783
|
const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
|
|
6406
6784
|
const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
|
|
6407
|
-
const [popupMode, setPopupMode] = (0,
|
|
6408
|
-
const [popupClosing, setPopupClosing] = (0,
|
|
6409
|
-
const onboardTimerRef = (0,
|
|
6410
|
-
const onboardFadeRef = (0,
|
|
6411
|
-
(0,
|
|
6785
|
+
const [popupMode, setPopupMode] = (0, import_react19.useState)("hidden");
|
|
6786
|
+
const [popupClosing, setPopupClosing] = (0, import_react19.useState)(false);
|
|
6787
|
+
const onboardTimerRef = (0, import_react19.useRef)(null);
|
|
6788
|
+
const onboardFadeRef = (0, import_react19.useRef)(null);
|
|
6789
|
+
(0, import_react19.useEffect)(() => {
|
|
6412
6790
|
let onboarded = false;
|
|
6413
6791
|
let shownThisSession = false;
|
|
6414
6792
|
try {
|
|
@@ -6438,13 +6816,13 @@ function PanelContent({
|
|
|
6438
6816
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6439
6817
|
};
|
|
6440
6818
|
}, [onboardKey, onboardSessionKey]);
|
|
6441
|
-
const markOnboarded = (0,
|
|
6819
|
+
const markOnboarded = (0, import_react19.useCallback)(() => {
|
|
6442
6820
|
try {
|
|
6443
6821
|
localStorage.setItem(onboardKey, "1");
|
|
6444
6822
|
} catch {
|
|
6445
6823
|
}
|
|
6446
6824
|
}, [onboardKey]);
|
|
6447
|
-
const dismissPopup = (0,
|
|
6825
|
+
const dismissPopup = (0, import_react19.useCallback)(() => {
|
|
6448
6826
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6449
6827
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6450
6828
|
markOnboarded();
|
|
@@ -6454,14 +6832,14 @@ function PanelContent({
|
|
|
6454
6832
|
setPopupClosing(false);
|
|
6455
6833
|
}, 180);
|
|
6456
6834
|
}, [markOnboarded]);
|
|
6457
|
-
const openPopupPersistent = (0,
|
|
6835
|
+
const openPopupPersistent = (0, import_react19.useCallback)(() => {
|
|
6458
6836
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6459
6837
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6460
6838
|
markOnboarded();
|
|
6461
6839
|
setPopupClosing(false);
|
|
6462
6840
|
setPopupMode("persistent");
|
|
6463
6841
|
}, [markOnboarded]);
|
|
6464
|
-
const handleTabChange = (0,
|
|
6842
|
+
const handleTabChange = (0, import_react19.useCallback)((id) => {
|
|
6465
6843
|
markOnboarded();
|
|
6466
6844
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6467
6845
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
@@ -6480,7 +6858,7 @@ function PanelContent({
|
|
|
6480
6858
|
{ id: "meta", label: "Meta", beta: true },
|
|
6481
6859
|
{ id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
|
|
6482
6860
|
];
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6484
6862
|
"div",
|
|
6485
6863
|
{
|
|
6486
6864
|
className: "seo-copilot-panel",
|
|
@@ -6495,9 +6873,9 @@ function PanelContent({
|
|
|
6495
6873
|
position: "relative"
|
|
6496
6874
|
},
|
|
6497
6875
|
children: [
|
|
6498
|
-
/* @__PURE__ */ (0,
|
|
6499
|
-
popupMode !== "hidden" && /* @__PURE__ */ (0,
|
|
6500
|
-
/* @__PURE__ */ (0,
|
|
6876
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
|
|
6877
|
+
popupMode !== "hidden" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
|
|
6878
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6501
6879
|
"div",
|
|
6502
6880
|
{
|
|
6503
6881
|
onMouseDown: isFloating ? onDragStart : void 0,
|
|
@@ -6515,16 +6893,26 @@ function PanelContent({
|
|
|
6515
6893
|
flexShrink: 0
|
|
6516
6894
|
},
|
|
6517
6895
|
children: [
|
|
6518
|
-
/* @__PURE__ */ (0,
|
|
6519
|
-
/* @__PURE__ */ (0,
|
|
6520
|
-
/* @__PURE__ */ (0,
|
|
6521
|
-
/* @__PURE__ */ (0,
|
|
6522
|
-
/* @__PURE__ */ (0,
|
|
6896
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
6897
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LogoIcon2, {}),
|
|
6898
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
|
|
6899
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { color: MJH_GOLD }, children: "SEO" }),
|
|
6900
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { color: MJH_SLATE }, children: " copilot" })
|
|
6523
6901
|
] })
|
|
6524
6902
|
] }),
|
|
6525
|
-
/* @__PURE__ */ (0,
|
|
6526
|
-
/* @__PURE__ */ (0,
|
|
6527
|
-
|
|
6903
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
|
|
6904
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OnboardingInfoButton, { onClick: openPopupPersistent }),
|
|
6905
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6906
|
+
ReportProblemButton,
|
|
6907
|
+
{
|
|
6908
|
+
activeTab,
|
|
6909
|
+
publication,
|
|
6910
|
+
documentId,
|
|
6911
|
+
documentType,
|
|
6912
|
+
primaryKeyword: effectivePrimary
|
|
6913
|
+
}
|
|
6914
|
+
),
|
|
6915
|
+
isFloating && onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6528
6916
|
"button",
|
|
6529
6917
|
{
|
|
6530
6918
|
onClick: (e) => {
|
|
@@ -6546,16 +6934,16 @@ function PanelContent({
|
|
|
6546
6934
|
fontWeight: 600,
|
|
6547
6935
|
transition: "all 150ms"
|
|
6548
6936
|
},
|
|
6549
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
6550
|
-
/* @__PURE__ */ (0,
|
|
6937
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
6938
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.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" }) }),
|
|
6551
6939
|
"Exit fullscreen"
|
|
6552
|
-
] }) : /* @__PURE__ */ (0,
|
|
6553
|
-
/* @__PURE__ */ (0,
|
|
6940
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
6941
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.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" }) }),
|
|
6554
6942
|
"Fullscreen"
|
|
6555
6943
|
] })
|
|
6556
6944
|
}
|
|
6557
6945
|
),
|
|
6558
|
-
isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
6946
|
+
isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6559
6947
|
"button",
|
|
6560
6948
|
{
|
|
6561
6949
|
onClick: (e) => {
|
|
@@ -6578,7 +6966,7 @@ function PanelContent({
|
|
|
6578
6966
|
transition: "all 150ms"
|
|
6579
6967
|
},
|
|
6580
6968
|
children: [
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6969
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6582
6970
|
"path",
|
|
6583
6971
|
{
|
|
6584
6972
|
fillRule: "evenodd",
|
|
@@ -6590,7 +6978,7 @@ function PanelContent({
|
|
|
6590
6978
|
]
|
|
6591
6979
|
}
|
|
6592
6980
|
),
|
|
6593
|
-
!isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
6981
|
+
!isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6594
6982
|
"button",
|
|
6595
6983
|
{
|
|
6596
6984
|
onClick: (e) => {
|
|
@@ -6609,13 +6997,13 @@ function PanelContent({
|
|
|
6609
6997
|
transition: "color 150ms"
|
|
6610
6998
|
},
|
|
6611
6999
|
title: "Pop out",
|
|
6612
|
-
children: /* @__PURE__ */ (0,
|
|
6613
|
-
/* @__PURE__ */ (0,
|
|
6614
|
-
/* @__PURE__ */ (0,
|
|
7000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
7001
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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" }),
|
|
7002
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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" })
|
|
6615
7003
|
] })
|
|
6616
7004
|
}
|
|
6617
7005
|
),
|
|
6618
|
-
isLoading && /* @__PURE__ */ (0,
|
|
7006
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6619
7007
|
"div",
|
|
6620
7008
|
{
|
|
6621
7009
|
style: {
|
|
@@ -6627,7 +7015,7 @@ function PanelContent({
|
|
|
6627
7015
|
}
|
|
6628
7016
|
}
|
|
6629
7017
|
),
|
|
6630
|
-
onClose && /* @__PURE__ */ (0,
|
|
7018
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6631
7019
|
"button",
|
|
6632
7020
|
{
|
|
6633
7021
|
onClick: (e) => {
|
|
@@ -6646,11 +7034,11 @@ function PanelContent({
|
|
|
6646
7034
|
transition: "color 150ms"
|
|
6647
7035
|
},
|
|
6648
7036
|
title: "Close",
|
|
6649
|
-
children: /* @__PURE__ */ (0,
|
|
7037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.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" }) })
|
|
6650
7038
|
}
|
|
6651
7039
|
)
|
|
6652
7040
|
] }),
|
|
6653
|
-
/* @__PURE__ */ (0,
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6654
7042
|
"div",
|
|
6655
7043
|
{
|
|
6656
7044
|
style: {
|
|
@@ -6669,8 +7057,8 @@ function PanelContent({
|
|
|
6669
7057
|
]
|
|
6670
7058
|
}
|
|
6671
7059
|
),
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
7060
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
|
|
7061
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6674
7062
|
"div",
|
|
6675
7063
|
{
|
|
6676
7064
|
style: {
|
|
@@ -6686,8 +7074,8 @@ function PanelContent({
|
|
|
6686
7074
|
children: "Recommendations are generated by AI. Verify details before publishing."
|
|
6687
7075
|
}
|
|
6688
7076
|
),
|
|
6689
|
-
/* @__PURE__ */ (0,
|
|
6690
|
-
/* @__PURE__ */ (0,
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6691
7079
|
"div",
|
|
6692
7080
|
{
|
|
6693
7081
|
style: {
|
|
@@ -6698,7 +7086,7 @@ function PanelContent({
|
|
|
6698
7086
|
background: RECS_ZONE_BG
|
|
6699
7087
|
},
|
|
6700
7088
|
children: [
|
|
6701
|
-
/* @__PURE__ */ (0,
|
|
7089
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6702
7090
|
KeywordPanel,
|
|
6703
7091
|
{
|
|
6704
7092
|
text,
|
|
@@ -6714,7 +7102,7 @@ function PanelContent({
|
|
|
6714
7102
|
},
|
|
6715
7103
|
documentId || "default"
|
|
6716
7104
|
) }),
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
7105
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6718
7106
|
SummaryTab,
|
|
6719
7107
|
{
|
|
6720
7108
|
text,
|
|
@@ -6730,7 +7118,7 @@ function PanelContent({
|
|
|
6730
7118
|
onItemClick: summaryOps.onItemClick
|
|
6731
7119
|
}
|
|
6732
7120
|
) }),
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
7121
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6734
7122
|
AEOTab,
|
|
6735
7123
|
{
|
|
6736
7124
|
text,
|
|
@@ -6746,7 +7134,7 @@ function PanelContent({
|
|
|
6746
7134
|
loadContentSuggestions: aeoOps.loadContentSuggestions
|
|
6747
7135
|
}
|
|
6748
7136
|
) }),
|
|
6749
|
-
/* @__PURE__ */ (0,
|
|
7137
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6750
7138
|
LinkingTab,
|
|
6751
7139
|
{
|
|
6752
7140
|
analysis: keywordAnalysisState.analysis,
|
|
@@ -6762,8 +7150,8 @@ function PanelContent({
|
|
|
6762
7150
|
documentType
|
|
6763
7151
|
}
|
|
6764
7152
|
) }),
|
|
6765
|
-
/* @__PURE__ */ (0,
|
|
6766
|
-
/* @__PURE__ */ (0,
|
|
7153
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
|
|
7154
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6767
7155
|
TechnicalTab,
|
|
6768
7156
|
{
|
|
6769
7157
|
text,
|
|
@@ -6781,7 +7169,7 @@ function PanelContent({
|
|
|
6781
7169
|
]
|
|
6782
7170
|
}
|
|
6783
7171
|
),
|
|
6784
|
-
chatOpen && /* @__PURE__ */ (0,
|
|
7172
|
+
chatOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6785
7173
|
"div",
|
|
6786
7174
|
{
|
|
6787
7175
|
onMouseDown,
|
|
@@ -6794,10 +7182,10 @@ function PanelContent({
|
|
|
6794
7182
|
justifyContent: "center",
|
|
6795
7183
|
flexShrink: 0
|
|
6796
7184
|
},
|
|
6797
|
-
children: /* @__PURE__ */ (0,
|
|
7185
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
|
|
6798
7186
|
}
|
|
6799
7187
|
),
|
|
6800
|
-
/* @__PURE__ */ (0,
|
|
7188
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6801
7189
|
"div",
|
|
6802
7190
|
{
|
|
6803
7191
|
style: {
|
|
@@ -6810,7 +7198,7 @@ function PanelContent({
|
|
|
6810
7198
|
background: CHAT_ZONE_BG
|
|
6811
7199
|
},
|
|
6812
7200
|
children: [
|
|
6813
|
-
/* @__PURE__ */ (0,
|
|
7201
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6814
7202
|
"button",
|
|
6815
7203
|
{
|
|
6816
7204
|
onClick: () => onChatOpenChange(!chatOpen),
|
|
@@ -6831,7 +7219,7 @@ function PanelContent({
|
|
|
6831
7219
|
flexShrink: 0
|
|
6832
7220
|
},
|
|
6833
7221
|
children: [
|
|
6834
|
-
/* @__PURE__ */ (0,
|
|
7222
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6835
7223
|
"span",
|
|
6836
7224
|
{
|
|
6837
7225
|
style: {
|
|
@@ -6844,7 +7232,7 @@ function PanelContent({
|
|
|
6844
7232
|
children: "Chat"
|
|
6845
7233
|
}
|
|
6846
7234
|
),
|
|
6847
|
-
/* @__PURE__ */ (0,
|
|
7235
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6848
7236
|
"svg",
|
|
6849
7237
|
{
|
|
6850
7238
|
width: "12",
|
|
@@ -6852,7 +7240,7 @@ function PanelContent({
|
|
|
6852
7240
|
viewBox: "0 0 20 20",
|
|
6853
7241
|
fill: "rgba(0,0,0,0.55)",
|
|
6854
7242
|
style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
|
|
6855
|
-
children: /* @__PURE__ */ (0,
|
|
7243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6856
7244
|
"path",
|
|
6857
7245
|
{
|
|
6858
7246
|
fillRule: "evenodd",
|
|
@@ -6865,7 +7253,7 @@ function PanelContent({
|
|
|
6865
7253
|
]
|
|
6866
7254
|
}
|
|
6867
7255
|
),
|
|
6868
|
-
/* @__PURE__ */ (0,
|
|
7256
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6869
7257
|
"div",
|
|
6870
7258
|
{
|
|
6871
7259
|
style: {
|
|
@@ -6875,7 +7263,7 @@ function PanelContent({
|
|
|
6875
7263
|
flexDirection: "column",
|
|
6876
7264
|
minHeight: 0
|
|
6877
7265
|
},
|
|
6878
|
-
children: /* @__PURE__ */ (0,
|
|
7266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6879
7267
|
ChatPanel,
|
|
6880
7268
|
{
|
|
6881
7269
|
messages: chatState.messages,
|
|
@@ -6906,21 +7294,21 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6906
7294
|
"seo-copilot-ui-float-size",
|
|
6907
7295
|
{ width: 380, height: typeof window !== "undefined" ? Math.round(window.innerHeight * 0.8) : 600 }
|
|
6908
7296
|
);
|
|
6909
|
-
const dragOffset = (0,
|
|
6910
|
-
const resizeStart = (0,
|
|
6911
|
-
const activeDragCleanupRef = (0,
|
|
6912
|
-
const activeResizeCleanupRef = (0,
|
|
7297
|
+
const dragOffset = (0, import_react19.useRef)(null);
|
|
7298
|
+
const resizeStart = (0, import_react19.useRef)(null);
|
|
7299
|
+
const activeDragCleanupRef = (0, import_react19.useRef)(null);
|
|
7300
|
+
const activeResizeCleanupRef = (0, import_react19.useRef)(null);
|
|
6913
7301
|
const { text, isLoading: docLoading, documentFields, documentId, documentType } = useDocumentContent();
|
|
6914
7302
|
const { apiUrl } = useConfig();
|
|
6915
|
-
const workspace = (0,
|
|
7303
|
+
const workspace = (0, import_sanity4.useWorkspace)();
|
|
6916
7304
|
const effectivePublication = config.publication || workspace?.dataset;
|
|
6917
|
-
const sanityBaseUrl = (0,
|
|
7305
|
+
const sanityBaseUrl = (0, import_react19.useMemo)(() => {
|
|
6918
7306
|
if (typeof window === "undefined") return void 0;
|
|
6919
7307
|
const basePath = (workspace?.basePath || "/").replace(/\/+$/, "");
|
|
6920
7308
|
return `${window.location.origin}${basePath}`;
|
|
6921
7309
|
}, [workspace?.basePath]);
|
|
6922
7310
|
const seedCacheKey = documentId ? `seo-copilot-cache-${documentId}` : "seo-copilot-cache-v2";
|
|
6923
|
-
const loadSeedsFromCache = (0,
|
|
7311
|
+
const loadSeedsFromCache = (0, import_react19.useCallback)(() => {
|
|
6924
7312
|
try {
|
|
6925
7313
|
const c = localStorage.getItem(seedCacheKey);
|
|
6926
7314
|
if (c) return JSON.parse(c).seeds || [];
|
|
@@ -6928,8 +7316,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6928
7316
|
}
|
|
6929
7317
|
return [];
|
|
6930
7318
|
}, [seedCacheKey]);
|
|
6931
|
-
const [seedKeywords, setSeedKeywordsRaw] = (0,
|
|
6932
|
-
const setSeedKeywords = (0,
|
|
7319
|
+
const [seedKeywords, setSeedKeywordsRaw] = (0, import_react19.useState)(loadSeedsFromCache);
|
|
7320
|
+
const setSeedKeywords = (0, import_react19.useCallback)(
|
|
6933
7321
|
(seeds) => {
|
|
6934
7322
|
setSeedKeywordsRaw(seeds);
|
|
6935
7323
|
try {
|
|
@@ -6944,25 +7332,25 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6944
7332
|
const [selectedPrimary, setSelectedPrimary] = usePersistentState(selectedPrimaryKey, void 0);
|
|
6945
7333
|
const selectedSecondaryKey = documentId ? `seo-copilot-secondary-${documentId}` : "seo-copilot-secondary-default";
|
|
6946
7334
|
const [selectedSecondary, setSelectedSecondary] = usePersistentState(selectedSecondaryKey, "");
|
|
6947
|
-
const seedsInitializedRef = (0,
|
|
6948
|
-
(0,
|
|
7335
|
+
const seedsInitializedRef = (0, import_react19.useRef)(false);
|
|
7336
|
+
(0, import_react19.useEffect)(() => {
|
|
6949
7337
|
if (!seedsInitializedRef.current) {
|
|
6950
7338
|
seedsInitializedRef.current = true;
|
|
6951
7339
|
return;
|
|
6952
7340
|
}
|
|
6953
7341
|
setSeedKeywordsRaw(loadSeedsFromCache());
|
|
6954
7342
|
}, [documentId, loadSeedsFromCache]);
|
|
6955
|
-
const [activeTab, setActiveTab] = (0,
|
|
7343
|
+
const [activeTab, setActiveTab] = (0, import_react19.useState)("keywords");
|
|
6956
7344
|
const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
|
|
6957
7345
|
const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
|
|
6958
7346
|
const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId, selectedSecondary);
|
|
6959
7347
|
const effectivePrimary = selectedPrimary || keywordAnalysisState.analysis?.primaryKeyword?.term || "";
|
|
6960
|
-
(0,
|
|
7348
|
+
(0, import_react19.useEffect)(() => {
|
|
6961
7349
|
if (selectedSecondary && effectivePrimary && selectedSecondary.toLowerCase() === effectivePrimary.toLowerCase()) {
|
|
6962
7350
|
setSelectedSecondary("");
|
|
6963
7351
|
}
|
|
6964
7352
|
}, [effectivePrimary, selectedSecondary, setSelectedSecondary]);
|
|
6965
|
-
const keywordPanelData = (0,
|
|
7353
|
+
const keywordPanelData = (0, import_react19.useMemo)(() => {
|
|
6966
7354
|
const analysis = keywordAnalysisState.analysis;
|
|
6967
7355
|
if (!analysis) return void 0;
|
|
6968
7356
|
return {
|
|
@@ -6980,12 +7368,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6980
7368
|
const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
|
|
6981
7369
|
const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
|
|
6982
7370
|
const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
|
|
6983
|
-
const [isCSLoading, setIsCSLoading] = (0,
|
|
6984
|
-
const [csError, setCsError] = (0,
|
|
6985
|
-
const aeoOpVersionRef = (0,
|
|
6986
|
-
const csAbortRef = (0,
|
|
6987
|
-
const didInitAeoRef = (0,
|
|
6988
|
-
(0,
|
|
7371
|
+
const [isCSLoading, setIsCSLoading] = (0, import_react19.useState)(false);
|
|
7372
|
+
const [csError, setCsError] = (0, import_react19.useState)(null);
|
|
7373
|
+
const aeoOpVersionRef = (0, import_react19.useRef)(0);
|
|
7374
|
+
const csAbortRef = (0, import_react19.useRef)(null);
|
|
7375
|
+
const didInitAeoRef = (0, import_react19.useRef)(false);
|
|
7376
|
+
(0, import_react19.useEffect)(() => {
|
|
6989
7377
|
if (!didInitAeoRef.current) {
|
|
6990
7378
|
didInitAeoRef.current = true;
|
|
6991
7379
|
return;
|
|
@@ -6994,7 +7382,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
6994
7382
|
setIsCSLoading(false);
|
|
6995
7383
|
setCsError(null);
|
|
6996
7384
|
}, [documentId]);
|
|
6997
|
-
const loadContentSuggestions = (0,
|
|
7385
|
+
const loadContentSuggestions = (0, import_react19.useCallback)(async () => {
|
|
6998
7386
|
const myVersion = aeoOpVersionRef.current;
|
|
6999
7387
|
setIsCSLoading(true);
|
|
7000
7388
|
setCsError(null);
|
|
@@ -7019,14 +7407,14 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7019
7407
|
}, [apiUrl, text, effectivePrimary, effectivePublication]);
|
|
7020
7408
|
const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
|
|
7021
7409
|
const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
|
|
7022
|
-
const [isLinkingLoading, setIsLinkingLoading] = (0,
|
|
7023
|
-
const [linkingError, setLinkingError] = (0,
|
|
7024
|
-
const [linkingFetchedText, setLinkingFetchedText] = (0,
|
|
7025
|
-
const linkingVersionRef = (0,
|
|
7026
|
-
const linkingAbortRef = (0,
|
|
7027
|
-
const didInitLinkingRef = (0,
|
|
7028
|
-
const lastLinkingFetchKey = (0,
|
|
7029
|
-
(0,
|
|
7410
|
+
const [isLinkingLoading, setIsLinkingLoading] = (0, import_react19.useState)(false);
|
|
7411
|
+
const [linkingError, setLinkingError] = (0, import_react19.useState)(null);
|
|
7412
|
+
const [linkingFetchedText, setLinkingFetchedText] = (0, import_react19.useState)("");
|
|
7413
|
+
const linkingVersionRef = (0, import_react19.useRef)(0);
|
|
7414
|
+
const linkingAbortRef = (0, import_react19.useRef)(null);
|
|
7415
|
+
const didInitLinkingRef = (0, import_react19.useRef)(false);
|
|
7416
|
+
const lastLinkingFetchKey = (0, import_react19.useRef)("");
|
|
7417
|
+
(0, import_react19.useEffect)(() => {
|
|
7030
7418
|
if (!didInitLinkingRef.current) {
|
|
7031
7419
|
didInitLinkingRef.current = true;
|
|
7032
7420
|
return;
|
|
@@ -7036,12 +7424,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7036
7424
|
setLinkingError(null);
|
|
7037
7425
|
lastLinkingFetchKey.current = "";
|
|
7038
7426
|
}, [documentId]);
|
|
7039
|
-
const supportingKeywordsForLinking = (0,
|
|
7427
|
+
const supportingKeywordsForLinking = (0, import_react19.useMemo)(() => {
|
|
7040
7428
|
const base = (keywordAnalysisState.analysis?.supportingKeywords || []).map((kw) => kw.term).filter(Boolean);
|
|
7041
7429
|
const merged = selectedSecondary ? [selectedSecondary, ...base.filter((t) => t.toLowerCase() !== selectedSecondary.toLowerCase())] : base;
|
|
7042
7430
|
return merged.slice(0, 5);
|
|
7043
7431
|
}, [keywordAnalysisState.analysis, selectedSecondary]);
|
|
7044
|
-
const refreshLinkingSuggestions = (0,
|
|
7432
|
+
const refreshLinkingSuggestions = (0, import_react19.useCallback)(async () => {
|
|
7045
7433
|
if (!text || text.trim().length < 50) return;
|
|
7046
7434
|
if (!effectivePrimary) return;
|
|
7047
7435
|
const myVersion = linkingVersionRef.current;
|
|
@@ -7071,12 +7459,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7071
7459
|
if (linkingVersionRef.current !== myVersion) return;
|
|
7072
7460
|
setIsLinkingLoading(false);
|
|
7073
7461
|
}, [apiUrl, text, effectivePrimary, supportingKeywordsForLinking, documentId, effectivePublication]);
|
|
7074
|
-
const isLinkingStale = (0,
|
|
7462
|
+
const isLinkingStale = (0, import_react19.useMemo)(() => {
|
|
7075
7463
|
if (!linkingFetchedText || linkingSuggestions.length === 0) return false;
|
|
7076
7464
|
if (Math.abs(text.length - linkingFetchedText.length) > 150) return true;
|
|
7077
7465
|
return text.slice(0, 300) !== linkingFetchedText.slice(0, 300);
|
|
7078
7466
|
}, [text, linkingFetchedText, linkingSuggestions.length]);
|
|
7079
|
-
(0,
|
|
7467
|
+
(0, import_react19.useEffect)(() => {
|
|
7080
7468
|
if (!text || text.trim().length < 50 || !effectivePrimary) return;
|
|
7081
7469
|
const fetchKey = `${documentId || "_"}|${effectivePrimary}|${supportingKeywordsForLinking.join(",")}`;
|
|
7082
7470
|
if (fetchKey === lastLinkingFetchKey.current) return;
|
|
@@ -7090,11 +7478,11 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7090
7478
|
const linkCheckKey = documentId ? `seo-copilot-link-check-${documentId}` : "seo-copilot-link-check-default";
|
|
7091
7479
|
const [linkCheckResults, setLinkCheckResults] = usePersistentState(linkCheckKey, []);
|
|
7092
7480
|
const [hasRunLinkCheck, setHasRunLinkCheck] = usePersistentState(`${linkCheckKey}-ran`, false);
|
|
7093
|
-
const [isLinkCheckLoading, setIsLinkCheckLoading] = (0,
|
|
7094
|
-
const [linkCheckError, setLinkCheckError] = (0,
|
|
7095
|
-
const linkCheckVersionRef = (0,
|
|
7096
|
-
const didInitLinkCheckRef = (0,
|
|
7097
|
-
(0,
|
|
7481
|
+
const [isLinkCheckLoading, setIsLinkCheckLoading] = (0, import_react19.useState)(false);
|
|
7482
|
+
const [linkCheckError, setLinkCheckError] = (0, import_react19.useState)(null);
|
|
7483
|
+
const linkCheckVersionRef = (0, import_react19.useRef)(0);
|
|
7484
|
+
const didInitLinkCheckRef = (0, import_react19.useRef)(false);
|
|
7485
|
+
(0, import_react19.useEffect)(() => {
|
|
7098
7486
|
if (!didInitLinkCheckRef.current) {
|
|
7099
7487
|
didInitLinkCheckRef.current = true;
|
|
7100
7488
|
return;
|
|
@@ -7103,7 +7491,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7103
7491
|
setIsLinkCheckLoading(false);
|
|
7104
7492
|
setLinkCheckError(null);
|
|
7105
7493
|
}, [documentId]);
|
|
7106
|
-
const runLinkCheck = (0,
|
|
7494
|
+
const runLinkCheck = (0, import_react19.useCallback)(async () => {
|
|
7107
7495
|
const urls = documentFields?.bodyLinks || [];
|
|
7108
7496
|
if (urls.length === 0) {
|
|
7109
7497
|
setHasRunLinkCheck(true);
|
|
@@ -7129,7 +7517,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7129
7517
|
if (linkCheckVersionRef.current !== myVersion) return;
|
|
7130
7518
|
setIsLinkCheckLoading(false);
|
|
7131
7519
|
}, [apiUrl, documentFields?.bodyLinks, setHasRunLinkCheck, setLinkCheckResults]);
|
|
7132
|
-
(0,
|
|
7520
|
+
(0, import_react19.useEffect)(() => {
|
|
7133
7521
|
return () => {
|
|
7134
7522
|
activeDragCleanupRef.current?.();
|
|
7135
7523
|
activeResizeCleanupRef.current?.();
|
|
@@ -7143,10 +7531,10 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7143
7531
|
if (text && text.trim().length >= 50 && effectivePrimary) refreshLinkingSuggestions();
|
|
7144
7532
|
if ((documentFields?.bodyLinks || []).length > 0) runLinkCheck();
|
|
7145
7533
|
};
|
|
7146
|
-
const runAllRef = (0,
|
|
7534
|
+
const runAllRef = (0, import_react19.useRef)(runAllAnalyses);
|
|
7147
7535
|
runAllRef.current = runAllAnalyses;
|
|
7148
|
-
const secAutoRunRef = (0,
|
|
7149
|
-
(0,
|
|
7536
|
+
const secAutoRunRef = (0, import_react19.useRef)({ doc: documentId, sec: selectedSecondary, init: true });
|
|
7537
|
+
(0, import_react19.useEffect)(() => {
|
|
7150
7538
|
const prev = secAutoRunRef.current;
|
|
7151
7539
|
const docChanged = prev.doc !== documentId;
|
|
7152
7540
|
const secChanged = prev.sec !== selectedSecondary;
|
|
@@ -7155,7 +7543,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7155
7543
|
const t = setTimeout(() => runAllRef.current(), 1500);
|
|
7156
7544
|
return () => clearTimeout(t);
|
|
7157
7545
|
}, [selectedSecondary, documentId]);
|
|
7158
|
-
const handleDragStart = (0,
|
|
7546
|
+
const handleDragStart = (0, import_react19.useCallback)(
|
|
7159
7547
|
(e) => {
|
|
7160
7548
|
dragOffset.current = {
|
|
7161
7549
|
dx: e.clientX - floatPos.x,
|
|
@@ -7189,7 +7577,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7189
7577
|
},
|
|
7190
7578
|
[floatPos]
|
|
7191
7579
|
);
|
|
7192
|
-
const handleResizeStart = (0,
|
|
7580
|
+
const handleResizeStart = (0, import_react19.useCallback)(
|
|
7193
7581
|
(e) => {
|
|
7194
7582
|
e.preventDefault();
|
|
7195
7583
|
e.stopPropagation();
|
|
@@ -7221,7 +7609,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7221
7609
|
},
|
|
7222
7610
|
[floatSize]
|
|
7223
7611
|
);
|
|
7224
|
-
const panelContent = /* @__PURE__ */ (0,
|
|
7612
|
+
const panelContent = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7225
7613
|
PanelContent,
|
|
7226
7614
|
{
|
|
7227
7615
|
initialPublication: effectivePublication,
|
|
@@ -7303,7 +7691,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7303
7691
|
}
|
|
7304
7692
|
}
|
|
7305
7693
|
);
|
|
7306
|
-
const floatingPanel = /* @__PURE__ */ (0,
|
|
7694
|
+
const floatingPanel = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7307
7695
|
"div",
|
|
7308
7696
|
{
|
|
7309
7697
|
style: {
|
|
@@ -7321,7 +7709,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7321
7709
|
},
|
|
7322
7710
|
children: [
|
|
7323
7711
|
panelContent,
|
|
7324
|
-
!isFullscreen && /* @__PURE__ */ (0,
|
|
7712
|
+
!isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7325
7713
|
"div",
|
|
7326
7714
|
{
|
|
7327
7715
|
onMouseDown: handleResizeStart,
|
|
@@ -7336,9 +7724,9 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7336
7724
|
alignItems: "center",
|
|
7337
7725
|
justifyContent: "center"
|
|
7338
7726
|
},
|
|
7339
|
-
children: /* @__PURE__ */ (0,
|
|
7340
|
-
/* @__PURE__ */ (0,
|
|
7341
|
-
/* @__PURE__ */ (0,
|
|
7727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
|
|
7728
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
7729
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
7342
7730
|
] })
|
|
7343
7731
|
}
|
|
7344
7732
|
)
|
|
@@ -7346,8 +7734,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7346
7734
|
}
|
|
7347
7735
|
);
|
|
7348
7736
|
if (isFloating) {
|
|
7349
|
-
return /* @__PURE__ */ (0,
|
|
7350
|
-
/* @__PURE__ */ (0,
|
|
7737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
7738
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7351
7739
|
"div",
|
|
7352
7740
|
{
|
|
7353
7741
|
style: {
|
|
@@ -7357,30 +7745,30 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7357
7745
|
alignItems: "center",
|
|
7358
7746
|
justifyContent: "center"
|
|
7359
7747
|
},
|
|
7360
|
-
children: /* @__PURE__ */ (0,
|
|
7748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
|
|
7361
7749
|
}
|
|
7362
7750
|
),
|
|
7363
7751
|
typeof document !== "undefined" && (0, import_react_dom.createPortal)(floatingPanel, document.body)
|
|
7364
7752
|
] });
|
|
7365
7753
|
}
|
|
7366
|
-
return /* @__PURE__ */ (0,
|
|
7754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
|
|
7367
7755
|
}
|
|
7368
7756
|
function SEOCopilotPanel({ config, onClose }) {
|
|
7369
|
-
return /* @__PURE__ */ (0,
|
|
7370
|
-
|
|
7757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7758
|
+
import_react19.Suspense,
|
|
7371
7759
|
{
|
|
7372
|
-
fallback: /* @__PURE__ */ (0,
|
|
7373
|
-
/* @__PURE__ */ (0,
|
|
7374
|
-
/* @__PURE__ */ (0,
|
|
7760
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
7761
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoadingBars, {}),
|
|
7762
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
|
|
7375
7763
|
] }),
|
|
7376
|
-
children: /* @__PURE__ */ (0,
|
|
7764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SEOCopilotInner, { config, onClose }) })
|
|
7377
7765
|
}
|
|
7378
7766
|
);
|
|
7379
7767
|
}
|
|
7380
7768
|
function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
7381
7769
|
const barWidth = size === "xs" ? 4 : 6;
|
|
7382
7770
|
const containerHeight = size === "xs" ? 10 : 14;
|
|
7383
|
-
return /* @__PURE__ */ (0,
|
|
7771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7384
7772
|
"div",
|
|
7385
7773
|
{
|
|
7386
7774
|
style: {
|
|
@@ -7397,11 +7785,11 @@ function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
|
7397
7785
|
|
|
7398
7786
|
// src/inspector.ts
|
|
7399
7787
|
function SEOIcon() {
|
|
7400
|
-
return (0,
|
|
7788
|
+
return (0, import_react20.createElement)(
|
|
7401
7789
|
"svg",
|
|
7402
7790
|
{ viewBox: "0 0 25 25", width: "1em", height: "1em", fill: "none" },
|
|
7403
|
-
(0,
|
|
7404
|
-
(0,
|
|
7791
|
+
(0, import_react20.createElement)("circle", { cx: "12.5", cy: "12.5", r: "11.5", fill: "#E6C01B" }),
|
|
7792
|
+
(0, import_react20.createElement)("text", {
|
|
7405
7793
|
x: "12.5",
|
|
7406
7794
|
y: "7.5",
|
|
7407
7795
|
textAnchor: "middle",
|
|
@@ -7411,7 +7799,7 @@ function SEOIcon() {
|
|
|
7411
7799
|
fontWeight: "900",
|
|
7412
7800
|
fontFamily: "Arial Black, Impact, sans-serif"
|
|
7413
7801
|
}, "S"),
|
|
7414
|
-
(0,
|
|
7802
|
+
(0, import_react20.createElement)("text", {
|
|
7415
7803
|
x: "12.5",
|
|
7416
7804
|
y: "12.8",
|
|
7417
7805
|
textAnchor: "middle",
|
|
@@ -7421,7 +7809,7 @@ function SEOIcon() {
|
|
|
7421
7809
|
fontWeight: "900",
|
|
7422
7810
|
fontFamily: "Arial Black, Impact, sans-serif"
|
|
7423
7811
|
}, "E"),
|
|
7424
|
-
(0,
|
|
7812
|
+
(0, import_react20.createElement)("text", {
|
|
7425
7813
|
x: "12.5",
|
|
7426
7814
|
y: "18",
|
|
7427
7815
|
textAnchor: "middle",
|
|
@@ -7449,13 +7837,13 @@ function seoCopilotInspector(config) {
|
|
|
7449
7837
|
tone: "default"
|
|
7450
7838
|
}),
|
|
7451
7839
|
component: function SEOCopilotInspector(props) {
|
|
7452
|
-
return (0,
|
|
7840
|
+
return (0, import_react20.createElement)(SEOCopilotPanel, { ...props, config });
|
|
7453
7841
|
}
|
|
7454
7842
|
};
|
|
7455
7843
|
}
|
|
7456
7844
|
|
|
7457
7845
|
// src/index.ts
|
|
7458
|
-
var seoCopilot = (0,
|
|
7846
|
+
var seoCopilot = (0, import_sanity5.definePlugin)((config) => ({
|
|
7459
7847
|
name: "seo-copilot",
|
|
7460
7848
|
document: {
|
|
7461
7849
|
inspectors: (prev) => {
|