@consilioweb/payload-seo-analyzer 1.17.2 → 1.17.3

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/client.cjs CHANGED
@@ -1077,6 +1077,7 @@ var fr = {
1077
1077
  bulkExport: "Exporter CSV",
1078
1078
  bulkNoChanges: "Aucune correction n\xE9cessaire sur la s\xE9lection.",
1079
1079
  bulkCappedNote: "limite atteinte (affine la s\xE9lection)",
1080
+ bulkAppliedNote: "\u2713 Corrections appliqu\xE9es. Rafra\xEEchis pour recalculer les scores (une seule fois, apr\xE8s tes lots).",
1080
1081
  searchPlaceholder: "Rechercher (titre, slug, keyword)...",
1081
1082
  allCollections: "Toutes les collections",
1082
1083
  allScores: "Tous les scores",
@@ -1681,6 +1682,7 @@ var en = {
1681
1682
  bulkExport: "Export CSV",
1682
1683
  bulkNoChanges: "No corrections needed on the selection.",
1683
1684
  bulkCappedNote: "limit reached (narrow the selection)",
1685
+ bulkAppliedNote: "\u2713 Corrections applied. Refresh to recompute scores (once, after your batches).",
1684
1686
  searchPlaceholder: "Search (title, slug, keyword)...",
1685
1687
  allCollections: "All collections",
1686
1688
  allScores: "All scores",
@@ -9327,6 +9329,7 @@ function SeoView() {
9327
9329
  const [saveError, setSaveError] = React4.useState(null);
9328
9330
  const [bulkOptimizing, setBulkOptimizing] = React4.useState(false);
9329
9331
  const [bulkApplying, setBulkApplying] = React4.useState(false);
9332
+ const [bulkApplied, setBulkApplied] = React4.useState(false);
9330
9333
  const [bulkPreview, setBulkPreview] = React4.useState(null);
9331
9334
  const PAGE_SIZE = 50;
9332
9335
  const fetchAudit = React4.useCallback(async (forceRefresh = false) => {
@@ -9599,8 +9602,8 @@ function SeoView() {
9599
9602
  setBulkApplying(false);
9600
9603
  setBulkPreview(null);
9601
9604
  setSelectedIds(/* @__PURE__ */ new Set());
9602
- fetchAudit();
9603
- }, [bulkPreview, fetchAudit]);
9605
+ setBulkApplied(true);
9606
+ }, [bulkPreview]);
9604
9607
  const handleExportBulkPreviewCsv = React4.useCallback(() => {
9605
9608
  if (!bulkPreview) return;
9606
9609
  const header = [
@@ -9984,6 +9987,41 @@ function SeoView() {
9984
9987
  ]
9985
9988
  }
9986
9989
  ),
9990
+ bulkApplied && /* @__PURE__ */ jsxRuntime.jsxs(
9991
+ "div",
9992
+ {
9993
+ style: {
9994
+ marginBottom: 16,
9995
+ padding: "10px 14px",
9996
+ borderRadius: 8,
9997
+ border: `1px solid ${V2.border}`,
9998
+ backgroundColor: "rgba(34,197,94,0.10)",
9999
+ color: V2.text,
10000
+ fontSize: 13,
10001
+ display: "flex",
10002
+ alignItems: "center",
10003
+ justifyContent: "space-between",
10004
+ gap: 12
10005
+ },
10006
+ children: [
10007
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t.seoView.bulkAppliedNote }),
10008
+ /* @__PURE__ */ jsxRuntime.jsxs(
10009
+ "button",
10010
+ {
10011
+ onClick: () => {
10012
+ setBulkApplied(false);
10013
+ fetchAudit(true);
10014
+ },
10015
+ style: { ...btnBase, backgroundColor: V2.bgCard, color: V2.text },
10016
+ children: [
10017
+ "\u21BB ",
10018
+ t.common.refresh
10019
+ ]
10020
+ }
10021
+ )
10022
+ ]
10023
+ }
10024
+ ),
9987
10025
  stats && /* @__PURE__ */ jsxRuntime.jsxs(
9988
10026
  "div",
9989
10027
  {
package/dist/client.js CHANGED
@@ -1071,6 +1071,7 @@ var fr = {
1071
1071
  bulkExport: "Exporter CSV",
1072
1072
  bulkNoChanges: "Aucune correction n\xE9cessaire sur la s\xE9lection.",
1073
1073
  bulkCappedNote: "limite atteinte (affine la s\xE9lection)",
1074
+ bulkAppliedNote: "\u2713 Corrections appliqu\xE9es. Rafra\xEEchis pour recalculer les scores (une seule fois, apr\xE8s tes lots).",
1074
1075
  searchPlaceholder: "Rechercher (titre, slug, keyword)...",
1075
1076
  allCollections: "Toutes les collections",
1076
1077
  allScores: "Tous les scores",
@@ -1675,6 +1676,7 @@ var en = {
1675
1676
  bulkExport: "Export CSV",
1676
1677
  bulkNoChanges: "No corrections needed on the selection.",
1677
1678
  bulkCappedNote: "limit reached (narrow the selection)",
1679
+ bulkAppliedNote: "\u2713 Corrections applied. Refresh to recompute scores (once, after your batches).",
1678
1680
  searchPlaceholder: "Search (title, slug, keyword)...",
1679
1681
  allCollections: "All collections",
1680
1682
  allScores: "All scores",
@@ -9321,6 +9323,7 @@ function SeoView() {
9321
9323
  const [saveError, setSaveError] = useState(null);
9322
9324
  const [bulkOptimizing, setBulkOptimizing] = useState(false);
9323
9325
  const [bulkApplying, setBulkApplying] = useState(false);
9326
+ const [bulkApplied, setBulkApplied] = useState(false);
9324
9327
  const [bulkPreview, setBulkPreview] = useState(null);
9325
9328
  const PAGE_SIZE = 50;
9326
9329
  const fetchAudit = useCallback(async (forceRefresh = false) => {
@@ -9593,8 +9596,8 @@ function SeoView() {
9593
9596
  setBulkApplying(false);
9594
9597
  setBulkPreview(null);
9595
9598
  setSelectedIds(/* @__PURE__ */ new Set());
9596
- fetchAudit();
9597
- }, [bulkPreview, fetchAudit]);
9599
+ setBulkApplied(true);
9600
+ }, [bulkPreview]);
9598
9601
  const handleExportBulkPreviewCsv = useCallback(() => {
9599
9602
  if (!bulkPreview) return;
9600
9603
  const header = [
@@ -9978,6 +9981,41 @@ function SeoView() {
9978
9981
  ]
9979
9982
  }
9980
9983
  ),
9984
+ bulkApplied && /* @__PURE__ */ jsxs(
9985
+ "div",
9986
+ {
9987
+ style: {
9988
+ marginBottom: 16,
9989
+ padding: "10px 14px",
9990
+ borderRadius: 8,
9991
+ border: `1px solid ${V2.border}`,
9992
+ backgroundColor: "rgba(34,197,94,0.10)",
9993
+ color: V2.text,
9994
+ fontSize: 13,
9995
+ display: "flex",
9996
+ alignItems: "center",
9997
+ justifyContent: "space-between",
9998
+ gap: 12
9999
+ },
10000
+ children: [
10001
+ /* @__PURE__ */ jsx("span", { children: t.seoView.bulkAppliedNote }),
10002
+ /* @__PURE__ */ jsxs(
10003
+ "button",
10004
+ {
10005
+ onClick: () => {
10006
+ setBulkApplied(false);
10007
+ fetchAudit(true);
10008
+ },
10009
+ style: { ...btnBase, backgroundColor: V2.bgCard, color: V2.text },
10010
+ children: [
10011
+ "\u21BB ",
10012
+ t.common.refresh
10013
+ ]
10014
+ }
10015
+ )
10016
+ ]
10017
+ }
10018
+ ),
9981
10019
  stats && /* @__PURE__ */ jsxs(
9982
10020
  "div",
9983
10021
  {
package/dist/index.cjs CHANGED
@@ -1689,8 +1689,8 @@ async function buildAuditCache(payload, collections, globals, seoConfig, reqLoca
1689
1689
  const BATCH_SIZE = Math.min(100, Math.max(1, parseInt(process.env.SEO_AUDIT_BATCH_SIZE || "10", 10) || 10));
1690
1690
  const MAX_DOCS2 = Math.max(1, parseInt(process.env.SEO_AUDIT_MAX_DOCS || "1500", 10) || 1500);
1691
1691
  const BATCH_DELAY_MS = Math.min(5e3, Math.max(0, parseInt(process.env.SEO_AUDIT_BATCH_DELAY_MS || "100", 10) || 0));
1692
- const rawDepth = parseInt(process.env.SEO_AUDIT_DEPTH ?? "1", 10);
1693
- const DEPTH = Number.isNaN(rawDepth) ? 1 : Math.min(2, Math.max(0, rawDepth));
1692
+ const rawDepth = parseInt(process.env.SEO_AUDIT_DEPTH ?? "0", 10);
1693
+ const DEPTH = Number.isNaN(rawDepth) ? 0 : Math.min(2, Math.max(0, rawDepth));
1694
1694
  const allResults = [];
1695
1695
  let capped = false;
1696
1696
  collectionsLoop:
@@ -1720,10 +1720,11 @@ async function buildAuditCache(payload, collections, globals, seoConfig, reqLoca
1720
1720
  `[seo] audit: skipped ${collectionSlug}/${doc.id}: ${e instanceof Error ? e.message : "error"}`
1721
1721
  );
1722
1722
  }
1723
+ await new Promise((resolve) => setImmediate(resolve));
1723
1724
  }
1724
1725
  hasMore = result.hasNextPage;
1725
1726
  page++;
1726
- await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY_MS));
1727
+ if (BATCH_DELAY_MS > 0) await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY_MS));
1727
1728
  }
1728
1729
  } catch {
1729
1730
  }
@@ -9336,6 +9337,7 @@ var fr = {
9336
9337
  bulkExport: "Exporter CSV",
9337
9338
  bulkNoChanges: "Aucune correction n\xE9cessaire sur la s\xE9lection.",
9338
9339
  bulkCappedNote: "limite atteinte (affine la s\xE9lection)",
9340
+ bulkAppliedNote: "\u2713 Corrections appliqu\xE9es. Rafra\xEEchis pour recalculer les scores (une seule fois, apr\xE8s tes lots).",
9339
9341
  searchPlaceholder: "Rechercher (titre, slug, keyword)...",
9340
9342
  allCollections: "Toutes les collections",
9341
9343
  allScores: "Tous les scores",
@@ -9940,6 +9942,7 @@ var en = {
9940
9942
  bulkExport: "Export CSV",
9941
9943
  bulkNoChanges: "No corrections needed on the selection.",
9942
9944
  bulkCappedNote: "limit reached (narrow the selection)",
9945
+ bulkAppliedNote: "\u2713 Corrections applied. Refresh to recompute scores (once, after your batches).",
9943
9946
  searchPlaceholder: "Search (title, slug, keyword)...",
9944
9947
  allCollections: "All collections",
9945
9948
  allScores: "All scores",
package/dist/index.d.cts CHANGED
@@ -485,6 +485,7 @@ interface DashboardTranslations {
485
485
  bulkExport: string;
486
486
  bulkNoChanges: string;
487
487
  bulkCappedNote: string;
488
+ bulkAppliedNote: string;
488
489
  searchPlaceholder: string;
489
490
  allCollections: string;
490
491
  allScores: string;
package/dist/index.d.ts CHANGED
@@ -485,6 +485,7 @@ interface DashboardTranslations {
485
485
  bulkExport: string;
486
486
  bulkNoChanges: string;
487
487
  bulkCappedNote: string;
488
+ bulkAppliedNote: string;
488
489
  searchPlaceholder: string;
489
490
  allCollections: string;
490
491
  allScores: string;
package/dist/index.js CHANGED
@@ -1687,8 +1687,8 @@ async function buildAuditCache(payload, collections, globals, seoConfig, reqLoca
1687
1687
  const BATCH_SIZE = Math.min(100, Math.max(1, parseInt(process.env.SEO_AUDIT_BATCH_SIZE || "10", 10) || 10));
1688
1688
  const MAX_DOCS2 = Math.max(1, parseInt(process.env.SEO_AUDIT_MAX_DOCS || "1500", 10) || 1500);
1689
1689
  const BATCH_DELAY_MS = Math.min(5e3, Math.max(0, parseInt(process.env.SEO_AUDIT_BATCH_DELAY_MS || "100", 10) || 0));
1690
- const rawDepth = parseInt(process.env.SEO_AUDIT_DEPTH ?? "1", 10);
1691
- const DEPTH = Number.isNaN(rawDepth) ? 1 : Math.min(2, Math.max(0, rawDepth));
1690
+ const rawDepth = parseInt(process.env.SEO_AUDIT_DEPTH ?? "0", 10);
1691
+ const DEPTH = Number.isNaN(rawDepth) ? 0 : Math.min(2, Math.max(0, rawDepth));
1692
1692
  const allResults = [];
1693
1693
  let capped = false;
1694
1694
  collectionsLoop:
@@ -1718,10 +1718,11 @@ async function buildAuditCache(payload, collections, globals, seoConfig, reqLoca
1718
1718
  `[seo] audit: skipped ${collectionSlug}/${doc.id}: ${e instanceof Error ? e.message : "error"}`
1719
1719
  );
1720
1720
  }
1721
+ await new Promise((resolve) => setImmediate(resolve));
1721
1722
  }
1722
1723
  hasMore = result.hasNextPage;
1723
1724
  page++;
1724
- await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY_MS));
1725
+ if (BATCH_DELAY_MS > 0) await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY_MS));
1725
1726
  }
