sanity-plugin-seo-copilot 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -50
- package/dist/index.js +868 -797
- package/dist/index.mjs +791 -720
- package/package.json +9 -8
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/sanity.json +0 -3
- package/src/components/ChatPanel.tsx +0 -311
- package/src/components/ConfigContext.tsx +0 -22
- package/src/components/FeedbackButton.tsx +0 -218
- package/src/components/KeywordBadge.tsx +0 -50
- package/src/components/KeywordPanel.tsx +0 -1233
- package/src/components/OnboardingPopup.tsx +0 -108
- package/src/components/PlacementIndicators.tsx +0 -80
- package/src/components/ReportProblemButton.tsx +0 -212
- package/src/components/SEOCopilotPanel.tsx +0 -1287
- package/src/components/ScoreDonut.tsx +0 -158
- package/src/components/SeedKeywordInput.tsx +0 -128
- package/src/components/ShimmerLoader.tsx +0 -123
- package/src/components/TabBar.tsx +0 -373
- package/src/components/styles.ts +0 -158
- package/src/components/tabs/AEOTab.tsx +0 -585
- package/src/components/tabs/LinkingTab.tsx +0 -446
- package/src/components/tabs/MetaTab.tsx +0 -431
- package/src/components/tabs/SummaryTab.tsx +0 -405
- package/src/components/tabs/TechnicalTab.tsx +0 -933
- package/src/hooks/useDocumentContent.ts +0 -48
- package/src/hooks/useKeywordAnalysis.ts +0 -292
- package/src/hooks/useSEOChat.ts +0 -254
- package/src/index.ts +0 -16
- package/src/inspector.ts +0 -58
- package/src/lib/api.ts +0 -260
- package/src/lib/documentExtract.ts +0 -422
- package/src/lib/geoAnalysis.ts +0 -122
- package/src/lib/persistence.ts +0 -69
- package/src/lib/scoring.ts +0 -197
- package/src/lib/summary.ts +0 -645
- package/src/lib/types.ts +0 -212
- package/src/lib/utils.ts +0 -35
- package/v2-incompatible.js +0 -10
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
|
|
@@ -423,6 +423,15 @@ function useDocumentContent() {
|
|
|
423
423
|
// src/hooks/useKeywordAnalysis.ts
|
|
424
424
|
var import_react2 = require("react");
|
|
425
425
|
|
|
426
|
+
// src/lib/apiKey.ts
|
|
427
|
+
var SHARED_CLIENT_KEY = "seo-copilot-public-client-key-v1";
|
|
428
|
+
function authHeaders() {
|
|
429
|
+
return { "x-api-key": SHARED_CLIENT_KEY };
|
|
430
|
+
}
|
|
431
|
+
function jsonHeaders() {
|
|
432
|
+
return { "Content-Type": "application/json", ...authHeaders() };
|
|
433
|
+
}
|
|
434
|
+
|
|
426
435
|
// src/lib/api.ts
|
|
427
436
|
function safeParseJson(text) {
|
|
428
437
|
try {
|
|
@@ -443,7 +452,7 @@ function safeParseJson(text) {
|
|
|
443
452
|
async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, documentFields, focusKeyword, secondaryKeyword, signal) {
|
|
444
453
|
const response = await fetch(`${apiUrl}/api/seo-copilot/analyze`, {
|
|
445
454
|
method: "POST",
|
|
446
|
-
headers:
|
|
455
|
+
headers: jsonHeaders(),
|
|
447
456
|
body: JSON.stringify({ content, mode, publication, seedKeywords, documentFields, focusKeyword, secondaryKeyword }),
|
|
448
457
|
signal
|
|
449
458
|
});
|
|
@@ -458,7 +467,7 @@ async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, d
|
|
|
458
467
|
async function fetchChatStream(apiUrl, messages, documentContext, publication, keywordPanelData, signal) {
|
|
459
468
|
const response = await fetch(`${apiUrl}/api/seo-copilot/chat`, {
|
|
460
469
|
method: "POST",
|
|
461
|
-
headers:
|
|
470
|
+
headers: jsonHeaders(),
|
|
462
471
|
body: JSON.stringify({ messages, documentContext, publication, keywordPanelData }),
|
|
463
472
|
signal
|
|
464
473
|
});
|
|
@@ -472,7 +481,7 @@ async function fetchChatStream(apiUrl, messages, documentContext, publication, k
|
|
|
472
481
|
async function submitFeedback(apiUrl, data) {
|
|
473
482
|
const res = await fetch(`${apiUrl}/api/seo-copilot/feedback`, {
|
|
474
483
|
method: "POST",
|
|
475
|
-
headers:
|
|
484
|
+
headers: jsonHeaders(),
|
|
476
485
|
body: JSON.stringify(data)
|
|
477
486
|
});
|
|
478
487
|
if (!res.ok) throw new Error(`Feedback submit failed: HTTP ${res.status}`);
|
|
@@ -480,7 +489,7 @@ async function submitFeedback(apiUrl, data) {
|
|
|
480
489
|
async function lookupKeywords(apiUrl, keywords, signal) {
|
|
481
490
|
const response = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
|
|
482
491
|
method: "POST",
|
|
483
|
-
headers:
|
|
492
|
+
headers: jsonHeaders(),
|
|
484
493
|
body: JSON.stringify({ keywords }),
|
|
485
494
|
signal
|
|
486
495
|
});
|
|
@@ -491,24 +500,12 @@ async function lookupKeywords(apiUrl, keywords, signal) {
|
|
|
491
500
|
}
|
|
492
501
|
return response.json();
|
|
493
502
|
}
|
|
494
|
-
async function loadChatHistory(apiUrl, userId, documentId) {
|
|
495
|
-
try {
|
|
496
|
-
const res = await fetch(
|
|
497
|
-
`${apiUrl}/api/seo-copilot/chat-history?userId=${encodeURIComponent(userId)}&documentId=${encodeURIComponent(documentId)}`
|
|
498
|
-
);
|
|
499
|
-
if (!res.ok) return [];
|
|
500
|
-
const data = await res.json();
|
|
501
|
-
return data.messages || [];
|
|
502
|
-
} catch {
|
|
503
|
-
return [];
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
503
|
async function fetchContentSuggestions(apiUrl, content, primaryKeyword, publication, signal) {
|
|
507
504
|
const empty = { keyTakeaways: [], infographicOpportunities: [], bulletListItems: [] };
|
|
508
505
|
try {
|
|
509
506
|
const res = await fetch(`${apiUrl}/api/seo-copilot/content-suggestions`, {
|
|
510
507
|
method: "POST",
|
|
511
|
-
headers:
|
|
508
|
+
headers: jsonHeaders(),
|
|
512
509
|
body: JSON.stringify({ content, primaryKeyword, publication }),
|
|
513
510
|
signal
|
|
514
511
|
});
|
|
@@ -529,7 +526,7 @@ async function fetchLinkingSuggestions(apiUrl, content, primaryKeyword, supporti
|
|
|
529
526
|
try {
|
|
530
527
|
const res = await fetch(`${apiUrl}/api/seo-copilot/linking-suggestions`, {
|
|
531
528
|
method: "POST",
|
|
532
|
-
headers:
|
|
529
|
+
headers: jsonHeaders(),
|
|
533
530
|
body: JSON.stringify({ content, primaryKeyword, supportingKeywords, currentDocumentId, publication }),
|
|
534
531
|
signal
|
|
535
532
|
});
|
|
@@ -546,7 +543,7 @@ async function checkLinks(apiUrl, urls) {
|
|
|
546
543
|
try {
|
|
547
544
|
const res = await fetch(`${apiUrl}/api/seo-copilot/check-links`, {
|
|
548
545
|
method: "POST",
|
|
549
|
-
headers:
|
|
546
|
+
headers: jsonHeaders(),
|
|
550
547
|
body: JSON.stringify({ urls })
|
|
551
548
|
});
|
|
552
549
|
if (!res.ok) return [];
|
|
@@ -557,16 +554,6 @@ async function checkLinks(apiUrl, urls) {
|
|
|
557
554
|
return [];
|
|
558
555
|
}
|
|
559
556
|
}
|
|
560
|
-
async function saveChatHistory(apiUrl, userId, documentId, messages, publication) {
|
|
561
|
-
try {
|
|
562
|
-
await fetch(`${apiUrl}/api/seo-copilot/chat-history`, {
|
|
563
|
-
method: "POST",
|
|
564
|
-
headers: { "Content-Type": "application/json" },
|
|
565
|
-
body: JSON.stringify({ userId, documentId, messages, publication })
|
|
566
|
-
});
|
|
567
|
-
} catch {
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
557
|
|
|
571
558
|
// src/hooks/useKeywordAnalysis.ts
|
|
572
559
|
function mergeVolumes(analysis, volumeMap) {
|
|
@@ -798,21 +785,6 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
|
|
|
798
785
|
|
|
799
786
|
// src/hooks/useSEOChat.ts
|
|
800
787
|
var import_react3 = require("react");
|
|
801
|
-
var import_sanity = require("sanity");
|
|
802
|
-
function getLocalUserId() {
|
|
803
|
-
if (typeof window === "undefined") return "anonymous";
|
|
804
|
-
const key = "seo-copilot-user-id";
|
|
805
|
-
try {
|
|
806
|
-
let id = localStorage.getItem(key);
|
|
807
|
-
if (!id) {
|
|
808
|
-
id = `user-${Math.random().toString(36).slice(2)}-${Date.now()}`;
|
|
809
|
-
localStorage.setItem(key, id);
|
|
810
|
-
}
|
|
811
|
-
return id;
|
|
812
|
-
} catch {
|
|
813
|
-
return "anonymous";
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
788
|
function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documentId) {
|
|
817
789
|
const chatCacheKey = documentId ? `seo-copilot-chat-${documentId}` : "seo-copilot-chat-default";
|
|
818
790
|
const loadCachedMessages = (0, import_react3.useCallback)(() => {
|
|
@@ -829,14 +801,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
829
801
|
setMessagesRaw(msgs);
|
|
830
802
|
}, []);
|
|
831
803
|
const [isStreaming, setIsStreaming] = (0, import_react3.useState)(false);
|
|
832
|
-
const [historyLoaded, setHistoryLoaded] = (0, import_react3.useState)(false);
|
|
833
|
-
const sanityUser = (0, import_sanity.useCurrentUser)();
|
|
834
|
-
const userId = (0, import_react3.useRef)(sanityUser?.id || getLocalUserId());
|
|
835
|
-
(0, import_react3.useEffect)(() => {
|
|
836
|
-
if (sanityUser?.id && userId.current !== sanityUser.id) {
|
|
837
|
-
userId.current = sanityUser.id;
|
|
838
|
-
}
|
|
839
|
-
}, [sanityUser?.id]);
|
|
840
804
|
(0, import_react3.useEffect)(() => {
|
|
841
805
|
messagesRef.current = messages;
|
|
842
806
|
}, [messages]);
|
|
@@ -853,10 +817,8 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
853
817
|
(0, import_react3.useEffect)(() => {
|
|
854
818
|
return () => {
|
|
855
819
|
streamAbortRef.current?.abort();
|
|
856
|
-
if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
|
|
857
820
|
};
|
|
858
821
|
}, []);
|
|
859
|
-
const saveTimerRef = (0, import_react3.useRef)(null);
|
|
860
822
|
const opVersionRef = (0, import_react3.useRef)(0);
|
|
861
823
|
const didInitRef = (0, import_react3.useRef)(false);
|
|
862
824
|
(0, import_react3.useEffect)(() => {
|
|
@@ -869,34 +831,7 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
869
831
|
streamAbortRef.current = null;
|
|
870
832
|
setMessagesRaw(loadCachedMessages());
|
|
871
833
|
setIsStreaming(false);
|
|
872
|
-
setHistoryLoaded(false);
|
|
873
|
-
if (saveTimerRef.current) {
|
|
874
|
-
clearTimeout(saveTimerRef.current);
|
|
875
|
-
saveTimerRef.current = null;
|
|
876
|
-
}
|
|
877
834
|
}, [documentId, loadCachedMessages]);
|
|
878
|
-
(0, import_react3.useEffect)(() => {
|
|
879
|
-
if (!documentId || historyLoaded) return;
|
|
880
|
-
const myVersion = opVersionRef.current;
|
|
881
|
-
let cancelled = false;
|
|
882
|
-
loadChatHistory(apiUrl, userId.current, documentId).then((loaded) => {
|
|
883
|
-
if (cancelled || opVersionRef.current !== myVersion) return;
|
|
884
|
-
if (loaded.length > 0) {
|
|
885
|
-
setMessages((current) => current.length === 0 ? loaded : current);
|
|
886
|
-
}
|
|
887
|
-
setHistoryLoaded(true);
|
|
888
|
-
});
|
|
889
|
-
return () => {
|
|
890
|
-
cancelled = true;
|
|
891
|
-
};
|
|
892
|
-
}, [apiUrl, documentId, historyLoaded]);
|
|
893
|
-
const scheduleSave = (0, import_react3.useCallback)((msgs) => {
|
|
894
|
-
if (!documentId) return;
|
|
895
|
-
if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
|
|
896
|
-
saveTimerRef.current = setTimeout(() => {
|
|
897
|
-
saveChatHistory(apiUrl, userId.current, documentId, msgs, publication);
|
|
898
|
-
}, 800);
|
|
899
|
-
}, [apiUrl, documentId, publication]);
|
|
900
835
|
const sendMessage = (0, import_react3.useCallback)(
|
|
901
836
|
async (text) => {
|
|
902
837
|
const myVersion = opVersionRef.current;
|
|
@@ -965,13 +900,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
965
900
|
}
|
|
966
901
|
}
|
|
967
902
|
}
|
|
968
|
-
if (opVersionRef.current === myVersion) {
|
|
969
|
-
const finalMessages = [
|
|
970
|
-
...updatedMessages,
|
|
971
|
-
{ role: "assistant", content: assistantContent }
|
|
972
|
-
];
|
|
973
|
-
scheduleSave(finalMessages);
|
|
974
|
-
}
|
|
975
903
|
} catch (err) {
|
|
976
904
|
if (err instanceof Error && err.name === "AbortError") {
|
|
977
905
|
setIsStreaming(false);
|
|
@@ -989,14 +917,11 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
|
|
|
989
917
|
}
|
|
990
918
|
if (opVersionRef.current === myVersion) setIsStreaming(false);
|
|
991
919
|
},
|
|
992
|
-
[apiUrl, documentText, publication, keywordPanelData
|
|
920
|
+
[apiUrl, documentText, publication, keywordPanelData]
|
|
993
921
|
);
|
|
994
922
|
const clearChat = (0, import_react3.useCallback)(() => {
|
|
995
923
|
setMessages([]);
|
|
996
|
-
|
|
997
|
-
saveChatHistory(apiUrl, userId.current, documentId, [], publication);
|
|
998
|
-
}
|
|
999
|
-
}, [apiUrl, documentId, publication]);
|
|
924
|
+
}, [setMessages]);
|
|
1000
925
|
return { messages, isStreaming, sendMessage, clearChat };
|
|
1001
926
|
}
|
|
1002
927
|
|
|
@@ -1049,7 +974,7 @@ function IndicatorDot({ letter, active, tooltip }) {
|
|
|
1049
974
|
lineHeight: 1,
|
|
1050
975
|
cursor: "default",
|
|
1051
976
|
flexShrink: 0,
|
|
1052
|
-
// Inactive = a solid
|
|
977
|
+
// Inactive = a solid white disc (was a near-invisible faint-grey ring on
|
|
1053
978
|
// transparent) so each indicator reads clearly on the warm panel; a light
|
|
1054
979
|
// edge + soft lift keep it defined even on a white card. Active = green.
|
|
1055
980
|
background: active ? "#16a34a" : "#ffffff",
|
|
@@ -1334,20 +1259,24 @@ function SeedKeywordInput({ seeds, onSeedsChange }) {
|
|
|
1334
1259
|
|
|
1335
1260
|
// src/components/FeedbackButton.tsx
|
|
1336
1261
|
var import_react7 = require("react");
|
|
1337
|
-
var
|
|
1262
|
+
var import_sanity = require("sanity");
|
|
1338
1263
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1339
1264
|
function FeedbackButton({ suggestionType, suggestionText, documentId, publication }) {
|
|
1340
1265
|
const { apiUrl } = useConfig();
|
|
1341
|
-
const sanityUser = (0,
|
|
1266
|
+
const sanityUser = (0, import_sanity.useCurrentUser)();
|
|
1342
1267
|
const [vote, setVote] = (0, import_react7.useState)(null);
|
|
1343
1268
|
const [showReasonPopup, setShowReasonPopup] = (0, import_react7.useState)(false);
|
|
1344
1269
|
const [reason, setReason] = (0, import_react7.useState)("");
|
|
1345
1270
|
const [submitted, setSubmitted] = (0, import_react7.useState)(false);
|
|
1271
|
+
const [failed, setFailed] = (0, import_react7.useState)(false);
|
|
1346
1272
|
const popupRef = (0, import_react7.useRef)(null);
|
|
1347
1273
|
const inputRef = (0, import_react7.useRef)(null);
|
|
1348
1274
|
const submitTimerRef = (0, import_react7.useRef)(null);
|
|
1275
|
+
const downVoteUnsentRef = (0, import_react7.useRef)(false);
|
|
1276
|
+
const mounted = (0, import_react7.useRef)(true);
|
|
1349
1277
|
(0, import_react7.useEffect)(() => {
|
|
1350
1278
|
return () => {
|
|
1279
|
+
mounted.current = false;
|
|
1351
1280
|
if (submitTimerRef.current) clearTimeout(submitTimerRef.current);
|
|
1352
1281
|
};
|
|
1353
1282
|
}, []);
|
|
@@ -1356,6 +1285,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1356
1285
|
const handler = (e) => {
|
|
1357
1286
|
if (popupRef.current && !popupRef.current.contains(e.target)) {
|
|
1358
1287
|
setShowReasonPopup(false);
|
|
1288
|
+
if (downVoteUnsentRef.current) setVote(null);
|
|
1359
1289
|
}
|
|
1360
1290
|
};
|
|
1361
1291
|
document.addEventListener("mousedown", handler);
|
|
@@ -1366,56 +1296,69 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1366
1296
|
setTimeout(() => inputRef.current?.focus(), 50);
|
|
1367
1297
|
}
|
|
1368
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
|
+
};
|
|
1369
1315
|
const handleVote = async (v) => {
|
|
1316
|
+
setFailed(false);
|
|
1370
1317
|
if (v === "down" && vote !== "down") {
|
|
1371
1318
|
setVote("down");
|
|
1372
1319
|
setShowReasonPopup(true);
|
|
1373
1320
|
setSubmitted(false);
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
vote: "down",
|
|
1379
|
-
document_id: documentId,
|
|
1380
|
-
publication,
|
|
1381
|
-
user_id: sanityUser?.id
|
|
1382
|
-
});
|
|
1383
|
-
} catch {
|
|
1384
|
-
}
|
|
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);
|
|
1385
1325
|
return;
|
|
1386
1326
|
}
|
|
1387
1327
|
const newVote = vote === v ? null : v;
|
|
1388
1328
|
setVote(newVote);
|
|
1389
1329
|
setShowReasonPopup(false);
|
|
1390
1330
|
if (newVote) {
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
vote: newVote,
|
|
1396
|
-
document_id: documentId,
|
|
1397
|
-
publication,
|
|
1398
|
-
user_id: sanityUser?.id
|
|
1399
|
-
});
|
|
1400
|
-
} catch {
|
|
1331
|
+
const ok = await send(suggestionType, suggestionText, newVote);
|
|
1332
|
+
if (!ok && mounted.current) {
|
|
1333
|
+
setVote(null);
|
|
1334
|
+
setFailed(true);
|
|
1401
1335
|
}
|
|
1402
1336
|
}
|
|
1403
1337
|
};
|
|
1338
|
+
const handleSkip = () => {
|
|
1339
|
+
setShowReasonPopup(false);
|
|
1340
|
+
setReason("");
|
|
1341
|
+
if (downVoteUnsentRef.current) setVote(null);
|
|
1342
|
+
};
|
|
1404
1343
|
const handleSubmitReason = async () => {
|
|
1405
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
|
+
}
|
|
1406
1354
|
if (trimmed) {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
vote: "down",
|
|
1412
|
-
document_id: documentId,
|
|
1413
|
-
publication,
|
|
1414
|
-
user_id: sanityUser?.id
|
|
1415
|
-
});
|
|
1416
|
-
} catch {
|
|
1355
|
+
const ok = await send(suggestionType + "_reason", suggestionText + " | REASON: " + trimmed, "down");
|
|
1356
|
+
if (!ok) {
|
|
1357
|
+
if (mounted.current) setFailed(true);
|
|
1358
|
+
return;
|
|
1417
1359
|
}
|
|
1418
1360
|
}
|
|
1361
|
+
if (!mounted.current) return;
|
|
1419
1362
|
setSubmitted(true);
|
|
1420
1363
|
submitTimerRef.current = setTimeout(() => {
|
|
1421
1364
|
setShowReasonPopup(false);
|
|
@@ -1461,6 +1404,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1461
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" }) })
|
|
1462
1405
|
}
|
|
1463
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" }),
|
|
1464
1408
|
showReasonPopup && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1465
1409
|
"div",
|
|
1466
1410
|
{
|
|
@@ -1479,7 +1423,9 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1479
1423
|
border: "1px solid #e5e7eb"
|
|
1480
1424
|
},
|
|
1481
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: [
|
|
1482
|
-
/* @__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" }),
|
|
1483
1429
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1484
1430
|
"input",
|
|
1485
1431
|
{
|
|
@@ -1507,10 +1453,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
|
|
|
1507
1453
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1508
1454
|
"button",
|
|
1509
1455
|
{
|
|
1510
|
-
onClick:
|
|
1511
|
-
setShowReasonPopup(false);
|
|
1512
|
-
setReason("");
|
|
1513
|
-
},
|
|
1456
|
+
onClick: handleSkip,
|
|
1514
1457
|
style: {
|
|
1515
1458
|
padding: "3px 8px",
|
|
1516
1459
|
fontSize: 10,
|
|
@@ -1588,6 +1531,165 @@ function usePersistentState(key, initial) {
|
|
|
1588
1531
|
return [val, set];
|
|
1589
1532
|
}
|
|
1590
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
|
+
|
|
1591
1693
|
// src/components/KeywordPanel.tsx
|
|
1592
1694
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1593
1695
|
function loadLocalArray(key) {
|
|
@@ -1608,29 +1710,21 @@ var cardStyle = {
|
|
|
1608
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)",
|
|
1609
1711
|
padding: "14px"
|
|
1610
1712
|
};
|
|
1611
|
-
function abbrevVol(v) {
|
|
1612
|
-
if (v == null) return "";
|
|
1613
|
-
if (v === 0) return "N/A";
|
|
1614
|
-
if (v >= 1e4) return Math.round(v / 1e3) + "K";
|
|
1615
|
-
if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
|
|
1616
|
-
return String(v);
|
|
1617
|
-
}
|
|
1618
1713
|
function placementCount(p) {
|
|
1619
1714
|
if (!p) return 0;
|
|
1620
1715
|
return [p.inBody, p.inTitle, p.inMetaDescription, p.inImages, p.inUrl].filter(Boolean).length;
|
|
1621
1716
|
}
|
|
1622
1717
|
function buildSuggestedKeywords(supporting, missing, documentText, documentFields) {
|
|
1623
1718
|
const merged = [];
|
|
1624
|
-
const lowerText = documentText.toLowerCase();
|
|
1625
1719
|
for (const kw of supporting) {
|
|
1626
1720
|
if (kw == null || typeof kw.term !== "string") continue;
|
|
1627
|
-
const actuallyInContent =
|
|
1721
|
+
const actuallyInContent = isKeywordInText(documentText, kw.term);
|
|
1628
1722
|
const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
|
|
1629
1723
|
merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, placement: livePlacement });
|
|
1630
1724
|
}
|
|
1631
1725
|
for (const kw of missing) {
|
|
1632
1726
|
if (kw == null || typeof kw.term !== "string") continue;
|
|
1633
|
-
const actuallyInContent =
|
|
1727
|
+
const actuallyInContent = isKeywordInText(documentText, kw.term);
|
|
1634
1728
|
const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
|
|
1635
1729
|
merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, reason: kw.reason, placement: livePlacement });
|
|
1636
1730
|
}
|
|
@@ -1914,7 +2008,8 @@ function SuggestedKeywordsCard({
|
|
|
1914
2008
|
documentId,
|
|
1915
2009
|
secondaryKeyword,
|
|
1916
2010
|
onSelectSecondary,
|
|
1917
|
-
primaryTerm
|
|
2011
|
+
primaryTerm,
|
|
2012
|
+
focusKeyword
|
|
1918
2013
|
}) {
|
|
1919
2014
|
const docScope = documentId || "default";
|
|
1920
2015
|
const [helpData, setHelpData] = usePersistentState(
|
|
@@ -1975,7 +2070,7 @@ function SuggestedKeywordsCard({
|
|
|
1975
2070
|
const previousSuggestions = forceRegenerate && helpData[term] ? helpData[term].map((s) => s.revised || s.sentence || "").filter(Boolean) : void 0;
|
|
1976
2071
|
const res = await fetch(`${apiUrl}/api/seo-copilot/keyword-help`, {
|
|
1977
2072
|
method: "POST",
|
|
1978
|
-
headers:
|
|
2073
|
+
headers: jsonHeaders(),
|
|
1979
2074
|
// Clip to 5,000 chars: the backend only reads the first 4,000 anyway, so sending
|
|
1980
2075
|
// the full article needlessly bloats the request on long pieces.
|
|
1981
2076
|
body: JSON.stringify({ keyword: term, content: text.slice(0, 5e3), publication, previousSuggestions })
|
|
@@ -2003,7 +2098,7 @@ function SuggestedKeywordsCard({
|
|
|
2003
2098
|
try {
|
|
2004
2099
|
const res = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
|
|
2005
2100
|
method: "POST",
|
|
2006
|
-
headers:
|
|
2101
|
+
headers: jsonHeaders(),
|
|
2007
2102
|
body: JSON.stringify({ keywords: [trimmed] })
|
|
2008
2103
|
});
|
|
2009
2104
|
if (res.ok) {
|
|
@@ -2039,6 +2134,24 @@ function SuggestedKeywordsCard({
|
|
|
2039
2134
|
return next;
|
|
2040
2135
|
});
|
|
2041
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]);
|
|
2042
2155
|
let filtered = keywords;
|
|
2043
2156
|
if (activeFilters.size > 0) {
|
|
2044
2157
|
const hasNoneFilter = activeFilters.has("none");
|
|
@@ -2084,7 +2197,7 @@ function SuggestedKeywordsCard({
|
|
|
2084
2197
|
const existingTerms = allKeywords.map((kw) => kw.term);
|
|
2085
2198
|
const res = await fetch(`${apiUrl}/api/seo-copilot/more-keywords`, {
|
|
2086
2199
|
method: "POST",
|
|
2087
|
-
headers:
|
|
2200
|
+
headers: jsonHeaders(),
|
|
2088
2201
|
body: JSON.stringify({ content: text, existingKeywords: existingTerms, publication })
|
|
2089
2202
|
});
|
|
2090
2203
|
if (res.ok) {
|
|
@@ -2377,7 +2490,7 @@ function SuggestedKeywordsCard({
|
|
|
2377
2490
|
}
|
|
2378
2491
|
)
|
|
2379
2492
|
] }),
|
|
2380
|
-
/* @__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: [
|
|
2381
2494
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: {
|
|
2382
2495
|
display: "flex",
|
|
2383
2496
|
alignItems: "center",
|
|
@@ -2507,7 +2620,8 @@ function KeywordPanel({
|
|
|
2507
2620
|
onSelectSecondary,
|
|
2508
2621
|
documentFields,
|
|
2509
2622
|
documentId,
|
|
2510
|
-
externalAnalysis
|
|
2623
|
+
externalAnalysis,
|
|
2624
|
+
focusKeyword
|
|
2511
2625
|
}) {
|
|
2512
2626
|
const { apiUrl } = useConfig();
|
|
2513
2627
|
const { analysis, isLoading, error, deepAnalysis, isDeepLoading, runDeepAnalysis } = externalAnalysis;
|
|
@@ -2608,7 +2722,8 @@ function KeywordPanel({
|
|
|
2608
2722
|
documentId,
|
|
2609
2723
|
secondaryKeyword,
|
|
2610
2724
|
onSelectSecondary,
|
|
2611
|
-
primaryTerm: activeTerm
|
|
2725
|
+
primaryTerm: activeTerm,
|
|
2726
|
+
focusKeyword
|
|
2612
2727
|
},
|
|
2613
2728
|
documentId || "default"
|
|
2614
2729
|
),
|
|
@@ -3064,7 +3179,7 @@ function TabBar({ tabs, activeTab, onTabChange }) {
|
|
|
3064
3179
|
WebkitBackdropFilter: "blur(16px) saturate(170%)",
|
|
3065
3180
|
// Beveled glass: top-left light edge + bottom-right inner shadow + a soft blue glow.
|
|
3066
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)",
|
|
3067
|
-
// Always a
|
|
3182
|
+
// Always a defined transition (never "none") - that's what keeps every
|
|
3068
3183
|
// click animating. Normally: a real slide with a gentle bounce that lands
|
|
3069
3184
|
// on arrival (ease-out-back), for the distance-scaled duration so long
|
|
3070
3185
|
// jumps glide instead of darting. While resizing: 0ms = track instantly
|
|
@@ -3294,11 +3409,11 @@ function OnboardingCard({ onDismiss, closing }) {
|
|
|
3294
3409
|
|
|
3295
3410
|
// src/components/ReportProblemButton.tsx
|
|
3296
3411
|
var import_react12 = require("react");
|
|
3297
|
-
var
|
|
3412
|
+
var import_sanity2 = require("sanity");
|
|
3298
3413
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3299
3414
|
function ReportProblemButton({ activeTab, publication, documentId, documentType, primaryKeyword }) {
|
|
3300
3415
|
const { apiUrl } = useConfig();
|
|
3301
|
-
const sanityUser = (0,
|
|
3416
|
+
const sanityUser = (0, import_sanity2.useCurrentUser)();
|
|
3302
3417
|
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
3303
3418
|
const [text, setText] = (0, import_react12.useState)("");
|
|
3304
3419
|
const [submitting, setSubmitting] = (0, import_react12.useState)(false);
|
|
@@ -3421,7 +3536,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
|
|
|
3421
3536
|
},
|
|
3422
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: [
|
|
3423
3538
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 3 }, children: "Report a problem" }),
|
|
3424
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 10.5, color: "#6b7280", marginBottom: 8, lineHeight: 1.45 }, children: "Beta - tell us what went wrong. We also
|
|
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." }),
|
|
3425
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." }),
|
|
3426
3541
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3427
3542
|
"textarea",
|
|
@@ -3500,7 +3615,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
|
|
|
3500
3615
|
}
|
|
3501
3616
|
|
|
3502
3617
|
// src/components/tabs/SummaryTab.tsx
|
|
3503
|
-
var
|
|
3618
|
+
var import_react15 = require("react");
|
|
3504
3619
|
|
|
3505
3620
|
// src/components/ShimmerLoader.tsx
|
|
3506
3621
|
var import_react13 = require("react");
|
|
@@ -3601,134 +3716,6 @@ var DEFAULT_GENERATE_ALL_MESSAGES = [
|
|
|
3601
3716
|
"Compiling summary"
|
|
3602
3717
|
];
|
|
3603
3718
|
|
|
3604
|
-
// src/lib/scoring.ts
|
|
3605
|
-
function countWholeMatches(haystack, needle) {
|
|
3606
|
-
if (!needle) return 0;
|
|
3607
|
-
const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3608
|
-
const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
|
|
3609
|
-
return m ? m.length : 0;
|
|
3610
|
-
}
|
|
3611
|
-
function calculateContentScoreDetailed(content, analysis, documentFields) {
|
|
3612
|
-
if (!content || !analysis) {
|
|
3613
|
-
return { total: 0, components: [] };
|
|
3614
|
-
}
|
|
3615
|
-
const lowerContent = content.toLowerCase();
|
|
3616
|
-
const words = content.split(/\s+/).filter(Boolean).length;
|
|
3617
|
-
const components = [];
|
|
3618
|
-
const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
|
|
3619
|
-
if (primaryTerm) {
|
|
3620
|
-
const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
|
|
3621
|
-
const phraseCount = countWholeMatches(lowerContent, primaryTerm);
|
|
3622
|
-
let occurrences = phraseCount;
|
|
3623
|
-
let viaTokens = false;
|
|
3624
|
-
if (phraseCount === 0 && tokens.length > 0) {
|
|
3625
|
-
const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
|
|
3626
|
-
if (counts.every((c) => c > 0)) {
|
|
3627
|
-
occurrences = Math.min(...counts);
|
|
3628
|
-
viaTokens = true;
|
|
3629
|
-
}
|
|
3630
|
-
}
|
|
3631
|
-
const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
|
|
3632
|
-
let pts = 0;
|
|
3633
|
-
let detail;
|
|
3634
|
-
if (occurrences === 0) {
|
|
3635
|
-
detail = `Primary keyword "${primaryTerm}" not found in content`;
|
|
3636
|
-
} else {
|
|
3637
|
-
pts += 12;
|
|
3638
|
-
const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
|
|
3639
|
-
if (density >= 0.5 && density <= 2.5) {
|
|
3640
|
-
pts += 13;
|
|
3641
|
-
detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
|
|
3642
|
-
} else if (density < 0.5) {
|
|
3643
|
-
pts += 7;
|
|
3644
|
-
detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
|
|
3645
|
-
} else if (viaTokens && density <= 6) {
|
|
3646
|
-
pts += 11;
|
|
3647
|
-
detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
|
|
3648
|
-
} else {
|
|
3649
|
-
pts += 4;
|
|
3650
|
-
detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
|
|
3651
|
-
}
|
|
3652
|
-
}
|
|
3653
|
-
components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
|
|
3654
|
-
} else {
|
|
3655
|
-
components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
|
|
3656
|
-
}
|
|
3657
|
-
const supportingKws = analysis.supportingKeywords || [];
|
|
3658
|
-
if (supportingKws.length > 0) {
|
|
3659
|
-
const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
|
|
3660
|
-
const coverageRatio = inContentCount / supportingKws.length;
|
|
3661
|
-
const pts = Math.round(coverageRatio * 25);
|
|
3662
|
-
components.push({
|
|
3663
|
-
label: "Supporting keyword coverage",
|
|
3664
|
-
points: pts,
|
|
3665
|
-
max: 25,
|
|
3666
|
-
detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
|
|
3667
|
-
});
|
|
3668
|
-
} else {
|
|
3669
|
-
components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
|
|
3670
|
-
}
|
|
3671
|
-
let wcPts = 0;
|
|
3672
|
-
let wcDetail;
|
|
3673
|
-
if (words >= 1500) {
|
|
3674
|
-
wcPts = 15;
|
|
3675
|
-
wcDetail = `${words} words - strong length for clinical content`;
|
|
3676
|
-
} else if (words >= 450) {
|
|
3677
|
-
wcPts = 11;
|
|
3678
|
-
wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
|
|
3679
|
-
} else if (words >= 200) {
|
|
3680
|
-
wcPts = 5;
|
|
3681
|
-
wcDetail = `${words} words - below the 450-word floor`;
|
|
3682
|
-
} else {
|
|
3683
|
-
wcDetail = `${words} words - start writing`;
|
|
3684
|
-
}
|
|
3685
|
-
components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
|
|
3686
|
-
let hasH1orTitle;
|
|
3687
|
-
let hasSubheadings;
|
|
3688
|
-
if (documentFields) {
|
|
3689
|
-
hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
|
|
3690
|
-
const det = documentFields.headingsDetailed;
|
|
3691
|
-
const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
|
|
3692
|
-
hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
|
|
3693
|
-
} else {
|
|
3694
|
-
hasH1orTitle = /^#\s|<h1/im.test(content);
|
|
3695
|
-
hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
|
|
3696
|
-
}
|
|
3697
|
-
const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
|
|
3698
|
-
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";
|
|
3699
|
-
components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
|
|
3700
|
-
const missingCount = (analysis.missingKeywords || []).length;
|
|
3701
|
-
let mPts = 0;
|
|
3702
|
-
let mDetail;
|
|
3703
|
-
if (missingCount === 0) {
|
|
3704
|
-
mPts = 15;
|
|
3705
|
-
mDetail = "No missing keywords flagged";
|
|
3706
|
-
} else if (missingCount <= 2) {
|
|
3707
|
-
mPts = 10;
|
|
3708
|
-
mDetail = `${missingCount} suggested keywords missing - quick add`;
|
|
3709
|
-
} else if (missingCount <= 4) {
|
|
3710
|
-
mPts = 5;
|
|
3711
|
-
mDetail = `${missingCount} suggested keywords missing`;
|
|
3712
|
-
} else {
|
|
3713
|
-
mDetail = `${missingCount} suggested keywords missing - significant gaps`;
|
|
3714
|
-
}
|
|
3715
|
-
components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail });
|
|
3716
|
-
let qCount;
|
|
3717
|
-
if (documentFields) {
|
|
3718
|
-
qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
|
|
3719
|
-
} else {
|
|
3720
|
-
qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
|
|
3721
|
-
}
|
|
3722
|
-
let aeoPts = 0;
|
|
3723
|
-
if (qCount >= 3) aeoPts = 10;
|
|
3724
|
-
else if (qCount === 2) aeoPts = 7;
|
|
3725
|
-
else if (qCount === 1) aeoPts = 4;
|
|
3726
|
-
const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
|
|
3727
|
-
components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
|
|
3728
|
-
const total = components.reduce((sum, c) => sum + c.points, 0);
|
|
3729
|
-
return { total: Math.min(100, Math.max(0, total)), components };
|
|
3730
|
-
}
|
|
3731
|
-
|
|
3732
3719
|
// src/lib/utils.ts
|
|
3733
3720
|
function containsKeywordTokens(haystack, needle) {
|
|
3734
3721
|
if (!needle) return true;
|
|
@@ -4084,7 +4071,7 @@ function buildSummaryItems(input) {
|
|
|
4084
4071
|
category: "images",
|
|
4085
4072
|
severity: "warning",
|
|
4086
4073
|
label: `${missingTitles} image${missingTitles === 1 ? "" : "s"} missing a title`,
|
|
4087
|
-
description: "The title attribute shows on hover and
|
|
4074
|
+
description: "The title attribute shows on hover and helps readers.",
|
|
4088
4075
|
howToFix: "Add a descriptive title attribute (2-5 keywords) to each image that's missing one.",
|
|
4089
4076
|
jumpTo: { tab: "technical", anchorId: "anchor-image-titles" }
|
|
4090
4077
|
});
|
|
@@ -4246,9 +4233,9 @@ function buildSummaryItems(input) {
|
|
|
4246
4233
|
id: `deep-gap-${i}`,
|
|
4247
4234
|
category: "content",
|
|
4248
4235
|
severity: "opportunity",
|
|
4249
|
-
label: "
|
|
4236
|
+
label: "Possible gap",
|
|
4250
4237
|
description: note,
|
|
4251
|
-
howToFix: "
|
|
4238
|
+
howToFix: "Consider adding a section on this topic if it fits the article.",
|
|
4252
4239
|
jumpTo: { tab: "summary" }
|
|
4253
4240
|
});
|
|
4254
4241
|
});
|
|
@@ -4273,8 +4260,77 @@ function buildSummaryItems(input) {
|
|
|
4273
4260
|
return items;
|
|
4274
4261
|
}
|
|
4275
4262
|
|
|
4276
|
-
// src/components/tabs/
|
|
4263
|
+
// src/components/tabs/MissingKeywordsDetail.tsx
|
|
4264
|
+
var import_react14 = require("react");
|
|
4277
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");
|
|
4278
4334
|
var cardStyle2 = {
|
|
4279
4335
|
borderRadius: 14,
|
|
4280
4336
|
background: "rgba(255,255,255,0.55)",
|
|
@@ -4301,11 +4357,11 @@ function componentTier(pct) {
|
|
|
4301
4357
|
if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
|
|
4302
4358
|
return { label: "Low", color: "#dc2626", bar: "#dc2626" };
|
|
4303
4359
|
}
|
|
4304
|
-
function ScoreBadge({ score, breakdown }) {
|
|
4360
|
+
function ScoreBadge({ score, breakdown, onKeywordClick }) {
|
|
4305
4361
|
const c = scoreColors(score);
|
|
4306
|
-
return /* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4308
|
-
/* @__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)(
|
|
4309
4365
|
"div",
|
|
4310
4366
|
{
|
|
4311
4367
|
style: {
|
|
@@ -4318,24 +4374,24 @@ function ScoreBadge({ score, breakdown }) {
|
|
|
4318
4374
|
justifyContent: "center",
|
|
4319
4375
|
flexShrink: 0
|
|
4320
4376
|
},
|
|
4321
|
-
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 } })
|
|
4322
4378
|
}
|
|
4323
4379
|
),
|
|
4324
|
-
/* @__PURE__ */ (0,
|
|
4325
|
-
/* @__PURE__ */ (0,
|
|
4326
|
-
/* @__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 })
|
|
4327
4383
|
] })
|
|
4328
4384
|
] }),
|
|
4329
|
-
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) => {
|
|
4330
4386
|
const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
|
|
4331
4387
|
const tier = componentTier(pct);
|
|
4332
|
-
return /* @__PURE__ */ (0,
|
|
4333
|
-
/* @__PURE__ */ (0,
|
|
4334
|
-
/* @__PURE__ */ (0,
|
|
4335
|
-
/* @__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 })
|
|
4336
4392
|
] }),
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4338
|
-
/* @__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 })
|
|
4339
4395
|
] }, i);
|
|
4340
4396
|
}) })
|
|
4341
4397
|
] });
|
|
@@ -4349,7 +4405,7 @@ function ItemCard({ item, onClick }) {
|
|
|
4349
4405
|
const v = severityVisual(item.severity);
|
|
4350
4406
|
const tab = item.jumpTo.tab;
|
|
4351
4407
|
const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
|
|
4352
|
-
return /* @__PURE__ */ (0,
|
|
4408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4353
4409
|
"div",
|
|
4354
4410
|
{
|
|
4355
4411
|
onClick,
|
|
@@ -4366,8 +4422,8 @@ function ItemCard({ item, onClick }) {
|
|
|
4366
4422
|
cursor: "pointer"
|
|
4367
4423
|
},
|
|
4368
4424
|
children: [
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__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)(
|
|
4371
4427
|
"div",
|
|
4372
4428
|
{
|
|
4373
4429
|
style: {
|
|
@@ -4380,12 +4436,12 @@ function ItemCard({ item, onClick }) {
|
|
|
4380
4436
|
}
|
|
4381
4437
|
}
|
|
4382
4438
|
),
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4384
|
-
/* @__PURE__ */ (0,
|
|
4385
|
-
/* @__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 })
|
|
4386
4442
|
] })
|
|
4387
4443
|
] }),
|
|
4388
|
-
/* @__PURE__ */ (0,
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4389
4445
|
"div",
|
|
4390
4446
|
{
|
|
4391
4447
|
style: {
|
|
@@ -4397,12 +4453,12 @@ function ItemCard({ item, onClick }) {
|
|
|
4397
4453
|
lineHeight: 1.55
|
|
4398
4454
|
},
|
|
4399
4455
|
children: [
|
|
4400
|
-
/* @__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" }),
|
|
4401
4457
|
item.howToFix
|
|
4402
4458
|
]
|
|
4403
4459
|
}
|
|
4404
4460
|
),
|
|
4405
|
-
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: [
|
|
4406
4462
|
"Go to ",
|
|
4407
4463
|
tabLabel,
|
|
4408
4464
|
" \u203A"
|
|
@@ -4418,7 +4474,7 @@ function FilterChip({
|
|
|
4418
4474
|
count,
|
|
4419
4475
|
dotColor
|
|
4420
4476
|
}) {
|
|
4421
|
-
return /* @__PURE__ */ (0,
|
|
4477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4422
4478
|
"button",
|
|
4423
4479
|
{
|
|
4424
4480
|
onClick,
|
|
@@ -4437,9 +4493,9 @@ function FilterChip({
|
|
|
4437
4493
|
transition: "all 150ms"
|
|
4438
4494
|
},
|
|
4439
4495
|
children: [
|
|
4440
|
-
dotColor && /* @__PURE__ */ (0,
|
|
4441
|
-
/* @__PURE__ */ (0,
|
|
4442
|
-
/* @__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 })
|
|
4443
4499
|
]
|
|
4444
4500
|
}
|
|
4445
4501
|
);
|
|
@@ -4455,15 +4511,16 @@ function SummaryTab({
|
|
|
4455
4511
|
secondaryKeyword,
|
|
4456
4512
|
isAnyLoading,
|
|
4457
4513
|
onGenerateAll,
|
|
4458
|
-
onItemClick
|
|
4514
|
+
onItemClick,
|
|
4515
|
+
onKeywordClick
|
|
4459
4516
|
}) {
|
|
4460
|
-
const scoreDetail = (0,
|
|
4517
|
+
const scoreDetail = (0, import_react15.useMemo)(() => {
|
|
4461
4518
|
if (!analysis) return null;
|
|
4462
4519
|
const scored = primaryKeyword && analysis.primaryKeyword && primaryKeyword !== analysis.primaryKeyword.term ? { ...analysis, primaryKeyword: { ...analysis.primaryKeyword, term: primaryKeyword } } : analysis;
|
|
4463
4520
|
return calculateContentScoreDetailed(text, scored, documentFields);
|
|
4464
4521
|
}, [text, analysis, documentFields, primaryKeyword]);
|
|
4465
4522
|
const score = scoreDetail?.total ?? null;
|
|
4466
|
-
const items = (0,
|
|
4523
|
+
const items = (0, import_react15.useMemo)(
|
|
4467
4524
|
() => buildSummaryItems({
|
|
4468
4525
|
analysis,
|
|
4469
4526
|
deepAnalysis,
|
|
@@ -4477,8 +4534,8 @@ function SummaryTab({
|
|
|
4477
4534
|
}),
|
|
4478
4535
|
[analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
|
|
4479
4536
|
);
|
|
4480
|
-
const [filter, setFilter] = (0,
|
|
4481
|
-
const counts = (0,
|
|
4537
|
+
const [filter, setFilter] = (0, import_react15.useState)("all");
|
|
4538
|
+
const counts = (0, import_react15.useMemo)(
|
|
4482
4539
|
() => ({
|
|
4483
4540
|
all: items.length,
|
|
4484
4541
|
error: items.filter((i) => i.severity === "error").length,
|
|
@@ -4489,15 +4546,15 @@ function SummaryTab({
|
|
|
4489
4546
|
);
|
|
4490
4547
|
const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
|
|
4491
4548
|
if (!analysis) {
|
|
4492
|
-
return /* @__PURE__ */ (0,
|
|
4493
|
-
/* @__PURE__ */ (0,
|
|
4494
|
-
/* @__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." })
|
|
4495
4552
|
] });
|
|
4496
4553
|
}
|
|
4497
|
-
return /* @__PURE__ */ (0,
|
|
4498
|
-
score != null && scoreDetail && /* @__PURE__ */ (0,
|
|
4499
|
-
/* @__PURE__ */ (0,
|
|
4500
|
-
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)(
|
|
4501
4558
|
"button",
|
|
4502
4559
|
{
|
|
4503
4560
|
onClick: onGenerateAll,
|
|
@@ -4525,24 +4582,24 @@ function SummaryTab({
|
|
|
4525
4582
|
children: "Run all analyses"
|
|
4526
4583
|
}
|
|
4527
4584
|
),
|
|
4528
|
-
/* @__PURE__ */ (0,
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
|
|
4529
4586
|
"Runs the analyses that fill the ",
|
|
4530
|
-
/* @__PURE__ */ (0,
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "AEO/GEO" }),
|
|
4531
4588
|
", ",
|
|
4532
|
-
/* @__PURE__ */ (0,
|
|
4589
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Linking" }),
|
|
4533
4590
|
", and ",
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4591
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Other Recs" }),
|
|
4535
4592
|
" tabs. New issues they find appear in this Summary as each one finishes."
|
|
4536
4593
|
] })
|
|
4537
4594
|
] }),
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4539
|
-
/* @__PURE__ */ (0,
|
|
4540
|
-
/* @__PURE__ */ (0,
|
|
4541
|
-
/* @__PURE__ */ (0,
|
|
4542
|
-
/* @__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 })
|
|
4543
4600
|
] }),
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4545
|
-
/* @__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)(
|
|
4546
4603
|
"div",
|
|
4547
4604
|
{
|
|
4548
4605
|
style: {
|
|
@@ -4555,21 +4612,21 @@ function SummaryTab({
|
|
|
4555
4612
|
justifyContent: "center",
|
|
4556
4613
|
margin: "0 auto 8px"
|
|
4557
4614
|
},
|
|
4558
|
-
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" }) })
|
|
4559
4616
|
}
|
|
4560
4617
|
),
|
|
4561
|
-
/* @__PURE__ */ (0,
|
|
4562
|
-
/* @__PURE__ */ (0,
|
|
4563
|
-
] }) : /* @__PURE__ */ (0,
|
|
4564
|
-
isAnyLoading && items.length > 0 && /* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4566
|
-
/* @__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..." })
|
|
4567
4624
|
] })
|
|
4568
4625
|
] });
|
|
4569
4626
|
}
|
|
4570
4627
|
|
|
4571
4628
|
// src/components/tabs/AEOTab.tsx
|
|
4572
|
-
var
|
|
4629
|
+
var import_react16 = require("react");
|
|
4573
4630
|
|
|
4574
4631
|
// src/lib/geoAnalysis.ts
|
|
4575
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;
|
|
@@ -4643,7 +4700,7 @@ function analyzeGEO(text, headings) {
|
|
|
4643
4700
|
}
|
|
4644
4701
|
|
|
4645
4702
|
// src/components/tabs/AEOTab.tsx
|
|
4646
|
-
var
|
|
4703
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4647
4704
|
var AEO_PURPLE = "#005DAC";
|
|
4648
4705
|
var GEO_TEAL = "#C9A716";
|
|
4649
4706
|
var cardStyle3 = {
|
|
@@ -4655,7 +4712,7 @@ var cardStyle3 = {
|
|
|
4655
4712
|
padding: "14px"
|
|
4656
4713
|
};
|
|
4657
4714
|
function AiPill() {
|
|
4658
|
-
return /* @__PURE__ */ (0,
|
|
4715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4659
4716
|
"span",
|
|
4660
4717
|
{
|
|
4661
4718
|
style: {
|
|
@@ -4674,16 +4731,16 @@ function AiPill() {
|
|
|
4674
4731
|
);
|
|
4675
4732
|
}
|
|
4676
4733
|
function SectionHeader2({ label, iconColor, ai }) {
|
|
4677
|
-
return /* @__PURE__ */ (0,
|
|
4678
|
-
/* @__PURE__ */ (0,
|
|
4679
|
-
/* @__PURE__ */ (0,
|
|
4680
|
-
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, {})
|
|
4681
4738
|
] });
|
|
4682
4739
|
}
|
|
4683
4740
|
function CopyButton({ text }) {
|
|
4684
|
-
const [copied, setCopied] = (0,
|
|
4685
|
-
const copyTimerRef = (0,
|
|
4686
|
-
(0,
|
|
4741
|
+
const [copied, setCopied] = (0, import_react16.useState)(false);
|
|
4742
|
+
const copyTimerRef = (0, import_react16.useRef)(null);
|
|
4743
|
+
(0, import_react16.useEffect)(() => {
|
|
4687
4744
|
return () => {
|
|
4688
4745
|
if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
|
|
4689
4746
|
};
|
|
@@ -4696,7 +4753,7 @@ function CopyButton({ text }) {
|
|
|
4696
4753
|
} catch {
|
|
4697
4754
|
}
|
|
4698
4755
|
};
|
|
4699
|
-
return /* @__PURE__ */ (0,
|
|
4756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4700
4757
|
"button",
|
|
4701
4758
|
{
|
|
4702
4759
|
onClick: handleCopy,
|
|
@@ -4715,9 +4772,9 @@ function CopyButton({ text }) {
|
|
|
4715
4772
|
transition: "color 150ms"
|
|
4716
4773
|
},
|
|
4717
4774
|
title: copied ? "Copied!" : "Copy to clipboard",
|
|
4718
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
4719
|
-
/* @__PURE__ */ (0,
|
|
4720
|
-
/* @__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" })
|
|
4721
4778
|
] })
|
|
4722
4779
|
}
|
|
4723
4780
|
);
|
|
@@ -4732,13 +4789,13 @@ function GEOCard({ geo, publication }) {
|
|
|
4732
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)";
|
|
4733
4790
|
const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
|
|
4734
4791
|
const totalHeadings = geo.headingAudit.length;
|
|
4735
|
-
return /* @__PURE__ */ (0,
|
|
4736
|
-
/* @__PURE__ */ (0,
|
|
4737
|
-
/* @__PURE__ */ (0,
|
|
4738
|
-
/* @__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 })
|
|
4739
4796
|
] }),
|
|
4740
|
-
/* @__PURE__ */ (0,
|
|
4741
|
-
/* @__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)(
|
|
4742
4799
|
"div",
|
|
4743
4800
|
{
|
|
4744
4801
|
style: {
|
|
@@ -4751,7 +4808,7 @@ function GEOCard({ geo, publication }) {
|
|
|
4751
4808
|
marginBottom: 8
|
|
4752
4809
|
},
|
|
4753
4810
|
children: [
|
|
4754
|
-
/* @__PURE__ */ (0,
|
|
4811
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4755
4812
|
"div",
|
|
4756
4813
|
{
|
|
4757
4814
|
style: {
|
|
@@ -4767,17 +4824,17 @@ function GEOCard({ geo, publication }) {
|
|
|
4767
4824
|
boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
|
|
4768
4825
|
},
|
|
4769
4826
|
children: [
|
|
4770
|
-
/* @__PURE__ */ (0,
|
|
4771
|
-
/* @__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" })
|
|
4772
4829
|
]
|
|
4773
4830
|
}
|
|
4774
4831
|
),
|
|
4775
|
-
/* @__PURE__ */ (0,
|
|
4776
|
-
/* @__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: [
|
|
4777
4834
|
"Fact density: ",
|
|
4778
4835
|
fdLabel
|
|
4779
4836
|
] }),
|
|
4780
|
-
/* @__PURE__ */ (0,
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
|
|
4781
4838
|
fd.factCount,
|
|
4782
4839
|
" specific stat",
|
|
4783
4840
|
fd.factCount === 1 ? "" : "s",
|
|
@@ -4793,7 +4850,7 @@ function GEOCard({ geo, publication }) {
|
|
|
4793
4850
|
]
|
|
4794
4851
|
}
|
|
4795
4852
|
),
|
|
4796
|
-
fd.driftPassages > 0 && /* @__PURE__ */ (0,
|
|
4853
|
+
fd.driftPassages > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4797
4854
|
"div",
|
|
4798
4855
|
{
|
|
4799
4856
|
style: {
|
|
@@ -4807,15 +4864,15 @@ function GEOCard({ geo, publication }) {
|
|
|
4807
4864
|
lineHeight: 1.45
|
|
4808
4865
|
},
|
|
4809
4866
|
children: [
|
|
4810
|
-
/* @__PURE__ */ (0,
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: fd.driftPassages }),
|
|
4811
4868
|
" passage",
|
|
4812
4869
|
fd.driftPassages === 1 ? "" : "s",
|
|
4813
4870
|
" over 200 words with no specific stats or citations. AI engines tend to skip these."
|
|
4814
4871
|
]
|
|
4815
4872
|
}
|
|
4816
4873
|
),
|
|
4817
|
-
totalHeadings > 0 && /* @__PURE__ */ (0,
|
|
4818
|
-
/* @__PURE__ */ (0,
|
|
4874
|
+
totalHeadings > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { marginTop: 4 }, children: [
|
|
4875
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4819
4876
|
"button",
|
|
4820
4877
|
{
|
|
4821
4878
|
onClick: () => setShowDetails((v) => !v),
|
|
@@ -4834,22 +4891,22 @@ function GEOCard({ geo, publication }) {
|
|
|
4834
4891
|
color: GEO_TEAL
|
|
4835
4892
|
},
|
|
4836
4893
|
children: [
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
4838
4895
|
"Short-answer paragraphs: ",
|
|
4839
4896
|
goodCount,
|
|
4840
4897
|
"/",
|
|
4841
4898
|
totalHeadings,
|
|
4842
4899
|
" headings have one"
|
|
4843
4900
|
] }),
|
|
4844
|
-
/* @__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" }) })
|
|
4845
4902
|
]
|
|
4846
4903
|
}
|
|
4847
4904
|
),
|
|
4848
|
-
showDetails && /* @__PURE__ */ (0,
|
|
4849
|
-
/* @__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." }),
|
|
4850
4907
|
geo.headingAudit.map((h, i) => {
|
|
4851
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" };
|
|
4852
|
-
return /* @__PURE__ */ (0,
|
|
4909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4853
4910
|
"div",
|
|
4854
4911
|
{
|
|
4855
4912
|
style: {
|
|
@@ -4863,8 +4920,8 @@ function GEOCard({ geo, publication }) {
|
|
|
4863
4920
|
gap: 8
|
|
4864
4921
|
},
|
|
4865
4922
|
children: [
|
|
4866
|
-
/* @__PURE__ */ (0,
|
|
4867
|
-
/* @__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 })
|
|
4868
4925
|
]
|
|
4869
4926
|
},
|
|
4870
4927
|
i
|
|
@@ -4887,7 +4944,7 @@ function AEOTab({
|
|
|
4887
4944
|
csError,
|
|
4888
4945
|
loadContentSuggestions
|
|
4889
4946
|
}) {
|
|
4890
|
-
const geo = (0,
|
|
4947
|
+
const geo = (0, import_react16.useMemo)(() => analyzeGEO(text, headings), [text, headings]);
|
|
4891
4948
|
const geoWordCount = text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
|
|
4892
4949
|
const hasEnoughTextForGEO = geoWordCount >= 150;
|
|
4893
4950
|
const hasEnoughText = text && text.trim().length >= 50;
|
|
@@ -4901,8 +4958,8 @@ function AEOTab({
|
|
|
4901
4958
|
originalHeading: void 0,
|
|
4902
4959
|
rationale: h.rationale
|
|
4903
4960
|
})) ?? [];
|
|
4904
|
-
return /* @__PURE__ */ (0,
|
|
4905
|
-
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)(
|
|
4906
4963
|
"div",
|
|
4907
4964
|
{
|
|
4908
4965
|
onClick: runDeepAnalysis,
|
|
@@ -4925,30 +4982,30 @@ function AEOTab({
|
|
|
4925
4982
|
cursor: "pointer"
|
|
4926
4983
|
},
|
|
4927
4984
|
children: [
|
|
4928
|
-
/* @__PURE__ */ (0,
|
|
4929
|
-
/* @__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" })
|
|
4930
4987
|
]
|
|
4931
4988
|
}
|
|
4932
4989
|
),
|
|
4933
|
-
hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
4934
|
-
hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0,
|
|
4935
|
-
/* @__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" }),
|
|
4936
4993
|
" needs at least 150 words to read fact density.",
|
|
4937
|
-
/* @__PURE__ */ (0,
|
|
4938
|
-
/* @__PURE__ */ (0,
|
|
4994
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("br", {}),
|
|
4995
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { color: "#4b5563" }, children: [
|
|
4939
4996
|
"Current: ",
|
|
4940
4997
|
geoWordCount,
|
|
4941
4998
|
" word",
|
|
4942
4999
|
geoWordCount === 1 ? "" : "s"
|
|
4943
5000
|
] })
|
|
4944
5001
|
] }) }),
|
|
4945
|
-
!deepAnalysis && isDeepLoading && /* @__PURE__ */ (0,
|
|
4946
|
-
/* @__PURE__ */ (0,
|
|
4947
|
-
/* @__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..." })
|
|
4948
5005
|
] }),
|
|
4949
|
-
!deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0,
|
|
4950
|
-
/* @__PURE__ */ (0,
|
|
4951
|
-
/* @__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)(
|
|
4952
5009
|
"button",
|
|
4953
5010
|
{
|
|
4954
5011
|
onClick: runDeepAnalysis,
|
|
@@ -4968,11 +5025,11 @@ function AEOTab({
|
|
|
4968
5025
|
}
|
|
4969
5026
|
)
|
|
4970
5027
|
] }),
|
|
4971
|
-
deepAnalysis && !aeo && /* @__PURE__ */ (0,
|
|
4972
|
-
questionHeadings.length > 0 && /* @__PURE__ */ (0,
|
|
4973
|
-
/* @__PURE__ */ (0,
|
|
4974
|
-
/* @__PURE__ */ (0,
|
|
4975
|
-
/* @__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)(
|
|
4976
5033
|
"div",
|
|
4977
5034
|
{
|
|
4978
5035
|
style: {
|
|
@@ -4982,26 +5039,26 @@ function AEOTab({
|
|
|
4982
5039
|
borderLeft: `3px solid ${AEO_PURPLE}`
|
|
4983
5040
|
},
|
|
4984
5041
|
children: [
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
4987
|
-
h.originalHeading && /* @__PURE__ */ (0,
|
|
4988
|
-
/* @__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 })
|
|
4989
5046
|
] }),
|
|
4990
|
-
/* @__PURE__ */ (0,
|
|
4991
|
-
/* @__PURE__ */ (0,
|
|
4992
|
-
/* @__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 })
|
|
4993
5050
|
] })
|
|
4994
5051
|
] }),
|
|
4995
|
-
/* @__PURE__ */ (0,
|
|
5052
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
|
|
4996
5053
|
]
|
|
4997
5054
|
},
|
|
4998
5055
|
i
|
|
4999
5056
|
)) })
|
|
5000
5057
|
] }),
|
|
5001
|
-
/* @__PURE__ */ (0,
|
|
5002
|
-
/* @__PURE__ */ (0,
|
|
5003
|
-
/* @__PURE__ */ (0,
|
|
5004
|
-
!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)(
|
|
5005
5062
|
"button",
|
|
5006
5063
|
{
|
|
5007
5064
|
onClick: loadContentSuggestions,
|
|
@@ -5025,15 +5082,15 @@ function AEOTab({
|
|
|
5025
5082
|
children: "Generate suggestions"
|
|
5026
5083
|
}
|
|
5027
5084
|
),
|
|
5028
|
-
isCSLoading && /* @__PURE__ */ (0,
|
|
5029
|
-
/* @__PURE__ */ (0,
|
|
5030
|
-
/* @__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..." })
|
|
5031
5088
|
] }),
|
|
5032
|
-
csError && /* @__PURE__ */ (0,
|
|
5033
|
-
contentSuggestions && /* @__PURE__ */ (0,
|
|
5034
|
-
contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0,
|
|
5035
|
-
/* @__PURE__ */ (0,
|
|
5036
|
-
/* @__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)(
|
|
5037
5094
|
"div",
|
|
5038
5095
|
{
|
|
5039
5096
|
style: {
|
|
@@ -5046,19 +5103,19 @@ function AEOTab({
|
|
|
5046
5103
|
alignItems: "flex-start"
|
|
5047
5104
|
},
|
|
5048
5105
|
children: [
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
5050
|
-
/* @__PURE__ */ (0,
|
|
5051
|
-
/* @__PURE__ */ (0,
|
|
5052
|
-
/* @__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 })
|
|
5053
5110
|
] })
|
|
5054
5111
|
]
|
|
5055
5112
|
},
|
|
5056
5113
|
i
|
|
5057
5114
|
)) })
|
|
5058
5115
|
] }),
|
|
5059
|
-
contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5061
|
-
/* @__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)(
|
|
5062
5119
|
"div",
|
|
5063
5120
|
{
|
|
5064
5121
|
style: {
|
|
@@ -5068,23 +5125,23 @@ function AEOTab({
|
|
|
5068
5125
|
borderLeft: `2px solid ${AEO_PURPLE}`
|
|
5069
5126
|
},
|
|
5070
5127
|
children: [
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
5072
|
-
/* @__PURE__ */ (0,
|
|
5073
|
-
/* @__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 })
|
|
5074
5131
|
] }),
|
|
5075
|
-
/* @__PURE__ */ (0,
|
|
5132
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
|
|
5076
5133
|
]
|
|
5077
5134
|
},
|
|
5078
5135
|
i
|
|
5079
5136
|
)) })
|
|
5080
5137
|
] }),
|
|
5081
|
-
contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0,
|
|
5082
|
-
/* @__PURE__ */ (0,
|
|
5083
|
-
/* @__PURE__ */ (0,
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5086
|
-
/* @__PURE__ */ (0,
|
|
5087
|
-
/* @__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)(
|
|
5088
5145
|
FeedbackButton,
|
|
5089
5146
|
{
|
|
5090
5147
|
suggestionType: "aeo_bullets",
|
|
@@ -5095,7 +5152,7 @@ function AEOTab({
|
|
|
5095
5152
|
] })
|
|
5096
5153
|
] })
|
|
5097
5154
|
] }),
|
|
5098
|
-
/* @__PURE__ */ (0,
|
|
5155
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5099
5156
|
"button",
|
|
5100
5157
|
{
|
|
5101
5158
|
onClick: loadContentSuggestions,
|
|
@@ -5124,8 +5181,8 @@ function AEOTab({
|
|
|
5124
5181
|
}
|
|
5125
5182
|
|
|
5126
5183
|
// src/components/ScoreDonut.tsx
|
|
5127
|
-
var
|
|
5128
|
-
var
|
|
5184
|
+
var import_react17 = require("react");
|
|
5185
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
5129
5186
|
var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
|
|
5130
5187
|
var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
|
|
5131
5188
|
var TRACK = "#eef2f7";
|
|
@@ -5137,7 +5194,7 @@ function ScoreDonut({
|
|
|
5137
5194
|
sectionFit,
|
|
5138
5195
|
composite
|
|
5139
5196
|
}) {
|
|
5140
|
-
const [hovered, setHovered] = (0,
|
|
5197
|
+
const [hovered, setHovered] = (0, import_react17.useState)(false);
|
|
5141
5198
|
const radius = (size - strokeWidth) / 2;
|
|
5142
5199
|
const circumference = 2 * Math.PI * radius;
|
|
5143
5200
|
const cTopic = topic * W.topic;
|
|
@@ -5150,7 +5207,7 @@ function ScoreDonut({
|
|
|
5150
5207
|
const topicLen = seg(cTopic);
|
|
5151
5208
|
const freshLen = seg(cFresh);
|
|
5152
5209
|
const sectionLen = seg(cSection);
|
|
5153
|
-
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0,
|
|
5210
|
+
const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5154
5211
|
"circle",
|
|
5155
5212
|
{
|
|
5156
5213
|
cx: size / 2,
|
|
@@ -5164,20 +5221,20 @@ function ScoreDonut({
|
|
|
5164
5221
|
strokeDashoffset: -offset
|
|
5165
5222
|
}
|
|
5166
5223
|
);
|
|
5167
|
-
return /* @__PURE__ */ (0,
|
|
5224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5168
5225
|
"div",
|
|
5169
5226
|
{
|
|
5170
5227
|
style: { position: "relative", width: size, height: size, flexShrink: 0 },
|
|
5171
5228
|
onMouseEnter: () => setHovered(true),
|
|
5172
5229
|
onMouseLeave: () => setHovered(false),
|
|
5173
5230
|
children: [
|
|
5174
|
-
/* @__PURE__ */ (0,
|
|
5175
|
-
/* @__PURE__ */ (0,
|
|
5176
|
-
/* @__PURE__ */ (0,
|
|
5177
|
-
/* @__PURE__ */ (0,
|
|
5178
|
-
/* @__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 })
|
|
5179
5236
|
] }),
|
|
5180
|
-
/* @__PURE__ */ (0,
|
|
5237
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5181
5238
|
"div",
|
|
5182
5239
|
{
|
|
5183
5240
|
style: {
|
|
@@ -5191,15 +5248,15 @@ function ScoreDonut({
|
|
|
5191
5248
|
lineHeight: 1
|
|
5192
5249
|
},
|
|
5193
5250
|
children: [
|
|
5194
|
-
/* @__PURE__ */ (0,
|
|
5251
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
|
|
5195
5252
|
compositeValue,
|
|
5196
5253
|
"%"
|
|
5197
5254
|
] }),
|
|
5198
|
-
/* @__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" })
|
|
5199
5256
|
]
|
|
5200
5257
|
}
|
|
5201
5258
|
),
|
|
5202
|
-
hovered && /* @__PURE__ */ (0,
|
|
5259
|
+
hovered && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5203
5260
|
"div",
|
|
5204
5261
|
{
|
|
5205
5262
|
role: "tooltip",
|
|
@@ -5220,9 +5277,9 @@ function ScoreDonut({
|
|
|
5220
5277
|
pointerEvents: "none"
|
|
5221
5278
|
},
|
|
5222
5279
|
children: [
|
|
5223
|
-
/* @__PURE__ */ (0,
|
|
5224
|
-
/* @__PURE__ */ (0,
|
|
5225
|
-
/* @__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 })
|
|
5226
5283
|
]
|
|
5227
5284
|
}
|
|
5228
5285
|
)
|
|
@@ -5231,31 +5288,31 @@ function ScoreDonut({
|
|
|
5231
5288
|
);
|
|
5232
5289
|
}
|
|
5233
5290
|
function SubScoreRow({ color, label, value }) {
|
|
5234
|
-
return /* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5236
|
-
/* @__PURE__ */ (0,
|
|
5237
|
-
/* @__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: [
|
|
5238
5295
|
Math.round(value),
|
|
5239
5296
|
"/100"
|
|
5240
5297
|
] })
|
|
5241
5298
|
] });
|
|
5242
5299
|
}
|
|
5243
5300
|
function ScoreDonutLegend() {
|
|
5244
|
-
return /* @__PURE__ */ (0,
|
|
5245
|
-
/* @__PURE__ */ (0,
|
|
5246
|
-
/* @__PURE__ */ (0,
|
|
5247
|
-
/* @__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%)" })
|
|
5248
5305
|
] });
|
|
5249
5306
|
}
|
|
5250
5307
|
function LegendDot({ color, label }) {
|
|
5251
|
-
return /* @__PURE__ */ (0,
|
|
5252
|
-
/* @__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" } }),
|
|
5253
5310
|
label
|
|
5254
5311
|
] });
|
|
5255
5312
|
}
|
|
5256
5313
|
|
|
5257
5314
|
// src/components/tabs/LinkingTab.tsx
|
|
5258
|
-
var
|
|
5315
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5259
5316
|
function buildLiveUrl(publication, slug) {
|
|
5260
5317
|
if (!slug) return null;
|
|
5261
5318
|
const pub = (publication || "").trim().toLowerCase();
|
|
@@ -5271,7 +5328,7 @@ function buildSanityUrl(baseUrl, id, type) {
|
|
|
5271
5328
|
return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
|
|
5272
5329
|
}
|
|
5273
5330
|
function LinkChip({ href, label, color }) {
|
|
5274
|
-
return /* @__PURE__ */ (0,
|
|
5331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5275
5332
|
"a",
|
|
5276
5333
|
{
|
|
5277
5334
|
href,
|
|
@@ -5293,16 +5350,16 @@ function LinkChip({ href, label, color }) {
|
|
|
5293
5350
|
},
|
|
5294
5351
|
children: [
|
|
5295
5352
|
label,
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5297
|
-
/* @__PURE__ */ (0,
|
|
5298
|
-
/* @__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" })
|
|
5299
5356
|
] })
|
|
5300
5357
|
]
|
|
5301
5358
|
}
|
|
5302
5359
|
);
|
|
5303
5360
|
}
|
|
5304
5361
|
function ClickableBadge({ clickable }) {
|
|
5305
|
-
return /* @__PURE__ */ (0,
|
|
5362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5306
5363
|
"span",
|
|
5307
5364
|
{
|
|
5308
5365
|
style: {
|
|
@@ -5319,7 +5376,7 @@ function ClickableBadge({ clickable }) {
|
|
|
5319
5376
|
color: clickable ? "#16a34a" : "#9ca3af"
|
|
5320
5377
|
},
|
|
5321
5378
|
children: [
|
|
5322
|
-
/* @__PURE__ */ (0,
|
|
5379
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
|
|
5323
5380
|
clickable ? "Clickable link" : "No live link"
|
|
5324
5381
|
]
|
|
5325
5382
|
}
|
|
@@ -5334,7 +5391,7 @@ var cardStyle4 = {
|
|
|
5334
5391
|
padding: "14px"
|
|
5335
5392
|
};
|
|
5336
5393
|
function AiPill2() {
|
|
5337
|
-
return /* @__PURE__ */ (0,
|
|
5394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5338
5395
|
"span",
|
|
5339
5396
|
{
|
|
5340
5397
|
style: {
|
|
@@ -5358,10 +5415,10 @@ function SectionHeader3({
|
|
|
5358
5415
|
ai,
|
|
5359
5416
|
action
|
|
5360
5417
|
}) {
|
|
5361
|
-
return /* @__PURE__ */ (0,
|
|
5362
|
-
/* @__PURE__ */ (0,
|
|
5363
|
-
/* @__PURE__ */ (0,
|
|
5364
|
-
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, {}),
|
|
5365
5422
|
action
|
|
5366
5423
|
] });
|
|
5367
5424
|
}
|
|
@@ -5382,7 +5439,7 @@ function freshnessChip(label, score) {
|
|
|
5382
5439
|
};
|
|
5383
5440
|
const c = map[label];
|
|
5384
5441
|
if (!c) return null;
|
|
5385
|
-
return /* @__PURE__ */ (0,
|
|
5442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5386
5443
|
"span",
|
|
5387
5444
|
{
|
|
5388
5445
|
style: {
|
|
@@ -5402,8 +5459,8 @@ function freshnessChip(label, score) {
|
|
|
5402
5459
|
);
|
|
5403
5460
|
}
|
|
5404
5461
|
function RefreshIcon({ spinning }) {
|
|
5405
|
-
if (spinning) return /* @__PURE__ */ (0,
|
|
5406
|
-
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" }) });
|
|
5407
5464
|
}
|
|
5408
5465
|
function LinkingTab({
|
|
5409
5466
|
analysis,
|
|
@@ -5419,21 +5476,21 @@ function LinkingTab({
|
|
|
5419
5476
|
documentType
|
|
5420
5477
|
}) {
|
|
5421
5478
|
if (!analysis) {
|
|
5422
|
-
return /* @__PURE__ */ (0,
|
|
5423
|
-
/* @__PURE__ */ (0,
|
|
5424
|
-
/* @__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." })
|
|
5425
5482
|
] });
|
|
5426
5483
|
}
|
|
5427
5484
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
5428
5485
|
const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
|
|
5429
5486
|
const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
|
|
5430
|
-
return /* @__PURE__ */ (0,
|
|
5431
|
-
/* @__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)(
|
|
5432
5489
|
SectionHeader3,
|
|
5433
5490
|
{
|
|
5434
5491
|
label: "Suggested Links",
|
|
5435
5492
|
iconColor: MJH_BLUE,
|
|
5436
|
-
action: /* @__PURE__ */ (0,
|
|
5493
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5437
5494
|
"button",
|
|
5438
5495
|
{
|
|
5439
5496
|
onClick: onRefresh,
|
|
@@ -5448,20 +5505,20 @@ function LinkingTab({
|
|
|
5448
5505
|
fontSize: 10
|
|
5449
5506
|
},
|
|
5450
5507
|
title: "Refresh",
|
|
5451
|
-
children: /* @__PURE__ */ (0,
|
|
5508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefreshIcon, { spinning: isLoading })
|
|
5452
5509
|
}
|
|
5453
5510
|
)
|
|
5454
5511
|
}
|
|
5455
5512
|
),
|
|
5456
|
-
/* @__PURE__ */ (0,
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
|
|
5457
5514
|
"Other articles on this site that fit this topic.",
|
|
5458
|
-
wordCount2 > 0 && /* @__PURE__ */ (0,
|
|
5515
|
+
wordCount2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5459
5516
|
" ",
|
|
5460
5517
|
"For a ",
|
|
5461
5518
|
wordCount2.toLocaleString(),
|
|
5462
5519
|
"-word article, aim for",
|
|
5463
5520
|
" ",
|
|
5464
|
-
/* @__PURE__ */ (0,
|
|
5521
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
|
|
5465
5522
|
recommendedMin,
|
|
5466
5523
|
"-",
|
|
5467
5524
|
recommendedMax,
|
|
@@ -5470,17 +5527,17 @@ function LinkingTab({
|
|
|
5470
5527
|
"."
|
|
5471
5528
|
] })
|
|
5472
5529
|
] }),
|
|
5473
|
-
/* @__PURE__ */ (0,
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
|
|
5474
5531
|
"Each suggestion gets a 0-100% match score from three signals - ",
|
|
5475
|
-
/* @__PURE__ */ (0,
|
|
5532
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "topic match" }),
|
|
5476
5533
|
", ",
|
|
5477
|
-
/* @__PURE__ */ (0,
|
|
5534
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "freshness" }),
|
|
5478
5535
|
", and ",
|
|
5479
|
-
/* @__PURE__ */ (0,
|
|
5536
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "section fit" }),
|
|
5480
5537
|
" (where in your article the link belongs). The percentage on each card is the weighted total:"
|
|
5481
5538
|
] }),
|
|
5482
|
-
/* @__PURE__ */ (0,
|
|
5483
|
-
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)(
|
|
5484
5541
|
"div",
|
|
5485
5542
|
{
|
|
5486
5543
|
role: "button",
|
|
@@ -5505,16 +5562,16 @@ function LinkingTab({
|
|
|
5505
5562
|
cursor: "pointer"
|
|
5506
5563
|
},
|
|
5507
5564
|
children: [
|
|
5508
|
-
/* @__PURE__ */ (0,
|
|
5509
|
-
/* @__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" })
|
|
5510
5567
|
]
|
|
5511
5568
|
}
|
|
5512
5569
|
),
|
|
5513
|
-
isLoading && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
5514
|
-
/* @__PURE__ */ (0,
|
|
5515
|
-
/* @__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..." })
|
|
5516
5573
|
] }),
|
|
5517
|
-
!isLoading && error && /* @__PURE__ */ (0,
|
|
5574
|
+
!isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5518
5575
|
"div",
|
|
5519
5576
|
{
|
|
5520
5577
|
style: {
|
|
@@ -5525,9 +5582,9 @@ function LinkingTab({
|
|
|
5525
5582
|
textAlign: "center"
|
|
5526
5583
|
},
|
|
5527
5584
|
children: [
|
|
5528
|
-
/* @__PURE__ */ (0,
|
|
5529
|
-
/* @__PURE__ */ (0,
|
|
5530
|
-
/* @__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)(
|
|
5531
5588
|
"button",
|
|
5532
5589
|
{
|
|
5533
5590
|
onClick: onRefresh,
|
|
@@ -5547,14 +5604,14 @@ function LinkingTab({
|
|
|
5547
5604
|
]
|
|
5548
5605
|
}
|
|
5549
5606
|
),
|
|
5550
|
-
!isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0,
|
|
5551
|
-
/* @__PURE__ */ (0,
|
|
5552
|
-
/* @__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." })
|
|
5553
5610
|
] }),
|
|
5554
|
-
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) => {
|
|
5555
5612
|
const liveUrl = buildLiveUrl(publication, s.slug);
|
|
5556
5613
|
const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
|
|
5557
|
-
return /* @__PURE__ */ (0,
|
|
5614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5558
5615
|
"div",
|
|
5559
5616
|
{
|
|
5560
5617
|
style: {
|
|
@@ -5567,7 +5624,7 @@ function LinkingTab({
|
|
|
5567
5624
|
alignItems: "flex-start"
|
|
5568
5625
|
},
|
|
5569
5626
|
children: [
|
|
5570
|
-
/* @__PURE__ */ (0,
|
|
5627
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5571
5628
|
ScoreDonut,
|
|
5572
5629
|
{
|
|
5573
5630
|
size: 64,
|
|
@@ -5577,27 +5634,27 @@ function LinkingTab({
|
|
|
5577
5634
|
composite: Math.max(0, Math.min(100, s.compositeScore))
|
|
5578
5635
|
}
|
|
5579
5636
|
),
|
|
5580
|
-
/* @__PURE__ */ (0,
|
|
5581
|
-
/* @__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: [
|
|
5582
5639
|
freshnessChip(s.freshnessLabel, s.freshnessScore),
|
|
5583
|
-
s.publishedAt && /* @__PURE__ */ (0,
|
|
5584
|
-
/* @__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 })
|
|
5585
5642
|
] }),
|
|
5586
|
-
/* @__PURE__ */ (0,
|
|
5587
|
-
/* @__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: [
|
|
5588
5645
|
"/",
|
|
5589
5646
|
s.slug
|
|
5590
5647
|
] }),
|
|
5591
|
-
(liveUrl || sanityUrl) && /* @__PURE__ */ (0,
|
|
5592
|
-
sanityUrl && /* @__PURE__ */ (0,
|
|
5593
|
-
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" })
|
|
5594
5651
|
] }),
|
|
5595
|
-
s.relevanceReason && /* @__PURE__ */ (0,
|
|
5596
|
-
/* @__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:" }),
|
|
5597
5654
|
" ",
|
|
5598
|
-
/* @__PURE__ */ (0,
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
|
|
5599
5656
|
] }),
|
|
5600
|
-
s.anchorQuote && /* @__PURE__ */ (0,
|
|
5657
|
+
s.anchorQuote && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5601
5658
|
"div",
|
|
5602
5659
|
{
|
|
5603
5660
|
style: {
|
|
@@ -5611,21 +5668,21 @@ function LinkingTab({
|
|
|
5611
5668
|
lineHeight: 1.5
|
|
5612
5669
|
},
|
|
5613
5670
|
children: [
|
|
5614
|
-
/* @__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: [
|
|
5615
5672
|
"Where to link from - paragraph ",
|
|
5616
5673
|
s.anchorParagraph
|
|
5617
5674
|
] }),
|
|
5618
|
-
/* @__PURE__ */ (0,
|
|
5675
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontStyle: "italic" }, children: [
|
|
5619
5676
|
'"',
|
|
5620
5677
|
s.anchorQuote,
|
|
5621
5678
|
'"'
|
|
5622
5679
|
] }),
|
|
5623
|
-
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 })
|
|
5624
5681
|
]
|
|
5625
5682
|
}
|
|
5626
5683
|
)
|
|
5627
5684
|
] }),
|
|
5628
|
-
/* @__PURE__ */ (0,
|
|
5685
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5629
5686
|
FeedbackButton,
|
|
5630
5687
|
{
|
|
5631
5688
|
suggestionType: "internal_link",
|
|
@@ -5643,11 +5700,11 @@ function LinkingTab({
|
|
|
5643
5700
|
}
|
|
5644
5701
|
|
|
5645
5702
|
// src/components/tabs/MetaTab.tsx
|
|
5646
|
-
var
|
|
5647
|
-
var
|
|
5703
|
+
var import_react18 = require("react");
|
|
5704
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5648
5705
|
var GOOGLE_EEAT_URL = "https://developers.google.com/search/docs/fundamentals/creating-helpful-content#eat";
|
|
5649
5706
|
function ExternalLinkChip({ href, label }) {
|
|
5650
|
-
return /* @__PURE__ */ (0,
|
|
5707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5651
5708
|
"a",
|
|
5652
5709
|
{
|
|
5653
5710
|
href,
|
|
@@ -5670,16 +5727,16 @@ function ExternalLinkChip({ href, label }) {
|
|
|
5670
5727
|
},
|
|
5671
5728
|
children: [
|
|
5672
5729
|
label,
|
|
5673
|
-
/* @__PURE__ */ (0,
|
|
5674
|
-
/* @__PURE__ */ (0,
|
|
5675
|
-
/* @__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" })
|
|
5676
5733
|
] })
|
|
5677
5734
|
]
|
|
5678
5735
|
}
|
|
5679
5736
|
);
|
|
5680
5737
|
}
|
|
5681
5738
|
function FreshnessNotice() {
|
|
5682
|
-
return /* @__PURE__ */ (0,
|
|
5739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5683
5740
|
"div",
|
|
5684
5741
|
{
|
|
5685
5742
|
style: {
|
|
@@ -5693,11 +5750,11 @@ function FreshnessNotice() {
|
|
|
5693
5750
|
lineHeight: 1.5
|
|
5694
5751
|
},
|
|
5695
5752
|
children: [
|
|
5696
|
-
/* @__PURE__ */ (0,
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
|
|
5697
5754
|
"Planning to update this article after it's published? Set the ",
|
|
5698
|
-
/* @__PURE__ */ (0,
|
|
5755
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: "Updated on" }),
|
|
5699
5756
|
" date in Sanity (e.g. \u201CUpdated: February 19, 2026\u201D). It surfaces the article in ",
|
|
5700
|
-
/* @__PURE__ */ (0,
|
|
5757
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: "Latest Updated Articles" }),
|
|
5701
5758
|
" and increases its visibility in search engine results."
|
|
5702
5759
|
]
|
|
5703
5760
|
}
|
|
@@ -5718,7 +5775,7 @@ function StatusBadge({ status }) {
|
|
|
5718
5775
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
5719
5776
|
};
|
|
5720
5777
|
const c = map[status];
|
|
5721
|
-
return /* @__PURE__ */ (0,
|
|
5778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5722
5779
|
"span",
|
|
5723
5780
|
{
|
|
5724
5781
|
style: {
|
|
@@ -5737,12 +5794,12 @@ function StatusBadge({ status }) {
|
|
|
5737
5794
|
);
|
|
5738
5795
|
}
|
|
5739
5796
|
function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
5740
|
-
return /* @__PURE__ */ (0,
|
|
5741
|
-
/* @__PURE__ */ (0,
|
|
5742
|
-
/* @__PURE__ */ (0,
|
|
5743
|
-
/* @__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 })
|
|
5744
5801
|
] }),
|
|
5745
|
-
/* @__PURE__ */ (0,
|
|
5802
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5746
5803
|
"div",
|
|
5747
5804
|
{
|
|
5748
5805
|
style: {
|
|
@@ -5755,7 +5812,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
|
|
|
5755
5812
|
children: value
|
|
5756
5813
|
}
|
|
5757
5814
|
),
|
|
5758
|
-
recommendation && /* @__PURE__ */ (0,
|
|
5815
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5759
5816
|
"div",
|
|
5760
5817
|
{
|
|
5761
5818
|
style: {
|
|
@@ -5881,13 +5938,13 @@ function formatDateShort(iso) {
|
|
|
5881
5938
|
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
5882
5939
|
}
|
|
5883
5940
|
function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }) {
|
|
5884
|
-
const audits = (0,
|
|
5941
|
+
const audits = (0, import_react18.useMemo)(() => {
|
|
5885
5942
|
const list = [];
|
|
5886
5943
|
list.push(titleAudit(documentFields?.title, primaryKeyword));
|
|
5887
5944
|
list.push(metaDescriptionAudit(documentFields?.metaDescription, primaryKeyword, secondaryKeyword));
|
|
5888
5945
|
return list;
|
|
5889
5946
|
}, [documentFields, primaryKeyword, secondaryKeyword]);
|
|
5890
|
-
const eeatItems = (0,
|
|
5947
|
+
const eeatItems = (0, import_react18.useMemo)(() => {
|
|
5891
5948
|
const items = [];
|
|
5892
5949
|
const author = documentFields?.authorName;
|
|
5893
5950
|
const creds = documentFields?.authorCredentials;
|
|
@@ -5904,7 +5961,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5904
5961
|
} else {
|
|
5905
5962
|
items.push({ label: "Author Byline", value: `${author}, ${creds}`, status: "good" });
|
|
5906
5963
|
}
|
|
5907
|
-
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" });
|
|
5908
5965
|
const factChecker = documentFields?.factCheckerName;
|
|
5909
5966
|
const factCheckerRef = documentFields?.factCheckerIsReference;
|
|
5910
5967
|
if (factChecker) {
|
|
@@ -5929,31 +5986,31 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5929
5986
|
if (days <= 14) {
|
|
5930
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." });
|
|
5931
5988
|
} else if (days <= 90) {
|
|
5932
|
-
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." });
|
|
5933
5990
|
} else {
|
|
5934
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." });
|
|
5935
5992
|
}
|
|
5936
5993
|
}
|
|
5937
5994
|
return items;
|
|
5938
5995
|
}, [documentFields]);
|
|
5939
|
-
const publishDateItem = (0,
|
|
5996
|
+
const publishDateItem = (0, import_react18.useMemo)(() => {
|
|
5940
5997
|
const published = documentFields?.publishedAt;
|
|
5941
5998
|
const daysPub = daysSince(published);
|
|
5942
|
-
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." };
|
|
5943
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." };
|
|
5944
6001
|
return { label: "Publish Date", value: formatDateShort(published), status: "good" };
|
|
5945
6002
|
}, [documentFields]);
|
|
5946
6003
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
|
|
5947
6004
|
if (isLoading && !hasAnyField) {
|
|
5948
|
-
return /* @__PURE__ */ (0,
|
|
5949
|
-
/* @__PURE__ */ (0,
|
|
5950
|
-
/* @__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" })
|
|
5951
6008
|
] });
|
|
5952
6009
|
}
|
|
5953
6010
|
const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
|
|
5954
|
-
return /* @__PURE__ */ (0,
|
|
5955
|
-
/* @__PURE__ */ (0,
|
|
5956
|
-
/* @__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)(
|
|
5957
6014
|
AuditCard,
|
|
5958
6015
|
{
|
|
5959
6016
|
anchorId: "anchor-publish-date",
|
|
@@ -5963,7 +6020,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5963
6020
|
recommendation: publishDateItem.recommendation
|
|
5964
6021
|
}
|
|
5965
6022
|
),
|
|
5966
|
-
audits.map((a, i) => /* @__PURE__ */ (0,
|
|
6023
|
+
audits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5967
6024
|
AuditCard,
|
|
5968
6025
|
{
|
|
5969
6026
|
anchorId: auditAnchors[i],
|
|
@@ -5974,14 +6031,14 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5974
6031
|
},
|
|
5975
6032
|
i
|
|
5976
6033
|
)),
|
|
5977
|
-
eeatItems.length > 0 && /* @__PURE__ */ (0,
|
|
5978
|
-
/* @__PURE__ */ (0,
|
|
5979
|
-
/* @__PURE__ */ (0,
|
|
5980
|
-
/* @__PURE__ */ (0,
|
|
5981
|
-
/* @__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)" } })
|
|
5982
6039
|
] }),
|
|
5983
|
-
/* @__PURE__ */ (0,
|
|
5984
|
-
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)(
|
|
5985
6042
|
AuditCard,
|
|
5986
6043
|
{
|
|
5987
6044
|
label: item.label,
|
|
@@ -5997,8 +6054,8 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
|
|
|
5997
6054
|
}
|
|
5998
6055
|
|
|
5999
6056
|
// src/components/tabs/TechnicalTab.tsx
|
|
6000
|
-
var
|
|
6001
|
-
var
|
|
6057
|
+
var import_react19 = require("react");
|
|
6058
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6002
6059
|
function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
6003
6060
|
const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
|
|
6004
6061
|
if (!slug) {
|
|
@@ -6033,28 +6090,28 @@ function urlAudit(slug, primaryKeyword, secondaryKeyword) {
|
|
|
6033
6090
|
return { label: "URL Slug", value: `/${slug}`, status: "good" };
|
|
6034
6091
|
}
|
|
6035
6092
|
function SlugRedirectNotice() {
|
|
6036
|
-
const [expanded, setExpanded] = (0,
|
|
6037
|
-
return /* @__PURE__ */ (0,
|
|
6038
|
-
/* @__PURE__ */ (0,
|
|
6039
|
-
/* @__PURE__ */ (0,
|
|
6040
|
-
/* @__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?" })
|
|
6041
6098
|
] }),
|
|
6042
|
-
/* @__PURE__ */ (0,
|
|
6043
|
-
/* @__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)(
|
|
6044
6101
|
"button",
|
|
6045
6102
|
{
|
|
6046
6103
|
onClick: () => setExpanded((v) => !v),
|
|
6047
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" },
|
|
6048
6105
|
children: [
|
|
6049
6106
|
expanded ? "Show less" : "Learn more",
|
|
6050
|
-
/* @__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" }) })
|
|
6051
6108
|
]
|
|
6052
6109
|
}
|
|
6053
6110
|
),
|
|
6054
|
-
expanded && /* @__PURE__ */ (0,
|
|
6055
|
-
/* @__PURE__ */ (0,
|
|
6056
|
-
/* @__PURE__ */ (0,
|
|
6057
|
-
/* @__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." })
|
|
6058
6115
|
] })
|
|
6059
6116
|
] }) });
|
|
6060
6117
|
}
|
|
@@ -6073,7 +6130,7 @@ function StatusBadge2({ status }) {
|
|
|
6073
6130
|
error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
|
|
6074
6131
|
};
|
|
6075
6132
|
const c = map[status];
|
|
6076
|
-
return /* @__PURE__ */ (0,
|
|
6133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6077
6134
|
"span",
|
|
6078
6135
|
{
|
|
6079
6136
|
style: {
|
|
@@ -6099,12 +6156,12 @@ function AuditCard2({
|
|
|
6099
6156
|
anchorId,
|
|
6100
6157
|
footer
|
|
6101
6158
|
}) {
|
|
6102
|
-
return /* @__PURE__ */ (0,
|
|
6103
|
-
/* @__PURE__ */ (0,
|
|
6104
|
-
/* @__PURE__ */ (0,
|
|
6105
|
-
/* @__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 })
|
|
6106
6163
|
] }),
|
|
6107
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6108
6165
|
"div",
|
|
6109
6166
|
{
|
|
6110
6167
|
style: {
|
|
@@ -6117,7 +6174,7 @@ function AuditCard2({
|
|
|
6117
6174
|
children: value
|
|
6118
6175
|
}
|
|
6119
6176
|
),
|
|
6120
|
-
recommendation && /* @__PURE__ */ (0,
|
|
6177
|
+
recommendation && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6121
6178
|
"div",
|
|
6122
6179
|
{
|
|
6123
6180
|
style: {
|
|
@@ -6231,7 +6288,7 @@ function imageTitleAudit(titles, imageCount) {
|
|
|
6231
6288
|
label: "Image Titles",
|
|
6232
6289
|
value: `${withTitle} of ${imageCount} image${imageCount === 1 ? "" : "s"} ${withTitle === 1 ? "has" : "have"} a title`,
|
|
6233
6290
|
status: "warning",
|
|
6234
|
-
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.`
|
|
6235
6292
|
};
|
|
6236
6293
|
}
|
|
6237
6294
|
const sparse = titles.filter((t) => t.trim().split(/\s+/).filter(Boolean).length < 2);
|
|
@@ -6359,7 +6416,7 @@ function HealthBadge({ result }) {
|
|
|
6359
6416
|
error: { color: "#dc2626", label: "ERR" }
|
|
6360
6417
|
};
|
|
6361
6418
|
const c = map[result.category];
|
|
6362
|
-
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 });
|
|
6363
6420
|
}
|
|
6364
6421
|
function LinkCheckCard({
|
|
6365
6422
|
urls,
|
|
@@ -6370,15 +6427,15 @@ function LinkCheckCard({
|
|
|
6370
6427
|
hasRun,
|
|
6371
6428
|
onCheck
|
|
6372
6429
|
}) {
|
|
6373
|
-
const [openBucket, setOpenBucket] = (0,
|
|
6430
|
+
const [openBucket, setOpenBucket] = (0, import_react19.useState)(null);
|
|
6374
6431
|
const haveTypes = !!linksDetailed;
|
|
6375
|
-
const detailByUrl = (0,
|
|
6432
|
+
const detailByUrl = (0, import_react19.useMemo)(
|
|
6376
6433
|
() => new Map((linksDetailed || []).map((d) => [d.url, d])),
|
|
6377
6434
|
[linksDetailed]
|
|
6378
6435
|
);
|
|
6379
|
-
const resultByUrl = (0,
|
|
6436
|
+
const resultByUrl = (0, import_react19.useMemo)(() => new Map(results.map((r) => [r.url, r])), [results]);
|
|
6380
6437
|
const blockedUrls = results.filter((r) => r.category === "unverified").map((r) => r.url);
|
|
6381
|
-
const tiles = (0,
|
|
6438
|
+
const tiles = (0, import_react19.useMemo)(() => {
|
|
6382
6439
|
const hyper = (linksDetailed || []).filter((l) => l.hyperlinked).map((l) => l.url);
|
|
6383
6440
|
const plain = (linksDetailed || []).filter((l) => !l.hyperlinked).map((l) => l.url);
|
|
6384
6441
|
const working = results.filter((r) => r.category === "ok" || r.category === "redirect").map((r) => r.url);
|
|
@@ -6394,7 +6451,7 @@ function LinkCheckCard({
|
|
|
6394
6451
|
const renderLinkRow = (url) => {
|
|
6395
6452
|
const d = detailByUrl.get(url);
|
|
6396
6453
|
const r = resultByUrl.get(url);
|
|
6397
|
-
return /* @__PURE__ */ (0,
|
|
6454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6398
6455
|
"a",
|
|
6399
6456
|
{
|
|
6400
6457
|
href: url,
|
|
@@ -6402,37 +6459,37 @@ function LinkCheckCard({
|
|
|
6402
6459
|
rel: "noopener noreferrer",
|
|
6403
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 },
|
|
6404
6461
|
children: [
|
|
6405
|
-
r && /* @__PURE__ */ (0,
|
|
6406
|
-
/* @__PURE__ */ (0,
|
|
6407
|
-
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: [
|
|
6408
6465
|
"\u201C",
|
|
6409
6466
|
d.anchorText,
|
|
6410
6467
|
"\u201D"
|
|
6411
6468
|
] }),
|
|
6412
|
-
/* @__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 })
|
|
6413
6470
|
] })
|
|
6414
6471
|
]
|
|
6415
6472
|
},
|
|
6416
6473
|
url
|
|
6417
6474
|
);
|
|
6418
6475
|
};
|
|
6419
|
-
return /* @__PURE__ */ (0,
|
|
6420
|
-
/* @__PURE__ */ (0,
|
|
6421
|
-
/* @__PURE__ */ (0,
|
|
6422
|
-
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" })
|
|
6423
6480
|
] }),
|
|
6424
|
-
urls.length === 0 ? /* @__PURE__ */ (0,
|
|
6425
|
-
/* @__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: [
|
|
6426
6483
|
urls.length,
|
|
6427
6484
|
" link",
|
|
6428
6485
|
urls.length === 1 ? "" : "s",
|
|
6429
6486
|
" in the body.",
|
|
6430
6487
|
tiles.length > 0 ? " Tap a box to see which." : ""
|
|
6431
6488
|
] }),
|
|
6432
|
-
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) => {
|
|
6433
6490
|
const empty = t.urls.length === 0;
|
|
6434
6491
|
const active = openBucket === t.key && !empty;
|
|
6435
|
-
return /* @__PURE__ */ (0,
|
|
6492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6436
6493
|
"button",
|
|
6437
6494
|
{
|
|
6438
6495
|
type: "button",
|
|
@@ -6449,24 +6506,24 @@ function LinkCheckCard({
|
|
|
6449
6506
|
opacity: empty ? 0.5 : 1
|
|
6450
6507
|
},
|
|
6451
6508
|
children: [
|
|
6452
|
-
/* @__PURE__ */ (0,
|
|
6453
|
-
/* @__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 })
|
|
6454
6511
|
]
|
|
6455
6512
|
},
|
|
6456
6513
|
t.key
|
|
6457
6514
|
);
|
|
6458
6515
|
}) }),
|
|
6459
|
-
open && open.urls.length > 0 && /* @__PURE__ */ (0,
|
|
6460
|
-
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 }),
|
|
6461
6518
|
open.urls.map(renderLinkRow)
|
|
6462
6519
|
] }),
|
|
6463
|
-
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: [
|
|
6464
6521
|
blockedUrls.length,
|
|
6465
6522
|
" link",
|
|
6466
6523
|
blockedUrls.length === 1 ? "" : "s",
|
|
6467
6524
|
" couldn't be auto-checked (the destination blocks our checker) - open them to confirm."
|
|
6468
6525
|
] }),
|
|
6469
|
-
!hasRun && !isLoading && /* @__PURE__ */ (0,
|
|
6526
|
+
!hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6470
6527
|
"button",
|
|
6471
6528
|
{
|
|
6472
6529
|
onClick: onCheck,
|
|
@@ -6480,9 +6537,9 @@ function LinkCheckCard({
|
|
|
6480
6537
|
]
|
|
6481
6538
|
}
|
|
6482
6539
|
),
|
|
6483
|
-
isLoading && /* @__PURE__ */ (0,
|
|
6484
|
-
/* @__PURE__ */ (0,
|
|
6485
|
-
/* @__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: [
|
|
6486
6543
|
"Checking ",
|
|
6487
6544
|
urls.length,
|
|
6488
6545
|
" link",
|
|
@@ -6490,9 +6547,9 @@ function LinkCheckCard({
|
|
|
6490
6547
|
"..."
|
|
6491
6548
|
] })
|
|
6492
6549
|
] }),
|
|
6493
|
-
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: [
|
|
6494
6551
|
error,
|
|
6495
|
-
/* @__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" })
|
|
6496
6553
|
] })
|
|
6497
6554
|
] })
|
|
6498
6555
|
] });
|
|
@@ -6509,37 +6566,37 @@ function TechnicalTab({
|
|
|
6509
6566
|
hasRunLinkCheck,
|
|
6510
6567
|
onCheckLinks
|
|
6511
6568
|
}) {
|
|
6512
|
-
const urlSlugAudit = (0,
|
|
6569
|
+
const urlSlugAudit = (0, import_react19.useMemo)(
|
|
6513
6570
|
() => urlAudit(documentFields?.slug, primaryKeyword, secondaryKeyword),
|
|
6514
6571
|
[documentFields?.slug, primaryKeyword, secondaryKeyword]
|
|
6515
6572
|
);
|
|
6516
6573
|
const headings = documentFields?.headings || [];
|
|
6517
6574
|
const headingsDetailed = documentFields?.headingsDetailed;
|
|
6518
|
-
const headingsForStructure = (0,
|
|
6575
|
+
const headingsForStructure = (0, import_react19.useMemo)(
|
|
6519
6576
|
() => headingsDetailed ? headingsDetailed : headings.map((text2) => ({ text: text2, level: 2 })),
|
|
6520
6577
|
[headingsDetailed, headings]
|
|
6521
6578
|
);
|
|
6522
6579
|
const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
|
|
6523
|
-
const structureAudits = (0,
|
|
6580
|
+
const structureAudits = (0, import_react19.useMemo)(
|
|
6524
6581
|
() => computeHeadingStructureAudits(headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings),
|
|
6525
6582
|
[headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings]
|
|
6526
6583
|
);
|
|
6527
6584
|
const imageNames = documentFields?.imageNames || [];
|
|
6528
|
-
const { filenames: imageFilenames, altTexts: imageAltTexts } = (0,
|
|
6585
|
+
const { filenames: imageFilenames, altTexts: imageAltTexts } = (0, import_react19.useMemo)(
|
|
6529
6586
|
() => classifyImageNames(imageNames),
|
|
6530
6587
|
[imageNames]
|
|
6531
6588
|
);
|
|
6532
|
-
const filenameAudit = (0,
|
|
6589
|
+
const filenameAudit = (0, import_react19.useMemo)(
|
|
6533
6590
|
() => imageFilenameAudit(imageFilenames),
|
|
6534
6591
|
[imageFilenames]
|
|
6535
6592
|
);
|
|
6536
|
-
const altTextAudit = (0,
|
|
6593
|
+
const altTextAudit = (0, import_react19.useMemo)(
|
|
6537
6594
|
() => imageAltTextAudit(imageAltTexts),
|
|
6538
6595
|
[imageAltTexts]
|
|
6539
6596
|
);
|
|
6540
6597
|
const imageTitles = documentFields?.imageTitles || [];
|
|
6541
6598
|
const imageCount = documentFields?.imageCount ?? 0;
|
|
6542
|
-
const imgTitleAudit = (0,
|
|
6599
|
+
const imgTitleAudit = (0, import_react19.useMemo)(
|
|
6543
6600
|
() => imageTitleAudit(imageTitles, imageCount),
|
|
6544
6601
|
[imageTitles, imageCount]
|
|
6545
6602
|
);
|
|
@@ -6566,13 +6623,13 @@ function TechnicalTab({
|
|
|
6566
6623
|
const bodyLinksDetailed = documentFields?.bodyLinksDetailed;
|
|
6567
6624
|
const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
|
|
6568
6625
|
if (isLoading && !hasAnyField) {
|
|
6569
|
-
return /* @__PURE__ */ (0,
|
|
6570
|
-
/* @__PURE__ */ (0,
|
|
6571
|
-
/* @__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" })
|
|
6572
6629
|
] });
|
|
6573
6630
|
}
|
|
6574
|
-
return /* @__PURE__ */ (0,
|
|
6575
|
-
/* @__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)(
|
|
6576
6633
|
AuditCard2,
|
|
6577
6634
|
{
|
|
6578
6635
|
anchorId: "anchor-url-slug",
|
|
@@ -6580,10 +6637,10 @@ function TechnicalTab({
|
|
|
6580
6637
|
value: urlSlugAudit.value,
|
|
6581
6638
|
status: urlSlugAudit.status,
|
|
6582
6639
|
recommendation: urlSlugAudit.recommendation,
|
|
6583
|
-
footer: /* @__PURE__ */ (0,
|
|
6640
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SlugRedirectNotice, {})
|
|
6584
6641
|
}
|
|
6585
6642
|
),
|
|
6586
|
-
/* @__PURE__ */ (0,
|
|
6643
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6587
6644
|
LinkCheckCard,
|
|
6588
6645
|
{
|
|
6589
6646
|
urls: bodyLinks,
|
|
@@ -6595,7 +6652,7 @@ function TechnicalTab({
|
|
|
6595
6652
|
onCheck: onCheckLinks
|
|
6596
6653
|
}
|
|
6597
6654
|
),
|
|
6598
|
-
wordAudit && /* @__PURE__ */ (0,
|
|
6655
|
+
wordAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6599
6656
|
AuditCard2,
|
|
6600
6657
|
{
|
|
6601
6658
|
anchorId: "anchor-word-count",
|
|
@@ -6609,7 +6666,7 @@ function TechnicalTab({
|
|
|
6609
6666
|
const structIdx = structureAudits.findIndex(
|
|
6610
6667
|
(a) => a.label !== "Keywords in Headings" && a.label !== "Looks Like a Heading"
|
|
6611
6668
|
);
|
|
6612
|
-
return structureAudits.map((a, i) => /* @__PURE__ */ (0,
|
|
6669
|
+
return structureAudits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6613
6670
|
AuditCard2,
|
|
6614
6671
|
{
|
|
6615
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,
|
|
@@ -6621,17 +6678,17 @@ function TechnicalTab({
|
|
|
6621
6678
|
`structure-${i}`
|
|
6622
6679
|
));
|
|
6623
6680
|
})(),
|
|
6624
|
-
(headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ (0,
|
|
6625
|
-
/* @__PURE__ */ (0,
|
|
6626
|
-
/* @__PURE__ */ (0,
|
|
6627
|
-
documentFields?.title && /* @__PURE__ */ (0,
|
|
6628
|
-
/* @__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" }),
|
|
6629
6686
|
documentFields.title,
|
|
6630
|
-
/* @__PURE__ */ (0,
|
|
6687
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
|
|
6631
6688
|
] }),
|
|
6632
6689
|
(headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => {
|
|
6633
6690
|
const isH1 = h.level === 1;
|
|
6634
|
-
return /* @__PURE__ */ (0,
|
|
6691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6635
6692
|
"div",
|
|
6636
6693
|
{
|
|
6637
6694
|
style: {
|
|
@@ -6643,7 +6700,7 @@ function TechnicalTab({
|
|
|
6643
6700
|
paddingLeft: Math.max(0, (h.level - 2) * 12)
|
|
6644
6701
|
},
|
|
6645
6702
|
children: [
|
|
6646
|
-
/* @__PURE__ */ (0,
|
|
6703
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
|
|
6647
6704
|
"H",
|
|
6648
6705
|
h.level
|
|
6649
6706
|
] }),
|
|
@@ -6653,15 +6710,15 @@ function TechnicalTab({
|
|
|
6653
6710
|
i
|
|
6654
6711
|
);
|
|
6655
6712
|
}),
|
|
6656
|
-
(headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0,
|
|
6713
|
+
(headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
|
|
6657
6714
|
"+ ",
|
|
6658
6715
|
(headingsDetailed ?? headings).length - 12,
|
|
6659
6716
|
" more"
|
|
6660
6717
|
] })
|
|
6661
6718
|
] }),
|
|
6662
|
-
/* @__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." })
|
|
6663
6720
|
] }),
|
|
6664
|
-
imagesAudit && /* @__PURE__ */ (0,
|
|
6721
|
+
imagesAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6665
6722
|
AuditCard2,
|
|
6666
6723
|
{
|
|
6667
6724
|
anchorId: "anchor-images",
|
|
@@ -6671,7 +6728,7 @@ function TechnicalTab({
|
|
|
6671
6728
|
recommendation: imagesAudit.recommendation
|
|
6672
6729
|
}
|
|
6673
6730
|
),
|
|
6674
|
-
filenameAudit && /* @__PURE__ */ (0,
|
|
6731
|
+
filenameAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6675
6732
|
AuditCard2,
|
|
6676
6733
|
{
|
|
6677
6734
|
anchorId: "anchor-image-filenames",
|
|
@@ -6681,7 +6738,7 @@ function TechnicalTab({
|
|
|
6681
6738
|
recommendation: filenameAudit.recommendation
|
|
6682
6739
|
}
|
|
6683
6740
|
),
|
|
6684
|
-
altTextAudit && /* @__PURE__ */ (0,
|
|
6741
|
+
altTextAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6685
6742
|
AuditCard2,
|
|
6686
6743
|
{
|
|
6687
6744
|
anchorId: "anchor-image-alt",
|
|
@@ -6691,7 +6748,7 @@ function TechnicalTab({
|
|
|
6691
6748
|
recommendation: altTextAudit.recommendation
|
|
6692
6749
|
}
|
|
6693
6750
|
),
|
|
6694
|
-
imgTitleAudit && /* @__PURE__ */ (0,
|
|
6751
|
+
imgTitleAudit && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6695
6752
|
AuditCard2,
|
|
6696
6753
|
{
|
|
6697
6754
|
anchorId: "anchor-image-titles",
|
|
@@ -6705,12 +6762,12 @@ function TechnicalTab({
|
|
|
6705
6762
|
}
|
|
6706
6763
|
|
|
6707
6764
|
// src/components/SEOCopilotPanel.tsx
|
|
6708
|
-
var
|
|
6765
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6709
6766
|
function LogoIcon2() {
|
|
6710
|
-
return /* @__PURE__ */ (0,
|
|
6711
|
-
/* @__PURE__ */ (0,
|
|
6712
|
-
/* @__PURE__ */ (0,
|
|
6713
|
-
/* @__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" })
|
|
6714
6771
|
] });
|
|
6715
6772
|
}
|
|
6716
6773
|
function PanelContent({
|
|
@@ -6752,14 +6809,14 @@ function PanelContent({
|
|
|
6752
6809
|
const keywordAnalysisState = externalAnalysis;
|
|
6753
6810
|
const effectivePrimary = selectedPrimary || externalAnalysis.analysis?.primaryKeyword?.term || "";
|
|
6754
6811
|
const effectiveSecondary = selectedSecondary || "";
|
|
6755
|
-
const containerRef = (0,
|
|
6756
|
-
const dragging = (0,
|
|
6757
|
-
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)(() => {
|
|
6758
6815
|
dragging.current = true;
|
|
6759
6816
|
document.body.style.cursor = "row-resize";
|
|
6760
6817
|
document.body.style.userSelect = "none";
|
|
6761
6818
|
}, []);
|
|
6762
|
-
(0,
|
|
6819
|
+
(0, import_react20.useEffect)(() => {
|
|
6763
6820
|
const onMouseMove = (e) => {
|
|
6764
6821
|
if (!dragging.current || !containerRef.current) return;
|
|
6765
6822
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -6782,11 +6839,11 @@ function PanelContent({
|
|
|
6782
6839
|
const onboardSite = publication || "default";
|
|
6783
6840
|
const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
|
|
6784
6841
|
const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
|
|
6785
|
-
const [popupMode, setPopupMode] = (0,
|
|
6786
|
-
const [popupClosing, setPopupClosing] = (0,
|
|
6787
|
-
const onboardTimerRef = (0,
|
|
6788
|
-
const onboardFadeRef = (0,
|
|
6789
|
-
(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)(() => {
|
|
6790
6847
|
let onboarded = false;
|
|
6791
6848
|
let shownThisSession = false;
|
|
6792
6849
|
try {
|
|
@@ -6816,13 +6873,13 @@ function PanelContent({
|
|
|
6816
6873
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6817
6874
|
};
|
|
6818
6875
|
}, [onboardKey, onboardSessionKey]);
|
|
6819
|
-
const markOnboarded = (0,
|
|
6876
|
+
const markOnboarded = (0, import_react20.useCallback)(() => {
|
|
6820
6877
|
try {
|
|
6821
6878
|
localStorage.setItem(onboardKey, "1");
|
|
6822
6879
|
} catch {
|
|
6823
6880
|
}
|
|
6824
6881
|
}, [onboardKey]);
|
|
6825
|
-
const dismissPopup = (0,
|
|
6882
|
+
const dismissPopup = (0, import_react20.useCallback)(() => {
|
|
6826
6883
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6827
6884
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6828
6885
|
markOnboarded();
|
|
@@ -6832,14 +6889,14 @@ function PanelContent({
|
|
|
6832
6889
|
setPopupClosing(false);
|
|
6833
6890
|
}, 180);
|
|
6834
6891
|
}, [markOnboarded]);
|
|
6835
|
-
const openPopupPersistent = (0,
|
|
6892
|
+
const openPopupPersistent = (0, import_react20.useCallback)(() => {
|
|
6836
6893
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6837
6894
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
6838
6895
|
markOnboarded();
|
|
6839
6896
|
setPopupClosing(false);
|
|
6840
6897
|
setPopupMode("persistent");
|
|
6841
6898
|
}, [markOnboarded]);
|
|
6842
|
-
const handleTabChange = (0,
|
|
6899
|
+
const handleTabChange = (0, import_react20.useCallback)((id) => {
|
|
6843
6900
|
markOnboarded();
|
|
6844
6901
|
if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
|
|
6845
6902
|
if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
|
|
@@ -6858,7 +6915,7 @@ function PanelContent({
|
|
|
6858
6915
|
{ id: "meta", label: "Meta", beta: true },
|
|
6859
6916
|
{ id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
|
|
6860
6917
|
];
|
|
6861
|
-
return /* @__PURE__ */ (0,
|
|
6918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6862
6919
|
"div",
|
|
6863
6920
|
{
|
|
6864
6921
|
className: "seo-copilot-panel",
|
|
@@ -6873,9 +6930,9 @@ function PanelContent({
|
|
|
6873
6930
|
position: "relative"
|
|
6874
6931
|
},
|
|
6875
6932
|
children: [
|
|
6876
|
-
/* @__PURE__ */ (0,
|
|
6877
|
-
popupMode !== "hidden" && /* @__PURE__ */ (0,
|
|
6878
|
-
/* @__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)(
|
|
6879
6936
|
"div",
|
|
6880
6937
|
{
|
|
6881
6938
|
onMouseDown: isFloating ? onDragStart : void 0,
|
|
@@ -6893,16 +6950,16 @@ function PanelContent({
|
|
|
6893
6950
|
flexShrink: 0
|
|
6894
6951
|
},
|
|
6895
6952
|
children: [
|
|
6896
|
-
/* @__PURE__ */ (0,
|
|
6897
|
-
/* @__PURE__ */ (0,
|
|
6898
|
-
/* @__PURE__ */ (0,
|
|
6899
|
-
/* @__PURE__ */ (0,
|
|
6900
|
-
/* @__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" })
|
|
6901
6958
|
] })
|
|
6902
6959
|
] }),
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6904
|
-
/* @__PURE__ */ (0,
|
|
6905
|
-
/* @__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)(
|
|
6906
6963
|
ReportProblemButton,
|
|
6907
6964
|
{
|
|
6908
6965
|
activeTab,
|
|
@@ -6912,7 +6969,7 @@ function PanelContent({
|
|
|
6912
6969
|
primaryKeyword: effectivePrimary
|
|
6913
6970
|
}
|
|
6914
6971
|
),
|
|
6915
|
-
isFloating && onToggleFullscreen && /* @__PURE__ */ (0,
|
|
6972
|
+
isFloating && onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6916
6973
|
"button",
|
|
6917
6974
|
{
|
|
6918
6975
|
onClick: (e) => {
|
|
@@ -6934,16 +6991,16 @@ function PanelContent({
|
|
|
6934
6991
|
fontWeight: 600,
|
|
6935
6992
|
transition: "all 150ms"
|
|
6936
6993
|
},
|
|
6937
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
6938
|
-
/* @__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" }) }),
|
|
6939
6996
|
"Exit fullscreen"
|
|
6940
|
-
] }) : /* @__PURE__ */ (0,
|
|
6941
|
-
/* @__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" }) }),
|
|
6942
6999
|
"Fullscreen"
|
|
6943
7000
|
] })
|
|
6944
7001
|
}
|
|
6945
7002
|
),
|
|
6946
|
-
isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
7003
|
+
isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6947
7004
|
"button",
|
|
6948
7005
|
{
|
|
6949
7006
|
onClick: (e) => {
|
|
@@ -6966,7 +7023,7 @@ function PanelContent({
|
|
|
6966
7023
|
transition: "all 150ms"
|
|
6967
7024
|
},
|
|
6968
7025
|
children: [
|
|
6969
|
-
/* @__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)(
|
|
6970
7027
|
"path",
|
|
6971
7028
|
{
|
|
6972
7029
|
fillRule: "evenodd",
|
|
@@ -6978,7 +7035,7 @@ function PanelContent({
|
|
|
6978
7035
|
]
|
|
6979
7036
|
}
|
|
6980
7037
|
),
|
|
6981
|
-
!isFloating && onToggleFloat && /* @__PURE__ */ (0,
|
|
7038
|
+
!isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6982
7039
|
"button",
|
|
6983
7040
|
{
|
|
6984
7041
|
onClick: (e) => {
|
|
@@ -6997,13 +7054,13 @@ function PanelContent({
|
|
|
6997
7054
|
transition: "color 150ms"
|
|
6998
7055
|
},
|
|
6999
7056
|
title: "Pop out",
|
|
7000
|
-
children: /* @__PURE__ */ (0,
|
|
7001
|
-
/* @__PURE__ */ (0,
|
|
7002
|
-
/* @__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" })
|
|
7003
7060
|
] })
|
|
7004
7061
|
}
|
|
7005
7062
|
),
|
|
7006
|
-
isLoading && /* @__PURE__ */ (0,
|
|
7063
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7007
7064
|
"div",
|
|
7008
7065
|
{
|
|
7009
7066
|
style: {
|
|
@@ -7015,7 +7072,7 @@ function PanelContent({
|
|
|
7015
7072
|
}
|
|
7016
7073
|
}
|
|
7017
7074
|
),
|
|
7018
|
-
onClose && /* @__PURE__ */ (0,
|
|
7075
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7019
7076
|
"button",
|
|
7020
7077
|
{
|
|
7021
7078
|
onClick: (e) => {
|
|
@@ -7034,11 +7091,11 @@ function PanelContent({
|
|
|
7034
7091
|
transition: "color 150ms"
|
|
7035
7092
|
},
|
|
7036
7093
|
title: "Close",
|
|
7037
|
-
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" }) })
|
|
7038
7095
|
}
|
|
7039
7096
|
)
|
|
7040
7097
|
] }),
|
|
7041
|
-
/* @__PURE__ */ (0,
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7042
7099
|
"div",
|
|
7043
7100
|
{
|
|
7044
7101
|
style: {
|
|
@@ -7057,8 +7114,8 @@ function PanelContent({
|
|
|
7057
7114
|
]
|
|
7058
7115
|
}
|
|
7059
7116
|
),
|
|
7060
|
-
/* @__PURE__ */ (0,
|
|
7061
|
-
/* @__PURE__ */ (0,
|
|
7117
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
|
|
7118
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7062
7119
|
"div",
|
|
7063
7120
|
{
|
|
7064
7121
|
style: {
|
|
@@ -7074,8 +7131,8 @@ function PanelContent({
|
|
|
7074
7131
|
children: "Recommendations are generated by AI. Verify details before publishing."
|
|
7075
7132
|
}
|
|
7076
7133
|
),
|
|
7077
|
-
/* @__PURE__ */ (0,
|
|
7078
|
-
/* @__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)(
|
|
7079
7136
|
"div",
|
|
7080
7137
|
{
|
|
7081
7138
|
style: {
|
|
@@ -7086,7 +7143,7 @@ function PanelContent({
|
|
|
7086
7143
|
background: RECS_ZONE_BG
|
|
7087
7144
|
},
|
|
7088
7145
|
children: [
|
|
7089
|
-
/* @__PURE__ */ (0,
|
|
7146
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7090
7147
|
KeywordPanel,
|
|
7091
7148
|
{
|
|
7092
7149
|
text,
|
|
@@ -7098,11 +7155,12 @@ function PanelContent({
|
|
|
7098
7155
|
onSelectSecondary,
|
|
7099
7156
|
documentFields,
|
|
7100
7157
|
documentId,
|
|
7101
|
-
externalAnalysis: keywordAnalysisState
|
|
7158
|
+
externalAnalysis: keywordAnalysisState,
|
|
7159
|
+
focusKeyword: summaryOps.focusKeyword
|
|
7102
7160
|
},
|
|
7103
7161
|
documentId || "default"
|
|
7104
7162
|
) }),
|
|
7105
|
-
/* @__PURE__ */ (0,
|
|
7163
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7106
7164
|
SummaryTab,
|
|
7107
7165
|
{
|
|
7108
7166
|
text,
|
|
@@ -7115,10 +7173,11 @@ function PanelContent({
|
|
|
7115
7173
|
linkCheckResults: technicalOps.linkCheckResults,
|
|
7116
7174
|
isAnyLoading: summaryOps.isAnyLoading,
|
|
7117
7175
|
onGenerateAll: summaryOps.onGenerateAll,
|
|
7118
|
-
onItemClick: summaryOps.onItemClick
|
|
7176
|
+
onItemClick: summaryOps.onItemClick,
|
|
7177
|
+
onKeywordClick: summaryOps.onKeywordClick
|
|
7119
7178
|
}
|
|
7120
7179
|
) }),
|
|
7121
|
-
/* @__PURE__ */ (0,
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7122
7181
|
AEOTab,
|
|
7123
7182
|
{
|
|
7124
7183
|
text,
|
|
@@ -7134,7 +7193,7 @@ function PanelContent({
|
|
|
7134
7193
|
loadContentSuggestions: aeoOps.loadContentSuggestions
|
|
7135
7194
|
}
|
|
7136
7195
|
) }),
|
|
7137
|
-
/* @__PURE__ */ (0,
|
|
7196
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7138
7197
|
LinkingTab,
|
|
7139
7198
|
{
|
|
7140
7199
|
analysis: keywordAnalysisState.analysis,
|
|
@@ -7150,8 +7209,8 @@ function PanelContent({
|
|
|
7150
7209
|
documentType
|
|
7151
7210
|
}
|
|
7152
7211
|
) }),
|
|
7153
|
-
/* @__PURE__ */ (0,
|
|
7154
|
-
/* @__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)(
|
|
7155
7214
|
TechnicalTab,
|
|
7156
7215
|
{
|
|
7157
7216
|
text,
|
|
@@ -7169,7 +7228,7 @@ function PanelContent({
|
|
|
7169
7228
|
]
|
|
7170
7229
|
}
|
|
7171
7230
|
),
|
|
7172
|
-
chatOpen && /* @__PURE__ */ (0,
|
|
7231
|
+
chatOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7173
7232
|
"div",
|
|
7174
7233
|
{
|
|
7175
7234
|
onMouseDown,
|
|
@@ -7182,10 +7241,10 @@ function PanelContent({
|
|
|
7182
7241
|
justifyContent: "center",
|
|
7183
7242
|
flexShrink: 0
|
|
7184
7243
|
},
|
|
7185
|
-
children: /* @__PURE__ */ (0,
|
|
7244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
|
|
7186
7245
|
}
|
|
7187
7246
|
),
|
|
7188
|
-
/* @__PURE__ */ (0,
|
|
7247
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7189
7248
|
"div",
|
|
7190
7249
|
{
|
|
7191
7250
|
style: {
|
|
@@ -7198,7 +7257,7 @@ function PanelContent({
|
|
|
7198
7257
|
background: CHAT_ZONE_BG
|
|
7199
7258
|
},
|
|
7200
7259
|
children: [
|
|
7201
|
-
/* @__PURE__ */ (0,
|
|
7260
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7202
7261
|
"button",
|
|
7203
7262
|
{
|
|
7204
7263
|
onClick: () => onChatOpenChange(!chatOpen),
|
|
@@ -7219,7 +7278,7 @@ function PanelContent({
|
|
|
7219
7278
|
flexShrink: 0
|
|
7220
7279
|
},
|
|
7221
7280
|
children: [
|
|
7222
|
-
/* @__PURE__ */ (0,
|
|
7281
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7223
7282
|
"span",
|
|
7224
7283
|
{
|
|
7225
7284
|
style: {
|
|
@@ -7232,7 +7291,7 @@ function PanelContent({
|
|
|
7232
7291
|
children: "Chat"
|
|
7233
7292
|
}
|
|
7234
7293
|
),
|
|
7235
|
-
/* @__PURE__ */ (0,
|
|
7294
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7236
7295
|
"svg",
|
|
7237
7296
|
{
|
|
7238
7297
|
width: "12",
|
|
@@ -7240,7 +7299,7 @@ function PanelContent({
|
|
|
7240
7299
|
viewBox: "0 0 20 20",
|
|
7241
7300
|
fill: "rgba(0,0,0,0.55)",
|
|
7242
7301
|
style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
|
|
7243
|
-
children: /* @__PURE__ */ (0,
|
|
7302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7244
7303
|
"path",
|
|
7245
7304
|
{
|
|
7246
7305
|
fillRule: "evenodd",
|
|
@@ -7253,7 +7312,7 @@ function PanelContent({
|
|
|
7253
7312
|
]
|
|
7254
7313
|
}
|
|
7255
7314
|
),
|
|
7256
|
-
/* @__PURE__ */ (0,
|
|
7315
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7257
7316
|
"div",
|
|
7258
7317
|
{
|
|
7259
7318
|
style: {
|
|
@@ -7263,7 +7322,7 @@ function PanelContent({
|
|
|
7263
7322
|
flexDirection: "column",
|
|
7264
7323
|
minHeight: 0
|
|
7265
7324
|
},
|
|
7266
|
-
children: /* @__PURE__ */ (0,
|
|
7325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7267
7326
|
ChatPanel,
|
|
7268
7327
|
{
|
|
7269
7328
|
messages: chatState.messages,
|
|
@@ -7294,21 +7353,21 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7294
7353
|
"seo-copilot-ui-float-size",
|
|
7295
7354
|
{ width: 380, height: typeof window !== "undefined" ? Math.round(window.innerHeight * 0.8) : 600 }
|
|
7296
7355
|
);
|
|
7297
|
-
const dragOffset = (0,
|
|
7298
|
-
const resizeStart = (0,
|
|
7299
|
-
const activeDragCleanupRef = (0,
|
|
7300
|
-
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);
|
|
7301
7360
|
const { text, isLoading: docLoading, documentFields, documentId, documentType } = useDocumentContent();
|
|
7302
7361
|
const { apiUrl } = useConfig();
|
|
7303
|
-
const workspace = (0,
|
|
7362
|
+
const workspace = (0, import_sanity3.useWorkspace)();
|
|
7304
7363
|
const effectivePublication = config.publication || workspace?.dataset;
|
|
7305
|
-
const sanityBaseUrl = (0,
|
|
7364
|
+
const sanityBaseUrl = (0, import_react20.useMemo)(() => {
|
|
7306
7365
|
if (typeof window === "undefined") return void 0;
|
|
7307
7366
|
const basePath = (workspace?.basePath || "/").replace(/\/+$/, "");
|
|
7308
7367
|
return `${window.location.origin}${basePath}`;
|
|
7309
7368
|
}, [workspace?.basePath]);
|
|
7310
7369
|
const seedCacheKey = documentId ? `seo-copilot-cache-${documentId}` : "seo-copilot-cache-v2";
|
|
7311
|
-
const loadSeedsFromCache = (0,
|
|
7370
|
+
const loadSeedsFromCache = (0, import_react20.useCallback)(() => {
|
|
7312
7371
|
try {
|
|
7313
7372
|
const c = localStorage.getItem(seedCacheKey);
|
|
7314
7373
|
if (c) return JSON.parse(c).seeds || [];
|
|
@@ -7316,8 +7375,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7316
7375
|
}
|
|
7317
7376
|
return [];
|
|
7318
7377
|
}, [seedCacheKey]);
|
|
7319
|
-
const [seedKeywords, setSeedKeywordsRaw] = (0,
|
|
7320
|
-
const setSeedKeywords = (0,
|
|
7378
|
+
const [seedKeywords, setSeedKeywordsRaw] = (0, import_react20.useState)(loadSeedsFromCache);
|
|
7379
|
+
const setSeedKeywords = (0, import_react20.useCallback)(
|
|
7321
7380
|
(seeds) => {
|
|
7322
7381
|
setSeedKeywordsRaw(seeds);
|
|
7323
7382
|
try {
|
|
@@ -7332,25 +7391,31 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7332
7391
|
const [selectedPrimary, setSelectedPrimary] = usePersistentState(selectedPrimaryKey, void 0);
|
|
7333
7392
|
const selectedSecondaryKey = documentId ? `seo-copilot-secondary-${documentId}` : "seo-copilot-secondary-default";
|
|
7334
7393
|
const [selectedSecondary, setSelectedSecondary] = usePersistentState(selectedSecondaryKey, "");
|
|
7335
|
-
const seedsInitializedRef = (0,
|
|
7336
|
-
(0,
|
|
7394
|
+
const seedsInitializedRef = (0, import_react20.useRef)(false);
|
|
7395
|
+
(0, import_react20.useEffect)(() => {
|
|
7337
7396
|
if (!seedsInitializedRef.current) {
|
|
7338
7397
|
seedsInitializedRef.current = true;
|
|
7339
7398
|
return;
|
|
7340
7399
|
}
|
|
7341
7400
|
setSeedKeywordsRaw(loadSeedsFromCache());
|
|
7342
7401
|
}, [documentId, loadSeedsFromCache]);
|
|
7343
|
-
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
|
+
}
|
|
7344
7409
|
const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
|
|
7345
7410
|
const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
|
|
7346
7411
|
const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId, selectedSecondary);
|
|
7347
7412
|
const effectivePrimary = selectedPrimary || keywordAnalysisState.analysis?.primaryKeyword?.term || "";
|
|
7348
|
-
(0,
|
|
7413
|
+
(0, import_react20.useEffect)(() => {
|
|
7349
7414
|
if (selectedSecondary && effectivePrimary && selectedSecondary.toLowerCase() === effectivePrimary.toLowerCase()) {
|
|
7350
7415
|
setSelectedSecondary("");
|
|
7351
7416
|
}
|
|
7352
7417
|
}, [effectivePrimary, selectedSecondary, setSelectedSecondary]);
|
|
7353
|
-
const keywordPanelData = (0,
|
|
7418
|
+
const keywordPanelData = (0, import_react20.useMemo)(() => {
|
|
7354
7419
|
const analysis = keywordAnalysisState.analysis;
|
|
7355
7420
|
if (!analysis) return void 0;
|
|
7356
7421
|
return {
|
|
@@ -7368,12 +7433,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7368
7433
|
const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
|
|
7369
7434
|
const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
|
|
7370
7435
|
const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
|
|
7371
|
-
const [isCSLoading, setIsCSLoading] = (0,
|
|
7372
|
-
const [csError, setCsError] = (0,
|
|
7373
|
-
const aeoOpVersionRef = (0,
|
|
7374
|
-
const csAbortRef = (0,
|
|
7375
|
-
const didInitAeoRef = (0,
|
|
7376
|
-
(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)(() => {
|
|
7377
7442
|
if (!didInitAeoRef.current) {
|
|
7378
7443
|
didInitAeoRef.current = true;
|
|
7379
7444
|
return;
|
|
@@ -7382,7 +7447,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7382
7447
|
setIsCSLoading(false);
|
|
7383
7448
|
setCsError(null);
|
|
7384
7449
|
}, [documentId]);
|
|
7385
|
-
const loadContentSuggestions = (0,
|
|
7450
|
+
const loadContentSuggestions = (0, import_react20.useCallback)(async () => {
|
|
7386
7451
|
const myVersion = aeoOpVersionRef.current;
|
|
7387
7452
|
setIsCSLoading(true);
|
|
7388
7453
|
setCsError(null);
|
|
@@ -7407,14 +7472,14 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7407
7472
|
}, [apiUrl, text, effectivePrimary, effectivePublication]);
|
|
7408
7473
|
const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
|
|
7409
7474
|
const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
|
|
7410
|
-
const [isLinkingLoading, setIsLinkingLoading] = (0,
|
|
7411
|
-
const [linkingError, setLinkingError] = (0,
|
|
7412
|
-
const [linkingFetchedText, setLinkingFetchedText] = (0,
|
|
7413
|
-
const linkingVersionRef = (0,
|
|
7414
|
-
const linkingAbortRef = (0,
|
|
7415
|
-
const didInitLinkingRef = (0,
|
|
7416
|
-
const lastLinkingFetchKey = (0,
|
|
7417
|
-
(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)(() => {
|
|
7418
7483
|
if (!didInitLinkingRef.current) {
|
|
7419
7484
|
didInitLinkingRef.current = true;
|
|
7420
7485
|
return;
|
|
@@ -7424,12 +7489,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7424
7489
|
setLinkingError(null);
|
|
7425
7490
|
lastLinkingFetchKey.current = "";
|
|
7426
7491
|
}, [documentId]);
|
|
7427
|
-
const supportingKeywordsForLinking = (0,
|
|
7492
|
+
const supportingKeywordsForLinking = (0, import_react20.useMemo)(() => {
|
|
7428
7493
|
const base = (keywordAnalysisState.analysis?.supportingKeywords || []).map((kw) => kw.term).filter(Boolean);
|
|
7429
7494
|
const merged = selectedSecondary ? [selectedSecondary, ...base.filter((t) => t.toLowerCase() !== selectedSecondary.toLowerCase())] : base;
|
|
7430
7495
|
return merged.slice(0, 5);
|
|
7431
7496
|
}, [keywordAnalysisState.analysis, selectedSecondary]);
|
|
7432
|
-
const refreshLinkingSuggestions = (0,
|
|
7497
|
+
const refreshLinkingSuggestions = (0, import_react20.useCallback)(async () => {
|
|
7433
7498
|
if (!text || text.trim().length < 50) return;
|
|
7434
7499
|
if (!effectivePrimary) return;
|
|
7435
7500
|
const myVersion = linkingVersionRef.current;
|
|
@@ -7459,12 +7524,12 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7459
7524
|
if (linkingVersionRef.current !== myVersion) return;
|
|
7460
7525
|
setIsLinkingLoading(false);
|
|
7461
7526
|
}, [apiUrl, text, effectivePrimary, supportingKeywordsForLinking, documentId, effectivePublication]);
|
|
7462
|
-
const isLinkingStale = (0,
|
|
7527
|
+
const isLinkingStale = (0, import_react20.useMemo)(() => {
|
|
7463
7528
|
if (!linkingFetchedText || linkingSuggestions.length === 0) return false;
|
|
7464
7529
|
if (Math.abs(text.length - linkingFetchedText.length) > 150) return true;
|
|
7465
7530
|
return text.slice(0, 300) !== linkingFetchedText.slice(0, 300);
|
|
7466
7531
|
}, [text, linkingFetchedText, linkingSuggestions.length]);
|
|
7467
|
-
(0,
|
|
7532
|
+
(0, import_react20.useEffect)(() => {
|
|
7468
7533
|
if (!text || text.trim().length < 50 || !effectivePrimary) return;
|
|
7469
7534
|
const fetchKey = `${documentId || "_"}|${effectivePrimary}|${supportingKeywordsForLinking.join(",")}`;
|
|
7470
7535
|
if (fetchKey === lastLinkingFetchKey.current) return;
|
|
@@ -7478,11 +7543,11 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7478
7543
|
const linkCheckKey = documentId ? `seo-copilot-link-check-${documentId}` : "seo-copilot-link-check-default";
|
|
7479
7544
|
const [linkCheckResults, setLinkCheckResults] = usePersistentState(linkCheckKey, []);
|
|
7480
7545
|
const [hasRunLinkCheck, setHasRunLinkCheck] = usePersistentState(`${linkCheckKey}-ran`, false);
|
|
7481
|
-
const [isLinkCheckLoading, setIsLinkCheckLoading] = (0,
|
|
7482
|
-
const [linkCheckError, setLinkCheckError] = (0,
|
|
7483
|
-
const linkCheckVersionRef = (0,
|
|
7484
|
-
const didInitLinkCheckRef = (0,
|
|
7485
|
-
(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)(() => {
|
|
7486
7551
|
if (!didInitLinkCheckRef.current) {
|
|
7487
7552
|
didInitLinkCheckRef.current = true;
|
|
7488
7553
|
return;
|
|
@@ -7491,7 +7556,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7491
7556
|
setIsLinkCheckLoading(false);
|
|
7492
7557
|
setLinkCheckError(null);
|
|
7493
7558
|
}, [documentId]);
|
|
7494
|
-
const runLinkCheck = (0,
|
|
7559
|
+
const runLinkCheck = (0, import_react20.useCallback)(async () => {
|
|
7495
7560
|
const urls = documentFields?.bodyLinks || [];
|
|
7496
7561
|
if (urls.length === 0) {
|
|
7497
7562
|
setHasRunLinkCheck(true);
|
|
@@ -7517,7 +7582,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7517
7582
|
if (linkCheckVersionRef.current !== myVersion) return;
|
|
7518
7583
|
setIsLinkCheckLoading(false);
|
|
7519
7584
|
}, [apiUrl, documentFields?.bodyLinks, setHasRunLinkCheck, setLinkCheckResults]);
|
|
7520
|
-
(0,
|
|
7585
|
+
(0, import_react20.useEffect)(() => {
|
|
7521
7586
|
return () => {
|
|
7522
7587
|
activeDragCleanupRef.current?.();
|
|
7523
7588
|
activeResizeCleanupRef.current?.();
|
|
@@ -7531,10 +7596,10 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7531
7596
|
if (text && text.trim().length >= 50 && effectivePrimary) refreshLinkingSuggestions();
|
|
7532
7597
|
if ((documentFields?.bodyLinks || []).length > 0) runLinkCheck();
|
|
7533
7598
|
};
|
|
7534
|
-
const runAllRef = (0,
|
|
7599
|
+
const runAllRef = (0, import_react20.useRef)(runAllAnalyses);
|
|
7535
7600
|
runAllRef.current = runAllAnalyses;
|
|
7536
|
-
const secAutoRunRef = (0,
|
|
7537
|
-
(0,
|
|
7601
|
+
const secAutoRunRef = (0, import_react20.useRef)({ doc: documentId, sec: selectedSecondary, init: true });
|
|
7602
|
+
(0, import_react20.useEffect)(() => {
|
|
7538
7603
|
const prev = secAutoRunRef.current;
|
|
7539
7604
|
const docChanged = prev.doc !== documentId;
|
|
7540
7605
|
const secChanged = prev.sec !== selectedSecondary;
|
|
@@ -7543,7 +7608,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7543
7608
|
const t = setTimeout(() => runAllRef.current(), 1500);
|
|
7544
7609
|
return () => clearTimeout(t);
|
|
7545
7610
|
}, [selectedSecondary, documentId]);
|
|
7546
|
-
const handleDragStart = (0,
|
|
7611
|
+
const handleDragStart = (0, import_react20.useCallback)(
|
|
7547
7612
|
(e) => {
|
|
7548
7613
|
dragOffset.current = {
|
|
7549
7614
|
dx: e.clientX - floatPos.x,
|
|
@@ -7577,7 +7642,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7577
7642
|
},
|
|
7578
7643
|
[floatPos]
|
|
7579
7644
|
);
|
|
7580
|
-
const handleResizeStart = (0,
|
|
7645
|
+
const handleResizeStart = (0, import_react20.useCallback)(
|
|
7581
7646
|
(e) => {
|
|
7582
7647
|
e.preventDefault();
|
|
7583
7648
|
e.stopPropagation();
|
|
@@ -7609,7 +7674,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7609
7674
|
},
|
|
7610
7675
|
[floatSize]
|
|
7611
7676
|
);
|
|
7612
|
-
const panelContent = /* @__PURE__ */ (0,
|
|
7677
|
+
const panelContent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7613
7678
|
PanelContent,
|
|
7614
7679
|
{
|
|
7615
7680
|
initialPublication: effectivePublication,
|
|
@@ -7676,6 +7741,11 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7676
7741
|
summaryOps: {
|
|
7677
7742
|
isAnyLoading: keywordAnalysisState.isLoading || keywordAnalysisState.isVolumesLoading || keywordAnalysisState.isDeepLoading || isCSLoading || isLinkingLoading || isLinkCheckLoading,
|
|
7678
7743
|
onGenerateAll: runAllAnalyses,
|
|
7744
|
+
focusKeyword,
|
|
7745
|
+
onKeywordClick: (term) => {
|
|
7746
|
+
setActiveTab("keywords");
|
|
7747
|
+
setFocusKeyword((prev) => ({ term, nonce: (prev?.nonce ?? 0) + 1 }));
|
|
7748
|
+
},
|
|
7679
7749
|
onItemClick: (item) => {
|
|
7680
7750
|
setActiveTab(item.jumpTo.tab);
|
|
7681
7751
|
const id = item.jumpTo.anchorId;
|
|
@@ -7691,7 +7761,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7691
7761
|
}
|
|
7692
7762
|
}
|
|
7693
7763
|
);
|
|
7694
|
-
const floatingPanel = /* @__PURE__ */ (0,
|
|
7764
|
+
const floatingPanel = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7695
7765
|
"div",
|
|
7696
7766
|
{
|
|
7697
7767
|
style: {
|
|
@@ -7709,7 +7779,7 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7709
7779
|
},
|
|
7710
7780
|
children: [
|
|
7711
7781
|
panelContent,
|
|
7712
|
-
!isFullscreen && /* @__PURE__ */ (0,
|
|
7782
|
+
!isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7713
7783
|
"div",
|
|
7714
7784
|
{
|
|
7715
7785
|
onMouseDown: handleResizeStart,
|
|
@@ -7724,9 +7794,9 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7724
7794
|
alignItems: "center",
|
|
7725
7795
|
justifyContent: "center"
|
|
7726
7796
|
},
|
|
7727
|
-
children: /* @__PURE__ */ (0,
|
|
7728
|
-
/* @__PURE__ */ (0,
|
|
7729
|
-
/* @__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" })
|
|
7730
7800
|
] })
|
|
7731
7801
|
}
|
|
7732
7802
|
)
|
|
@@ -7734,8 +7804,8 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7734
7804
|
}
|
|
7735
7805
|
);
|
|
7736
7806
|
if (isFloating) {
|
|
7737
|
-
return /* @__PURE__ */ (0,
|
|
7738
|
-
/* @__PURE__ */ (0,
|
|
7807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
7808
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7739
7809
|
"div",
|
|
7740
7810
|
{
|
|
7741
7811
|
style: {
|
|
@@ -7745,30 +7815,30 @@ function SEOCopilotInner({ config, onClose }) {
|
|
|
7745
7815
|
alignItems: "center",
|
|
7746
7816
|
justifyContent: "center"
|
|
7747
7817
|
},
|
|
7748
|
-
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" })
|
|
7749
7819
|
}
|
|
7750
7820
|
),
|
|
7751
7821
|
typeof document !== "undefined" && (0, import_react_dom.createPortal)(floatingPanel, document.body)
|
|
7752
7822
|
] });
|
|
7753
7823
|
}
|
|
7754
|
-
return /* @__PURE__ */ (0,
|
|
7824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
|
|
7755
7825
|
}
|
|
7756
7826
|
function SEOCopilotPanel({ config, onClose }) {
|
|
7757
|
-
return /* @__PURE__ */ (0,
|
|
7758
|
-
|
|
7827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7828
|
+
import_react20.Suspense,
|
|
7759
7829
|
{
|
|
7760
|
-
fallback: /* @__PURE__ */ (0,
|
|
7761
|
-
/* @__PURE__ */ (0,
|
|
7762
|
-
/* @__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..." })
|
|
7763
7833
|
] }),
|
|
7764
|
-
children: /* @__PURE__ */ (0,
|
|
7834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SEOCopilotInner, { config, onClose }) })
|
|
7765
7835
|
}
|
|
7766
7836
|
);
|
|
7767
7837
|
}
|
|
7768
7838
|
function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
7769
7839
|
const barWidth = size === "xs" ? 4 : 6;
|
|
7770
7840
|
const containerHeight = size === "xs" ? 10 : 14;
|
|
7771
|
-
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)(
|
|
7772
7842
|
"div",
|
|
7773
7843
|
{
|
|
7774
7844
|
style: {
|
|
@@ -7785,11 +7855,11 @@ function LoadingBars({ size = "sm", color = MJH_GOLD }) {
|
|
|
7785
7855
|
|
|
7786
7856
|
// src/inspector.ts
|
|
7787
7857
|
function SEOIcon() {
|
|
7788
|
-
return (0,
|
|
7858
|
+
return (0, import_react21.createElement)(
|
|
7789
7859
|
"svg",
|
|
7790
7860
|
{ viewBox: "0 0 25 25", width: "1em", height: "1em", fill: "none" },
|
|
7791
|
-
(0,
|
|
7792
|
-
(0,
|
|
7861
|
+
(0, import_react21.createElement)("circle", { cx: "12.5", cy: "12.5", r: "11.5", fill: "#E6C01B" }),
|
|
7862
|
+
(0, import_react21.createElement)("text", {
|
|
7793
7863
|
x: "12.5",
|
|
7794
7864
|
y: "7.5",
|
|
7795
7865
|
textAnchor: "middle",
|
|
@@ -7799,7 +7869,7 @@ function SEOIcon() {
|
|
|
7799
7869
|
fontWeight: "900",
|
|
7800
7870
|
fontFamily: "Arial Black, Impact, sans-serif"
|
|
7801
7871
|
}, "S"),
|
|
7802
|
-
(0,
|
|
7872
|
+
(0, import_react21.createElement)("text", {
|
|
7803
7873
|
x: "12.5",
|
|
7804
7874
|
y: "12.8",
|
|
7805
7875
|
textAnchor: "middle",
|
|
@@ -7809,7 +7879,7 @@ function SEOIcon() {
|
|
|
7809
7879
|
fontWeight: "900",
|
|
7810
7880
|
fontFamily: "Arial Black, Impact, sans-serif"
|
|
7811
7881
|
}, "E"),
|
|
7812
|
-
(0,
|
|
7882
|
+
(0, import_react21.createElement)("text", {
|
|
7813
7883
|
x: "12.5",
|
|
7814
7884
|
y: "18",
|
|
7815
7885
|
textAnchor: "middle",
|
|
@@ -7829,30 +7899,31 @@ function seoCopilotInspector(config) {
|
|
|
7829
7899
|
icon: SEOIcon,
|
|
7830
7900
|
// Toolbar placement test: showAsAction renders this as a button in the document
|
|
7831
7901
|
// toolbar (where editors expect it). The original crash came from passing
|
|
7832
|
-
// showAsAction
|
|
7902
|
+
// showAsAction without a tone; pairing it with a valid string tone is how Sanity's
|
|
7833
7903
|
// own built-in inspectors (Validation, etc.) keep their toolbar button safely.
|
|
7834
|
-
// If this still crashes in
|
|
7904
|
+
// If this still crashes in the production Studio, remove these two lines to fall back to
|
|
7835
7905
|
// the "..." overflow menu (the known-safe placement).
|
|
7836
7906
|
showAsAction: true,
|
|
7837
7907
|
tone: "default"
|
|
7838
7908
|
}),
|
|
7839
7909
|
component: function SEOCopilotInspector(props) {
|
|
7840
|
-
return (0,
|
|
7910
|
+
return (0, import_react21.createElement)(SEOCopilotPanel, { ...props, config });
|
|
7841
7911
|
}
|
|
7842
7912
|
};
|
|
7843
7913
|
}
|
|
7844
7914
|
|
|
7845
7915
|
// src/index.ts
|
|
7846
|
-
var seoCopilot = (0,
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7916
|
+
var seoCopilot = (0, import_sanity4.definePlugin)((config) => {
|
|
7917
|
+
return {
|
|
7918
|
+
name: "seo-copilot",
|
|
7919
|
+
document: {
|
|
7920
|
+
inspectors: (prev) => {
|
|
7921
|
+
return [...prev, seoCopilotInspector(config)];
|
|
7922
|
+
}
|
|
7851
7923
|
}
|
|
7852
|
-
}
|
|
7853
|
-
})
|
|
7924
|
+
};
|
|
7925
|
+
});
|
|
7854
7926
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7855
7927
|
0 && (module.exports = {
|
|
7856
7928
|
seoCopilot
|
|
7857
7929
|
});
|
|
7858
|
-
//# sourceMappingURL=index.js.map
|