@bison-lab/payload-core 4.15.2 → 4.17.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/README.md +41 -31
- package/dist/admin.mjs.map +1 -1
- package/dist/block-library.d.mts +1 -1
- package/dist/block-thumbnails--AJzSdzJ.mjs +130 -0
- package/dist/block-thumbnails--AJzSdzJ.mjs.map +1 -0
- package/dist/block-thumbnails-cli.d.mts +1 -0
- package/dist/block-thumbnails-cli.mjs +121 -0
- package/dist/block-thumbnails-cli.mjs.map +1 -0
- package/dist/block-thumbnails.d.mts +74 -0
- package/dist/block-thumbnails.d.mts.map +1 -0
- package/dist/block-thumbnails.mjs +2 -0
- package/dist/{catalogue-CFXM1yAZ.d.mts → catalogue-DMoDgScN.d.mts} +6 -5
- package/dist/catalogue-DMoDgScN.d.mts.map +1 -0
- package/dist/{facet-field-_8bYI1i0.d.mts → facet-field-DKzRCYrh.d.mts} +1 -1
- package/dist/{facet-field-_8bYI1i0.d.mts.map → facet-field-DKzRCYrh.d.mts.map} +1 -1
- package/dist/index.d.mts +27 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +80 -21
- package/dist/index.mjs.map +1 -1
- package/dist/metadata.d.mts +1 -1
- package/dist/navigation.d.mts +1 -1
- package/dist/{preview-Vaa1KXJP.d.mts → preview-T5VFcS32.d.mts} +1 -1
- package/dist/{preview-Vaa1KXJP.d.mts.map → preview-T5VFcS32.d.mts.map} +1 -1
- package/dist/published-BjmUCpdY.mjs.map +1 -1
- package/dist/{published-FUgC5Mc8.d.mts → published-IX1-6JEa.d.mts} +1 -1
- package/dist/{published-FUgC5Mc8.d.mts.map → published-IX1-6JEa.d.mts.map} +1 -1
- package/dist/taxonomy.d.mts +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{title-ImlifZ_6.d.mts → title-BvjHeRo5.d.mts} +1 -1
- package/dist/{title-ImlifZ_6.d.mts.map → title-BvjHeRo5.d.mts.map} +1 -1
- package/dist/{wireframe-BTocmmyY.mjs → wireframe-ApjwNWAN.mjs} +6 -1
- package/dist/{wireframe-BTocmmyY.mjs.map → wireframe-ApjwNWAN.mjs.map} +1 -1
- package/dist/wireframe-cli.mjs +5 -1
- package/dist/wireframe-cli.mjs.map +1 -1
- package/dist/wireframe.d.mts +5 -0
- package/dist/wireframe.d.mts.map +1 -1
- package/dist/wireframe.mjs +1 -1
- package/package.json +7 -2
- package/dist/catalogue-CFXM1yAZ.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Media list with `next/navigation`, which Payload's admin already loads); `@bison
|
|
|
19
19
|
Pin the plugin to the same version as `payload`; Payload releases them in
|
|
20
20
|
lockstep.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Ten entry points, and why
|
|
23
23
|
|
|
24
24
|
| Import | Contents | Runs where |
|
|
25
25
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
@@ -29,7 +29,8 @@ lockstep.
|
|
|
29
29
|
| `@bison-lab/payload-core/navigation` | `getNavigation`, the Header and Footer slugs | Server. What a site header imports; it does not load the plugin or React. |
|
|
30
30
|
| `@bison-lab/payload-core/block-library` | `getSectionControls`, `sectionControlsFromLibrary`, `SectionControls`, the catalogue readers, the island height message | Server. What a page route and the Block Settings fold import; it does not load the plugin or React. |
|
|
31
31
|
| `@bison-lab/payload-core/taxonomy` | `facetField`, `FacetEntry` | Anywhere. What a block config imports to tag content from a taxonomy; no plugin, no React, so a browser bundle can take it (`@bison-lab/payload-blocks` main entry reaches the docs island and Storybook). |
|
|
32
|
-
| `@bison-lab/payload-core/
|
|
32
|
+
| `@bison-lab/payload-core/block-thumbnails` | `captureThumbnails`, `thumbnailCss`, `NEUTRAL_THEME`, `thumbnailVersion`; the `bison-block-thumbnails` bin | Node, beside Playwright. What a site's thumbnail script imports; no Payload, no React. |
|
|
33
|
+
| `@bison-lab/payload-core/wireframe` | Deprecated: the 4.15 wireframe generator and the `bison-wireframes` bin | Node. Kept for one release so a site's script keeps working; use `./block-thumbnails`. Goes in the next major. |
|
|
33
34
|
| `@bison-lab/payload-core/admin` | Theme fields, the Roles and Features matrices, the Block library field, Admin nav, the Users Roles checklist, and the FAQ Library list | Admin. Referenced by import-map string; `generate:importmap` writes it. |
|
|
34
35
|
| `@bison-lab/payload-core/react` | `BlockLibraryIsland`; `ThemePreview` (legacy; Theme has no preview pane) | Client. What a Block library preview route wraps its sample in. |
|
|
35
36
|
|
|
@@ -428,12 +429,18 @@ every catalogue block, in every collection and global, so all three agree:
|
|
|
428
429
|
Feature, Process, … like the Block library. Blocks outside the catalogue
|
|
429
430
|
(a Header's `megaMenu` and `navLink`) are left alone and go last, which
|
|
430
431
|
is also where Payload draws ungrouped blocks.
|
|
431
|
-
- **`admin.images.thumbnail`**: a
|
|
432
|
-
|
|
433
|
-
(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
432
|
+
- **`admin.images.thumbnail`**: a screenshot of the block's sample (generic
|
|
433
|
+
copy and photos from `@bison-lab/payload-blocks`) under a neutral slate
|
|
434
|
+
theme (BIS-151). The package ships one for each of its page blocks
|
|
435
|
+
(`block-library/thumbnails.generated.ts`, `resources` included) and
|
|
436
|
+
serves it from `GET /api/block-library/thumbnail/:slug`, a root endpoint
|
|
437
|
+
the plugin registers: signed-in users only, `image/jpeg`, cached for a
|
|
438
|
+
year behind a `?v=` that changes with the picture. The admin's client
|
|
439
|
+
config carries only that URL. A site extra passes its own `thumbnail`
|
|
440
|
+
URL on its `createBlockLibrary` entry (a file it serves, such as
|
|
441
|
+
`/block-thumbnails/ctaBand.jpg` from `public/`); it is kept in the
|
|
442
|
+
Global's server-only `custom`. A block config that already sets a
|
|
443
|
+
thumbnail or `imageURL` keeps it.
|
|
437
444
|
- **Larger cards**: one admin stylesheet (`BLOCK_DRAWER_CSS`, mounted as the
|
|
438
445
|
`BLOCK_DRAWER_STYLES` provider) lays the drawer out three across, two at
|
|
439
446
|
Payload's 1024px break, one at 768px, instead of Payload's six.
|
|
@@ -448,7 +455,7 @@ export default buildConfig({
|
|
|
448
455
|
globals: [
|
|
449
456
|
createBlockLibrary({
|
|
450
457
|
previewPath: (slug) => `/block-library/${slug}`,
|
|
451
|
-
blocks: [{ slug: "ctaBand", label: "CTA band", category: "cta", thumbnail:
|
|
458
|
+
blocks: [{ slug: "ctaBand", label: "CTA band", category: "cta", thumbnail: "/block-thumbnails/ctaBand.jpg" }],
|
|
452
459
|
}),
|
|
453
460
|
],
|
|
454
461
|
plugins: [blockDrawer()],
|
|
@@ -457,33 +464,36 @@ export default buildConfig({
|
|
|
457
464
|
|
|
458
465
|
Run `payload generate:importmap` once for the stylesheet provider.
|
|
459
466
|
|
|
460
|
-
**
|
|
461
|
-
opens each block's Block library preview in a headless browser at
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
when a layout changes. Run it from the site, which supplies Playwright:
|
|
467
|
+
**Screenshots** come from `bison-block-thumbnails`, a bin on this package
|
|
468
|
+
that opens each block's Block library preview in a headless browser at
|
|
469
|
+
1280px, lays the neutral theme over the site's (`thumbnailCss`: the
|
|
470
|
+
`NEUTRAL_THEME` tokens from `buildThemeCss`, a system font stack, no
|
|
471
|
+
motion, dev-server chrome hidden), centers the block in a 3:2 box, and
|
|
472
|
+
saves a 960 × 640 JPEG (`captureThumbnails`, from the `./block-thumbnails`
|
|
473
|
+
entry). Run it from the site, which supplies Playwright:
|
|
468
474
|
|
|
469
475
|
```sh
|
|
470
|
-
|
|
476
|
+
THUMBNAIL_EMAIL=… THUMBNAIL_PASSWORD=… pnpm exec bison-block-thumbnails \
|
|
471
477
|
--base http://localhost:3039 --slugs ctaBand,productMap \
|
|
472
|
-
--out
|
|
478
|
+
--out-dir public/block-thumbnails
|
|
473
479
|
```
|
|
474
480
|
|
|
475
|
-
The login (any user the preview route accepts) comes from the environment
|
|
476
|
-
`--
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
481
|
+
The login (any user the preview route accepts) comes from the environment
|
|
482
|
+
and is required unless `--no-login` names a public route. `--preview`
|
|
483
|
+
changes the route pattern (`/block-library/{slug}` by default; a site can
|
|
484
|
+
add a query, such as `?thumbnail=1`, to swap in generic stand-ins for data
|
|
485
|
+
its sample reads), and `--selector` the element that holds the sample
|
|
486
|
+
(`BlockLibraryIsland`'s by default). `--out-dir` writes `<slug>.jpg` files;
|
|
487
|
+
`--module` writes a TypeScript module of base64 JPEGs (`--export` names
|
|
488
|
+
the constant), which is how this package ships its own. A preview that
|
|
489
|
+
answers an error status, or renders nothing the selector matches, fails
|
|
490
|
+
the run and writes nothing, so a sign-in wall or a mistyped slug never
|
|
491
|
+
becomes a block's picture. Rerun it when a block's layout or sample
|
|
492
|
+
changes. To refresh the package's own, run it with `--module
|
|
493
|
+
src/block-library/thumbnails.generated.ts --export PACKAGE_THUMBNAILS`
|
|
494
|
+
against a site's preview route with this release's payload-blocks
|
|
495
|
+
installed; the `hero` alias reuses the sweep hero's picture, since no site
|
|
496
|
+
installs it.
|
|
487
497
|
|
|
488
498
|
### Section controls
|
|
489
499
|
|