@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 +13 -5
- package/dist/admin.mjs.map +1 -1
- package/dist/block-library.d.mts +1 -1
- package/dist/block-library.mjs +1 -1
- package/dist/block-thumbnails-cli.mjs +1 -1
- package/dist/block-thumbnails-cli.mjs.map +1 -1
- package/dist/{catalogue-C2r48lET.d.mts → catalogue-BC_A9eLc.d.mts} +14 -5
- package/dist/catalogue-BC_A9eLc.d.mts.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{published-Cc1a8uYp.mjs → published-niJkPGjE.mjs} +47 -9
- package/dist/published-niJkPGjE.mjs.map +1 -0
- package/dist/wireframe-cli.mjs +1 -1
- package/dist/wireframe-cli.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/catalogue-C2r48lET.d.mts.map +0 -1
- package/dist/published-Cc1a8uYp.mjs.map +0 -1
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: "
|
|
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/
|
|
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: "
|
|
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
|
|
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: "
|
|
539
|
+
{ slug: "pricingTable", label: "Pricing table", category: "cta", kind: "section",
|
|
532
540
|
sectionControls: { spacing: false } },
|
|
533
541
|
],
|
|
534
542
|
});
|