sanity-plugin-seo-copilot 0.2.10 → 0.2.12
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 +12 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/OnboardingPopup.tsx +108 -108
- package/src/components/ShimmerLoader.tsx +4 -4
- package/src/inspector.ts +58 -50
- package/src/lib/summary.ts +3 -3
- package/src/lib/utils.ts +35 -35
package/dist/index.js
CHANGED
|
@@ -3191,13 +3191,6 @@ function ShimmerLoader({
|
|
|
3191
3191
|
style.dataset.seoCopilotKeyframes = "1";
|
|
3192
3192
|
style.innerHTML = KEYFRAMES;
|
|
3193
3193
|
document.head.appendChild(style);
|
|
3194
|
-
return () => {
|
|
3195
|
-
try {
|
|
3196
|
-
document.head.removeChild(style);
|
|
3197
|
-
} catch {
|
|
3198
|
-
}
|
|
3199
|
-
keyframesInjected = false;
|
|
3200
|
-
};
|
|
3201
3194
|
}
|
|
3202
3195
|
}, []);
|
|
3203
3196
|
(0, import_react12.useEffect)(() => {
|
|
@@ -3599,7 +3592,7 @@ function buildSummaryItems(input) {
|
|
|
3599
3592
|
category: "headings",
|
|
3600
3593
|
severity: "error",
|
|
3601
3594
|
label: "Long article without section headings",
|
|
3602
|
-
description: `${wordCount2} words and no H2 headings.`,
|
|
3595
|
+
description: `${wordCount2} words and no H2 or H3 section headings.`,
|
|
3603
3596
|
howToFix: "Add 2-3 H2 headings to break the article into scannable sections.",
|
|
3604
3597
|
jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
|
|
3605
3598
|
});
|
|
@@ -3609,7 +3602,7 @@ function buildSummaryItems(input) {
|
|
|
3609
3602
|
category: "headings",
|
|
3610
3603
|
severity: "warning",
|
|
3611
3604
|
label: "Long article could use more section headings",
|
|
3612
|
-
description: `${h2Count}
|
|
3605
|
+
description: `${h2Count} section heading${h2Count === 1 ? "" : "s"} for ${wordCount2} words.`,
|
|
3613
3606
|
howToFix: "Long articles read best with 1 H2 per 300-400 words. Add more named section breaks.",
|
|
3614
3607
|
jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
|
|
3615
3608
|
});
|
|
@@ -3619,7 +3612,7 @@ function buildSummaryItems(input) {
|
|
|
3619
3612
|
category: "headings",
|
|
3620
3613
|
severity: "warning",
|
|
3621
3614
|
label: "Article could use more section headings",
|
|
3622
|
-
description: `${h2Count}
|
|
3615
|
+
description: `${h2Count} section heading${h2Count === 1 ? "" : "s"} for ${wordCount2} words.`,
|
|
3623
3616
|
howToFix: "Articles above 1,500 words usually need at least 3 H2 sections. Break the content into more named blocks.",
|
|
3624
3617
|
jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
|
|
3625
3618
|
});
|
|
@@ -7413,7 +7406,15 @@ function seoCopilotInspector(config) {
|
|
|
7413
7406
|
name: "seo-copilot",
|
|
7414
7407
|
useMenuItem: () => ({
|
|
7415
7408
|
title: "SEO Copilot",
|
|
7416
|
-
icon: SEOIcon
|
|
7409
|
+
icon: SEOIcon,
|
|
7410
|
+
// Toolbar placement test: showAsAction renders this as a button in the document
|
|
7411
|
+
// toolbar (where editors expect it). The original crash came from passing
|
|
7412
|
+
// showAsAction WITHOUT a tone; pairing it with a valid string tone is how Sanity's
|
|
7413
|
+
// own built-in inspectors (Validation, etc.) keep their toolbar button safely.
|
|
7414
|
+
// If this still crashes in Nick's studio, remove these two lines to fall back to
|
|
7415
|
+
// the "..." overflow menu (the known-safe placement).
|
|
7416
|
+
showAsAction: true,
|
|
7417
|
+
tone: "default"
|
|
7417
7418
|
}),
|
|
7418
7419
|
component: function SEOCopilotInspector(props) {
|
|
7419
7420
|
return (0, import_react19.createElement)(SEOCopilotPanel, { ...props, config });
|