sanity-plugin-seo-copilot 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1506 -1086
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1474 -1054
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/KeywordPanel.tsx +190 -176
- package/src/components/ReportProblemButton.tsx +212 -0
- package/src/components/SEOCopilotPanel.tsx +37 -9
- package/src/components/styles.ts +7 -0
- package/src/components/tabs/AEOTab.tsx +5 -1
- package/src/components/tabs/LinkingTab.tsx +39 -13
- package/src/components/tabs/MetaTab.tsx +122 -24
- package/src/components/tabs/SummaryTab.tsx +21 -15
- package/src/components/tabs/TechnicalTab.tsx +276 -269
- package/src/hooks/useKeywordAnalysis.ts +8 -7
- package/src/lib/api.ts +21 -52
- package/src/lib/documentExtract.ts +168 -14
- package/src/lib/scoring.ts +4 -4
- package/src/lib/summary.ts +23 -14
- package/src/lib/types.ts +12 -0
|
@@ -60,13 +60,23 @@ function scoreColors(score: number): { bg: string; text: string; label: string }
|
|
|
60
60
|
return { bg: "rgba(220,38,38,0.08)", text: "#dc2626", label: "Needs work" };
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
//
|
|
64
|
-
//
|
|
63
|
+
// Qualitative tier for a single score component. We deliberately show a word + color,
|
|
64
|
+
// not "points / max" - the underlying numbers are coarse heuristics, and a precise-looking
|
|
65
|
+
// "17 / 25" implies an accuracy the rubric doesn't actually have.
|
|
66
|
+
function componentTier(pct: number): { label: string; color: string; bar: string } {
|
|
67
|
+
if (pct >= 75) return { label: "Strong", color: "#16a34a", bar: "#16a34a" };
|
|
68
|
+
if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
|
|
69
|
+
return { label: "Low", color: "#dc2626", bar: "#dc2626" };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// The score card. The breakdown is ALWAYS visible - the overall tier is just a roll-up
|
|
73
|
+
// of the components below it. No raw numbers: each row reads as a colored "vibe" (Strong /
|
|
74
|
+
// OK / Low) so editors focus on what's weak, not on chasing an arbitrary point total.
|
|
65
75
|
function ScoreBadge({ score, breakdown }: { score: number; breakdown: ContentScore["components"] }) {
|
|
66
76
|
const c = scoreColors(score);
|
|
67
77
|
return (
|
|
68
78
|
<div style={cardStyle}>
|
|
69
|
-
{/* Top row:
|
|
79
|
+
{/* Top row: qualitative tier + label (no number) */}
|
|
70
80
|
<div style={{ display: "flex", alignItems: "center", gap: 14 }}>
|
|
71
81
|
<div
|
|
72
82
|
style={{
|
|
@@ -75,42 +85,38 @@ function ScoreBadge({ score, breakdown }: { score: number; breakdown: ContentSco
|
|
|
75
85
|
borderRadius: "50%",
|
|
76
86
|
background: c.bg,
|
|
77
87
|
display: "flex",
|
|
78
|
-
flexDirection: "column",
|
|
79
88
|
alignItems: "center",
|
|
80
89
|
justifyContent: "center",
|
|
81
90
|
flexShrink: 0,
|
|
82
|
-
lineHeight: 1,
|
|
83
91
|
}}
|
|
84
92
|
>
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
/ 100
|
|
88
|
-
</span>
|
|
93
|
+
{/* Solid status disc - a color cue, not a number */}
|
|
94
|
+
<div style={{ width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 }} />
|
|
89
95
|
</div>
|
|
90
96
|
<div style={{ flex: 1, minWidth: 0 }}>
|
|
91
97
|
<div style={{ fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }}>
|
|
92
98
|
Content Score
|
|
93
99
|
</div>
|
|
94
|
-
<div style={{ fontSize:
|
|
100
|
+
<div style={{ fontSize: 16, fontWeight: 700, color: c.text }}>{c.label}</div>
|
|
95
101
|
</div>
|
|
96
102
|
</div>
|
|
97
103
|
|
|
98
|
-
{/* Always-visible breakdown - each row shows what's driving the score */}
|
|
104
|
+
{/* Always-visible breakdown - each row shows what's driving the score, as a vibe */}
|
|
99
105
|
{breakdown.length > 0 && (
|
|
100
106
|
<div style={{ marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }}>
|
|
101
107
|
{breakdown.map((comp, i) => {
|
|
102
108
|
const pct = comp.max > 0 ? (comp.points / comp.max) * 100 : 0;
|
|
103
|
-
const
|
|
109
|
+
const tier = componentTier(pct);
|
|
104
110
|
return (
|
|
105
111
|
<div key={i}>
|
|
106
112
|
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }}>
|
|
107
113
|
<span style={{ fontSize: 11, fontWeight: 600, color: "#1f2937" }}>{comp.label}</span>
|
|
108
|
-
<span style={{ fontSize:
|
|
109
|
-
{
|
|
114
|
+
<span style={{ fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }}>
|
|
115
|
+
{tier.label}
|
|
110
116
|
</span>
|
|
111
117
|
</div>
|
|
112
118
|
<div style={{ height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }}>
|
|
113
|
-
<div style={{ width: `${pct}%`, height: "100%", background:
|
|
119
|
+
<div style={{ width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" }} />
|
|
114
120
|
</div>
|
|
115
121
|
<div style={{ fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }}>{comp.detail}</div>
|
|
116
122
|
</div>
|