@nocode-factory/sanity-kit 2.30.0 → 2.31.0

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/bin/ncf-kit.mjs CHANGED
@@ -452,6 +452,22 @@ async function doctor() {
452
452
  const workflows = walk(join(root, '.github', 'workflows'))
453
453
  const captures = workflows.find((f) => /public\/sections/.test(read(f)))
454
454
  captures ? ok('Captures des composants', captures.replace(root + '/', '')) : warn('Captures des composants', "aucun workflow ne produit public/sections/<bloc>.png : l'onglet Composants affichera « Pas de capture ». Reprendre .github/workflows/section-screenshots.yml du starter.")
455
+ // Chaque section a SA vraie capture (jamais un dessin), tenue à jour chaque nuit.
456
+ {
457
+ const options = read(join(web, 'app', 'lib', 'section-options.json'))
458
+ if (options) {
459
+ const expected = (JSON.parse(options).sections ?? []).map((x) => String(x.type).replace(/^section\./, ''))
460
+ const missing = expected.filter((name) => !existsSync(join(web, 'public', 'sections', `${name}.png`)))
461
+ missing.length
462
+ ? ko('Captures des sections', `le kit a besoin d'une vraie capture par section (menu d'insertion, onglet Composants) ; le projet n'en a pas pour : ${missing.join(', ')}. Pousser une modification de section (le workflow les génère) ou lancer « Captures des sections » dans GitHub Actions.`)
463
+ : ok('Captures des sections', `${expected.length} section(s), une capture chacune`)
464
+ if (captures && !/schedule:/.test(read(captures)))
465
+ warn('Captures des sections', "le workflow ne tourne pas chaque nuit : une valeur par défaut changée dans le Studio ne se verrait pas dans la capture. Ajouter `schedule: - cron: \"0 3 * * *\"` (voir le starter).")
466
+ }
467
+ const studioFiles2 = walk(studio)
468
+ const drawn = studioFiles2.find((f) => /data:image\/svg\+xml/.test(read(f)) && /previewImageUrl|blockPreview|blockThumb/.test(read(f)))
469
+ if (drawn) warn('Captures des sections', `${drawn.replace(root + '/', '')} dessine des vignettes (SVG) : le Studio doit montrer la vraie capture (${'${SITE}'}/sections/<type>.png).`)
470
+ }
455
471
 
456
472
  /* En ligne */
457
473
  if (!offline) {
package/dist/index.d.ts CHANGED
@@ -1361,7 +1361,7 @@ export declare function ActorName(props: {
1361
1361
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1362
1362
  * le vérifie.
1363
1363
  */
1364
- export declare const KIT_VERSION = "2.30.0";
1364
+ export declare const KIT_VERSION = "2.31.0";
1365
1365
  /**
1366
1366
  * Données de la page proposées comme colonnes.
1367
1367
  *
package/dist/index.js CHANGED
@@ -1381,7 +1381,7 @@ function explainGrantError(error) {
1381
1381
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1382
1382
  * le vérifie.
1383
1383
  */
1384
- const KIT_VERSION = "2.30.0";
1384
+ const KIT_VERSION = "2.31.0";
1385
1385
  /**
1386
1386
  * Signale ce Studio au service du kit, une fois par montage.
1387
1387
  *
@@ -1724,7 +1724,7 @@ function useKitUpdate() {
1724
1724
  !controller.signal.aborted && body?.version && setLatest(body.version);
1725
1725
  }).catch(() => {}), () => controller.abort();
1726
1726
  }, []);
1727
- let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.30.0") > 0);
1727
+ let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.31.0") > 0);
1728
1728
  return {
1729
1729
  current: KIT_VERSION,
1730
1730
  latest,
@@ -8494,13 +8494,23 @@ function createOverrideInput(config) {
8494
8494
  })
8495
8495
  ]
8496
8496
  }),
8497
- inherits && placeholder === null && /* @__PURE__ */ jsx(Box, {
8497
+ inherits && placeholder === null && /* @__PURE__ */ jsxs(Flex, {
8498
+ align: "center",
8499
+ gap: 2,
8498
8500
  marginTop: 2,
8499
- children: /* @__PURE__ */ jsxs(Text, {
8501
+ wrap: "wrap",
8502
+ children: [/* @__PURE__ */ jsxs(Text, {
8500
8503
  size: 0,
8501
8504
  muted: !0,
8502
8505
  children: ["Component default value: ", describeValue(inherited)]
8503
- })
8506
+ }), Array.isArray(inherited) && !inputProps.readOnly && /* @__PURE__ */ jsx(Button, {
8507
+ mode: "ghost",
8508
+ tone: "primary",
8509
+ fontSize: 0,
8510
+ padding: 2,
8511
+ text: "Edit default items",
8512
+ onClick: () => inputProps.onChange(set(structuredClone(inherited)))
8513
+ })]
8504
8514
  })
8505
8515
  ]
8506
8516
  }), override && !inputProps.readOnly && /* @__PURE__ */ jsx(OverrideDot, {