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.mjs CHANGED
@@ -3157,13 +3157,6 @@ function ShimmerLoader({
3157
3157
  style.dataset.seoCopilotKeyframes = "1";
3158
3158
  style.innerHTML = KEYFRAMES;
3159
3159
  document.head.appendChild(style);
3160
- return () => {
3161
- try {
3162
- document.head.removeChild(style);
3163
- } catch {
3164
- }
3165
- keyframesInjected = false;
3166
- };
3167
3160
  }
3168
3161
  }, []);
3169
3162
  useEffect9(() => {
@@ -3565,7 +3558,7 @@ function buildSummaryItems(input) {
3565
3558
  category: "headings",
3566
3559
  severity: "error",
3567
3560
  label: "Long article without section headings",
3568
- description: `${wordCount2} words and no H2 headings.`,
3561
+ description: `${wordCount2} words and no H2 or H3 section headings.`,
3569
3562
  howToFix: "Add 2-3 H2 headings to break the article into scannable sections.",
3570
3563
  jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
3571
3564
  });
@@ -3575,7 +3568,7 @@ function buildSummaryItems(input) {
3575
3568
  category: "headings",
3576
3569
  severity: "warning",
3577
3570
  label: "Long article could use more section headings",
3578
- description: `${h2Count} H2 heading${h2Count === 1 ? "" : "s"} for ${wordCount2} words.`,
3571
+ description: `${h2Count} section heading${h2Count === 1 ? "" : "s"} for ${wordCount2} words.`,
3579
3572
  howToFix: "Long articles read best with 1 H2 per 300-400 words. Add more named section breaks.",
3580
3573
  jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
3581
3574
  });
@@ -3585,7 +3578,7 @@ function buildSummaryItems(input) {
3585
3578
  category: "headings",
3586
3579
  severity: "warning",
3587
3580
  label: "Article could use more section headings",
3588
- description: `${h2Count} H2 heading${h2Count === 1 ? "" : "s"} for ${wordCount2} words.`,
3581
+ description: `${h2Count} section heading${h2Count === 1 ? "" : "s"} for ${wordCount2} words.`,
3589
3582
  howToFix: "Articles above 1,500 words usually need at least 3 H2 sections. Break the content into more named blocks.",
3590
3583
  jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
3591
3584
  });
@@ -7379,7 +7372,15 @@ function seoCopilotInspector(config) {
7379
7372
  name: "seo-copilot",
7380
7373
  useMenuItem: () => ({
7381
7374
  title: "SEO Copilot",
7382
- icon: SEOIcon
7375
+ icon: SEOIcon,
7376
+ // Toolbar placement test: showAsAction renders this as a button in the document
7377
+ // toolbar (where editors expect it). The original crash came from passing
7378
+ // showAsAction WITHOUT a tone; pairing it with a valid string tone is how Sanity's
7379
+ // own built-in inspectors (Validation, etc.) keep their toolbar button safely.
7380
+ // If this still crashes in Nick's studio, remove these two lines to fall back to
7381
+ // the "..." overflow menu (the known-safe placement).
7382
+ showAsAction: true,
7383
+ tone: "default"
7383
7384
  }),
7384
7385
  component: function SEOCopilotInspector(props) {
7385
7386
  return createElement(SEOCopilotPanel, { ...props, config });