sanity-plugin-seo-copilot 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -50
- package/dist/index.js +841 -782
- package/dist/index.mjs +763 -704
- package/package.json +62 -64
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/sanity.json +0 -3
- package/src/components/ChatPanel.tsx +0 -311
- package/src/components/ConfigContext.tsx +0 -22
- package/src/components/FeedbackButton.tsx +0 -218
- package/src/components/KeywordBadge.tsx +0 -50
- package/src/components/KeywordPanel.tsx +0 -1234
- package/src/components/OnboardingPopup.tsx +0 -108
- package/src/components/PlacementIndicators.tsx +0 -80
- package/src/components/ReportProblemButton.tsx +0 -212
- package/src/components/SEOCopilotPanel.tsx +0 -1287
- package/src/components/ScoreDonut.tsx +0 -158
- package/src/components/SeedKeywordInput.tsx +0 -128
- package/src/components/ShimmerLoader.tsx +0 -123
- package/src/components/TabBar.tsx +0 -373
- package/src/components/styles.ts +0 -158
- package/src/components/tabs/AEOTab.tsx +0 -585
- package/src/components/tabs/LinkingTab.tsx +0 -446
- package/src/components/tabs/MetaTab.tsx +0 -431
- package/src/components/tabs/SummaryTab.tsx +0 -405
- package/src/components/tabs/TechnicalTab.tsx +0 -933
- package/src/hooks/useDocumentContent.ts +0 -48
- package/src/hooks/useKeywordAnalysis.ts +0 -292
- package/src/hooks/useSEOChat.ts +0 -254
- package/src/index.ts +0 -18
- package/src/inspector.ts +0 -58
- package/src/lib/api.ts +0 -262
- package/src/lib/apiKey.ts +0 -30
- package/src/lib/documentExtract.ts +0 -422
- package/src/lib/geoAnalysis.ts +0 -122
- package/src/lib/persistence.ts +0 -69
- package/src/lib/scoring.ts +0 -197
- package/src/lib/summary.ts +0 -645
- package/src/lib/types.ts +0 -212
- package/src/lib/utils.ts +0 -35
- package/v2-incompatible.js +0 -10
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_sanity4 = require("sanity");
|
|
37
37
|
|
|
38
38
|
// src/inspector.ts
|
|
39
|
-
var
|
|
39
|
+
var import_react21 = require("react");
|
|
40
40
|
|
|
41
41
|
// src/components/SEOCopilotPanel.tsx
|
|
42
|
-
var
|
|
43
|
-
var
|
|
42
|
+
var import_react20 = require("react");
|
|
43
|
+
var import_sanity3 = require("sanity");
|
|
44
44
|
var import_react_dom = require("react-dom");
|
|
45
45
|
|
|
46
46
|
// src/hooks/useDocumentContent.ts
|
|
@@ -500,19 +500,6 @@ async function lookupKeywords(apiUrl, keywords, signal) {
|
|
|
500
500
|
}
|
|
501
501
|
return response.json();
|
|
502
502
|
}
|
|
503
|
-
async function loadChatHistory(apiUrl, userId, documentId) {
|
|
504
|
-
try {
|
|
505
|
-
const res = await fetch(
|
|
506
|
-
`${apiUrl}/api/seo-copilot/chat-history?userId=${encodeURIComponent(userId)}&documentId=${encodeURIComponent(documentId)}`,
|
|
507
|
-
{ headers: authHeaders() }
|
|
508
|
-
);
|
|
509
|
-
if (!res.ok) return [];
|
|
510
|
-
const data = await res.json();
|
|
511
|
-
return data.messages || [];
|
|
512
|
-
} catch {
|
|
513
|
-
return [];
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
503
|
async function fetchContentSuggestions(apiUrl, content, primaryKeyword, publication, signal) {
|
|
517
504
|
const empty = { keyTakeaways: [], infographicOpportunities: [], bulletListItems: [] };
|
|
518
505
|
try {
|
|
@@ -567,16 +554,6 @@ async function checkLinks(apiUrl, urls) {
|
|
|
567
554
|
return [];
|
|
568
555
|
}
|
|
569
556
|
}
|
|
570
|
-
async function saveChatHistory(apiUrl, userId, documentId, messages, publication) {
|
|
571
|
-
try {
|
|
572
|
-
await fetch(`${apiUrl}/api/seo-copilot/chat-history`, {
|
|
573
|
-
method: "POST",
|
|
574
|
-
headers: jsonHeaders(),
|
|
575
|
-
body: JSON.stringify({ userId, documentId, messages, publication })
|
|
576
|
-
});
|
|
577
|
-
} catch {
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
557
|
|
|
581
558
|
// src/hooks/useKeywordAnalysis.ts
|
|
582
559
|
function mergeVolumes(analysis, volumeMap) {
|
|
@@ -808,21 +785,6 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
808
785
|
|
|
809
786
|
// src/hooks/useSEOChat.ts
|
|
810
787
|
var import_react3 = require("react");
|
|
811
|
-
var import_sanity = require("sanity");
|
|
812
|
-
function getLocalUserId() {
|
|
813
|
-
if (typeof window === "undefined") return "anonymous";
|
|
814
|
-
const key = "seo-copilot-user-id";
|
|
815
|
-
try {
|
|
816
|
-
let id = localStorage.getItem(key);
|
|
817
|
-
if (!id) {
|
|
818
|
-
id = `user-${Math.random().toString(36).slice(2)}-${Date.now()}`;
|
|
819
|
-
localStorage.setItem(key, id);
|
|
820
|
-
}
|
|
821
|
-
return id;
|
|
822
|
-
} catch {
|
|
823
|
-
return "anonymous";
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
788
|
function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documentId) {
|
|
827
789
|
const chatCacheKey = documentId ? `seo-copilot-chat-${documentId}` : "seo-copilot-chat-default";
|
|
828
790
|
const loadCachedMessages = (0, import_react3.useCallback)(() => {
|
|
@@ -839,14 +801,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
839
801
|
setMessagesRaw(msgs);
|
|
840
802
|
}, []);
|
|
841
803
|
const [isStreaming, setIsStreaming] = (0, import_react3.useState)(false);
|
|
842
|
-
const [historyLoaded, setHistoryLoaded] = (0, import_react3.useState)(false);
|
|
843
|
-
const sanityUser = (0, import_sanity.useCurrentUser)();
|
|
844
|
-
const userId = (0, import_react3.useRef)(sanityUser?.id || getLocalUserId());
|
|
845
|
-
(0, import_react3.useEffect)(() => {
|
|
846
|
-
if (sanityUser?.id && userId.current !== sanityUser.id) {
|
|
847
|
-
userId.current = sanityUser.id;
|
|
848
|
-
}
|
|
849
|
-
}, [sanityUser?.id]);
|
|
850
804
|
(0, import_react3.useEffect)(() => {
|
|
851
805
|
messagesRef.current = messages;
|
|
852
806
|
}, [messages]);
|
|
@@ -863,10 +817,8 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
863
817
|
(0, import_react3.useEffect)(() => {
|
|
864
818
|
return () => {
|
|
865
819
|
streamAbortRef.current?.abort();
|
|
866
|
-
if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
|
|
867
820
|
};
|
|
868
821
|
}, []);
|
|
869
|
-
const saveTimerRef = (0, import_react3.useRef)(null);
|
|
870
822
|
const opVersionRef = (0, import_react3.useRef)(0);
|
|
871
823
|
const didInitRef = (0, import_react3.useRef)(false);
|
|
872
824
|
(0, import_react3.useEffect)(() => {
|
|
@@ -879,34 +831,7 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
879
831
|
streamAbortRef.current = null;
|
|
880
832
|
setMessagesRaw(loadCachedMessages());
|
|
881
833
|
setIsStreaming(false);
|
|
882
|
-
setHistoryLoaded(false);
|
|
883
|
-
if (saveTimerRef.current) {
|
|
884
|
-
clearTimeout(saveTimerRef.current);
|
|
885
|
-
saveTimerRef.current = null;
|
|
886
|
-
}
|
|
887
834
|
}, [documentId, loadCachedMessages]);
|
|
888
|
-
(0, import_react3.useEffect)(() => {
|
|
889
|
-
if (!documentId || historyLoaded) return;
|
|
890
|
-
const myVersion = opVersionRef.current;
|
|
891
|
-
let cancelled = false;
|
|
892
|
-
loadChatHistory(apiUrl, userId.current, documentId).then((loaded) => {
|
|
893
|
-
if (cancelled || opVersionRef.current !== myVersion) return;
|
|
894
|
-
if (loaded.length > 0) {
|
|
895
|
-
setMessages((current) => current.length === 0 ? loaded : current);
|
|
896
|
-
}
|
|
897
|
-
setHistoryLoaded(true);
|
|
898
|
-
});
|
|
899
|
-
return () => {
|
|
900
|
-
cancelled = true;
|
|
901
|
-
};
|
|
902
|
-
}, [apiUrl, documentId, historyLoaded]);
|
|
903
|
-
const scheduleSave = (0, import_react3.useCallback)((msgs) => {
|
|
904
|
-
if (!documentId) return;
|
|
905
|
-
if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
|
|
906
|
-
saveTimerRef.current = setTimeout(() => {
|
|
907
|
-
saveChatHistory(apiUrl, userId.current, documentId, msgs, publication);
|
|
908
|
-
}, 800);
|
|
909
|
-
}, [apiUrl, documentId, publication]);
|
|
910
835
|
const sendMessage = (0, import_react3.useCallback)(
|
|
911
836
|
async (text) => {
|
|
912
837
|
const myVersion = opVersionRef.current;
|
|
@@ -975,13 +900,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
975
900
|
}
|
|
976
901
|
}
|
|
977
902
|
}
|
|
978
|
-
if (opVersionRef.current === myVersion) {
|
|
979
|
-
const finalMessages = [
|
|
980
|
-
...updatedMessages,
|
|
981
|
-
{ role: "assistant", content: assistantContent }
|
|
982
|
-
];
|
|
983
|
-
scheduleSave(finalMessages);
|
|
984
|
-
}
|
|
985
903
|
} catch (err) {
|
|
986
904
|
if (err instanceof Error && err.name === "AbortError") {
|
|
987
905
|
setIsStreaming(false);
|
|
@@ -999,14 +917,11 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
999
917
|
}
|
|
1000
918
|
if (opVersionRef.current === myVersion) setIsStreaming(false);
|
|
1001
919
|
},
|
|
1002
|
-
[apiUrl, documentText, publication, keywordPanelData
|
|
920
|
+
[apiUrl, documentText, publication, keywordPanelData]
|
|
1003
921
|
);
|
|
1004
922
|
const clearChat = (0, import_react3.useCallback)(() => {
|
|
1005
923
|
setMessages([]);
|
|
1006
|
-
|
|
1007
|
-
saveChatHistory(apiUrl, userId.current, documentId, [], publication);
|
|
1008
|
-
}
|
|
1009
|
-
}, [apiUrl, documentId, publication]);
|
|
924
|
+
}, [setMessages]);
|
|
1010
925
|
return { messages, isStreaming, sendMessage, clearChat };
|
|
1011
926
|
}
|
|
1012
927
|
|
|
@@ -1059,7 +974,7 @@ function IndicatorDot({ letter, active, tooltip }) {
|
|
|
1059
974
|
lineHeight: 1,
|
|
1060
975
|
cursor: "default",
|
|
1061
976
|
flexShrink: 0,
|
|
1062
|
-
// Inactive = a solid
|
|
977
|
+
// Inactive = a solid white disc (was a near-invisible faint-grey ring on
|
|
1063
978
|
// transparent) so each indicator reads clearly on the warm panel; a light
|
|
1064
979
|
// edge + soft lift keep it defined even on a white card. Active = green.
|
|
1065
980
|
background: active ? "#16a34a" : "#ffffff",
|
|
@@ -1344,20 +1259,24 @@ function SeedKeywordInput({ seeds, onSeedsChange }) {
|
|
|
1344
1259
|
|
|
1345
1260
|
// src/components/FeedbackButton.tsx
|
|
1346
1261
|
var import_react7 = require("react");
|
|
1347
|
-
var
|
|
1262
|
+
var import_sanity = require("sanity");
|
|
1348
1263
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1349
1264
|
function FeedbackButton({ suggestionType, suggestionText, documentId, publication }) {
|
|
1350
1265
|
const { apiUrl } = useConfig();
|
|
1351
|
-
const sanityUser = (0,
|
|
1266
|
+
const sanityUser = (0, import_sanity.useCurrentUser)();
|
|
1352
1267
|
const [vote, setVote] = (0, import_react7.useState)(null);
|
|
1353
1268
|
const [showReasonPopup, setShowReasonPopup] = (0, import_react7.useState)(false);
|
|
1354
1269
|
const [reason, setReason] = (0, import_react7.useState)("");
|
|
1355
1270
|
const [submitted, setSubmitted] = (0, import_react7.useState)(false);
|
|
1271
|
+
const [failed, setFailed] = (0, import_react7.useState)(false);
|
|
1356
1272
|
const popupRef = (0, import_react7.useRef)(null);
|
|
1357
1273
|
const inputRef = (0, import_react7.useRef)(null);
|
|
1358
1274
|
const submitTimerRef = (0, import_react7.useRef)(null);
|
|
1275
|
+
const downVoteUnsentRef = (0, import_react7.useRef)(false);
|
|
1276
|
+
const mounted = (0, import_react7.useRef)(true);
|
|
1359
1277
|
(0, import_react7.useEffect)(() => {
|
|
1360
1278
|
return () => {
|
|
1279
|
+
mounted.current = false;
|
|
1361
1280
|
if (submitTimerRef.current) clearTimeout(submitTimerRef.current);
|
|
1362
1281
|
};
|
|
1363
1282
|
}, []);
|
|
@@ -1366,6 +1285,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1366
1285
|
const handler = (e) => {
|
|
1367
1286
|
if (popupRef.current && !popupRef.current.contains(e.target)) {
|
|
1368
1287
|
setShowReasonPopup(false);
|
|
1288
|
+
if (downVoteUnsentRef.current) setVote(null);
|
|
1369
1289
|
}
|
|
1370
1290
|
};
|
|
1371
1291
|
document.addEventListener("mousedown", handler);
|
|
@@ -1376,56 +1296,69 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1376
1296
|
setTimeout(() => inputRef.current?.focus(), 50);
|
|
1377
1297
|
}
|
|
1378
1298
|
}, [showReasonPopup]);
|
|
1299
|
+
const send = async (type, text, v) => {
|
|
1300
|
+
try {
|
|
1301
|
+
await submitFeedback(apiUrl, {
|
|
1302
|
+
suggestion_type: type,
|
|
1303
|
+
suggestion_text: text,
|
|
1304
|
+
vote: v,
|
|
1305
|
+
document_id: documentId,
|
|
1306
|
+
publication,
|
|
1307
|
+
user_id: sanityUser?.id
|
|
1308
|
+
});
|
|
1309
|
+
return true;
|
|
1310
|
+
} catch (e) {
|
|
1311
|
+
console.error("[SEO Copilot] failed to send feedback:", e);
|
|
1312
|
+
return false;
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1379
1315
|
const handleVote = async (v) => {
|
|
1316
|
+
setFailed(false);
|
|
1380
1317
|
if (v === "down" && vote !== "down") {
|
|
1381
1318
|
setVote("down");
|
|
1382
1319
|
setShowReasonPopup(true);
|
|
1383
1320
|
setSubmitted(false);
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
vote: "down",
|
|
1389
|
-
document_id: documentId,
|
|
1390
|
-
publication,
|
|
1391
|
-
user_id: sanityUser?.id
|
|
1392
|
-
});
|
|
1393
|
-
} catch {
|
|
1394
|
-
}
|
|
1321
|
+
downVoteUnsentRef.current = true;
|
|
1322
|
+
const ok = await send(suggestionType, suggestionText, "down");
|
|
1323
|
+
if (ok) downVoteUnsentRef.current = false;
|
|
1324
|
+
else if (mounted.current) setFailed(true);
|
|
1395
1325
|
return;
|
|
1396
1326
|
}
|
|
1397
1327
|
const newVote = vote === v ? null : v;
|
|
1398
1328
|
setVote(newVote);
|
|
1399
1329
|
setShowReasonPopup(false);
|
|
1400
1330
|
if (newVote) {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
vote: newVote,
|
|
1406
|
-
document_id: documentId,
|
|
1407
|
-
publication,
|
|
1408
|
-
user_id: sanityUser?.id
|
|
1409
|
-
});
|
|
1410
|
-
} catch {
|
|
1331
|
+
const ok = await send(suggestionType, suggestionText, newVote);
|
|
1332
|
+
if (!ok && mounted.current) {
|
|
1333
|
+
setVote(null);
|
|
1334
|
+
setFailed(true);
|
|
1411
1335
|
}
|
|
1412
1336
|
}
|
|
1413
1337
|
};
|
|
1338
|
+
const handleSkip = () => {
|
|
1339
|
+
setShowReasonPopup(false);
|
|
1340
|
+
setReason("");
|
|
1341
|
+
if (downVoteUnsentRef.current) setVote(null);
|
|
1342
|
+
};
|
|
1414
1343
|
const handleSubmitReason = async () => {
|
|
1415
1344
|
const trimmed = reason.trim();
|
|
1345
|
+
setFailed(false);
|
|
1346
|
+
if (downVoteUnsentRef.current) {
|
|
1347
|
+
const ok = await send(suggestionType, suggestionText, "down");
|
|
1348
|
+
if (!ok) {
|
|
1349
|
+
if (mounted.current) setFailed(true);
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
downVoteUnsentRef.current = false;
|
|
1353
|
+
}
|
|
1416
1354
|
if (trimmed) {
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
vote: "down",
|
|
1422
|
-
document_id: documentId,
|
|
1423
|
-
publication,
|
|
1424
|
-
user_id: sanityUser?.id
|
|
1425
|
-
});
|
|
1426
|
-
} catch {
|
|
1355
|
+
const ok = await send(suggestionType + "_reason", suggestionText + " | REASON: " + trimmed, "down");
|
|
1356
|
+
if (!ok) {
|
|
1357
|
+
if (mounted.current) setFailed(true);
|
|
1358
|
+
return;
|
|
1427
1359
|
}
|
|
1428
1360
|
}
|
|
1361
|
+
if (!mounted.current) return;
|
|
1429
1362
|
setSubmitted(true);
|
|
1430
1363
|
submitTimerRef.current = setTimeout(() => {
|
|
1431
1364
|
setShowReasonPopup(false);
|
|
@@ -1471,6 +1404,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1471
1404
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M19 11.75a1.25 1.25 0 11-2.5 0v-7.5a1.25 1.25 0 112.5 0v7.5zM9 17v1.3c0 .268-.14.526-.395.607A2 2 0 016 17c0-.995.182-1.948.514-2.826.204-.54-.166-1.174-.744-1.174H3.25c-1.243 0-2.261-1.01-2.146-2.247a23.864 23.864 0 011.341-5.974A1.637 1.637 0 014 3.75h9.5V12.5L9 17z" }) })
|
|
1472
1405
|
}
|
|
1473
1406
|
),
|
|
1407
|
+
failed && !showReasonPopup && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { role: "alert", style: { fontSize: 10, color: "#dc2626", fontWeight: 600, whiteSpace: "nowrap", marginLeft: 2 }, children: "Couldn't send - try again" }),
|
|
1474
1408
|
showReasonPopup && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1475
1409
|
"div",
|
|
1476
1410
|
{
|
|
@@ -1489,7 +1423,9 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1489
1423
|
border: "1px solid #e5e7eb"
|
|
1490
1424
|
},
|
|
1491
1425
|
children: submitted ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 11, color: "#16a34a", textAlign: "center", padding: "4px 0" }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1492
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937", marginBottom:
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937", marginBottom: 3 }, children: "Sorry! What went wrong?" }),
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 10, color: "#6b7280", marginBottom: 6, lineHeight: 1.45 }, children: "Sends your vote, this suggestion and your note, plus your user ID, document ID and publication when available." }),
|
|
1428
|
+
failed && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "alert", style: { fontSize: 10.5, color: "#dc2626", marginBottom: 6, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - try again" }),
|
|
1493
1429
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1494
1430
|
"input",
|
|
1495
1431
|
{
|
|
@@ -1517,10 +1453,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1517
1453
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1518
1454
|
"button",
|
|
1519
1455
|
{
|
|
1520
|
-
onClick:
|
|
1521
|
-
setShowReasonPopup(false);
|
|
1522
|
-
setReason("");
|
|
1523
|
-
},
|
|
1456
|
+
onClick: handleSkip,
|
|
1524
1457
|
style: {
|
|
1525
1458
|
padding: "3px 8px",
|
|
1526
1459
|
fontSize: 10,
|
|
@@ -1598,6 +1531,165 @@ function usePersistentState(key, initial) {
|
|
|
1598
1531
|
return [val, set];
|
|
1599
1532
|
}
|
|
1600
1533
|
|
|
1534
|
+
// src/lib/keywordAnchor.ts
|
|
1535
|
+
function keywordAnchorId(term) {
|
|
1536
|
+
const key = term.toLowerCase().trim();
|
|
1537
|
+
const slug = key.replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1538
|
+
let hash = 5381;
|
|
1539
|
+
for (let i = 0; i < key.length; i++) hash = (hash * 33 ^ key.charCodeAt(i)) >>> 0;
|
|
1540
|
+
return `anchor-kw-${slug}-${hash.toString(36)}`;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
// src/lib/format.ts
|
|
1544
|
+
function abbrevVol(v) {
|
|
1545
|
+
if (v == null) return "";
|
|
1546
|
+
if (v === 0) return "N/A";
|
|
1547
|
+
if (v >= 1e4) return Math.round(v / 1e3) + "K";
|
|
1548
|
+
if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
|
|
1549
|
+
return String(v);
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
// src/lib/scoring.ts
|
|
1553
|
+
function countWholeMatches(haystack, needle) {
|
|
1554
|
+
if (!needle) return 0;
|
|
1555
|
+
const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1556
|
+
const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
|
|
1557
|
+
return m ? m.length : 0;
|
|
1558
|
+
}
|
|
1559
|
+
function isKeywordInText(text, term) {
|
|
1560
|
+
return text.toLowerCase().includes(term.toLowerCase());
|
|
1561
|
+
}
|
|
1562
|
+
function calculateContentScoreDetailed(content, analysis, documentFields) {
|
|
1563
|
+
if (!content || !analysis) {
|
|
1564
|
+
return { total: 0, components: [] };
|
|
1565
|
+
}
|
|
1566
|
+
const lowerContent = content.toLowerCase();
|
|
1567
|
+
const words = content.split(/\s+/).filter(Boolean).length;
|
|
1568
|
+
const components = [];
|
|
1569
|
+
const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
|
|
1570
|
+
if (primaryTerm) {
|
|
1571
|
+
const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
|
|
1572
|
+
const phraseCount = countWholeMatches(lowerContent, primaryTerm);
|
|
1573
|
+
let occurrences = phraseCount;
|
|
1574
|
+
let viaTokens = false;
|
|
1575
|
+
if (phraseCount === 0 && tokens.length > 0) {
|
|
1576
|
+
const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
|
|
1577
|
+
if (counts.every((c) => c > 0)) {
|
|
1578
|
+
occurrences = Math.min(...counts);
|
|
1579
|
+
viaTokens = true;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
|
|
1583
|
+
let pts = 0;
|
|
1584
|
+
let detail;
|
|
1585
|
+
if (occurrences === 0) {
|
|
1586
|
+
detail = `Primary keyword "${primaryTerm}" not found in content`;
|
|
1587
|
+
} else {
|
|
1588
|
+
pts += 12;
|
|
1589
|
+
const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
|
|
1590
|
+
if (density >= 0.5 && density <= 2.5) {
|
|
1591
|
+
pts += 13;
|
|
1592
|
+
detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
|
|
1593
|
+
} else if (density < 0.5) {
|
|
1594
|
+
pts += 7;
|
|
1595
|
+
detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
|
|
1596
|
+
} else if (viaTokens && density <= 6) {
|
|
1597
|
+
pts += 11;
|
|
1598
|
+
detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
|
|
1599
|
+
} else {
|
|
1600
|
+
pts += 4;
|
|
1601
|
+
detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
|
|
1602
|
+
}
|
|
1603
|
+
if (viaTokens) {
|
|
1604
|
+
detail = `Exact phrase "${analysis.primaryKeyword.term}" is not in the article - its words appear separately`;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
|
|
1608
|
+
} else {
|
|
1609
|
+
components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
|
|
1610
|
+
}
|
|
1611
|
+
const supportingKws = analysis.supportingKeywords || [];
|
|
1612
|
+
if (supportingKws.length > 0) {
|
|
1613
|
+
const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
|
|
1614
|
+
const coverageRatio = inContentCount / supportingKws.length;
|
|
1615
|
+
const pts = Math.round(coverageRatio * 25);
|
|
1616
|
+
components.push({
|
|
1617
|
+
label: "Supporting keyword coverage",
|
|
1618
|
+
points: pts,
|
|
1619
|
+
max: 25,
|
|
1620
|
+
detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
|
|
1621
|
+
});
|
|
1622
|
+
} else {
|
|
1623
|
+
components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
|
|
1624
|
+
}
|
|
1625
|
+
let wcPts = 0;
|
|
1626
|
+
let wcDetail;
|
|
1627
|
+
if (words >= 1500) {
|
|
1628
|
+
wcPts = 15;
|
|
1629
|
+
wcDetail = `${words} words - strong length for clinical content`;
|
|
1630
|
+
} else if (words >= 450) {
|
|
1631
|
+
wcPts = 11;
|
|
1632
|
+
wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
|
|
1633
|
+
} else if (words >= 200) {
|
|
1634
|
+
wcPts = 5;
|
|
1635
|
+
wcDetail = `${words} words - below the 450-word floor`;
|
|
1636
|
+
} else {
|
|
1637
|
+
wcDetail = `${words} words - start writing`;
|
|
1638
|
+
}
|
|
1639
|
+
components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
|
|
1640
|
+
let hasH1orTitle;
|
|
1641
|
+
let hasSubheadings;
|
|
1642
|
+
if (documentFields) {
|
|
1643
|
+
hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
|
|
1644
|
+
const det = documentFields.headingsDetailed;
|
|
1645
|
+
const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
|
|
1646
|
+
hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
|
|
1647
|
+
} else {
|
|
1648
|
+
hasH1orTitle = /^#\s|<h1/im.test(content);
|
|
1649
|
+
hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
|
|
1650
|
+
}
|
|
1651
|
+
const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
|
|
1652
|
+
const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
|
|
1653
|
+
components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
|
|
1654
|
+
const suggested = [];
|
|
1655
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1656
|
+
for (const kw of [...analysis.supportingKeywords || [], ...analysis.missingKeywords || []]) {
|
|
1657
|
+
if (kw == null || typeof kw.term !== "string") continue;
|
|
1658
|
+
const key = kw.term.toLowerCase();
|
|
1659
|
+
if (seen.has(key)) continue;
|
|
1660
|
+
seen.add(key);
|
|
1661
|
+
suggested.push({ term: kw.term, volume: kw.volume ?? null });
|
|
1662
|
+
}
|
|
1663
|
+
const withVolume = suggested.filter((kw) => kw.volume != null && kw.volume > 0);
|
|
1664
|
+
const pool = withVolume.length > 0 ? withVolume : suggested;
|
|
1665
|
+
const stillMissing = pool.filter((kw) => !isKeywordInText(content, kw.term)).sort((a, b) => (b.volume ?? 0) - (a.volume ?? 0));
|
|
1666
|
+
let mPts = 0;
|
|
1667
|
+
let mDetail;
|
|
1668
|
+
if (stillMissing.length === 0) {
|
|
1669
|
+
mPts = 15;
|
|
1670
|
+
mDetail = "No missing keywords - every suggestion is in your article";
|
|
1671
|
+
} else {
|
|
1672
|
+
const usedShare = (pool.length - stillMissing.length) / pool.length;
|
|
1673
|
+
mPts = usedShare >= 0.75 ? 15 : usedShare >= 0.5 ? 10 : usedShare >= 0.25 ? 5 : 0;
|
|
1674
|
+
mDetail = "Suggested keywords not in your article yet";
|
|
1675
|
+
}
|
|
1676
|
+
components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail, missingKeywords: stillMissing });
|
|
1677
|
+
let qCount;
|
|
1678
|
+
if (documentFields) {
|
|
1679
|
+
qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
|
|
1680
|
+
} else {
|
|
1681
|
+
qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
|
|
1682
|
+
}
|
|
1683
|
+
let aeoPts = 0;
|
|
1684
|
+
if (qCount >= 3) aeoPts = 10;
|
|
1685
|
+
else if (qCount === 2) aeoPts = 7;
|
|
1686
|
+
else if (qCount === 1) aeoPts = 4;
|
|
1687
|
+
const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
|
|
1688
|
+
components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
|
|
1689
|
+
const total = components.reduce((sum, c) => sum + c.points, 0);
|
|
1690
|
+
return { total: Math.min(100, Math.max(0, total)), components };
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1601
1693
|
// src/components/KeywordPanel.tsx
|
|
1602
1694
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1603
1695
|
function loadLocalArray(key) {
|
|
@@ -1618,29 +1710,21 @@ var cardStyle = {
|
|
|
1618
1710
|
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.85), inset 1.5px 2px 1px -1px rgba(255,255,255,1), inset -2px -3px 2px -1px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.07), 0 10px 26px rgba(0,0,0,0.08)",
|
|
1619
1711
|
padding: "14px"
|
|
1620
1712
|
};
|
|
1621
|
-
function abbrevVol(v) {
|
|
1622
|
-
if (v == null) return "";
|
|
1623
|
-
if (v === 0) return "N/A";
|
|
1624
|
-
if (v >= 1e4) return Math.round(v / 1e3) + "K";
|
|
1625
|
-
if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
|
|
1626
|
-
return String(v);
|
|
1627
|
-
}
|
|
1628
1713
|
function placementCount(p) {
|
|
1629
1714
|
if (!p) return 0;
|
|
1630
1715
|
return [p.inBody, p.inTitle, p.inMetaDescription, p.inImages, p.inUrl].filter(Boolean).length;
|
|
1631
1716
|
}
|
|
1632
1717
|
function buildSuggestedKeywords(supporting, missing, documentText, documentFields) {
|
|
1633
1718
|
const merged = [];
|
|
1634
|
-
const lowerText = documentText.toLowerCase();
|
|
1635
1719
|
for (const kw of supporting) {
|
|
1636
1720
|
if (kw == null || typeof kw.term !== "string") continue;
|
|
1637
|
-
const actuallyInContent =
|
|
1721
|
+
const actuallyInContent = isKeywordInText(documentText, kw.term);
|
|
1638
1722
|
const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
|
|
1639
1723
|
merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, placement: livePlacement });
|
|
1640
1724
|
}
|
|
1641
1725
|
for (const kw of missing) {
|
|
1642
1726
|
if (kw == null || typeof kw.term !== "string") continue;
|
|
1643
|
-
const actuallyInContent =
|
|
1727
|
+
const actuallyInContent = isKeywordInText(documentText, kw.term);
|
|
1644
1728
|
const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
|
|
1645
1729
|
merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, reason: kw.reason, placement: livePlacement });
|
|
1646
1730
|
}
|
|
@@ -1924,7 +2008,8 @@ function SuggestedKeywordsCard({
|
|
|
1924
2008
|
documentId,
|
|
1925
2009
|
secondaryKeyword,
|
|
1926
2010
|
onSelectSecondary,
|
|
1927
|
-
primaryTerm
|
|
2011
|
+
primaryTerm,
|
|
2012
|
+
focusKeyword
|
|
1928
2013
|
}) {
|
|
1929
2014
|
const docScope = documentId || "default";
|
|
1930
2015
|
const [helpData, setHelpData] = usePersistentState(
|
|
@@ -2049,6 +2134,24 @@ function SuggestedKeywordsCard({
|
|
|
2049
2134
|
return next;
|
|
2050
2135
|
});
|
|
2051
2136
|
};
|
|
2137
|
+
(0, import_react9.useEffect)(() => {
|
|
2138
|
+
if (!focusKeyword) return;
|
|
2139
|
+
const reveal = setTimeout(() => {
|
|
2140
|
+
setExpanded(true);
|
|
2141
|
+
setActiveFilters(/* @__PURE__ */ new Set());
|
|
2142
|
+
}, 0);
|
|
2143
|
+
const scroll = setTimeout(() => {
|
|
2144
|
+
const el = typeof document !== "undefined" ? document.getElementById(keywordAnchorId(focusKeyword.term)) : null;
|
|
2145
|
+
if (!el) return;
|
|
2146
|
+
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
2147
|
+
el.classList.add("seo-copilot-flash");
|
|
2148
|
+
setTimeout(() => el.classList.remove("seo-copilot-flash"), 1400);
|
|
2149
|
+
}, 80);
|
|
2150
|
+
return () => {
|
|
2151
|
+
clearTimeout(reveal);
|
|
2152
|
+
clearTimeout(scroll);
|
|
2153
|
+
};
|
|
2154
|
+
}, [focusKeyword?.nonce]);
|
|
2052
2155
|
let filtered = keywords;
|
|
2053
2156
|
if (activeFilters.size > 0) {
|
|
2054
2157
|
const hasNoneFilter = activeFilters.has("none");
|
|
@@ -2387,7 +2490,7 @@ function SuggestedKeywordsCard({
|
|
|
2387
2490
|
}
|
|
2388
2491
|
)
|
|
2389
2492
|
] }),
|
|
2390
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: visible.map((kw, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: visible.map((kw, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { id: keywordAnchorId(kw.term), children: [
|
|
2391
2494
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: {
|
|
2392
2495
|
display: "flex",
|
|
2393
2496
|
alignItems: "center",
|
|
@@ -2517,7 +2620,8 @@ function KeywordPanel({
|
|
|
2517
2620
|
onSelectSecondary,
|
|
2518
2621
|
documentFields,
|
|
2519
2622
|
documentId,
|
|
2520
|
-
externalAnalysis
|
|
2623
|
+
externalAnalysis,
|
|
2624
|
+
focusKeyword
|
|
2521
2625
|
}) {
|
|
2522
2626
|
const { apiUrl } = useConfig();
|
|
2523
2627
|
const { analysis, isLoading, error, deepAnalysis, isDeepLoading, runDeepAnalysis } = externalAnalysis;
|
|
@@ -2618,7 +2722,8 @@ function KeywordPanel({
|
|
|
2618
2722
|
documentId,
|
|
2619
2723
|
secondaryKeyword,
|
|
2620
2724
|
onSelectSecondary,
|
|
2621
|
-
primaryTerm: activeTerm
|
|
2725
|
+
primaryTerm: activeTerm,
|
|
2726
|
+
focusKeyword
|
|
2622
2727
|
},
|
|
2623
2728
|
documentId || "default"
|
|
2624
2729
|
),
|
|
@@ -3074,7 +3179,7 @@ function TabBar({ tabs, activeTab, onTabChange }) {
|
|
|
3074
3179
|
WebkitBackdropFilter: "blur(16px) saturate(170%)",
|
|
3075
3180
|
// Beveled glass: top-left light edge + bottom-right inner shadow + a soft blue glow.
|
|
3076
3181
|
boxShadow: "inset 1px 1px 3px rgba(255,255,255,0.4), inset -1px -1px 5px rgba(0,0,0,0.28), 0 0 14px rgba(0,93,172,0.40), 0 2px 8px rgba(0,0,0,0.15)",
|
|
3077
|
-
// Always a
|
|
3182
|
+
// Always a defined transition (never "none") - that's what keeps every
|
|
3078
3183
|
// click animating. Normally: a real slide with a gentle bounce that lands
|
|
3079
3184
|
// on arrival (ease-out-back), for the distance-scaled duration so long
|
|
3080
3185
|
// jumps glide instead of darting. While resizing: 0ms = track instantly
|
|
@@ -3304,11 +3409,11 @@ function OnboardingCard({ onDismiss, closing }) {
|
|
|
3304
3409
|
|
|
3305
3410
|
// src/components/ReportProblemButton.tsx
|
|
3306
3411
|
var import_react12 = require("react");
|
|
3307
|
-
var
|
|
3412
|
+
var import_sanity2 = require("sanity");
|
|
3308
3413
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3309
3414
|
function ReportProblemButton({ activeTab, publication, documentId, documentType, primaryKeyword }) {
|
|
3310
3415
|
const { apiUrl } = useConfig();
|
|
3311
|
-
const sanityUser = (0,
|
|
3416
|
+
const sanityUser = (0, import_sanity2.useCurrentUser)();
|
|
3312
3417
|
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
3313
3418
|
const [text, setText] = (0, import_react12.useState)("");
|
|
3314
3419
|
const [submitting, setSubmitting] = (0, import_react12.useState)(false);
|
|
@@ -3431,7 +3536,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
|
|
|
3431
3536
|
},
|
|
3432
3537
|
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: [
|
|
3433
3538
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 3 }, children: "Report a problem" }),
|
|
3434
|
-
/* @__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
|
|
3539
|
+
/* @__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 include your Sanity user ID, the tab, document and keyword you're working on, the page URL and basic browser details to help us track it down." }),
|
|
3435
3540
|
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." }),
|
|
3436
3541
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3437
3542
|
"textarea",
|
|
@@ -3510,7 +3615,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
|
|
|
3510
3615
|
}
|
|
3511
3616
|
|
|
3512
3617
|
// src/components/tabs/SummaryTab.tsx
|
|
3513
|
-
var
|
|
3618
|
+
var import_react15 = require("react");
|
|
3514
3619
|
|
|
3515
3620
|
// src/components/ShimmerLoader.tsx
|
|
3516
3621
|
var import_react13 = require("react");
|
|
@@ -3611,134 +3716,6 @@ var DEFAULT_GENERATE_ALL_MESSAGES = [
|
|
|
3611
3716
|
"Compiling summary"
|
|
3612
3717
|
];
|
|
3613
3718
|
|
|
3614
|
-
// src/lib/scoring.ts
|
|
3615
|
-
function countWholeMatches(haystack, needle) {
|
|
3616
|
-
if (!needle) return 0;
|
|
3617
|
-
const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3618
|
-
const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
|
|
3619
|
-
return m ? m.length : 0;
|
|
3620
|
-
}
|
|
3621
|
-
function calculateContentScoreDetailed(content, analysis, documentFields) {
|
|
3622
|
-
if (!content || !analysis) {
|
|
3623
|
-
return { total: 0, components: [] };
|
|
3624
|
-
}
|
|
3625
|
-
const lowerContent = content.toLowerCase();
|
|
3626
|
-
const words = content.split(/\s+/).filter(Boolean).length;
|
|
3627
|
-
const components = [];
|
|
3628
|
-
const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
|
|
3629
|
-
if (primaryTerm) {
|
|
3630
|
-
const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
|
|
3631
|
-
const phraseCount = countWholeMatches(lowerContent, primaryTerm);
|
|
3632
|
-
let occurrences = phraseCount;
|
|
3633
|
-
let viaTokens = false;
|
|
3634
|
-
if (phraseCount === 0 && tokens.length > 0) {
|
|
3635
|
-
const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
|
|
3636
|
-
if (counts.every((c) => c > 0)) {
|
|
3637
|
-
occurrences = Math.min(...counts);
|
|
3638
|
-
viaTokens = true;
|
|
3639
|
-
}
|
|
3640
|
-
}
|
|
3641
|
-
const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
|
|
3642
|
-
let pts = 0;
|
|
3643
|
-
let detail;
|
|
3644
|
-
if (occurrences === 0) {
|
|
3645
|
-
detail = `Primary keyword "${primaryTerm}" not found in content`;
|
|
3646
|
-
} else {
|
|
3647
|
-
pts += 12;
|
|
3648
|
-
const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
|
|
3649
|
-
if (density >= 0.5 && density <= 2.5) {
|
|
3650
|
-
pts += 13;
|
|
3651
|
-
detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
|
|
3652
|
-
} else if (density < 0.5) {
|
|
3653
|
-
pts += 7;
|
|
3654
|
-
detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
|
|
3655
|
-
} else if (viaTokens && density <= 6) {
|
|
3656
|
-
pts += 11;
|
|
3657
|
-
detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
|
|
3658
|
-
} else {
|
|
3659
|
-
pts += 4;
|
|
3660
|
-
detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
|
|
3661
|
-
}
|
|
3662
|
-
}
|
|
3663
|
-
components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
|
|
3664
|
-
} else {
|
|
3665
|
-
components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
|
|
3666
|
-
}
|
|
3667
|
-
const supportingKws = analysis.supportingKeywords || [];
|
|
3668
|
-
if (supportingKws.length > 0) {
|
|
3669
|
-
const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
|
|
3670
|
-
const coverageRatio = inContentCount / supportingKws.length;
|
|
3671
|
-
const pts = Math.round(coverageRatio * 25);
|
|
3672
|
-
components.push({
|
|
3673
|
-
label: "Supporting keyword coverage",
|
|
3674
|
-
points: pts,
|
|
3675
|
-
max: 25,
|
|
3676
|
-
detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
|
|
3677
|
-
});
|
|
3678
|
-
} else {
|
|
3679
|
-
components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
|
|
3680
|
-
}
|
|
3681
|
-
let wcPts = 0;
|
|
3682
|
-
let wcDetail;
|
|
3683
|
-
if (words >= 1500) {
|
|
3684
|
-
wcPts = 15;
|
|
3685
|
-
wcDetail = `${words} words - strong length for clinical content`;
|
|
3686
|
-
} else if (words >= 450) {
|
|
3687
|
-
wcPts = 11;
|
|
3688
|
-
wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
|
|
3689
|
-
} else if (words >= 200) {
|
|
3690
|
-
wcPts = 5;
|
|
3691
|
-
wcDetail = `${words} words - below the 450-word floor`;
|
|
3692
|
-
} else {
|
|
3693
|
-
wcDetail = `${words} words - start writing`;
|
|
3694
|
-
}
|
|
3695
|
-
components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
|
|
3696
|
-
let hasH1orTitle;
|
|
3697
|
-
let hasSubheadings;
|
|
3698
|
-
if (documentFields) {
|
|
3699
|
-
hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
|
|
3700
|
-
const det = documentFields.headingsDetailed;
|
|
3701
|
-
const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
|
|
3702
|
-
hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
|
|
3703
|
-
} else {
|
|
3704
|
-
hasH1orTitle = /^#\s|<h1/im.test(content);
|
|
3705
|
-
hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
|
|
3706
|
-
}
|
|
3707
|
-
const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
|
|
3708
|
-
const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
|
|
3709
|
-
components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
|
|
3710
|
-
const missingCount = (analysis.missingKeywords || []).length;
|
|
3711
|
-
let mPts = 0;
|
|
3712
|
-
let mDetail;
|
|
3713
|
-
if (missingCount === 0) {
|
|
3714
|
-
mPts = 15;
|
|
3715
|
-
mDetail = "No missing keywords flagged";
|
|
3716
|
-
} else if (missingCount <= 2) {
|
|
3717
|
-
mPts = 10;
|
|
3718
|
-
mDetail = `${missingCount} suggested keywords missing - quick add`;
|
|
3719
|
-
} else if (missingCount <= 4) {
|
|
3720
|
-
mPts = 5;
|
|
3721
|
-
mDetail = `${missingCount} suggested keywords missing`;
|
|
3722
|
-
} else {
|
|
3723
|
-
mDetail = `${missingCount} suggested keywords missing - significant gaps`;
|
|
3724
|
-
}
|
|
3725
|
-
components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail });
|
|
3726
|
-
let qCount;
|
|
3727
|
-
if (documentFields) {
|
|
3728
|
-
qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
|
|
3729
|
-
} else {
|
|
3730
|
-
qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
|
|
3731
|
-
}
|
|
3732
|
-
let aeoPts = 0;
|
|
3733
|
-
if (qCount >= 3) aeoPts = 10;
|
|
3734
|
-
else if (qCount === 2) aeoPts = 7;
|
|
3735
|
-
else if (qCount === 1) aeoPts = 4;
|
|
3736
|
-
const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
|
|
3737
|
-
components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
|
|
3738
|
-
const total = components.reduce((sum, c) => sum + c.points, 0);
|
|
3739
|
-
return { total: Math.min(100, Math.max(0, total)), components };
|
|
3740
|
-
}
|
|
3741
|
-
|
|
3742
3719
|
// src/lib/utils.ts
|
|
3743
3720
|
function containsKeywordTokens(haystack, needle) {
|
|
3744
3721
|
if (!needle) return true;
|
|
@@ -4094,7 +4071,7 @@ function buildSummaryItems(input) {
|
|
|
4094
4071
|
category: "images",
|
|
4095
4072
|
severity: "warning",
|
|
4096
4073
|
label: `${missingTitles} image${missingTitles === 1 ? "" : "s"} missing a title`,
|
|
4097
|
-
description: "The title attribute shows on hover and
|
|
4074
|
+
description: "The title attribute shows on hover and helps readers.",
|
|
4098
4075
|
howToFix: "Add a descriptive title attribute (2-5 keywords) to each image that's missing one.",
|
|
4099
4076
|
jumpTo: { tab: "technical", anchorId: "anchor-image-titles" }
|
|
4100
4077
|
});
|
|
@@ -4256,9 +4233,9 @@ function buildSummaryItems(input) {
|
|
|
4256
4233
|
id: `deep-gap-${i}`,
|
|
4257
4234
|
category: "content",
|
|
4258
4235
|
severity: "opportunity",
|
|
4259
|
-
label: "
|
|
4236
|
+
label: "Possible gap",
|
|
4260
4237
|
description: note,
|
|
4261
|
-
howToFix: "
|
|
4238
|
+
howToFix: "Consider adding a section on this topic if it fits the article.",
|
|
4262
4239
|
jumpTo: { tab: "summary" }
|
|
4263
4240
|
});
|
|
4264
4241
|
});
|
|
@@ -4283,8 +4260,77 @@ function buildSummaryItems(input) {
|
|
|
4283
4260
|
return items;
|
|
4284
4261
|
}
|
|
4285
4262
|
|
|
4286
|
-
// src/components/tabs/
|
|
4263
|
+
// src/components/tabs/MissingKeywordsDetail.tsx
|
|
4264
|
+
var import_react14 = require("react");
|
|
4287
4265
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4266
|
+
function MissingKeywordsDetail({ detail, keywords, onKeywordClick }) {
|
|
4267
|
+
const [open, setOpen] = (0, import_react14.useState)(false);
|
|
4268
|
+
if (keywords.length === 0) {
|
|
4269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: detail });
|
|
4270
|
+
}
|
|
4271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
4272
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4273
|
+
"button",
|
|
4274
|
+
{
|
|
4275
|
+
type: "button",
|
|
4276
|
+
onClick: () => setOpen((o) => !o),
|
|
4277
|
+
"aria-expanded": open,
|
|
4278
|
+
style: {
|
|
4279
|
+
display: "flex",
|
|
4280
|
+
alignItems: "baseline",
|
|
4281
|
+
gap: 5,
|
|
4282
|
+
padding: 0,
|
|
4283
|
+
margin: 0,
|
|
4284
|
+
background: "none",
|
|
4285
|
+
border: "none",
|
|
4286
|
+
cursor: "pointer",
|
|
4287
|
+
textAlign: "left",
|
|
4288
|
+
fontSize: 10.5,
|
|
4289
|
+
color: "#4b5563",
|
|
4290
|
+
lineHeight: 1.4,
|
|
4291
|
+
fontFamily: "inherit"
|
|
4292
|
+
},
|
|
4293
|
+
children: [
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", style: { fontSize: 9, width: 8, flexShrink: 0, color: "#1f2937" }, children: open ? "\u25BE" : "\u25B8" }),
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: detail })
|
|
4296
|
+
]
|
|
4297
|
+
}
|
|
4298
|
+
),
|
|
4299
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { style: { listStyle: "none", margin: "4px 0 0 13px", padding: 0, display: "flex", flexDirection: "column", gap: 1 }, children: keywords.map((kw) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4300
|
+
"button",
|
|
4301
|
+
{
|
|
4302
|
+
type: "button",
|
|
4303
|
+
onClick: () => onKeywordClick(kw.term),
|
|
4304
|
+
title: "Show on the Keywords tab",
|
|
4305
|
+
style: {
|
|
4306
|
+
display: "flex",
|
|
4307
|
+
alignItems: "baseline",
|
|
4308
|
+
justifyContent: "space-between",
|
|
4309
|
+
gap: 8,
|
|
4310
|
+
width: "100%",
|
|
4311
|
+
padding: "3px 0",
|
|
4312
|
+
margin: 0,
|
|
4313
|
+
background: "none",
|
|
4314
|
+
border: "none",
|
|
4315
|
+
cursor: "pointer",
|
|
4316
|
+
textAlign: "left",
|
|
4317
|
+
fontSize: 11,
|
|
4318
|
+
fontFamily: "inherit"
|
|
4319
|
+
},
|
|
4320
|
+
children: [
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { color: MJH_BLUE, fontWeight: 500 }, children: kw.term }),
|
|
4322
|
+
kw.volume != null && kw.volume > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: { fontSize: 10.5, fontWeight: 600, color: "#1f2937", flexShrink: 0 }, children: [
|
|
4323
|
+
abbrevVol(kw.volume),
|
|
4324
|
+
"/mo"
|
|
4325
|
+
] })
|
|
4326
|
+
]
|
|
4327
|
+
}
|
|
4328
|
+
) }, kw.term)) })
|
|
4329
|
+
] });
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4332
|
+
// src/components/tabs/SummaryTab.tsx
|
|
4333
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4288
4334
|
var cardStyle2 = {
|
|
4289
4335
|
borderRadius: 14,
|
|
4290
4336
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -4311,11 +4357,11 @@ function componentTier(pct) {
|
|
|
4311
4357
|
if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
|
|
4312
4358
|
return { label: "Low", color: "#dc2626", bar: "#dc2626" };
|
|
4313
4359
|
}
|
|
4314
|
-
function ScoreBadge({ score, breakdown }) {
|
|
4360
|
+
function ScoreBadge({ score, breakdown, onKeywordClick }) {
|
|
4315
4361
|
const c = scoreColors(score);
|
|
4316
|
-
return /* @__PURE__ */ (0,
|
|
4317
|
-
/* @__PURE__ */ (0,
|
|
4318
|
-
/* @__PURE__ */ (0,
|
|
4362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle2, children: [
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4319
4365
|
"div",
|
|
4320
4366
|
{
|
|
4321
4367
|
style: {
|
|
@@ -4328,24 +4374,24 @@ function ScoreBadge({ score, breakdown }) {
|
|
|
4328
4374
|
justifyContent: "center",
|
|
4329
4375
|
flexShrink: 0
|
|
4330
4376
|
},
|
|
4331
|
-
children: /* @__PURE__ */ (0,
|
|
4377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
|
|
4332
4378
|
}
|
|
4333
4379
|
),
|
|
4334
|
-
/* @__PURE__ */ (0,
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4380
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4381
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
|
|
4337
4383
|
] })
|
|
4338
4384
|
] }),
|
|
4339
|
-
breakdown.length > 0 && /* @__PURE__ */ (0,
|
|
4385
|
+
breakdown.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
|
|
4340
4386
|
const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
|
|
4341
4387
|
const tier = componentTier(pct);
|
|
4342
|
-
return /* @__PURE__ */ (0,
|
|
4343
|
-
/* @__PURE__ */ (0,
|
|
4344
|
-
/* @__PURE__ */ (0,
|
|
4345
|
-
/* @__PURE__ */ (0,
|
|
4388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
4389
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
|
|
4390
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
|
|
4346
4392
|
] }),
|
|
4347
|
-
/* @__PURE__ */ (0,
|
|
4348
|
-
/* @__PURE__ */ (0,
|
|
4393
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
|
|
4394
|
+
comp.missingKeywords ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MissingKeywordsDetail, { detail: comp.detail, keywords: comp.missingKeywords, onKeywordClick }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
|
|
4349
4395
|
] }, i);
|
|
4350
4396
|
}) })
|
|
4351
4397
|
] });
|
|
@@ -4359,7 +4405,7 @@ function ItemCard({ item, onClick }) {
|
|
|
4359
4405
|
const v = severityVisual(item.severity);
|
|
4360
4406
|
const tab = item.jumpTo.tab;
|
|
4361
4407
|
const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
|
|
4362
|
-
return /* @__PURE__ */ (0,
|
|
4408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4363
4409
|
"div",
|
|
4364
4410
|
{
|
|
4365
4411
|
onClick,
|
|
@@ -4376,8 +4422,8 @@ function ItemCard({ item, onClick }) {
|
|
|
4376
4422
|
cursor: "pointer"
|
|
4377
4423
|
},
|
|
4378
4424
|
children: [
|
|
4379
|
-
/* @__PURE__ */ (0,
|
|
4380
|
-
/* @__PURE__ */ (0,
|
|
4425
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
|
|
4426
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4381
4427
|
"div",
|
|
4382
4428
|
{
|
|
4383
4429
|
style: {
|
|
@@ -4390,12 +4436,12 @@ function ItemCard({ item, onClick }) {
|
|
|
4390
4436
|
}
|
|
4391
4437
|
}
|
|
4392
4438
|
),
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
4394
|
-
/* @__PURE__ */ (0,
|
|
4395
|
-
/* @__PURE__ */ (0,
|
|
4439
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4440
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
|
|
4396
4442
|
] })
|
|
4397
4443
|
] }),
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4399
4445
|
"div",
|
|
4400
4446
|
{
|
|
4401
4447
|
style: {
|
|
@@ -4407,12 +4453,12 @@ function ItemCard({ item, onClick }) {
|
|
|
4407
4453
|
lineHeight: 1.55
|
|
4408
4454
|
},
|
|
4409
4455
|
children: [
|
|
4410
|
-
/* @__PURE__ */ (0,
|
|
4456
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
|
|
4411
4457
|
item.howToFix
|
|
4412
4458
|
]
|
|
4413
4459
|
}
|
|
4414
4460
|
),
|
|
4415
|
-
item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0,
|
|
4461
|
+
item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
|
|
4416
4462
|
"Go to ",
|
|
4417
4463
|
tabLabel,
|
|
4418
4464
|
" \u203A"
|
|
@@ -4428,7 +4474,7 @@ function FilterChip({
|
|
|
4428
4474
|
count,
|
|
4429
4475
|
dotColor
|
|
4430
4476
|
}) {
|
|
4431
|
-
return /* @__PURE__ */ (0,
|
|
4477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4432
4478
|
"button",
|
|
4433
4479
|
{
|
|
4434
4480
|
onClick,
|
|
@@ -4447,9 +4493,9 @@ function FilterChip({
|
|
|
4447
4493
|
transition: "all 150ms"
|
|
4448
4494
|
},
|
|
4449
4495
|
children: [
|
|
4450
|
-
dotColor && /* @__PURE__ */ (0,
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4496
|
+
dotColor && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
|
|
4497
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: label }),
|
|
4498
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
|
|
4453
4499
|
]
|
|
4454
4500
|
}
|
|
4455
4501
|
);
|
|
@@ -4465,15 +4511,16 @@ function SummaryTab({
|
|
|
4465
4511
|
secondaryKeyword,
|
|
4466
4512
|
isAnyLoading,
|
|
4467
4513
|
onGenerateAll,
|
|
4468
|
-
onItemClick
|
|
4514
|
+
onItemClick,
|
|
4515
|
+
onKeywordClick
|
|
4469
4516
|
}) {
|
|
4470
|
-
const scoreDetail = (0,
|
|
4517
|
+
const scoreDetail = (0, import_react15.useMemo)(() => {
|
|
4471
4518
|
if (!analysis) return null;
|
|
4472
4519
|
const scored = primaryKeyword && analysis.primaryKeyword && primaryKeyword !== analysis.primaryKeyword.term ? { ...analysis, primaryKeyword: { ...analysis.primaryKeyword, term: primaryKeyword } } : analysis;
|
|
4473
4520
|
return calculateContentScoreDetailed(text, scored, documentFields);
|
|
4474
4521
|
}, [text, analysis, documentFields, primaryKeyword]);
|
|
4475
4522
|
const score = scoreDetail?.total ?? null;
|
|
4476
|
-
const items = (0,
|
|
4523
|
+
const items = (0, import_react15.useMemo)(
|
|
4477
4524
|
() => buildSummaryItems({
|
|
4478
4525
|
analysis,
|
|
4479
4526
|
deepAnalysis,
|
|
@@ -4487,8 +4534,8 @@ function SummaryTab({
|
|
|
4487
4534
|
}),
|
|
4488
4535
|
[analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
|
|
4489
4536
|
);
|
|
4490
|
-
const [filter, setFilter] = (0,
|
|
4491
|
-
const counts = (0,
|
|
4537
|
+
const [filter, setFilter] = (0, import_react15.useState)("all");
|
|
4538
|
+
const counts = (0, import_react15.useMemo)(
|
|
4492
4539
|
() => ({
|
|
4493
4540
|
all: items.length,
|
|
4494
4541
|
error: items.filter((i) => i.severity === "error").length,
|
|
@@ -4499,15 +4546,15 @@ function SummaryTab({
|
|
|
4499
4546
|
);
|
|
4500
4547
|
const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
|
|
4501
4548
|
if (!analysis) {
|
|
4502
|
-
return /* @__PURE__ */ (0,
|
|
4503
|
-
/* @__PURE__ */ (0,
|
|
4504
|
-
/* @__PURE__ */ (0,
|
|
4549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
|
|
4551
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
|
|
4505
4552
|
] });
|
|
4506
4553
|
}
|
|
4507
|
-
return /* @__PURE__ */ (0,
|
|
4508
|
-
score != null && scoreDetail && /* @__PURE__ */ (0,
|
|
4509
|
-
/* @__PURE__ */ (0,
|
|
4510
|
-
isAnyLoading ? /* @__PURE__ */ (0,
|
|
4554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
4555
|
+
score != null && scoreDetail && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScoreBadge, { score, breakdown: scoreDetail.components, onKeywordClick }),
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle2, children: [
|
|
4557
|
+
isAnyLoading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4511
4558
|
"button",
|
|
4512
4559
|
{
|
|
4513
4560
|
onClick: onGenerateAll,
|
|
@@ -4535,24 +4582,24 @@ function SummaryTab({
|
|
|
4535
4582
|
children: "Run all analyses"
|
|
4536
4583
|
}
|
|
4537
4584
|
),
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
|
|
4539
4586
|
"Runs the analyses that fill the ",
|
|
4540
|
-
/* @__PURE__ */ (0,
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "AEO/GEO" }),
|
|
4541
4588
|
", ",
|
|
4542
|
-
/* @__PURE__ */ (0,
|
|
4589
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Linking" }),
|
|
4543
4590
|
", and ",
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4591
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Other Recs" }),
|
|
4545
4592
|
" tabs. New issues they find appear in this Summary as each one finishes."
|
|
4546
4593
|
] })
|
|
4547
4594
|
] }),
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
4550
|
-
/* @__PURE__ */ (0,
|
|
4551
|
-
/* @__PURE__ */ (0,
|
|
4552
|
-
/* @__PURE__ */ (0,
|
|
4595
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
|
|
4596
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
|
|
4597
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
|
|
4599
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
|
|
4553
4600
|
] }),
|
|
4554
|
-
/* @__PURE__ */ (0,
|
|
4555
|
-
/* @__PURE__ */ (0,
|
|
4601
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
4602
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4556
4603
|
"div",
|
|
4557
4604
|
{
|
|
4558
4605
|
style: {
|
|
@@ -4565,21 +4612,21 @@ function SummaryTab({
|
|
|
4565
4612
|
justifyContent: "center",
|
|
4566
4613
|
margin: "0 auto 8px"
|
|
4567
4614
|
},
|
|
4568
|
-
children: /* @__PURE__ */ (0,
|
|
4615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", 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" }) })
|
|
4569
4616
|
}
|
|
4570
4617
|
),
|
|
4571
|
-
/* @__PURE__ */ (0,
|
|
4572
|
-
/* @__PURE__ */ (0,
|
|
4573
|
-
] }) : /* @__PURE__ */ (0,
|
|
4574
|
-
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0,
|
|
4575
|
-
/* @__PURE__ */ (0,
|
|
4576
|
-
/* @__PURE__ */ (0,
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
|
|
4620
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
|
|
4621
|
+
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
|
|
4577
4624
|
] })
|
|
4578
4625
|
] });
|
|
4579
4626
|
}
|
|
4580
4627
|
|
|
4581
4628
|
// src/components/tabs/AEOTab.tsx
|
|
4582
|
-
var
|
|
4629
|
+
var import_react16 = require("react");
|
|
4583
4630
|
|
|
4584
4631
|
// src/lib/geoAnalysis.ts
|
|
4585
4632
|
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;
|
|
@@ -4653,7 +4700,7 @@ function analyzeGEO(text, headings) {
|
|
|
4653
4700
|
}
|
|
4654
4701
|
|
|
4655
4702
|
// src/components/tabs/AEOTab.tsx
|
|
4656
|
-
var
|
|
4703
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4657
4704
|
var AEO_PURPLE = "#005DAC";
|
|
4658
4705
|
var GEO_TEAL = "#C9A716";
|
|
4659
4706
|
var cardStyle3 = {
|
|
@@ -4665,7 +4712,7 @@ var cardStyle3 = {
|
|
|
4665
4712
|
padding: "14px"
|
|
4666
4713
|
};
|
|
4667
4714
|
function AiPill() {
|
|
4668
|
-
return /* @__PURE__ */ (0,
|
|
4715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4669
4716
|
"span",
|
|
4670
4717
|
{
|
|
4671
4718
|
style: {
|
|
@@ -4684,16 +4731,16 @@ function AiPill() {
|
|
|
4684
4731
|
);
|
|
4685
4732
|
}
|
|
4686
4733
|
function SectionHeader2({ label, iconColor, ai }) {
|
|
4687
|
-
return /* @__PURE__ */ (0,
|
|
4688
|
-
/* @__PURE__ */ (0,
|
|
4689
|
-
/* @__PURE__ */ (0,
|
|
4690
|
-
ai && /* @__PURE__ */ (0,
|
|
4734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
|
|
4736
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
|
|
4737
|
+
ai && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AiPill, {})
|
|
4691
4738
|
] });
|
|
4692
4739
|
}
|
|
4693
4740
|
function CopyButton({ text }) {
|
|
4694
|
-
const [copied, setCopied] = (0,
|
|
4695
|
-
const copyTimerRef = (0,
|
|
4696
|
-
(0,
|
|
4741
|
+
const [copied, setCopied] = (0, import_react16.useState)(false);
|
|
4742
|
+
const copyTimerRef = (0, import_react16.useRef)(null);
|
|
4743
|
+
(0, import_react16.useEffect)(() => {
|
|
4697
4744
|
return () => {
|
|
4698
4745
|
if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
|
|
4699
4746
|
};
|
|
@@ -4706,7 +4753,7 @@ function CopyButton({ text }) {
|
|
|
4706
4753
|
} catch {
|
|
4707
4754
|
}
|
|
4708
4755
|
};
|
|
4709
|
-
return /* @__PURE__ */ (0,
|
|
4756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4710
4757
|
"button",
|
|
4711
4758
|
{
|
|
4712
4759
|
onClick: handleCopy,
|
|
@@ -4725,9 +4772,9 @@ function CopyButton({ text }) {
|
|
|
4725
4772
|
transition: "color 150ms"
|
|
4726
4773
|
},
|
|
4727
4774
|
title: copied ? "Copied!" : "Copy to clipboard",
|
|
4728
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4730
|
-
/* @__PURE__ */ (0,
|
|
4775
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.jsxs)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
4776
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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" }),
|
|
4777
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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" })
|
|
4731
4778
|
] })
|
|
4732
4779
|
}
|
|
4733
4780
|
);
|
|
@@ -4742,13 +4789,13 @@ function GEOCard({ geo, publication }) {
|
|
|
4742
4789
|
const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
|
|
4743
4790
|
const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
|
|
4744
4791
|
const totalHeadings = geo.headingAudit.length;
|
|
4745
|
-
return /* @__PURE__ */ (0,
|
|
4746
|
-
/* @__PURE__ */ (0,
|
|
4747
|
-
/* @__PURE__ */ (0,
|
|
4748
|
-
/* @__PURE__ */ (0,
|
|
4792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: cardStyle3, children: [
|
|
4793
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
|
|
4794
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
|
|
4795
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
|
|
4749
4796
|
] }),
|
|
4750
|
-
/* @__PURE__ */ (0,
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
4797
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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." }),
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4752
4799
|
"div",
|
|
4753
4800
|
{
|
|
4754
4801
|
style: {
|
|
@@ -4761,7 +4808,7 @@ function GEOCard({ geo, publication }) {
|
|
|
4761
4808
|
marginBottom: 8
|
|
4762
4809
|
},
|
|
4763
4810
|
children: [
|
|
4764
|
-
/* @__PURE__ */ (0,
|
|
4811
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4765
4812
|
"div",
|
|
4766
4813
|
{
|
|
4767
4814
|
style: {
|
|
@@ -4777,17 +4824,17 @@ function GEOCard({ geo, publication }) {
|
|
|
4777
4824
|
boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
|
|
4778
4825
|
},
|
|
4779
4826
|
children: [
|
|
4780
|
-
/* @__PURE__ */ (0,
|
|
4781
|
-
/* @__PURE__ */ (0,
|
|
4827
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
|
|
4828
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
|
|
4782
4829
|
]
|
|
4783
4830
|
}
|
|
4784
4831
|
),
|
|
4785
|
-
/* @__PURE__ */ (0,
|
|
4786
|
-
/* @__PURE__ */ (0,
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
|
|
4787
4834
|
"Fact density: ",
|
|
4788
4835
|
fdLabel
|
|
4789
4836
|
] }),
|
|
4790
|
-
/* @__PURE__ */ (0,
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
|
|
4791
4838
|
fd.factCount,
|
|
4792
4839
|
" specific stat",
|
|
4793
4840
|
fd.factCount === 1 ? "" : "s",
|
|
@@ -4803,7 +4850,7 @@ function GEOCard({ geo, publication }) {
|
|
|
4803
4850
|
]
|
|
4804
4851
|
}
|
|
4805
4852
|
),
|
|
4806
|
-
fd.driftPassages > 0 && /* @__PURE__ */ (0,
|
|
4853
|
+
fd.driftPassages > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4807
4854
|
"div",
|
|
4808
4855
|
{
|
|
4809
4856
|
style: {
|
|
@@ -4817,15 +4864,15 @@ function GEOCard({ geo, publication }) {
|
|
|
4817
4864
|
lineHeight: 1.45
|
|
4818
4865
|
},
|
|
4819
4866
|
children: [
|
|
4820
|
-
/* @__PURE__ */ (0,
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: fd.driftPassages }),
|
|
4821
4868
|
" passage",
|
|
4822
4869
|
fd.driftPassages === 1 ? "" : "s",
|
|
4823
4870
|
" over 200 words with no specific stats or citations. AI engines tend to skip these."
|
|
4824
4871
|
]
|
|
4825
4872
|
}
|
|
4826
4873
|
),
|
|
4827
|
-
totalHeadings > 0 && /* @__PURE__ */ (0,
|
|
4828
|
-
/* @__PURE__ */ (0,
|
|
4874
|
+
totalHeadings > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { marginTop: 4 }, children: [
|
|
4875
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4829
4876
|
"button",
|
|
4830
4877
|
{
|
|
4831
4878
|
onClick: () => setShowDetails((v) => !v),
|
|
@@ -4844,22 +4891,22 @@ function GEOCard({ geo, publication }) {
|
|
|
4844
4891
|
color: GEO_TEAL
|
|
4845
4892
|
},
|
|
4846
4893
|
children: [
|
|
4847
|
-
/* @__PURE__ */ (0,
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
4848
4895
|
"Short-answer paragraphs: ",
|
|
4849
4896
|
goodCount,
|
|
4850
4897
|
"/",
|
|
4851
4898
|
totalHeadings,
|
|
4852
4899
|
" headings have one"
|
|
4853
4900
|
] }),
|
|
4854
|
-
/* @__PURE__ */ (0,
|
|
4901
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.jsx)("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
|
|
4855
4902
|
]
|
|
4856
4903
|
}
|
|
4857
4904
|
),
|
|
4858
|
-
showDetails && /* @__PURE__ */ (0,
|
|
4859
|
-
/* @__PURE__ */ (0,
|
|
4905
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4906
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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." }),
|
|
4860
4907
|
geo.headingAudit.map((h, i) => {
|
|
4861
4908
|
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" };
|
|
4862
|
-
return /* @__PURE__ */ (0,
|
|
4909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4863
4910
|
"div",
|
|
4864
4911
|
{
|
|
4865
4912
|
style: {
|
|
@@ -4873,8 +4920,8 @@ function GEOCard({ geo, publication }) {
|
|
|
4873
4920
|
gap: 8
|
|
4874
4921
|
},
|
|
4875
4922
|
children: [
|
|
4876
|
-
/* @__PURE__ */ (0,
|
|
4877
|
-
/* @__PURE__ */ (0,
|
|
4923
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
|
|
4924
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
|
|
4878
4925
|
]
|
|
4879
4926
|
},
|
|
4880
4927
|
i
|
|
@@ -4897,7 +4944,7 @@ function AEOTab({
|
|
|
4897
4944
|
csError,
|
|
4898
4945
|
loadContentSuggestions
|
|
4899
4946
|
}) {
|
|
4900
|
-
const geo = (0,
|
|
4947
|
+
const geo = (0, import_react16.useMemo)(() => analyzeGEO(text, headings), [text, headings]);
|
|
4901
4948
|
const geoWordCount = text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
|
|
4902
4949
|
const hasEnoughTextForGEO = geoWordCount >= 150;
|
|
4903
4950
|
const hasEnoughText = text && text.trim().length >= 50;
|
|
@@ -4911,8 +4958,8 @@ function AEOTab({
|
|
|
4911
4958
|
originalHeading: void 0,
|
|
4912
4959
|
rationale: h.rationale
|
|
4913
4960
|
})) ?? [];
|
|
4914
|
-
return /* @__PURE__ */ (0,
|
|
4915
|
-
aeoContentChanged && /* @__PURE__ */ (0,
|
|
4961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
4962
|
+
aeoContentChanged && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4916
4963
|
"div",
|
|
4917
4964
|
{
|
|
4918
4965
|
onClick: runDeepAnalysis,
|
|
@@ -4935,30 +4982,30 @@ function AEOTab({
|
|
|
4935
4982
|
cursor: "pointer"
|
|
4936
4983
|
},
|
|
4937
4984
|
children: [
|
|
4938
|
-
/* @__PURE__ */ (0,
|
|
4939
|
-
/* @__PURE__ */ (0,
|
|
4985
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
|
|
4986
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
|
|
4940
4987
|
]
|
|
4941
4988
|
}
|
|
4942
4989
|
),
|
|
4943
|
-
hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
4944
|
-
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
4945
|
-
/* @__PURE__ */ (0,
|
|
4990
|
+
hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GEOCard, { geo, publication }),
|
|
4991
|
+
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
|
|
4946
4993
|
" needs at least 150 words to read fact density.",
|
|
4947
|
-
/* @__PURE__ */ (0,
|
|
4948
|
-
/* @__PURE__ */ (0,
|
|
4994
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("br", {}),
|
|
4995
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { color: "#4b5563" }, children: [
|
|
4949
4996
|
"Current: ",
|
|
4950
4997
|
geoWordCount,
|
|
4951
4998
|
" word",
|
|
4952
4999
|
geoWordCount === 1 ? "" : "s"
|
|
4953
5000
|
] })
|
|
4954
5001
|
] }) }),
|
|
4955
|
-
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0,
|
|
4956
|
-
/* @__PURE__ */ (0,
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
5002
|
+
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
|
|
5004
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
|
|
4958
5005
|
] }),
|
|
4959
|
-
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0,
|
|
4960
|
-
/* @__PURE__ */ (0,
|
|
4961
|
-
/* @__PURE__ */ (0,
|
|
5006
|
+
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4962
5009
|
"button",
|
|
4963
5010
|
{
|
|
4964
5011
|
onClick: runDeepAnalysis,
|
|
@@ -4978,11 +5025,11 @@ function AEOTab({
|
|
|
4978
5025
|
}
|
|
4979
5026
|
)
|
|
4980
5027
|
] }),
|
|
4981
|
-
deepAnalysis && !aeo && /* @__PURE__ */ (0,
|
|
4982
|
-
questionHeadings.length > 0 && /* @__PURE__ */ (0,
|
|
4983
|
-
/* @__PURE__ */ (0,
|
|
4984
|
-
/* @__PURE__ */ (0,
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
5028
|
+
deepAnalysis && !aeo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
|
|
5029
|
+
questionHeadings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: cardStyle3, children: [
|
|
5030
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4986
5033
|
"div",
|
|
4987
5034
|
{
|
|
4988
5035
|
style: {
|
|
@@ -4992,26 +5039,26 @@ function AEOTab({
|
|
|
4992
5039
|
borderLeft: `3px solid ${AEO_PURPLE}`
|
|
4993
5040
|
},
|
|
4994
5041
|
children: [
|
|
4995
|
-
/* @__PURE__ */ (0,
|
|
4996
|
-
/* @__PURE__ */ (0,
|
|
4997
|
-
h.originalHeading && /* @__PURE__ */ (0,
|
|
4998
|
-
/* @__PURE__ */ (0,
|
|
5042
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1 }, children: [
|
|
5044
|
+
h.originalHeading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
|
|
4999
5046
|
] }),
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
5001
|
-
/* @__PURE__ */ (0,
|
|
5002
|
-
/* @__PURE__ */ (0,
|
|
5047
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
5048
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CopyButton, { text: h.heading }),
|
|
5049
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
|
|
5003
5050
|
] })
|
|
5004
5051
|
] }),
|
|
5005
|
-
/* @__PURE__ */ (0,
|
|
5052
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
|
|
5006
5053
|
]
|
|
5007
5054
|
},
|
|
5008
5055
|
i
|
|
5009
5056
|
)) })
|
|
5010
5057
|
] }),
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
5012
|
-
/* @__PURE__ */ (0,
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5014
|
-
!contentSuggestions && !isCSLoading && /* @__PURE__ */ (0,
|
|
5058
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: cardStyle3, children: [
|
|
5059
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
|
|
5060
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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." }),
|
|
5061
|
+
!contentSuggestions && !isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5015
5062
|
"button",
|
|
5016
5063
|
{
|
|
5017
5064
|
onClick: loadContentSuggestions,
|
|
@@ -5035,15 +5082,15 @@ function AEOTab({
|
|
|
5035
5082
|
children: "Generate suggestions"
|
|
5036
5083
|
}
|
|
5037
5084
|
),
|
|
5038
|
-
isCSLoading && /* @__PURE__ */ (0,
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5085
|
+
isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
|
|
5086
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
|
|
5087
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
|
|
5041
5088
|
] }),
|
|
5042
|
-
csError && /* @__PURE__ */ (0,
|
|
5043
|
-
contentSuggestions && /* @__PURE__ */ (0,
|
|
5044
|
-
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5089
|
+
csError && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
|
|
5090
|
+
contentSuggestions && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
|
|
5091
|
+
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5047
5094
|
"div",
|
|
5048
5095
|
{
|
|
5049
5096
|
style: {
|
|
@@ -5056,19 +5103,19 @@ function AEOTab({
|
|
|
5056
5103
|
alignItems: "flex-start"
|
|
5057
5104
|
},
|
|
5058
5105
|
children: [
|
|
5059
|
-
/* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5062
|
-
/* @__PURE__ */ (0,
|
|
5106
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
|
|
5107
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CopyButton, { text: kt }),
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
|
|
5063
5110
|
] })
|
|
5064
5111
|
]
|
|
5065
5112
|
},
|
|
5066
5113
|
i
|
|
5067
5114
|
)) })
|
|
5068
5115
|
] }),
|
|
5069
|
-
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0,
|
|
5070
|
-
/* @__PURE__ */ (0,
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
5116
|
+
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
5117
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5072
5119
|
"div",
|
|
5073
5120
|
{
|
|
5074
5121
|
style: {
|
|
@@ -5078,23 +5125,23 @@ function AEOTab({
|
|
|
5078
5125
|
borderLeft: `2px solid ${AEO_PURPLE}`
|
|
5079
5126
|
},
|
|
5080
5127
|
children: [
|
|
5081
|
-
/* @__PURE__ */ (0,
|
|
5082
|
-
/* @__PURE__ */ (0,
|
|
5083
|
-
/* @__PURE__ */ (0,
|
|
5128
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
5129
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
|
|
5130
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
|
|
5084
5131
|
] }),
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5132
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
|
|
5086
5133
|
]
|
|
5087
5134
|
},
|
|
5088
5135
|
i
|
|
5089
5136
|
)) })
|
|
5090
5137
|
] }),
|
|
5091
|
-
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0,
|
|
5092
|
-
/* @__PURE__ */ (0,
|
|
5093
|
-
/* @__PURE__ */ (0,
|
|
5094
|
-
/* @__PURE__ */ (0,
|
|
5095
|
-
/* @__PURE__ */ (0,
|
|
5096
|
-
/* @__PURE__ */ (0,
|
|
5097
|
-
/* @__PURE__ */ (0,
|
|
5138
|
+
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
|
|
5140
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
|
|
5142
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
5143
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5098
5145
|
FeedbackButton,
|
|
5099
5146
|
{
|
|
5100
5147
|
suggestionType: "aeo_bullets",
|
|
@@ -5105,7 +5152,7 @@ function AEOTab({
|
|
|
5105
5152
|
] })
|
|
5106
5153
|
] })
|
|
5107
5154
|
] }),
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
5155
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5109
5156
|
"button",
|
|
5110
5157
|
{
|
|
5111
5158
|
onClick: loadContentSuggestions,
|
|
@@ -5134,8 +5181,8 @@ function AEOTab({
|
|
|
5134
5181
|
}
|
|
5135
5182
|
|
|
5136
5183
|
// src/components/ScoreDonut.tsx
|
|
5137
|
-
var
|
|
5138
|
-
var
|
|
5184
|
+
var import_react17 = require("react");
|
|
5185
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
5139
5186
|
var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
|
|
5140
5187
|
var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
|
|
5141
5188
|
var TRACK = "#eef2f7";
|
|
@@ -5147,7 +5194,7 @@ function ScoreDonut({
|
|
|
5147
5194
|
sectionFit,
|
|
5148
5195
|
composite
|
|
5149
5196
|
}) {
|
|
5150
|
-
const [hovered, setHovered] = (0,
|
|
5197
|
+
const [hovered, setHovered] = (0, import_react17.useState)(false);
|
|
5151
5198
|
const radius = (size - strokeWidth) / 2;
|
|
5152
5199
|
const circumference = 2 * Math.PI * radius;
|
|
5153
5200
|
const cTopic = topic * W.topic;
|
|
@@ -5160,7 +5207,7 @@ function ScoreDonut({
|
|
|
5160
5207
|
const topicLen = seg(cTopic);
|
|
5161
5208
|
const freshLen = seg(cFresh);
|
|
5162
5209
|
const sectionLen = seg(cSection);
|
|
5163
|
-
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0,
|
|
5210
|
+
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5164
5211
|
"circle",
|
|
5165
5212
|
{
|
|
5166
5213
|
cx: size / 2,
|
|
@@ -5174,20 +5221,20 @@ function ScoreDonut({
|
|
|
5174
5221
|
strokeDashoffset: -offset
|
|
5175
5222
|
}
|
|
5176
5223
|
);
|
|
5177
|
-
return /* @__PURE__ */ (0,
|
|
5224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5178
5225
|
"div",
|
|
5179
5226
|
{
|
|
5180
5227
|
style: { position: "relative", width: size, height: size, flexShrink: 0 },
|
|
5181
5228
|
onMouseEnter: () => setHovered(true),
|
|
5182
5229
|
onMouseLeave: () => setHovered(false),
|
|
5183
5230
|
children: [
|
|
5184
|
-
/* @__PURE__ */ (0,
|
|
5185
|
-
/* @__PURE__ */ (0,
|
|
5186
|
-
/* @__PURE__ */ (0,
|
|
5187
|
-
/* @__PURE__ */ (0,
|
|
5188
|
-
/* @__PURE__ */ (0,
|
|
5231
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
|
|
5232
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
|
|
5233
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
|
|
5234
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
|
|
5235
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
|
|
5189
5236
|
] }),
|
|
5190
|
-
/* @__PURE__ */ (0,
|
|
5237
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5191
5238
|
"div",
|
|
5192
5239
|
{
|
|
5193
5240
|
style: {
|
|
@@ -5201,15 +5248,15 @@ function ScoreDonut({
|
|
|
5201
5248
|
lineHeight: 1
|
|
5202
5249
|
},
|
|
5203
5250
|
children: [
|
|
5204
|
-
/* @__PURE__ */ (0,
|
|
5251
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
|
|
5205
5252
|
compositeValue,
|
|
5206
5253
|
"%"
|
|
5207
5254
|
] }),
|
|
5208
|
-
/* @__PURE__ */ (0,
|
|
5255
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
|
|
5209
5256
|
]
|
|
5210
5257
|
}
|
|
5211
5258
|
),
|
|
5212
|
-
hovered && /* @__PURE__ */ (0,
|
|
5259
|
+
hovered && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5213
5260
|
"div",
|
|
5214
5261
|
{
|
|
5215
5262
|
role: "tooltip",
|
|
@@ -5230,9 +5277,9 @@ function ScoreDonut({
|
|
|
5230
5277
|
pointerEvents: "none"
|
|
5231
5278
|
},
|
|
5232
5279
|
children: [
|
|
5233
|
-
/* @__PURE__ */ (0,
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
|
|
5281
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
|
|
5282
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
|
|
5236
5283
|
]
|
|
5237
5284
|
}
|
|
5238
5285
|
)
|
|
@@ -5241,31 +5288,31 @@ function ScoreDonut({
|
|
|
5241
5288
|
);
|
|
5242
5289
|
}
|
|
5243
5290
|
function SubScoreRow({ color, label, value }) {
|
|
5244
|
-
return /* @__PURE__ */ (0,
|
|
5245
|
-
/* @__PURE__ */ (0,
|
|
5246
|
-
/* @__PURE__ */ (0,
|
|
5247
|
-
/* @__PURE__ */ (0,
|
|
5291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
5292
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { flex: 1 }, children: label }),
|
|
5294
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
|
|
5248
5295
|
Math.round(value),
|
|
5249
5296
|
"/100"
|
|
5250
5297
|
] })
|
|
5251
5298
|
] });
|
|
5252
5299
|
}
|
|
5253
5300
|
function ScoreDonutLegend() {
|
|
5254
|
-
return /* @__PURE__ */ (0,
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5256
|
-
/* @__PURE__ */ (0,
|
|
5257
|
-
/* @__PURE__ */ (0,
|
|
5301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
|
|
5303
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
|
|
5304
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
|
|
5258
5305
|
] });
|
|
5259
5306
|
}
|
|
5260
5307
|
function LegendDot({ color, label }) {
|
|
5261
|
-
return /* @__PURE__ */ (0,
|
|
5262
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
|
|
5263
5310
|
label
|
|
5264
5311
|
] });
|
|
5265
5312
|
}
|
|
5266
5313
|
|
|
5267
5314
|
// src/components/tabs/LinkingTab.tsx
|
|
5268
|
-
var
|
|
5315
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5269
5316
|
function buildLiveUrl(publication, slug) {
|
|
5270
5317
|
if (!slug) return null;
|
|
5271
5318
|
const pub = (publication || "").trim().toLowerCase();
|
|
@@ -5281,7 +5328,7 @@ function buildSanityUrl(baseUrl, id, type) {
|
|
|
5281
5328
|
return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
|
|
5282
5329
|
}
|
|
5283
5330
|
function LinkChip({ href, label, color }) {
|
|
5284
|
-
return /* @__PURE__ */ (0,
|
|
5331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5285
5332
|
"a",
|
|
5286
5333
|
{
|
|
5287
5334
|
href,
|
|
@@ -5303,16 +5350,16 @@ function LinkChip({ href, label, color }) {
|
|
|
5303
5350
|
},
|
|
5304
5351
|
children: [
|
|
5305
5352
|
label,
|
|
5306
|
-
/* @__PURE__ */ (0,
|
|
5307
|
-
/* @__PURE__ */ (0,
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5353
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
|
|
5354
|
+
/* @__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" }),
|
|
5355
|
+
/* @__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" })
|
|
5309
5356
|
] })
|
|
5310
5357
|
]
|
|
5311
5358
|
}
|
|
5312
5359
|
);
|
|
5313
5360
|
}
|
|
5314
5361
|
function ClickableBadge({ clickable }) {
|
|
5315
|
-
return /* @__PURE__ */ (0,
|
|
5362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5316
5363
|
"span",
|
|
5317
5364
|
{
|
|
5318
5365
|
style: {
|
|
@@ -5329,7 +5376,7 @@ function ClickableBadge({ clickable }) {
|
|
|
5329
5376
|
color: clickable ? "#16a34a" : "#9ca3af"
|
|
5330
5377
|
},
|
|
5331
5378
|
children: [
|
|
5332
|
-
/* @__PURE__ */ (0,
|
|
5379
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
|
|
5333
5380
|
clickable ? "Clickable link" : "No live link"
|
|
5334
5381
|
]
|
|
5335
5382
|
}
|
|
@@ -5344,7 +5391,7 @@ var cardStyle4 = {
|
|
|
5344
5391
|
padding: "14px"
|
|
5345
5392
|
};
|
|
5346
5393
|
function AiPill2() {
|
|
5347
|
-
return /* @__PURE__ */ (0,
|
|
5394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5348
5395
|
"span",
|
|
5349
5396
|
{
|
|
5350
5397
|
style: {
|
|
@@ -5368,10 +5415,10 @@ function SectionHeader3({
|
|
|
5368
5415
|
ai,
|
|
5369
5416
|
action
|
|
5370
5417
|
}) {
|
|
5371
|
-
return /* @__PURE__ */ (0,
|
|
5372
|
-
/* @__PURE__ */ (0,
|
|
5373
|
-
/* @__PURE__ */ (0,
|
|
5374
|
-
ai && /* @__PURE__ */ (0,
|
|
5418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
|
|
5419
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
|
|
5420
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
|
|
5421
|
+
ai && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AiPill2, {}),
|
|
5375
5422
|
action
|
|
5376
5423
|
] });
|
|
5377
5424
|
}
|
|
@@ -5392,7 +5439,7 @@ function freshnessChip(label, score) {
|
|
|
5392
5439
|
};
|
|
5393
5440
|
const c = map[label];
|
|
5394
5441
|
if (!c) return null;
|
|
5395
|
-
return /* @__PURE__ */ (0,
|
|
5442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5396
5443
|
"span",
|
|
5397
5444
|
{
|
|
5398
5445
|
style: {
|
|
@@ -5412,8 +5459,8 @@ function freshnessChip(label, score) {
|
|
|
5412
5459
|
);
|
|
5413
5460
|
}
|
|
5414
5461
|
function RefreshIcon({ spinning }) {
|
|
5415
|
-
if (spinning) return /* @__PURE__ */ (0,
|
|
5416
|
-
return /* @__PURE__ */ (0,
|
|
5462
|
+
if (spinning) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LoadingBars, { size: "xs", color: "#9ca3af" });
|
|
5463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.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" }) });
|
|
5417
5464
|
}
|
|
5418
5465
|
function LinkingTab({
|
|
5419
5466
|
analysis,
|
|
@@ -5429,21 +5476,21 @@ function LinkingTab({
|
|
|
5429
5476
|
documentType
|
|
5430
5477
|
}) {
|
|
5431
5478
|
if (!analysis) {
|
|
5432
|
-
return /* @__PURE__ */ (0,
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5434
|
-
/* @__PURE__ */ (0,
|
|
5479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
5480
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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." })
|
|
5435
5482
|
] });
|
|
5436
5483
|
}
|
|
5437
5484
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
5438
5485
|
const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
|
|
5439
5486
|
const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
|
|
5440
|
-
return /* @__PURE__ */ (0,
|
|
5441
|
-
/* @__PURE__ */ (0,
|
|
5487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
|
|
5488
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5442
5489
|
SectionHeader3,
|
|
5443
5490
|
{
|
|
5444
5491
|
label: "Suggested Links",
|
|
5445
5492
|
iconColor: MJH_BLUE,
|
|
5446
|
-
action: /* @__PURE__ */ (0,
|
|
5493
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5447
5494
|
"button",
|
|
5448
5495
|
{
|
|
5449
5496
|
onClick: onRefresh,
|
|
@@ -5458,20 +5505,20 @@ function LinkingTab({
|
|
|
5458
5505
|
fontSize: 10
|
|
5459
5506
|
},
|
|
5460
5507
|
title: "Refresh",
|
|
5461
|
-
children: /* @__PURE__ */ (0,
|
|
5508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefreshIcon, { spinning: isLoading })
|
|
5462
5509
|
}
|
|
5463
5510
|
)
|
|
5464
5511
|
}
|
|
5465
5512
|
),
|
|
5466
|
-
/* @__PURE__ */ (0,
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
|
|
5467
5514
|
"Other articles on this site that fit this topic.",
|
|
5468
|
-
wordCount2 > 0 && /* @__PURE__ */ (0,
|
|
5515
|
+
wordCount2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5469
5516
|
" ",
|
|
5470
5517
|
"For a ",
|
|
5471
5518
|
wordCount2.toLocaleString(),
|
|
5472
5519
|
"-word article, aim for",
|
|
5473
5520
|
" ",
|
|
5474
|
-
/* @__PURE__ */ (0,
|
|
5521
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
|
|
5475
5522
|
recommendedMin,
|
|
5476
5523
|
"-",
|
|
5477
5524
|
recommendedMax,
|
|
@@ -5480,17 +5527,17 @@ function LinkingTab({
|
|
|
5480
5527
|
"."
|
|
5481
5528
|
] })
|
|
5482
5529
|
] }),
|
|
5483
|
-
/* @__PURE__ */ (0,
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
|
|
5484
5531
|
"Each suggestion gets a 0-100% match score from three signals - ",
|
|
5485
|
-
/* @__PURE__ */ (0,
|
|
5532
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "topic match" }),
|
|
5486
5533
|
", ",
|
|
5487
|
-
/* @__PURE__ */ (0,
|
|
5534
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "freshness" }),
|
|
5488
5535
|
", and ",
|
|
5489
|
-
/* @__PURE__ */ (0,
|
|
5536
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "section fit" }),
|
|
5490
5537
|
" (where in your article the link belongs). The percentage on each card is the weighted total:"
|
|
5491
5538
|
] }),
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0,
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScoreDonutLegend, {}) }),
|
|
5540
|
+
isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5494
5541
|
"div",
|
|
5495
5542
|
{
|
|
5496
5543
|
role: "button",
|
|
@@ -5515,16 +5562,16 @@ function LinkingTab({
|
|
|
5515
5562
|
cursor: "pointer"
|
|
5516
5563
|
},
|
|
5517
5564
|
children: [
|
|
5518
|
-
/* @__PURE__ */ (0,
|
|
5519
|
-
/* @__PURE__ */ (0,
|
|
5565
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
|
|
5566
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
|
|
5520
5567
|
]
|
|
5521
5568
|
}
|
|
5522
5569
|
),
|
|
5523
|
-
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5525
|
-
/* @__PURE__ */ (0,
|
|
5570
|
+
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
|
|
5571
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
|
|
5526
5573
|
] }),
|
|
5527
|
-
!isLoading && error && /* @__PURE__ */ (0,
|
|
5574
|
+
!isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5528
5575
|
"div",
|
|
5529
5576
|
{
|
|
5530
5577
|
style: {
|
|
@@ -5535,9 +5582,9 @@ function LinkingTab({
|
|
|
5535
5582
|
textAlign: "center"
|
|
5536
5583
|
},
|
|
5537
5584
|
children: [
|
|
5538
|
-
/* @__PURE__ */ (0,
|
|
5539
|
-
/* @__PURE__ */ (0,
|
|
5540
|
-
/* @__PURE__ */ (0,
|
|
5585
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
|
|
5586
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5541
5588
|
"button",
|
|
5542
5589
|
{
|
|
5543
5590
|
onClick: onRefresh,
|
|
@@ -5557,14 +5604,14 @@ function LinkingTab({
|
|
|
5557
5604
|
]
|
|
5558
5605
|
}
|
|
5559
5606
|
),
|
|
5560
|
-
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
5561
|
-
/* @__PURE__ */ (0,
|
|
5562
|
-
/* @__PURE__ */ (0,
|
|
5607
|
+
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.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: [
|
|
5608
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
|
|
5609
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "#4b5563" }, children: "Linking checked related and recent articles from your publication and did not find a strong match. As more related content is published, suggestions will appear here." })
|
|
5563
5610
|
] }),
|
|
5564
|
-
suggestions.length > 0 && /* @__PURE__ */ (0,
|
|
5611
|
+
suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
|
|
5565
5612
|
const liveUrl = buildLiveUrl(publication, s.slug);
|
|
5566
5613
|
const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
|
|
5567
|
-
return /* @__PURE__ */ (0,
|
|
5614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5568
5615
|
"div",
|
|
5569
5616
|
{
|
|
5570
5617
|
style: {
|
|
@@ -5577,7 +5624,7 @@ function LinkingTab({
|
|
|
5577
5624
|
alignItems: "flex-start"
|
|
5578
5625
|
},
|
|
5579
5626
|
children: [
|
|
5580
|
-
/* @__PURE__ */ (0,
|
|
5627
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5581
5628
|
ScoreDonut,
|
|
5582
5629
|
{
|
|
5583
5630
|
size: 64,
|
|
@@ -5587,27 +5634,27 @@ function LinkingTab({
|
|
|
5587
5634
|
composite: Math.max(0, Math.min(100, s.compositeScore))
|
|
5588
5635
|
}
|
|
5589
5636
|
),
|
|
5590
|
-
/* @__PURE__ */ (0,
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5637
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5638
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
|
|
5592
5639
|
freshnessChip(s.freshnessLabel, s.freshnessScore),
|
|
5593
|
-
s.publishedAt && /* @__PURE__ */ (0,
|
|
5594
|
-
/* @__PURE__ */ (0,
|
|
5640
|
+
s.publishedAt && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
|
|
5641
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ClickableBadge, { clickable: !!liveUrl })
|
|
5595
5642
|
] }),
|
|
5596
|
-
/* @__PURE__ */ (0,
|
|
5597
|
-
/* @__PURE__ */ (0,
|
|
5643
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
|
|
5598
5645
|
"/",
|
|
5599
5646
|
s.slug
|
|
5600
5647
|
] }),
|
|
5601
|
-
(liveUrl || sanityUrl) && /* @__PURE__ */ (0,
|
|
5602
|
-
sanityUrl && /* @__PURE__ */ (0,
|
|
5603
|
-
liveUrl && /* @__PURE__ */ (0,
|
|
5648
|
+
(liveUrl || sanityUrl) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
|
|
5649
|
+
sanityUrl && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
|
|
5650
|
+
liveUrl && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
|
|
5604
5651
|
] }),
|
|
5605
|
-
s.relevanceReason && /* @__PURE__ */ (0,
|
|
5606
|
-
/* @__PURE__ */ (0,
|
|
5652
|
+
s.relevanceReason && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
|
|
5653
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
|
|
5607
5654
|
" ",
|
|
5608
|
-
/* @__PURE__ */ (0,
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
|
|
5609
5656
|
] }),
|
|
5610
|
-
s.anchorQuote && /* @__PURE__ */ (0,
|
|
5657
|
+
s.anchorQuote && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5611
5658
|
"div",
|
|
5612
5659
|
{
|
|
5613
5660
|
style: {
|
|
@@ -5621,21 +5668,21 @@ function LinkingTab({
|
|
|
5621
5668
|
lineHeight: 1.5
|
|
5622
5669
|
},
|
|
5623
5670
|
children: [
|
|
5624
|
-
/* @__PURE__ */ (0,
|
|
5671
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
|
|
5625
5672
|
"Where to link from - paragraph ",
|
|
5626
5673
|
s.anchorParagraph
|
|
5627
5674
|
] }),
|
|
5628
|
-
/* @__PURE__ */ (0,
|
|
5675
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontStyle: "italic" }, children: [
|
|
5629
5676
|
'"',
|
|
5630
5677
|
s.anchorQuote,
|
|
5631
5678
|
'"'
|
|
5632
5679
|
] }),
|
|
5633
|
-
s.anchorReason && /* @__PURE__ */ (0,
|
|
5680
|
+
s.anchorReason && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
|
|
5634
5681
|
]
|
|
5635
5682
|
}
|
|
5636
5683
|
)
|
|
5637
5684
|
] }),
|
|
5638
|
-
/* @__PURE__ */ (0,
|
|
5685
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5639
5686
|
FeedbackButton,
|
|
5640
5687
|
{
|
|
5641
5688
|
suggestionType: "internal_link",
|
|
@@ -5653,11 +5700,11 @@ function LinkingTab({
|
|
|
5653
5700
|
}
|
|
5654
5701
|
|
|
5655
5702
|
// src/components/tabs/MetaTab.tsx
|
|
5656
|
-
var
|
|
5657
|
-
var
|
|
5703
|
+
var import_react18 = require("react");
|
|
5704
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5658
5705
|
var GOOGLE_EEAT_URL = "https://developers.google.com/search/docs/fundamentals/creating-helpful-content#eat";
|
|
5659
5706
|
function ExternalLinkChip({ href, label }) {
|
|
5660
|
-
return /* @__PURE__ */ (0,
|
|
5707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5661
5708
|
"a",
|
|
5662
5709
|
{
|
|
5663
5710
|
href,
|
|
@@ -5680,16 +5727,16 @@ function ExternalLinkChip({ href, label }) {
|
|
|
5680
5727
|
},
|
|
5681
5728
|
children: [
|
|
5682
5729
|
label,
|
|
5683
|
-
/* @__PURE__ */ (0,
|
|
5684
|
-
/* @__PURE__ */ (0,
|
|
5685
|
-
/* @__PURE__ */ (0,
|
|
5730
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
|
|
5731
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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" }),
|
|
5732
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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" })
|
|
5686
5733
|
] })
|
|
5687
5734
|
]
|
|
5688
5735
|
}
|
|
5689
5736
|
);
|
|
5690
5737
|
}
|
|
5691
5738
|
function FreshnessNotice() {
|
|
5692
|
-
return /* @__PURE__ */ (0,
|
|
5739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5693
5740
|
"div",
|
|
5694
5741
|
{
|
|
5695
5742
|
style: {
|
|
@@ -5703,11 +5750,11 @@ function FreshnessNotice() {
|
|
|
5703
5750
|
lineHeight: 1.5
|
|
5704
5751
|
},
|
|
5705
5752
|
children: [
|
|
5706
|
-
/* @__PURE__ */ (0,
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
|
|
5707
5754
|
"Planning to update this article after it's published? Set the ",
|
|
5708
|
-
/* @__PURE__ */ (0,
|
|
5755
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: "Updated on" }),
|
|
5709
5756
|
" date in Sanity (e.g. \u201CUpdated: February 19, 2026\u201D). It surfaces the article in ",
|
|
5710
|
-
/* @__PURE__ */ (0,
|
|
5757
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: "Latest Updated Articles" }),
|
|
5711
5758
|
" and increases its visibility in search engine results."
|
|
5712
5759
|
]
|
|
5713
5760
|
}
|
|
@@ -5728,7 +5775,7 @@ function StatusBadge({ status }) {
|
|
|
5728
5775
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
5729
5776
|
};
|
|
5730
5777
|
const c = map[status];
|
|
5731
|
-
return /* @__PURE__ */ (0,
|
|
5778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5732
5779
|
"span",
|
|
5733
5780
|
{
|
|
5734
5781
|
style: {
|
|
@@ -5747,12 +5794,12 @@ function StatusBadge({ status }) {
|
|
|
5747
5794
|
);
|
|
5748
5795
|
}
|
|
5749
5796
|
function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
5750
|
-
return /* @__PURE__ */ (0,
|
|
5751
|
-
/* @__PURE__ */ (0,
|
|
5752
|
-
/* @__PURE__ */ (0,
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: anchorId, style: cardStyle5, children: [
|
|
5798
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
5799
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
|
|
5800
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StatusBadge, { status })
|
|
5754
5801
|
] }),
|
|
5755
|
-
/* @__PURE__ */ (0,
|
|
5802
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5756
5803
|
"div",
|
|
5757
5804
|
{
|
|
5758
5805
|
style: {
|
|
@@ -5765,7 +5812,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
|
5765
5812
|
children: value
|
|
5766
5813
|
}
|
|
5767
5814
|
),
|
|
5768
|
-
recommendation && /* @__PURE__ */ (0,
|
|
5815
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5769
5816
|
"div",
|
|
5770
5817
|
{
|
|
5771
5818
|
style: {
|
|
@@ -5891,13 +5938,13 @@ function formatDateShort(iso) {
|
|
|
5891
5938
|
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
5892
5939
|
}
|
|
5893
5940
|
function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }) {
|
|
5894
|
-
const audits = (0,
|
|
5941
|
+
const audits = (0, import_react18.useMemo)(() => {
|
|
5895
5942
|
const list = [];
|
|
5896
5943
|
list.push(titleAudit(documentFields?.title, primaryKeyword));
|
|
5897
5944
|
list.push(metaDescriptionAudit(documentFields?.metaDescription, primaryKeyword, secondaryKeyword));
|
|
5898
5945
|
return list;
|
|
5899
5946
|
}, [documentFields, primaryKeyword, secondaryKeyword]);
|
|
5900
|
-
const eeatItems = (0,
|
|
5947
|
+
const eeatItems = (0, import_react18.useMemo)(() => {
|
|
5901
5948
|
const items = [];
|
|
5902
5949
|
const author = documentFields?.authorName;
|
|
5903
5950
|
const creds = documentFields?.authorCredentials;
|
|
@@ -5914,7 +5961,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5914
5961
|
} else {
|
|
5915
5962
|
items.push({ label: "Author Byline", value: `${author}, ${creds}`, status: "good" });
|
|
5916
5963
|
}
|
|
5917
|
-
items[0].footer = /* @__PURE__ */ (0,
|
|
5964
|
+
items[0].footer = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
|
|
5918
5965
|
const factChecker = documentFields?.factCheckerName;
|
|
5919
5966
|
const factCheckerRef = documentFields?.factCheckerIsReference;
|
|
5920
5967
|
if (factChecker) {
|
|
@@ -5939,31 +5986,31 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5939
5986
|
if (days <= 14) {
|
|
5940
5987
|
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." });
|
|
5941
5988
|
} else if (days <= 90) {
|
|
5942
|
-
items.push({ label: "Content Freshness", value, status: "warning", recommendation: "
|
|
5989
|
+
items.push({ label: "Content Freshness", value, status: "warning", recommendation: "Recently updated content tends to be cited more by AI search. If it's still accurate, refresh a stat and set the Updated-on date in Sanity." });
|
|
5943
5990
|
} else {
|
|
5944
5991
|
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." });
|
|
5945
5992
|
}
|
|
5946
5993
|
}
|
|
5947
5994
|
return items;
|
|
5948
5995
|
}, [documentFields]);
|
|
5949
|
-
const publishDateItem = (0,
|
|
5996
|
+
const publishDateItem = (0, import_react18.useMemo)(() => {
|
|
5950
5997
|
const published = documentFields?.publishedAt;
|
|
5951
5998
|
const daysPub = daysSince(published);
|
|
5952
|
-
if (!published) return { label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date.
|
|
5999
|
+
if (!published) return { label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date. Helps search engines and AI search judge how current the article is." };
|
|
5953
6000
|
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." };
|
|
5954
6001
|
return { label: "Publish Date", value: formatDateShort(published), status: "good" };
|
|
5955
6002
|
}, [documentFields]);
|
|
5956
6003
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
|
|
5957
6004
|
if (isLoading && !hasAnyField) {
|
|
5958
|
-
return /* @__PURE__ */ (0,
|
|
5959
|
-
/* @__PURE__ */ (0,
|
|
5960
|
-
/* @__PURE__ */ (0,
|
|
6005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
6006
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
|
|
6007
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
|
|
5961
6008
|
] });
|
|
5962
6009
|
}
|
|
5963
6010
|
const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
|
|
5964
|
-
return /* @__PURE__ */ (0,
|
|
5965
|
-
/* @__PURE__ */ (0,
|
|
5966
|
-
/* @__PURE__ */ (0,
|
|
6011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
6012
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FreshnessNotice, {}),
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5967
6014
|
AuditCard,
|
|
5968
6015
|
{
|
|
5969
6016
|
anchorId: "anchor-publish-date",
|
|
@@ -5973,7 +6020,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5973
6020
|
recommendation: publishDateItem.recommendation
|
|
5974
6021
|
}
|
|
5975
6022
|
),
|
|
5976
|
-
audits.map((a, i) => /* @__PURE__ */ (0,
|
|
6023
|
+
audits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5977
6024
|
AuditCard,
|
|
5978
6025
|
{
|
|
5979
6026
|
anchorId: auditAnchors[i],
|
|
@@ -5984,14 +6031,14 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5984
6031
|
},
|
|
5985
6032
|
i
|
|
5986
6033
|
)),
|
|
5987
|
-
eeatItems.length > 0 && /* @__PURE__ */ (0,
|
|
5988
|
-
/* @__PURE__ */ (0,
|
|
5989
|
-
/* @__PURE__ */ (0,
|
|
5990
|
-
/* @__PURE__ */ (0,
|
|
5991
|
-
/* @__PURE__ */ (0,
|
|
6034
|
+
eeatItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
6035
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
|
|
6036
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
|
|
6037
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
|
|
6038
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
|
|
5992
6039
|
] }),
|
|
5993
|
-
/* @__PURE__ */ (0,
|
|
5994
|
-
eeatItems.map((item, i) => /* @__PURE__ */ (0,
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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." }),
|
|
6041
|
+
eeatItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5995
6042
|
AuditCard,
|
|
5996
6043
|
{
|
|
5997
6044
|
label: item.label,
|
|
@@ -6007,8 +6054,8 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
6007
6054
|
}
|
|
6008
6055
|
|
|
6009
6056
|
// src/components/tabs/TechnicalTab.tsx
|
|
6010
|
-
var
|
|
6011
|
-
var
|
|
6057
|
+
var import_react19 = require("react");
|
|
6058
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6012
6059
|
function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
6013
6060
|
const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
|
|
6014
6061
|
if (!slug) {
|
|
@@ -6043,28 +6090,28 @@ function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
|
6043
6090
|
return { label: "URL Slug", value: `/${slug}`, status: "good" };
|
|
6044
6091
|
}
|
|
6045
6092
|
function SlugRedirectNotice() {
|
|
6046
|
-
const [expanded, setExpanded] = (0,
|
|
6047
|
-
return /* @__PURE__ */ (0,
|
|
6048
|
-
/* @__PURE__ */ (0,
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6050
|
-
/* @__PURE__ */ (0,
|
|
6093
|
+
const [expanded, setExpanded] = (0, import_react19.useState)(false);
|
|
6094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
|
|
6095
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
|
|
6096
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.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" }) }),
|
|
6097
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
|
|
6051
6098
|
] }),
|
|
6052
|
-
/* @__PURE__ */ (0,
|
|
6053
|
-
/* @__PURE__ */ (0,
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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." }),
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6054
6101
|
"button",
|
|
6055
6102
|
{
|
|
6056
6103
|
onClick: () => setExpanded((v) => !v),
|
|
6057
6104
|
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" },
|
|
6058
6105
|
children: [
|
|
6059
6106
|
expanded ? "Show less" : "Learn more",
|
|
6060
|
-
/* @__PURE__ */ (0,
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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" }) })
|
|
6061
6108
|
]
|
|
6062
6109
|
}
|
|
6063
6110
|
),
|
|
6064
|
-
expanded && /* @__PURE__ */ (0,
|
|
6065
|
-
/* @__PURE__ */ (0,
|
|
6066
|
-
/* @__PURE__ */ (0,
|
|
6067
|
-
/* @__PURE__ */ (0,
|
|
6111
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
|
|
6113
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
|
|
6114
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: "Set this up using vanity redirects in Sanity." })
|
|
6068
6115
|
] })
|
|
6069
6116
|
] }) });
|
|
6070
6117
|
}
|
|
@@ -6083,7 +6130,7 @@ function StatusBadge2({ status }) {
|
|
|
6083
6130
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
6084
6131
|
};
|
|
6085
6132
|
const c = map[status];
|
|
6086
|
-
return /* @__PURE__ */ (0,
|
|
6133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6087
6134
|
"span",
|
|
6088
6135
|
{
|
|
6089
6136
|
style: {
|
|
@@ -6109,12 +6156,12 @@ function AuditCard2({
|
|
|
6109
6156
|
anchorId,
|
|
6110
6157
|
footer
|
|
6111
6158
|
}) {
|
|
6112
|
-
return /* @__PURE__ */ (0,
|
|
6113
|
-
/* @__PURE__ */ (0,
|
|
6114
|
-
/* @__PURE__ */ (0,
|
|
6115
|
-
/* @__PURE__ */ (0,
|
|
6159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { id: anchorId, style: cardStyle6, children: [
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
6161
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
|
|
6162
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StatusBadge2, { status })
|
|
6116
6163
|
] }),
|
|
6117
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6118
6165
|
"div",
|
|
6119
6166
|
{
|
|
6120
6167
|
style: {
|
|
@@ -6127,7 +6174,7 @@ function AuditCard2({
|
|
|
6127
6174
|
children: value
|
|
6128
6175
|
}
|
|
6129
6176
|
),
|
|
6130
|
-
recommendation && /* @__PURE__ */ (0,
|
|
6177
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6131
6178
|
"div",
|
|
6132
6179
|
{
|
|
6133
6180
|
style: {
|
|
@@ -6241,7 +6288,7 @@ function imageTitleAudit(titles, imageCount) {
|
|
|
6241
6288
|
label: "Image Titles",
|
|
6242
6289
|
value: `${withTitle} of ${imageCount} image${imageCount === 1 ? "" : "s"} ${withTitle === 1 ? "has" : "have"} a title`,
|
|
6243
6290
|
status: "warning",
|
|
6244
|
-
recommendation: `Add a descriptive title attribute (2-5 keywords) to the ${missing} image${missing === 1 ? "" : "s"} without one. The title appears on hover and
|
|
6291
|
+
recommendation: `Add a descriptive title attribute (2-5 keywords) to the ${missing} image${missing === 1 ? "" : "s"} without one. The title appears on hover and helps readers.`
|
|
6245
6292
|
};
|
|
6246
6293
|
}
|
|
6247
6294
|
const sparse = titles.filter((t) => t.trim().split(/\s+/).filter(Boolean).length < 2);
|
|
@@ -6369,7 +6416,7 @@ function HealthBadge({ result }) {
|
|
|
6369
6416
|
error: { color: "#dc2626", label: "ERR" }
|
|
6370
6417
|
};
|
|
6371
6418
|
const c = map[result.category];
|
|
6372
|
-
return /* @__PURE__ */ (0,
|
|
6419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.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 });
|
|
6373
6420
|
}
|
|
6374
6421
|
function LinkCheckCard({
|
|
6375
6422
|
urls,
|
|
@@ -6380,15 +6427,15 @@ function LinkCheckCard({
|
|
|
6380
6427
|
hasRun,
|
|
6381
6428
|
onCheck
|
|
6382
6429
|
}) {
|
|
6383
|
-
const [openBucket, setOpenBucket] = (0,
|
|
6430
|
+
const [openBucket, setOpenBucket] = (0, import_react19.useState)(null);
|
|
6384
6431
|
const haveTypes = !!linksDetailed;
|
|
6385
|
-
const detailByUrl = (0,
|
|
6432
|
+
const detailByUrl = (0, import_react19.useMemo)(
|
|
6386
6433
|
() => new Map((linksDetailed || []).map((d) => [d.url, d])),
|
|
6387
6434
|
[linksDetailed]
|
|
6388
6435
|
);
|
|
6389
|
-
const resultByUrl = (0,
|
|
6436
|
+
const resultByUrl = (0, import_react19.useMemo)(() => new Map(results.map((r) => [r.url, r])), [results]);
|
|
6390
6437
|
const blockedUrls = results.filter((r) => r.category === "unverified").map((r) => r.url);
|
|
6391
|
-
const tiles = (0,
|
|
6438
|
+
const tiles = (0, import_react19.useMemo)(() => {
|
|
6392
6439
|
const hyper = (linksDetailed || []).filter((l) => l.hyperlinked).map((l) => l.url);
|
|
6393
6440
|
const plain = (linksDetailed || []).filter((l) => !l.hyperlinked).map((l) => l.url);
|
|
6394
6441
|
const working = results.filter((r) => r.category === "ok" || r.category === "redirect").map((r) => r.url);
|
|
@@ -6404,7 +6451,7 @@ function LinkCheckCard({
|
|
|
6404
6451
|
const renderLinkRow = (url) => {
|
|
6405
6452
|
const d = detailByUrl.get(url);
|
|
6406
6453
|
const r = resultByUrl.get(url);
|
|
6407
|
-
return /* @__PURE__ */ (0,
|
|
6454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6408
6455
|
"a",
|
|
6409
6456
|
{
|
|
6410
6457
|
href: url,
|
|
@@ -6412,37 +6459,37 @@ function LinkCheckCard({
|
|
|
6412
6459
|
rel: "noopener noreferrer",
|
|
6413
6460
|
style: { display: "flex", gap: 8, alignItems: "flex-start", padding: "6px 8px", background: "rgba(0,0,0,0.025)", borderRadius: 6, textDecoration: "none", marginTop: 4 },
|
|
6414
6461
|
children: [
|
|
6415
|
-
r && /* @__PURE__ */ (0,
|
|
6416
|
-
/* @__PURE__ */ (0,
|
|
6417
|
-
d?.anchorText && /* @__PURE__ */ (0,
|
|
6462
|
+
r && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(HealthBadge, { result: r }),
|
|
6463
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { minWidth: 0, flex: 1 }, children: [
|
|
6464
|
+
d?.anchorText && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
|
|
6418
6465
|
"\u201C",
|
|
6419
6466
|
d.anchorText,
|
|
6420
6467
|
"\u201D"
|
|
6421
6468
|
] }),
|
|
6422
|
-
/* @__PURE__ */ (0,
|
|
6469
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
|
|
6423
6470
|
] })
|
|
6424
6471
|
]
|
|
6425
6472
|
},
|
|
6426
6473
|
url
|
|
6427
6474
|
);
|
|
6428
6475
|
};
|
|
6429
|
-
return /* @__PURE__ */ (0,
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6431
|
-
/* @__PURE__ */ (0,
|
|
6432
|
-
hasRun && !isLoading && /* @__PURE__ */ (0,
|
|
6476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { id: "anchor-link-check", style: cardStyle6, children: [
|
|
6477
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
|
|
6478
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
|
|
6479
|
+
hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.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" })
|
|
6433
6480
|
] }),
|
|
6434
|
-
urls.length === 0 ? /* @__PURE__ */ (0,
|
|
6435
|
-
/* @__PURE__ */ (0,
|
|
6481
|
+
urls.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
6482
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
|
|
6436
6483
|
urls.length,
|
|
6437
6484
|
" link",
|
|
6438
6485
|
urls.length === 1 ? "" : "s",
|
|
6439
6486
|
" in the body.",
|
|
6440
6487
|
tiles.length > 0 ? " Tap a box to see which." : ""
|
|
6441
6488
|
] }),
|
|
6442
|
-
tiles.length > 0 && /* @__PURE__ */ (0,
|
|
6489
|
+
tiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
|
|
6443
6490
|
const empty = t.urls.length === 0;
|
|
6444
6491
|
const active = openBucket === t.key && !empty;
|
|
6445
|
-
return /* @__PURE__ */ (0,
|
|
6492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6446
6493
|
"button",
|
|
6447
6494
|
{
|
|
6448
6495
|
type: "button",
|
|
@@ -6459,24 +6506,24 @@ function LinkCheckCard({
|
|
|
6459
6506
|
opacity: empty ? 0.5 : 1
|
|
6460
6507
|
},
|
|
6461
6508
|
children: [
|
|
6462
|
-
/* @__PURE__ */ (0,
|
|
6463
|
-
/* @__PURE__ */ (0,
|
|
6509
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
|
|
6510
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
|
|
6464
6511
|
]
|
|
6465
6512
|
},
|
|
6466
6513
|
t.key
|
|
6467
6514
|
);
|
|
6468
6515
|
}) }),
|
|
6469
|
-
open && open.urls.length > 0 && /* @__PURE__ */ (0,
|
|
6470
|
-
open.note && /* @__PURE__ */ (0,
|
|
6516
|
+
open && open.urls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { marginTop: 8 }, children: [
|
|
6517
|
+
open.note && /* @__PURE__ */ (0, import_jsx_runtime17.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 }),
|
|
6471
6518
|
open.urls.map(renderLinkRow)
|
|
6472
6519
|
] }),
|
|
6473
|
-
hasRun && blockedUrls.length > 0 && /* @__PURE__ */ (0,
|
|
6520
|
+
hasRun && blockedUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.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: [
|
|
6474
6521
|
blockedUrls.length,
|
|
6475
6522
|
" link",
|
|
6476
6523
|
blockedUrls.length === 1 ? "" : "s",
|
|
6477
6524
|
" couldn't be auto-checked (the destination blocks our checker) - open them to confirm."
|
|
6478
6525
|
] }),
|
|
6479
|
-
!hasRun && !isLoading && /* @__PURE__ */ (0,
|
|
6526
|
+
!hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6480
6527
|
"button",
|
|
6481
6528
|
{
|
|
6482
6529
|
onClick: onCheck,
|
|
@@ -6490,9 +6537,9 @@ function LinkCheckCard({
|
|
|
6490
6537
|
]
|
|
6491
6538
|
}
|
|
6492
6539
|
),
|
|
6493
|
-
isLoading && /* @__PURE__ */ (0,
|
|
6494
|
-
/* @__PURE__ */ (0,
|
|
6495
|
-
/* @__PURE__ */ (0,
|
|
6540
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
|
|
6541
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
|
|
6542
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
|
|
6496
6543
|
"Checking ",
|
|
6497
6544
|
urls.length,
|
|
6498
6545
|
" link",
|
|
@@ -6500,9 +6547,9 @@ function LinkCheckCard({
|
|
|
6500
6547
|
"..."
|
|
6501
6548
|
] })
|
|
6502
6549
|
] }),
|
|
6503
|
-
error && !isLoading && /* @__PURE__ */ (0,
|
|
6550
|
+
error && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.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: [
|
|
6504
6551
|
error,
|
|
6505
|
-
/* @__PURE__ */ (0,
|
|
6552
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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" })
|
|
6506
6553
|
] })
|
|
6507
6554
|
] })
|
|
6508
6555
|
] });
|
|
@@ -6519,37 +6566,37 @@ function TechnicalTab({
|
|
|
6519
6566
|
hasRunLinkCheck,
|
|
6520
6567
|
onCheckLinks
|
|
6521
6568
|
}) {
|
|
6522
|
-
const urlSlugAudit = (0,
|
|
6569
|
+
const urlSlugAudit = (0, import_react19.useMemo)(
|
|
6523
6570
|
() => urlAudit(documentFields?.slug, primaryKeyword, secondaryKeyword),
|
|
6524
6571
|
[documentFields?.slug, primaryKeyword, secondaryKeyword]
|
|
6525
6572
|
);
|
|
6526
6573
|
const headings = documentFields?.headings || [];
|
|
6527
6574
|
const headingsDetailed = documentFields?.headingsDetailed;
|
|
6528
|
-
const headingsForStructure = (0,
|
|
6575
|
+
const headingsForStructure = (0, import_react19.useMemo)(
|
|
6529
6576
|
() => headingsDetailed ? headingsDetailed : headings.map((text2) => ({ text: text2, level: 2 })),
|
|
6530
6577
|
[headingsDetailed, headings]
|
|
6531
6578
|
);
|
|
6532
6579
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
6533
|
-
const structureAudits = (0,
|
|
6580
|
+
const structureAudits = (0, import_react19.useMemo)(
|
|
6534
6581
|
() => computeHeadingStructureAudits(headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings),
|
|
6535
6582
|
[headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings]
|
|
6536
6583
|
);
|
|
6537
6584
|
const imageNames = documentFields?.imageNames || [];
|
|
6538
|
-
const { filenames: imageFilenames, altTexts: imageAltTexts } = (0,
|
|
6585
|
+
const { filenames: imageFilenames, altTexts: imageAltTexts } = (0, import_react19.useMemo)(
|
|
6539
6586
|
() => classifyImageNames(imageNames),
|
|
6540
6587
|
[imageNames]
|
|
6541
6588
|
);
|
|
6542
|
-
const filenameAudit = (0,
|
|
6589
|
+
const filenameAudit = (0, import_react19.useMemo)(
|
|
6543
6590
|
() => imageFilenameAudit(imageFilenames),
|
|
6544
6591
|
[imageFilenames]
|
|
6545
6592
|
);
|
|
6546
|
-
const altTextAudit = (0,
|
|
6593
|
+
const altTextAudit = (0, import_react19.useMemo)(
|
|
6547
6594
|
() => imageAltTextAudit(imageAltTexts),
|
|
6548
6595
|
[imageAltTexts]
|
|
6549
6596
|
);
|
|
6550
6597
|
const imageTitles = documentFields?.imageTitles || [];
|
|
6551
6598
|
const imageCount = documentFields?.imageCount ?? 0;
|
|
6552
|
-
const imgTitleAudit = (0,
|
|
6599
|
+
const imgTitleAudit = (0, import_react19.useMemo)(
|
|
6553
6600
|
() => imageTitleAudit(imageTitles, imageCount),
|
|
6554
6601
|
[imageTitles, imageCount]
|
|
6555
6602
|
);
|
|
@@ -6576,13 +6623,13 @@ function TechnicalTab({
|
|
|
6576
6623
|
const bodyLinksDetailed = documentFields?.bodyLinksDetailed;
|
|
6577
6624
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
|
|
6578
6625
|
if (isLoading && !hasAnyField) {
|
|
6579
|
-
return /* @__PURE__ */ (0,
|
|
6580
|
-
/* @__PURE__ */ (0,
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
|
|
6627
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
|
|
6628
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
|
|
6582
6629
|
] });
|
|
6583
6630
|
}
|
|
6584
|
-
return /* @__PURE__ */ (0,
|
|
6585
|
-
/* @__PURE__ */ (0,
|
|
6631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
6632
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6586
6633
|
AuditCard2,
|
|
6587
6634
|
{
|
|
6588
6635
|
anchorId: "anchor-url-slug",
|
|
@@ -6590,10 +6637,10 @@ function TechnicalTab({
|
|
|
6590
6637
|
value: urlSlugAudit.value,
|
|
6591
6638
|
status: urlSlugAudit.status,
|
|
6592
6639
|
recommendation: urlSlugAudit.recommendation,
|
|
6593
|
-
footer: /* @__PURE__ */ (0,
|
|
6640
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SlugRedirectNotice, {})
|
|
6594
6641
|
}
|
|
6595
6642
|
),
|
|
6596
|
-
/* @__PURE__ */ (0,
|
|
6643
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6597
6644
|
LinkCheckCard,
|
|
6598
6645
|
{
|
|
6599
6646
|
urls: bodyLinks,
|
|
@@ -6605,7 +6652,7 @@ function TechnicalTab({
|
|
|
6605
6652
|
onCheck: onCheckLinks
|
|
6606
6653
|
}
|
|
6607
6654
|
),
|
|
6608
|
-
wordAudit && /* @__PURE__ */ (0,
|
|
6655
|
+
wordAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6609
6656
|
AuditCard2,
|
|
6610
6657
|
{
|
|
6611
6658
|
anchorId: "anchor-word-count",
|
|
@@ -6619,7 +6666,7 @@ function TechnicalTab({
|
|
|
6619
6666
|
const structIdx = structureAudits.findIndex(
|
|
6620
6667
|
(a) => a.label !== "Keywords in Headings" && a.label !== "Looks Like a Heading"
|
|
6621
6668
|
);
|
|
6622
|
-
return structureAudits.map((a, i) => /* @__PURE__ */ (0,
|
|
6669
|
+
return structureAudits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6623
6670
|
AuditCard2,
|
|
6624
6671
|
{
|
|
6625
6672
|
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,
|
|
@@ -6631,17 +6678,17 @@ function TechnicalTab({
|
|
|
6631
6678
|
`structure-${i}`
|
|
6632
6679
|
));
|
|
6633
6680
|
})(),
|
|
6634
|
-
(headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ (0,
|
|
6635
|
-
/* @__PURE__ */ (0,
|
|
6636
|
-
/* @__PURE__ */ (0,
|
|
6637
|
-
documentFields?.title && /* @__PURE__ */ (0,
|
|
6638
|
-
/* @__PURE__ */ (0,
|
|
6681
|
+
(headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
|
|
6682
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
|
|
6683
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
6684
|
+
documentFields?.title && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
|
|
6685
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
|
|
6639
6686
|
documentFields.title,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6687
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
|
|
6641
6688
|
] }),
|
|
6642
6689
|
(headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => {
|
|
6643
6690
|
const isH1 = h.level === 1;
|
|
6644
|
-
return /* @__PURE__ */ (0,
|
|
6691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6645
6692
|
"div",
|
|
6646
6693
|
{
|
|
6647
6694
|
style: {
|
|
@@ -6653,7 +6700,7 @@ function TechnicalTab({
|
|
|
6653
6700
|
paddingLeft: Math.max(0, (h.level - 2) * 12)
|
|
6654
6701
|
},
|
|
6655
6702
|
children: [
|
|
6656
|
-
/* @__PURE__ */ (0,
|
|
6703
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
|
|
6657
6704
|
"H",
|
|
6658
6705
|
h.level
|
|
6659
6706
|
] }),
|
|
@@ -6663,15 +6710,15 @@ function TechnicalTab({
|
|
|
6663
6710
|
i
|
|
6664
6711
|
);
|
|
6665
6712
|
}),
|
|
6666
|
-
(headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0,
|
|
6713
|
+
(headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
|
|
6667
6714
|
"+ ",
|
|
6668
6715
|
(headingsDetailed ?? headings).length - 12,
|
|
6669
6716
|
" more"
|
|
6670
6717
|
] })
|
|
6671
6718
|
] }),
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6719
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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." })
|
|
6673
6720
|
] }),
|
|
6674
|
-
imagesAudit && /* @__PURE__ */ (0,
|
|
6721
|
+
imagesAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6675
6722
|
AuditCard2,
|
|
6676
6723
|
{
|
|
6677
6724
|
anchorId: "anchor-images",
|
|
@@ -6681,7 +6728,7 @@ function TechnicalTab({
|
|
|
6681
6728
|
recommendation: imagesAudit.recommendation
|
|
6682
6729
|
}
|
|
6683
6730
|
),
|
|
6684
|
-
filenameAudit && /* @__PURE__ */ (0,
|
|
6731
|
+
filenameAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6685
6732
|
AuditCard2,
|
|
6686
6733
|
{
|
|
6687
6734
|
anchorId: "anchor-image-filenames",
|
|
@@ -6691,7 +6738,7 @@ function TechnicalTab({
|
|
|
6691
6738
|
recommendation: filenameAudit.recommendation
|
|
6692
6739
|
}
|
|
6693
6740
|
),
|
|
6694
|
-
altTextAudit && /* @__PURE__ */ (0,
|
|
6741
|
+
altTextAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6695
6742
|
AuditCard2,
|
|
6696
6743
|
{
|
|
6697
6744
|
anchorId: "anchor-image-alt",
|
|
@@ -6701,7 +6748,7 @@ function TechnicalTab({
|
|
|
6701
6748
|
recommendation: altTextAudit.recommendation
|
|
6702
6749
|
}
|
|
6703
6750
|
),
|
|
6704
|
-
imgTitleAudit && /* @__PURE__ */ (0,
|
|
6751
|
+
imgTitleAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6705
6752
|
AuditCard2,
|
|
6706
6753
|
{
|
|
6707
6754
|
anchorId: "anchor-image-titles",
|
|
@@ -6715,12 +6762,12 @@ function TechnicalTab({
|
|
|
6715
6762
|
}
|
|
6716
6763
|
|
|
6717
6764
|
// src/components/SEOCopilotPanel.tsx
|
|
6718
|
-
var
|
|
6765
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6719
6766
|
function LogoIcon2() {
|
|
6720
|
-
return /* @__PURE__ */ (0,
|
|
6721
|
-
/* @__PURE__ */ (0,
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
|
|
6768
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
|
|
6769
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
|
|
6770
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
|
|
6724
6771
|
] });
|
|
6725
6772
|
}
|
|
6726
6773
|
function PanelContent({
|
|
@@ -6762,14 +6809,14 @@ function PanelContent({
|
|
|
6762
6809
|
const keywordAnalysisState = externalAnalysis;
|
|
6763
6810
|
const effectivePrimary = selectedPrimary || externalAnalysis.analysis?.primaryKeyword?.term || "";
|
|
6764
6811
|
const effectiveSecondary = selectedSecondary || "";
|
|
6765
|
-
const containerRef = (0,
|
|
6766
|
-
const dragging = (0,
|
|
6767
|
-
const onMouseDown = (0,
|
|
6812
|
+
const containerRef = (0, import_react20.useRef)(null);
|
|
6813
|
+
const dragging = (0, import_react20.useRef)(false);
|
|
6814
|
+
const onMouseDown = (0, import_react20.useCallback)(() => {
|
|
6768
6815
|
dragging.current = true;
|
|
6769
6816
|
document.body.style.cursor = "row-resize";
|
|
6770
6817
|
document.body.style.userSelect = "none";
|
|
6771
6818
|
}, []);
|
|
6772
|
-
(0,
|
|
6819
|
+
(0, import_react20.useEffect)(() => {
|
|
6773
6820
|
const onMouseMove = (e) => {
|
|
6774
6821
|
if (!dragging.current || !containerRef.current) return;
|
|
6775
6822
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -6792,11 +6839,11 @@ function PanelContent({
|
|
|
6792
6839
|
const onboardSite = publication || "default";
|
|
6793
6840
|
const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
|
|
6794
6841
|
const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
|
|
6795
|
-
const [popupMode, setPopupMode] = (0,
|
|
6796
|
-
const [popupClosing, setPopupClosing] = (0,
|
|
6797
|
-
const onboardTimerRef = (0,
|
|
6798
|
-
const onboardFadeRef = (0,
|
|
6799
|
-
(0,
|
|
6842
|
+
const [popupMode, setPopupMode] = (0, import_react20.useState)("hidden");
|
|
6843
|
+
const [popupClosing, setPopupClosing] = (0, import_react20.useState)(false);
|
|
6844
|
+
const onboardTimerRef = (0, import_react20.useRef)(null);
|
|
6845
|
+
const onboardFadeRef = (0, import_react20.useRef)(null);
|
|
6846
|
+
(0, import_react20.useEffect)(() => {
|
|
6800
6847
|
let onboarded = false;
|
|
6801
6848
|
let shownThisSession = false;
|
|
6802
6849
|
try {
|
|
@@ -6826,13 +6873,13 @@ function PanelContent({
|
|
|
6826
6873
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6827
6874
|
};
|
|
6828
6875
|
}, [onboardKey, onboardSessionKey]);
|
|
6829
|
-
const markOnboarded = (0,
|
|
6876
|
+
const markOnboarded = (0, import_react20.useCallback)(() => {
|
|
6830
6877
|
try {
|
|
6831
6878
|
localStorage.setItem(onboardKey, "1");
|
|
6832
6879
|
} catch {
|
|
6833
6880
|
}
|
|
6834
6881
|
}, [onboardKey]);
|
|
6835
|
-
const dismissPopup = (0,
|
|
6882
|
+
const dismissPopup = (0, import_react20.useCallback)(() => {
|
|
6836
6883
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6837
6884
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6838
6885
|
markOnboarded();
|
|
@@ -6842,14 +6889,14 @@ function PanelContent({
|
|
|
6842
6889
|
setPopupClosing(false);
|
|
6843
6890
|
}, 180);
|
|
6844
6891
|
}, [markOnboarded]);
|
|
6845
|
-
const openPopupPersistent = (0,
|
|
6892
|
+
const openPopupPersistent = (0, import_react20.useCallback)(() => {
|
|
6846
6893
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6847
6894
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6848
6895
|
markOnboarded();
|
|
6849
6896
|
setPopupClosing(false);
|
|
6850
6897
|
setPopupMode("persistent");
|
|
6851
6898
|
}, [markOnboarded]);
|
|
6852
|
-
const handleTabChange = (0,
|
|
6899
|
+
const handleTabChange = (0, import_react20.useCallback)((id) => {
|
|
6853
6900
|
markOnboarded();
|
|
6854
6901
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6855
6902
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
@@ -6868,7 +6915,7 @@ function PanelContent({
|
|
|
6868
6915
|
{ id: "meta", label: "Meta", beta: true },
|
|
6869
6916
|
{ id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
|
|
6870
6917
|
];
|
|
6871
|
-
return /* @__PURE__ */ (0,
|
|
6918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6872
6919
|
"div",
|
|
6873
6920
|
{
|
|
6874
6921
|
className: "seo-copilot-panel",
|
|
@@ -6883,9 +6930,9 @@ function PanelContent({
|
|
|
6883
6930
|
position: "relative"
|
|
6884
6931
|
},
|
|
6885
6932
|
children: [
|
|
6886
|
-
/* @__PURE__ */ (0,
|
|
6887
|
-
popupMode !== "hidden" && /* @__PURE__ */ (0,
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
6933
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
|
|
6934
|
+
popupMode !== "hidden" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
|
|
6935
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6889
6936
|
"div",
|
|
6890
6937
|
{
|
|
6891
6938
|
onMouseDown: isFloating ? onDragStart : void 0,
|
|
@@ -6903,16 +6950,16 @@ function PanelContent({
|
|
|
6903
6950
|
flexShrink: 0
|
|
6904
6951
|
},
|
|
6905
6952
|
children: [
|
|
6906
|
-
/* @__PURE__ */ (0,
|
|
6907
|
-
/* @__PURE__ */ (0,
|
|
6908
|
-
/* @__PURE__ */ (0,
|
|
6909
|
-
/* @__PURE__ */ (0,
|
|
6910
|
-
/* @__PURE__ */ (0,
|
|
6953
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(LogoIcon2, {}),
|
|
6955
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
|
|
6956
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { color: MJH_GOLD }, children: "SEO" }),
|
|
6957
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { color: MJH_SLATE }, children: " copilot" })
|
|
6911
6958
|
] })
|
|
6912
6959
|
] }),
|
|
6913
|
-
/* @__PURE__ */ (0,
|
|
6914
|
-
/* @__PURE__ */ (0,
|
|
6915
|
-
/* @__PURE__ */ (0,
|
|
6960
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
|
|
6961
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OnboardingInfoButton, { onClick: openPopupPersistent }),
|
|
6962
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6916
6963
|
ReportProblemButton,
|
|
6917
6964
|
{
|
|
6918
6965
|
activeTab,
|
|
@@ -6922,7 +6969,7 @@ function PanelContent({
|
|
|
6922
6969
|
primaryKeyword: effectivePrimary
|
|
6923
6970
|
}
|
|
6924
6971
|
),
|
|
6925
|
-
isFloating && onToggleFullscreen && /* @__PURE__ */ (0,
|
|
6972
|
+
isFloating && onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6926
6973
|
"button",
|
|
6927
6974
|
{
|
|
6928
6975
|
onClick: (e) => {
|
|
@@ -6944,16 +6991,16 @@ function PanelContent({
|
|
|
6944
6991
|
fontWeight: 600,
|
|
6945
6992
|
transition: "all 150ms"
|
|
6946
6993
|
},
|
|
6947
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
6948
|
-
/* @__PURE__ */ (0,
|
|
6994
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime18.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" }) }),
|
|
6949
6996
|
"Exit fullscreen"
|
|
6950
|
-
] }) : /* @__PURE__ */ (0,
|
|
6951
|
-
/* @__PURE__ */ (0,
|
|
6997
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6998
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime18.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" }) }),
|
|
6952
6999
|
"Fullscreen"
|
|
6953
7000
|
] })
|
|
6954
7001
|
}
|
|
6955
7002
|
),
|
|
6956
|
-
isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
7003
|
+
isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6957
7004
|
"button",
|
|
6958
7005
|
{
|
|
6959
7006
|
onClick: (e) => {
|
|
@@ -6976,7 +7023,7 @@ function PanelContent({
|
|
|
6976
7023
|
transition: "all 150ms"
|
|
6977
7024
|
},
|
|
6978
7025
|
children: [
|
|
6979
|
-
/* @__PURE__ */ (0,
|
|
7026
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6980
7027
|
"path",
|
|
6981
7028
|
{
|
|
6982
7029
|
fillRule: "evenodd",
|
|
@@ -6988,7 +7035,7 @@ function PanelContent({
|
|
|
6988
7035
|
]
|
|
6989
7036
|
}
|
|
6990
7037
|
),
|
|
6991
|
-
!isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
7038
|
+
!isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6992
7039
|
"button",
|
|
6993
7040
|
{
|
|
6994
7041
|
onClick: (e) => {
|
|
@@ -7007,13 +7054,13 @@ function PanelContent({
|
|
|
7007
7054
|
transition: "color 150ms"
|
|
7008
7055
|
},
|
|
7009
7056
|
title: "Pop out",
|
|
7010
|
-
children: /* @__PURE__ */ (0,
|
|
7011
|
-
/* @__PURE__ */ (0,
|
|
7012
|
-
/* @__PURE__ */ (0,
|
|
7057
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
7058
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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" }),
|
|
7059
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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" })
|
|
7013
7060
|
] })
|
|
7014
7061
|
}
|
|
7015
7062
|
),
|
|
7016
|
-
isLoading && /* @__PURE__ */ (0,
|
|
7063
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7017
7064
|
"div",
|
|
7018
7065
|
{
|
|
7019
7066
|
style: {
|
|
@@ -7025,7 +7072,7 @@ function PanelContent({
|
|
|
7025
7072
|
}
|
|
7026
7073
|
}
|
|
7027
7074
|
),
|
|
7028
|
-
onClose && /* @__PURE__ */ (0,
|
|
7075
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7029
7076
|
"button",
|
|
7030
7077
|
{
|
|
7031
7078
|
onClick: (e) => {
|
|
@@ -7044,11 +7091,11 @@ function PanelContent({
|
|
|
7044
7091
|
transition: "color 150ms"
|
|
7045
7092
|
},
|
|
7046
7093
|
title: "Close",
|
|
7047
|
-
children: /* @__PURE__ */ (0,
|
|
7094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime18.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" }) })
|
|
7048
7095
|
}
|
|
7049
7096
|
)
|
|
7050
7097
|
] }),
|
|
7051
|
-
/* @__PURE__ */ (0,
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7052
7099
|
"div",
|
|
7053
7100
|
{
|
|
7054
7101
|
style: {
|
|
@@ -7067,8 +7114,8 @@ function PanelContent({
|
|
|
7067
7114
|
]
|
|
7068
7115
|
}
|
|
7069
7116
|
),
|
|
7070
|
-
/* @__PURE__ */ (0,
|
|
7071
|
-
/* @__PURE__ */ (0,
|
|
7117
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
|
|
7118
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7072
7119
|
"div",
|
|
7073
7120
|
{
|
|
7074
7121
|
style: {
|
|
@@ -7084,8 +7131,8 @@ function PanelContent({
|
|
|
7084
7131
|
children: "Recommendations are generated by AI. Verify details before publishing."
|
|
7085
7132
|
}
|
|
7086
7133
|
),
|
|
7087
|
-
/* @__PURE__ */ (0,
|
|
7088
|
-
/* @__PURE__ */ (0,
|
|
7134
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
7135
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7089
7136
|
"div",
|
|
7090
7137
|
{
|
|
7091
7138
|
style: {
|
|
@@ -7096,7 +7143,7 @@ function PanelContent({
|
|
|
7096
7143
|
background: RECS_ZONE_BG
|
|
7097
7144
|
},
|
|
7098
7145
|
children: [
|
|
7099
|
-
/* @__PURE__ */ (0,
|
|
7146
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7100
7147
|
KeywordPanel,
|
|
7101
7148
|
{
|
|
7102
7149
|
text,
|
|
@@ -7108,11 +7155,12 @@ function PanelContent({
|
|
|
7108
7155
|
onSelectSecondary,
|
|
7109
7156
|
documentFields,
|
|
7110
7157
|
documentId,
|
|
7111
|
-
externalAnalysis: keywordAnalysisState
|
|
7158
|
+
externalAnalysis: keywordAnalysisState,
|
|
7159
|
+
focusKeyword: summaryOps.focusKeyword
|
|
7112
7160
|
},
|
|
7113
7161
|
documentId || "default"
|
|
7114
7162
|
) }),
|
|
7115
|
-
/* @__PURE__ */ (0,
|
|
7163
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7116
7164
|
SummaryTab,
|
|
7117
7165
|
{
|
|
7118
7166
|
text,
|
|
@@ -7125,10 +7173,11 @@ function PanelContent({
|
|
|
7125
7173
|
linkCheckResults: technicalOps.linkCheckResults,
|
|
7126
7174
|
isAnyLoading: summaryOps.isAnyLoading,
|
|
7127
7175
|
onGenerateAll: summaryOps.onGenerateAll,
|
|
7128
|
-
onItemClick: summaryOps.onItemClick
|
|
7176
|
+
onItemClick: summaryOps.onItemClick,
|
|
7177
|
+
onKeywordClick: summaryOps.onKeywordClick
|
|
7129
7178
|
}
|
|
7130
7179
|
) }),
|
|
7131
|
-
/* @__PURE__ */ (0,
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7132
7181
|
AEOTab,
|
|
7133
7182
|
{
|
|
7134
7183
|
text,
|
|
@@ -7144,7 +7193,7 @@ function PanelContent({
|
|
|
7144
7193
|
loadContentSuggestions: aeoOps.loadContentSuggestions
|
|
7145
7194
|
}
|
|
7146
7195
|
) }),
|
|
7147
|
-
/* @__PURE__ */ (0,
|
|
7196
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7148
7197
|
LinkingTab,
|
|
7149
7198
|
{
|
|
7150
7199
|
analysis: keywordAnalysisState.analysis,
|
|
@@ -7160,8 +7209,8 @@ function PanelContent({
|
|
|
7160
7209
|
documentType
|
|
7161
7210
|
}
|
|
7162
7211
|
) }),
|
|
7163
|
-
/* @__PURE__ */ (0,
|
|
7164
|
-
/* @__PURE__ */ (0,
|
|
7212
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
|
|
7213
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7165
7214
|
TechnicalTab,
|
|
7166
7215
|
{
|
|
7167
7216
|
text,
|
|
@@ -7179,7 +7228,7 @@ function PanelContent({
|
|
|
7179
7228
|
]
|
|
7180
7229
|
}
|
|
7181
7230
|
),
|
|
7182
|
-
chatOpen && /* @__PURE__ */ (0,
|
|
7231
|
+
chatOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7183
7232
|
"div",
|
|
7184
7233
|
{
|
|
7185
7234
|
onMouseDown,
|
|
@@ -7192,10 +7241,10 @@ function PanelContent({
|
|
|
7192
7241
|
justifyContent: "center",
|
|
7193
7242
|
flexShrink: 0
|
|
7194
7243
|
},
|
|
7195
|
-
children: /* @__PURE__ */ (0,
|
|
7244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
|
|
7196
7245
|
}
|
|
7197
7246
|
),
|
|
7198
|
-
/* @__PURE__ */ (0,
|
|
7247
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7199
7248
|
"div",
|
|
7200
7249
|
{
|
|
7201
7250
|
style: {
|
|
@@ -7208,7 +7257,7 @@ function PanelContent({
|
|
|
7208
7257
|
background: CHAT_ZONE_BG
|
|
7209
7258
|
},
|
|
7210
7259
|
children: [
|
|
7211
|
-
/* @__PURE__ */ (0,
|
|
7260
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7212
7261
|
"button",
|
|
7213
7262
|
{
|
|
7214
7263
|
onClick: () => onChatOpenChange(!chatOpen),
|
|
@@ -7229,7 +7278,7 @@ function PanelContent({
|
|
|
7229
7278
|
flexShrink: 0
|
|
7230
7279
|
},
|
|
7231
7280
|
children: [
|
|
7232
|
-
/* @__PURE__ */ (0,
|
|
7281
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7233
7282
|
"span",
|
|
7234
7283
|
{
|
|
7235
7284
|
style: {
|
|
@@ -7242,7 +7291,7 @@ function PanelContent({
|
|
|
7242
7291
|
children: "Chat"
|
|
7243
7292
|
}
|
|
7244
7293
|
),
|
|
7245
|
-
/* @__PURE__ */ (0,
|
|
7294
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7246
7295
|
"svg",
|
|
7247
7296
|
{
|
|
7248
7297
|
width: "12",
|
|
@@ -7250,7 +7299,7 @@ function PanelContent({
|
|
|
7250
7299
|
viewBox: "0 0 20 20",
|
|
7251
7300
|
fill: "rgba(0,0,0,0.55)",
|
|
7252
7301
|
style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
|
|
7253
|
-
children: /* @__PURE__ */ (0,
|
|
7302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7254
7303
|
"path",
|
|
7255
7304
|
{
|
|
7256
7305
|
fillRule: "evenodd",
|
|
@@ -7263,7 +7312,7 @@ function PanelContent({
|
|
|
7263
7312
|
]
|
|
7264
7313
|
}
|
|
7265
7314
|
),
|
|
7266
|
-
/* @__PURE__ */ (0,
|
|
7315
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7267
7316
|
"div",
|
|
7268
7317
|
{
|
|
7269
7318
|
style: {
|
|
@@ -7273,7 +7322,7 @@ function PanelContent({
|
|
|
7273
7322
|
flexDirection: "column",
|
|
7274
7323
|
minHeight: 0
|
|
7275
7324
|
},
|
|
7276
|
-
children: /* @__PURE__ */ (0,
|
|
7325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7277
7326
|
ChatPanel,
|
|
7278
7327
|
{
|
|
7279
7328
|
messages: chatState.messages,
|
|
@@ -7304,21 +7353,21 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7304
7353
|
"seo-copilot-ui-float-size",
|
|
7305
7354
|
{ width: 380, height: typeof window !== "undefined" ? Math.round(window.innerHeight * 0.8) : 600 }
|
|
7306
7355
|
);
|
|
7307
|
-
const dragOffset = (0,
|
|
7308
|
-
const resizeStart = (0,
|
|
7309
|
-
const activeDragCleanupRef = (0,
|
|
7310
|
-
const activeResizeCleanupRef = (0,
|
|
7356
|
+
const dragOffset = (0, import_react20.useRef)(null);
|
|
7357
|
+
const resizeStart = (0, import_react20.useRef)(null);
|
|
7358
|
+
const activeDragCleanupRef = (0, import_react20.useRef)(null);
|
|
7359
|
+
const activeResizeCleanupRef = (0, import_react20.useRef)(null);
|
|
7311
7360
|
const { text, isLoading: docLoading, documentFields, documentId, documentType } = useDocumentContent();
|
|
7312
7361
|
const { apiUrl } = useConfig();
|
|
7313
|
-
const workspace = (0,
|
|
7362
|
+
const workspace = (0, import_sanity3.useWorkspace)();
|
|
7314
7363
|
const effectivePublication = config.publication || workspace?.dataset;
|
|
7315
|
-
const sanityBaseUrl = (0,
|
|
7364
|
+
const sanityBaseUrl = (0, import_react20.useMemo)(() => {
|
|
7316
7365
|
if (typeof window === "undefined") return void 0;
|
|
7317
7366
|
const basePath = (workspace?.basePath || "/").replace(/\/+$/, "");
|
|
7318
7367
|
return `${window.location.origin}${basePath}`;
|
|
7319
7368
|
}, [workspace?.basePath]);
|
|
7320
7369
|
const seedCacheKey = documentId ? `seo-copilot-cache-${documentId}` : "seo-copilot-cache-v2";
|
|
7321
|
-
const loadSeedsFromCache = (0,
|
|
7370
|
+
const loadSeedsFromCache = (0, import_react20.useCallback)(() => {
|
|
7322
7371
|
try {
|
|
7323
7372
|
const c = localStorage.getItem(seedCacheKey);
|
|
7324
7373
|
if (c) return JSON.parse(c).seeds || [];
|
|
@@ -7326,8 +7375,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7326
7375
|
}
|
|
7327
7376
|
return [];
|
|
7328
7377
|
}, [seedCacheKey]);
|
|
7329
|
-
const [seedKeywords, setSeedKeywordsRaw] = (0,
|
|
7330
|
-
const setSeedKeywords = (0,
|
|
7378
|
+
const [seedKeywords, setSeedKeywordsRaw] = (0, import_react20.useState)(loadSeedsFromCache);
|
|
7379
|
+
const setSeedKeywords = (0, import_react20.useCallback)(
|
|
7331
7380
|
(seeds) => {
|
|
7332
7381
|
setSeedKeywordsRaw(seeds);
|
|
7333
7382
|
try {
|
|
@@ -7342,25 +7391,31 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7342
7391
|
const [selectedPrimary, setSelectedPrimary] = usePersistentState(selectedPrimaryKey, void 0);
|
|
7343
7392
|
const selectedSecondaryKey = documentId ? `seo-copilot-secondary-${documentId}` : "seo-copilot-secondary-default";
|
|
7344
7393
|
const [selectedSecondary, setSelectedSecondary] = usePersistentState(selectedSecondaryKey, "");
|
|
7345
|
-
const seedsInitializedRef = (0,
|
|
7346
|
-
(0,
|
|
7394
|
+
const seedsInitializedRef = (0, import_react20.useRef)(false);
|
|
7395
|
+
(0, import_react20.useEffect)(() => {
|
|
7347
7396
|
if (!seedsInitializedRef.current) {
|
|
7348
7397
|
seedsInitializedRef.current = true;
|
|
7349
7398
|
return;
|
|
7350
7399
|
}
|
|
7351
7400
|
setSeedKeywordsRaw(loadSeedsFromCache());
|
|
7352
7401
|
}, [documentId, loadSeedsFromCache]);
|
|
7353
|
-
const [activeTab, setActiveTab] = (0,
|
|
7402
|
+
const [activeTab, setActiveTab] = (0, import_react20.useState)("keywords");
|
|
7403
|
+
const [focusKeyword, setFocusKeyword] = (0, import_react20.useState)(void 0);
|
|
7404
|
+
const [focusDoc, setFocusDoc] = (0, import_react20.useState)(documentId);
|
|
7405
|
+
if (focusDoc !== documentId) {
|
|
7406
|
+
setFocusDoc(documentId);
|
|
7407
|
+
setFocusKeyword(void 0);
|
|
7408
|
+
}
|
|
7354
7409
|
const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
|
|
7355
7410
|
const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
|
|
7356
7411
|
const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId, selectedSecondary);
|
|
7357
7412
|
const effectivePrimary = selectedPrimary || keywordAnalysisState.analysis?.primaryKeyword?.term || "";
|
|
7358
|
-
(0,
|
|
7413
|
+
(0, import_react20.useEffect)(() => {
|
|
7359
7414
|
if (selectedSecondary && effectivePrimary && selectedSecondary.toLowerCase() === effectivePrimary.toLowerCase()) {
|
|
7360
7415
|
setSelectedSecondary("");
|
|
7361
7416
|
}
|
|
7362
7417
|
}, [effectivePrimary, selectedSecondary, setSelectedSecondary]);
|
|
7363
|
-
const keywordPanelData = (0,
|
|
7418
|
+
const keywordPanelData = (0, import_react20.useMemo)(() => {
|
|
7364
7419
|
const analysis = keywordAnalysisState.analysis;
|
|
7365
7420
|
if (!analysis) return void 0;
|
|
7366
7421
|
return {
|
|
@@ -7378,12 +7433,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7378
7433
|
const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
|
|
7379
7434
|
const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
|
|
7380
7435
|
const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
|
|
7381
|
-
const [isCSLoading, setIsCSLoading] = (0,
|
|
7382
|
-
const [csError, setCsError] = (0,
|
|
7383
|
-
const aeoOpVersionRef = (0,
|
|
7384
|
-
const csAbortRef = (0,
|
|
7385
|
-
const didInitAeoRef = (0,
|
|
7386
|
-
(0,
|
|
7436
|
+
const [isCSLoading, setIsCSLoading] = (0, import_react20.useState)(false);
|
|
7437
|
+
const [csError, setCsError] = (0, import_react20.useState)(null);
|
|
7438
|
+
const aeoOpVersionRef = (0, import_react20.useRef)(0);
|
|
7439
|
+
const csAbortRef = (0, import_react20.useRef)(null);
|
|
7440
|
+
const didInitAeoRef = (0, import_react20.useRef)(false);
|
|
7441
|
+
(0, import_react20.useEffect)(() => {
|
|
7387
7442
|
if (!didInitAeoRef.current) {
|
|
7388
7443
|
didInitAeoRef.current = true;
|
|
7389
7444
|
return;
|
|
@@ -7392,7 +7447,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7392
7447
|
setIsCSLoading(false);
|
|
7393
7448
|
setCsError(null);
|
|
7394
7449
|
}, [documentId]);
|
|
7395
|
-
const loadContentSuggestions = (0,
|
|
7450
|
+
const loadContentSuggestions = (0, import_react20.useCallback)(async () => {
|
|
7396
7451
|
const myVersion = aeoOpVersionRef.current;
|
|
7397
7452
|
setIsCSLoading(true);
|
|
7398
7453
|
setCsError(null);
|
|
@@ -7417,14 +7472,14 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7417
7472
|
}, [apiUrl, text, effectivePrimary, effectivePublication]);
|
|
7418
7473
|
const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
|
|
7419
7474
|
const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
|
|
7420
|
-
const [isLinkingLoading, setIsLinkingLoading] = (0,
|
|
7421
|
-
const [linkingError, setLinkingError] = (0,
|
|
7422
|
-
const [linkingFetchedText, setLinkingFetchedText] = (0,
|
|
7423
|
-
const linkingVersionRef = (0,
|
|
7424
|
-
const linkingAbortRef = (0,
|
|
7425
|
-
const didInitLinkingRef = (0,
|
|
7426
|
-
const lastLinkingFetchKey = (0,
|
|
7427
|
-
(0,
|
|
7475
|
+
const [isLinkingLoading, setIsLinkingLoading] = (0, import_react20.useState)(false);
|
|
7476
|
+
const [linkingError, setLinkingError] = (0, import_react20.useState)(null);
|
|
7477
|
+
const [linkingFetchedText, setLinkingFetchedText] = (0, import_react20.useState)("");
|
|
7478
|
+
const linkingVersionRef = (0, import_react20.useRef)(0);
|
|
7479
|
+
const linkingAbortRef = (0, import_react20.useRef)(null);
|
|
7480
|
+
const didInitLinkingRef = (0, import_react20.useRef)(false);
|
|
7481
|
+
const lastLinkingFetchKey = (0, import_react20.useRef)("");
|
|
7482
|
+
(0, import_react20.useEffect)(() => {
|
|
7428
7483
|
if (!didInitLinkingRef.current) {
|
|
7429
7484
|
didInitLinkingRef.current = true;
|
|
7430
7485
|
return;
|
|
@@ -7434,12 +7489,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7434
7489
|
setLinkingError(null);
|
|
7435
7490
|
lastLinkingFetchKey.current = "";
|
|
7436
7491
|
}, [documentId]);
|
|
7437
|
-
const supportingKeywordsForLinking = (0,
|
|
7492
|
+
const supportingKeywordsForLinking = (0, import_react20.useMemo)(() => {
|
|
7438
7493
|
const base = (keywordAnalysisState.analysis?.supportingKeywords || []).map((kw) => kw.term).filter(Boolean);
|
|
7439
7494
|
const merged = selectedSecondary ? [selectedSecondary, ...base.filter((t) => t.toLowerCase() !== selectedSecondary.toLowerCase())] : base;
|
|
7440
7495
|
return merged.slice(0, 5);
|
|
7441
7496
|
}, [keywordAnalysisState.analysis, selectedSecondary]);
|
|
7442
|
-
const refreshLinkingSuggestions = (0,
|
|
7497
|
+
const refreshLinkingSuggestions = (0, import_react20.useCallback)(async () => {
|
|
7443
7498
|
if (!text || text.trim().length < 50) return;
|
|
7444
7499
|
if (!effectivePrimary) return;
|
|
7445
7500
|
const myVersion = linkingVersionRef.current;
|
|
@@ -7469,12 +7524,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7469
7524
|
if (linkingVersionRef.current !== myVersion) return;
|
|
7470
7525
|
setIsLinkingLoading(false);
|
|
7471
7526
|
}, [apiUrl, text, effectivePrimary, supportingKeywordsForLinking, documentId, effectivePublication]);
|
|
7472
|
-
const isLinkingStale = (0,
|
|
7527
|
+
const isLinkingStale = (0, import_react20.useMemo)(() => {
|
|
7473
7528
|
if (!linkingFetchedText || linkingSuggestions.length === 0) return false;
|
|
7474
7529
|
if (Math.abs(text.length - linkingFetchedText.length) > 150) return true;
|
|
7475
7530
|
return text.slice(0, 300) !== linkingFetchedText.slice(0, 300);
|
|
7476
7531
|
}, [text, linkingFetchedText, linkingSuggestions.length]);
|
|
7477
|
-
(0,
|
|
7532
|
+
(0, import_react20.useEffect)(() => {
|
|
7478
7533
|
if (!text || text.trim().length < 50 || !effectivePrimary) return;
|
|
7479
7534
|
const fetchKey = `${documentId || "_"}|${effectivePrimary}|${supportingKeywordsForLinking.join(",")}`;
|
|
7480
7535
|
if (fetchKey === lastLinkingFetchKey.current) return;
|
|
@@ -7488,11 +7543,11 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7488
7543
|
const linkCheckKey = documentId ? `seo-copilot-link-check-${documentId}` : "seo-copilot-link-check-default";
|
|
7489
7544
|
const [linkCheckResults, setLinkCheckResults] = usePersistentState(linkCheckKey, []);
|
|
7490
7545
|
const [hasRunLinkCheck, setHasRunLinkCheck] = usePersistentState(`${linkCheckKey}-ran`, false);
|
|
7491
|
-
const [isLinkCheckLoading, setIsLinkCheckLoading] = (0,
|
|
7492
|
-
const [linkCheckError, setLinkCheckError] = (0,
|
|
7493
|
-
const linkCheckVersionRef = (0,
|
|
7494
|
-
const didInitLinkCheckRef = (0,
|
|
7495
|
-
(0,
|
|
7546
|
+
const [isLinkCheckLoading, setIsLinkCheckLoading] = (0, import_react20.useState)(false);
|
|
7547
|
+
const [linkCheckError, setLinkCheckError] = (0, import_react20.useState)(null);
|
|
7548
|
+
const linkCheckVersionRef = (0, import_react20.useRef)(0);
|
|
7549
|
+
const didInitLinkCheckRef = (0, import_react20.useRef)(false);
|
|
7550
|
+
(0, import_react20.useEffect)(() => {
|
|
7496
7551
|
if (!didInitLinkCheckRef.current) {
|
|
7497
7552
|
didInitLinkCheckRef.current = true;
|
|
7498
7553
|
return;
|
|
@@ -7501,7 +7556,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7501
7556
|
setIsLinkCheckLoading(false);
|
|
7502
7557
|
setLinkCheckError(null);
|
|
7503
7558
|
}, [documentId]);
|
|
7504
|
-
const runLinkCheck = (0,
|
|
7559
|
+
const runLinkCheck = (0, import_react20.useCallback)(async () => {
|
|
7505
7560
|
const urls = documentFields?.bodyLinks || [];
|
|
7506
7561
|
if (urls.length === 0) {
|
|
7507
7562
|
setHasRunLinkCheck(true);
|
|
@@ -7527,7 +7582,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7527
7582
|
if (linkCheckVersionRef.current !== myVersion) return;
|
|
7528
7583
|
setIsLinkCheckLoading(false);
|
|
7529
7584
|
}, [apiUrl, documentFields?.bodyLinks, setHasRunLinkCheck, setLinkCheckResults]);
|
|
7530
|
-
(0,
|
|
7585
|
+
(0, import_react20.useEffect)(() => {
|
|
7531
7586
|
return () => {
|
|
7532
7587
|
activeDragCleanupRef.current?.();
|
|
7533
7588
|
activeResizeCleanupRef.current?.();
|
|
@@ -7541,10 +7596,10 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7541
7596
|
if (text && text.trim().length >= 50 && effectivePrimary) refreshLinkingSuggestions();
|
|
7542
7597
|
if ((documentFields?.bodyLinks || []).length > 0) runLinkCheck();
|
|
7543
7598
|
};
|
|
7544
|
-
const runAllRef = (0,
|
|
7599
|
+
const runAllRef = (0, import_react20.useRef)(runAllAnalyses);
|
|
7545
7600
|
runAllRef.current = runAllAnalyses;
|
|
7546
|
-
const secAutoRunRef = (0,
|
|
7547
|
-
(0,
|
|
7601
|
+
const secAutoRunRef = (0, import_react20.useRef)({ doc: documentId, sec: selectedSecondary, init: true });
|
|
7602
|
+
(0, import_react20.useEffect)(() => {
|
|
7548
7603
|
const prev = secAutoRunRef.current;
|
|
7549
7604
|
const docChanged = prev.doc !== documentId;
|
|
7550
7605
|
const secChanged = prev.sec !== selectedSecondary;
|
|
@@ -7553,7 +7608,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7553
7608
|
const t = setTimeout(() => runAllRef.current(), 1500);
|
|
7554
7609
|
return () => clearTimeout(t);
|
|
7555
7610
|
}, [selectedSecondary, documentId]);
|
|
7556
|
-
const handleDragStart = (0,
|
|
7611
|
+
const handleDragStart = (0, import_react20.useCallback)(
|
|
7557
7612
|
(e) => {
|
|
7558
7613
|
dragOffset.current = {
|
|
7559
7614
|
dx: e.clientX - floatPos.x,
|
|
@@ -7587,7 +7642,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7587
7642
|
},
|
|
7588
7643
|
[floatPos]
|
|
7589
7644
|
);
|
|
7590
|
-
const handleResizeStart = (0,
|
|
7645
|
+
const handleResizeStart = (0, import_react20.useCallback)(
|
|
7591
7646
|
(e) => {
|
|
7592
7647
|
e.preventDefault();
|
|
7593
7648
|
e.stopPropagation();
|
|
@@ -7619,7 +7674,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7619
7674
|
},
|
|
7620
7675
|
[floatSize]
|
|
7621
7676
|
);
|
|
7622
|
-
const panelContent = /* @__PURE__ */ (0,
|
|
7677
|
+
const panelContent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7623
7678
|
PanelContent,
|
|
7624
7679
|
{
|
|
7625
7680
|
initialPublication: effectivePublication,
|
|
@@ -7686,6 +7741,11 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7686
7741
|
summaryOps: {
|
|
7687
7742
|
isAnyLoading: keywordAnalysisState.isLoading || keywordAnalysisState.isVolumesLoading || keywordAnalysisState.isDeepLoading || isCSLoading || isLinkingLoading || isLinkCheckLoading,
|
|
7688
7743
|
onGenerateAll: runAllAnalyses,
|
|
7744
|
+
focusKeyword,
|
|
7745
|
+
onKeywordClick: (term) => {
|
|
7746
|
+
setActiveTab("keywords");
|
|
7747
|
+
setFocusKeyword((prev) => ({ term, nonce: (prev?.nonce ?? 0) + 1 }));
|
|
7748
|
+
},
|
|
7689
7749
|
onItemClick: (item) => {
|
|
7690
7750
|
setActiveTab(item.jumpTo.tab);
|
|
7691
7751
|
const id = item.jumpTo.anchorId;
|
|
@@ -7701,7 +7761,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7701
7761
|
}
|
|
7702
7762
|
}
|
|
7703
7763
|
);
|
|
7704
|
-
const floatingPanel = /* @__PURE__ */ (0,
|
|
7764
|
+
const floatingPanel = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7705
7765
|
"div",
|
|
7706
7766
|
{
|
|
7707
7767
|
style: {
|
|
@@ -7719,7 +7779,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7719
7779
|
},
|
|
7720
7780
|
children: [
|
|
7721
7781
|
panelContent,
|
|
7722
|
-
!isFullscreen && /* @__PURE__ */ (0,
|
|
7782
|
+
!isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7723
7783
|
"div",
|
|
7724
7784
|
{
|
|
7725
7785
|
onMouseDown: handleResizeStart,
|
|
@@ -7734,9 +7794,9 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7734
7794
|
alignItems: "center",
|
|
7735
7795
|
justifyContent: "center"
|
|
7736
7796
|
},
|
|
7737
|
-
children: /* @__PURE__ */ (0,
|
|
7738
|
-
/* @__PURE__ */ (0,
|
|
7739
|
-
/* @__PURE__ */ (0,
|
|
7797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
|
|
7798
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
7799
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
7740
7800
|
] })
|
|
7741
7801
|
}
|
|
7742
7802
|
)
|
|
@@ -7744,8 +7804,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7744
7804
|
}
|
|
7745
7805
|
);
|
|
7746
7806
|
if (isFloating) {
|
|
7747
|
-
return /* @__PURE__ */ (0,
|
|
7748
|
-
/* @__PURE__ */ (0,
|
|
7807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
7808
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7749
7809
|
"div",
|
|
7750
7810
|
{
|
|
7751
7811
|
style: {
|
|
@@ -7755,30 +7815,30 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7755
7815
|
alignItems: "center",
|
|
7756
7816
|
justifyContent: "center"
|
|
7757
7817
|
},
|
|
7758
|
-
children: /* @__PURE__ */ (0,
|
|
7818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
|
|
7759
7819
|
}
|
|
7760
7820
|
),
|
|
7761
7821
|
typeof document !== "undefined" && (0, import_react_dom.createPortal)(floatingPanel, document.body)
|
|
7762
7822
|
] });
|
|
7763
7823
|
}
|
|
7764
|
-
return /* @__PURE__ */ (0,
|
|
7824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
|
|
7765
7825
|
}
|
|
7766
7826
|
function SEOCopilotPanel({ config, onClose }) {
|
|
7767
|
-
return /* @__PURE__ */ (0,
|
|
7768
|
-
|
|
7827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7828
|
+
import_react20.Suspense,
|
|
7769
7829
|
{
|
|
7770
|
-
fallback: /* @__PURE__ */ (0,
|
|
7771
|
-
/* @__PURE__ */ (0,
|
|
7772
|
-
/* @__PURE__ */ (0,
|
|
7830
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
7831
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(LoadingBars, {}),
|
|
7832
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
|
|
7773
7833
|
] }),
|
|
7774
|
-
children: /* @__PURE__ */ (0,
|
|
7834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SEOCopilotInner, { config, onClose }) })
|
|
7775
7835
|
}
|
|
7776
7836
|
);
|
|
7777
7837
|
}
|
|
7778
7838
|
function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
7779
7839
|
const barWidth = size === "xs" ? 4 : 6;
|
|
7780
7840
|
const containerHeight = size === "xs" ? 10 : 14;
|
|
7781
|
-
return /* @__PURE__ */ (0,
|
|
7841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7782
7842
|
"div",
|
|
7783
7843
|
{
|
|
7784
7844
|
style: {
|
|
@@ -7795,11 +7855,11 @@ function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
|
7795
7855
|
|
|
7796
7856
|
// src/inspector.ts
|
|
7797
7857
|
function SEOIcon() {
|
|
7798
|
-
return (0,
|
|
7858
|
+
return (0, import_react21.createElement)(
|
|
7799
7859
|
"svg",
|
|
7800
7860
|
{ viewBox: "0 0 25 25", width: "1em", height: "1em", fill: "none" },
|
|
7801
|
-
(0,
|
|
7802
|
-
(0,
|
|
7861
|
+
(0, import_react21.createElement)("circle", { cx: "12.5", cy: "12.5", r: "11.5", fill: "#E6C01B" }),
|
|
7862
|
+
(0, import_react21.createElement)("text", {
|
|
7803
7863
|
x: "12.5",
|
|
7804
7864
|
y: "7.5",
|
|
7805
7865
|
textAnchor: "middle",
|
|
@@ -7809,7 +7869,7 @@ function SEOIcon() {
|
|
|
7809
7869
|
fontWeight: "900",
|
|
7810
7870
|
fontFamily: "Arial Black, Impact, sans-serif"
|
|
7811
7871
|
}, "S"),
|
|
7812
|
-
(0,
|
|
7872
|
+
(0, import_react21.createElement)("text", {
|
|
7813
7873
|
x: "12.5",
|
|
7814
7874
|
y: "12.8",
|
|
7815
7875
|
textAnchor: "middle",
|
|
@@ -7819,7 +7879,7 @@ function SEOIcon() {
|
|
|
7819
7879
|
fontWeight: "900",
|
|
7820
7880
|
fontFamily: "Arial Black, Impact, sans-serif"
|
|
7821
7881
|
}, "E"),
|
|
7822
|
-
(0,
|
|
7882
|
+
(0, import_react21.createElement)("text", {
|
|
7823
7883
|
x: "12.5",
|
|
7824
7884
|
y: "18",
|
|
7825
7885
|
textAnchor: "middle",
|
|
@@ -7839,21 +7899,21 @@ function seoCopilotInspector(config) {
|
|
|
7839
7899
|
icon: SEOIcon,
|
|
7840
7900
|
// Toolbar placement test: showAsAction renders this as a button in the document
|
|
7841
7901
|
// toolbar (where editors expect it). The original crash came from passing
|
|
7842
|
-
// showAsAction
|
|
7902
|
+
// showAsAction without a tone; pairing it with a valid string tone is how Sanity's
|
|
7843
7903
|
// own built-in inspectors (Validation, etc.) keep their toolbar button safely.
|
|
7844
|
-
// If this still crashes in
|
|
7904
|
+
// If this still crashes in the production Studio, remove these two lines to fall back to
|
|
7845
7905
|
// the "..." overflow menu (the known-safe placement).
|
|
7846
7906
|
showAsAction: true,
|
|
7847
7907
|
tone: "default"
|
|
7848
7908
|
}),
|
|
7849
7909
|
component: function SEOCopilotInspector(props) {
|
|
7850
|
-
return (0,
|
|
7910
|
+
return (0, import_react21.createElement)(SEOCopilotPanel, { ...props, config });
|
|
7851
7911
|
}
|
|
7852
7912
|
};
|
|
7853
7913
|
}
|
|
7854
7914
|
|
|
7855
7915
|
// src/index.ts
|
|
7856
|
-
var seoCopilot = (0,
|
|
7916
|
+
var seoCopilot = (0, import_sanity4.definePlugin)((config) => {
|
|
7857
7917
|
return {
|
|
7858
7918
|
name: "seo-copilot",
|
|
7859
7919
|
document: {
|
|
@@ -7867,4 +7927,3 @@ var seoCopilot = (0, import_sanity5.definePlugin)((config) => {
|
|
|
7867
7927
|
0 && (module.exports = {
|
|
7868
7928
|
seoCopilot
|
|
7869
7929
|
});
|
|
7870
|
-
//# sourceMappingURL=index.js.map
|