@bison-lab/payload-core 4.30.0 → 4.32.1

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/README.md CHANGED
@@ -419,13 +419,21 @@ import { createBlockLibrary } from "@bison-lab/payload-core";
419
419
 
420
420
  createBlockLibrary({
421
421
  previewPath: (slug) => `/block-library/${slug}`,
422
- blocks: [{ slug: "ctaBand", label: "Doctor finder", category: "cta", kind: "section" }],
422
+ blocks: [{ slug: "pricingTable", label: "Pricing table", category: "cta", kind: "section" }],
423
423
  });
424
424
  ```
425
425
 
426
426
  `access.update` defaults to `isAdmin`. Pass `access` to change who may
427
427
  edit availability. Then `payload generate:importmap` and `payload migrate:create`.
428
428
 
429
+ An extra may use a slug the package also ships. A site that built its own
430
+ block before the package shipped one under that slug still renders its own
431
+ config, so its entry replaces the package entry in place: its label,
432
+ category, controls, screenshot and sample, one row per slug.
433
+ `createBlockLibrary` records the site's slugs (`admin.custom.siteSlugs`) so
434
+ `getSectionControls` keeps that entry too. Remove the extra when the site
435
+ switches to the package block.
436
+
429
437
  ### The Add Block drawer
430
438
 
431
439
  Payload has no slot to replace its Add Block drawer, and three places open
@@ -447,7 +455,7 @@ every catalogue block, in every collection and global, so all three agree:
447
455
  year behind a `?v=` that changes with the picture. The admin's client
448
456
  config carries only that URL. A site extra passes its own `thumbnail`
449
457
  URL on its `createBlockLibrary` entry (a file it serves, such as
450
- `/block-thumbnails/ctaBand.jpg` from `public/`); it is kept in the
458
+ `/block-thumbnails/pricingTable.jpg` from `public/`); it is kept in the
451
459
  Global's server-only `custom`. A block config that already sets a
452
460
  thumbnail or `imageURL` keeps it.
453
461
  - **Larger cards**: one admin stylesheet (`BLOCK_DRAWER_CSS`, mounted as the
@@ -464,7 +472,7 @@ export default buildConfig({
464
472
  globals: [
465
473
  createBlockLibrary({
466
474
  previewPath: (slug) => `/block-library/${slug}`,
467
- blocks: [{ slug: "ctaBand", label: "CTA band", category: "cta", thumbnail: "/block-thumbnails/ctaBand.jpg" }],
475
+ blocks: [{ slug: "pricingTable", label: "Pricing table", category: "cta", thumbnail: "/block-thumbnails/pricingTable.jpg" }],
468
476
  }),
469
477
  ],
470
478
  plugins: [blockDrawer()],
@@ -483,7 +491,7 @@ entry). Run it from the site, which supplies Playwright:
483
491
 
484
492
  ```sh
485
493
  THUMBNAIL_EMAIL=… THUMBNAIL_PASSWORD=… pnpm exec bison-block-thumbnails \
486
- --base http://localhost:3039 --slugs ctaBand,productMap \
494
+ --base http://localhost:3039 --slugs pricingTable,productMap \
487
495
  --out-dir public/block-thumbnails
488
496
  ```
489
497
 
@@ -528,7 +536,7 @@ same way it passes `sample`:
528
536
  createBlockLibrary({
529
537
  previewPath: (slug) => `/block-library/${slug}`,
530
538
  blocks: [
531
- { slug: "ctaBand", label: "Doctor finder", category: "cta", kind: "section",
539
+ { slug: "pricingTable", label: "Pricing table", category: "cta", kind: "section",
532
540
  sectionControls: { spacing: false } },
533
541
  ],
534
542
  });