1726
1727
  } catch {
1727
1728
  }
@@ -9334,6 +9335,7 @@ var fr = {
9334
9335
  bulkExport: "Exporter CSV",
9335
9336
  bulkNoChanges: "Aucune correction n\xE9cessaire sur la s\xE9lection.",
9336
9337
  bulkCappedNote: "limite atteinte (affine la s\xE9lection)",
9338
+ bulkAppliedNote: "\u2713 Corrections appliqu\xE9es. Rafra\xEEchis pour recalculer les scores (une seule fois, apr\xE8s tes lots).",
9337
9339
  searchPlaceholder: "Rechercher (titre, slug, keyword)...",
9338
9340
  allCollections: "Toutes les collections",
9339
9341
  allScores: "Tous les scores",
@@ -9938,6 +9940,7 @@ var en = {
9938
9940
  bulkExport: "Export CSV",
9939
9941
  bulkNoChanges: "No corrections needed on the selection.",
9940
9942
  bulkCappedNote: "limit reached (narrow the selection)",
9943
+ bulkAppliedNote: "\u2713 Corrections applied. Refresh to recompute scores (once, after your batches).",
9941
9944
  searchPlaceholder: "Search (title, slug, keyword)...",
9942
9945
  allCollections: "All collections",
9943
9946
  allScores: "All scores",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consilioweb/payload-seo-analyzer",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "description": "Payload CMS SEO plugin — 50+ checks, dashboard, Lexical JSON support, Flesch FR/EN readability, i18n",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",