@bison-lab/payload-blocks 3.20.0 → 3.22.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 +37 -20
- package/dist/admin.d.mts +10 -2
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +992 -414
- package/dist/admin.mjs.map +1 -1
- package/dist/{header-CznT9Uwv.mjs → header-CTMSB4C0.mjs} +50 -24
- package/dist/header-CTMSB4C0.mjs.map +1 -0
- package/dist/index.d.mts +24 -12
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +14 -60
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +53 -5
- package/dist/react.d.mts.map +1 -1
- package/dist/react.mjs +2 -2
- package/dist/rich-text.d.mts +1 -1
- package/dist/{types-DWEoAURf.d.mts → types-BwWCwKJ4.d.mts} +15 -5
- package/dist/types-BwWCwKJ4.d.mts.map +1 -0
- package/package.json +4 -4
- package/dist/header-CznT9Uwv.mjs.map +0 -1
- package/dist/types-DWEoAURf.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -365,38 +365,41 @@ globals: [
|
|
|
365
365
|
|
|
366
366
|
Then `payload generate:types`, `payload generate:importmap`, and
|
|
367
367
|
`payload migrate:create`. Until the import map includes
|
|
368
|
-
`@bison-lab/payload-blocks/admin#NavItemsField
|
|
368
|
+
`@bison-lab/payload-blocks/admin#NavItemsField` and
|
|
369
|
+
`@bison-lab/payload-blocks/admin#AdminWorkspace`, those slots render
|
|
369
370
|
as nothing, not the stock blocks UI.
|
|
370
371
|
|
|
371
|
-
An editor sees
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
`
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
372
|
+
An editor opening Header sees the admin workspace: title strip (Payload
|
|
373
|
+
status / Save draft / Publish), a 300px item rail, and a canvas with a
|
|
374
|
+
sticky kit preview of the bar (Theme Identity lockup when one exists). Destinations
|
|
375
|
+
go through `LINK_FIELD`. The Header button is the rail slot that
|
|
376
|
+
writes `header.cta` (off until the editor enables it; label and destination
|
|
377
|
+
are required to save while it is on). Column widths, read as fractions, must add up to
|
|
378
|
+
100%: the rule is the array's own `validate`, so the editor sees
|
|
378
379
|
"The columns add up to 75%. They need to add up to 100%." as they build,
|
|
379
|
-
and the global's publish refuses the same.
|
|
380
|
-
mega trigger's landing page is
|
|
381
|
-
picker as every other destination
|
|
382
|
-
`payload migrate:create`.
|
|
380
|
+
and the global's publish refuses the same. A panel is narrow, standard,
|
|
381
|
+
or wide. The mega trigger's landing page is the same `type` / `page` /
|
|
382
|
+
`href` picker as every other destination.
|
|
383
383
|
|
|
384
|
-
In the site header, one call turns the
|
|
385
|
-
|
|
384
|
+
In the site header, one call turns the fetched Header global into
|
|
385
|
+
`FloatingNavBlock` props. Looks come from chrome roles
|
|
386
|
+
(`megaMenuVariantsFromLooks`), not a list on Header:
|
|
386
387
|
|
|
387
388
|
```tsx
|
|
388
389
|
'use client'
|
|
389
|
-
import { FloatingNavBlock } from '@bison-lab/ui'
|
|
390
|
-
import {
|
|
390
|
+
import { FloatingNavBlock, megaMenuVariantsFromLooks } from '@bison-lab/ui'
|
|
391
|
+
import { headerFromNavigation } from '@bison-lab/payload-blocks/react'
|
|
391
392
|
import { usePathname } from 'next/navigation'
|
|
392
393
|
|
|
393
|
-
export function SiteHeader({
|
|
394
|
+
export function SiteHeader({ doc }: { doc: Navigation }) {
|
|
394
395
|
const pathname = usePathname()
|
|
395
396
|
return (
|
|
396
397
|
<FloatingNavBlock
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
{...headerFromNavigation(doc, {
|
|
399
|
+
looks: megaMenuVariantsFromLooks(['lumbar', 'si'], {
|
|
400
|
+
lumbar: <Marker region="lumbar" />,
|
|
401
|
+
si: <Marker region="si" />,
|
|
402
|
+
}),
|
|
400
403
|
icons: { help: <CircleHelp className="size-4" aria-hidden /> },
|
|
401
404
|
isActive: (href) => pathname.startsWith(href),
|
|
402
405
|
linkComponent: NextBlockLink,
|
|
@@ -407,6 +410,20 @@ export function SiteHeader({ items }: { items: Navigation['items'] }) {
|
|
|
407
410
|
}
|
|
408
411
|
```
|
|
409
412
|
|
|
413
|
+
`headerItemsFromBlocks` is still the items half. Public headers must
|
|
414
|
+
call `headerFromNavigation` so hidden `bar` defaults reach the bar.
|
|
415
|
+
|
|
416
|
+
## Navigation settings
|
|
417
|
+
|
|
418
|
+
Bar behaviour stays on the Header schema (`bar.hideOnScroll`,
|
|
419
|
+
`bar.viewport`, `bar.defaultMaxWidth`) and is hidden in the admin.
|
|
420
|
+
The workspace canvas is the Header preview — do not leave a split
|
|
421
|
+
live-preview iframe. The kit editor holds the edited mega row open
|
|
422
|
+
through `openItem`. Featured looks stay on the chrome-role registry
|
|
423
|
+
(BIS-85 / SPI-89) — Header has no `variants` array. The Spinal consume
|
|
424
|
+
is SPI-99. After this schema change run `payload generate:importmap`,
|
|
425
|
+
`payload generate:types`, and `payload migrate:create`.
|
|
426
|
+
|
|
410
427
|
`MegaMenuBlockRenderer` renders one panel on its own, which is what a live
|
|
411
428
|
preview of the row wants; it is not a page block and has no place in the
|
|
412
429
|
registry. A row with no columns, or whose columns hold no complete links,
|
package/dist/admin.d.mts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { ArrayFieldClientComponent, BlocksFieldClientComponent, DocumentViewClientProps, RowFieldClientComponent } from "payload";
|
|
3
4
|
|
|
5
|
+
//#region src/admin/admin-workspace.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Wraps Payload's DefaultEditView so Header (and later kit editors)
|
|
8
|
+
* become the mockup workspace. Does not mount a second Form.
|
|
9
|
+
*/
|
|
10
|
+
declare function AdminWorkspace(props: DocumentViewClientProps): react_jsx_runtime0.JSX.Element;
|
|
11
|
+
//#endregion
|
|
4
12
|
//#region src/admin/link-field.d.ts
|
|
5
13
|
declare const LinkField: RowFieldClientComponent;
|
|
6
14
|
//#endregion
|
|
@@ -29,5 +37,5 @@ declare const MinRowsArrayField: ArrayFieldClientComponent;
|
|
|
29
37
|
//#region src/admin/nav-items-field.d.ts
|
|
30
38
|
declare const NavItemsField: BlocksFieldClientComponent;
|
|
31
39
|
//#endregion
|
|
32
|
-
export { LinkField, MinRowsArrayField, NavItemsField };
|
|
40
|
+
export { AdminWorkspace, LinkField, MinRowsArrayField, NavItemsField };
|
|
33
41
|
//# sourceMappingURL=admin.d.mts.map
|
package/dist/admin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.mts","names":[],"sources":["../src/admin/link-field.tsx","../src/admin/min-rows-array-field.tsx","../src/admin/nav-items-field.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin.d.mts","names":[],"sources":["../src/admin/admin-workspace.tsx","../src/admin/link-field.tsx","../src/admin/min-rows-array-field.tsx","../src/admin/nav-items-field.tsx"],"mappings":";;;;;;;;AAWA;iBAAgB,cAAA,CAAe,KAAA,EAAO,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;cC4DhD,SAAA,EAAW,uBAAA;;;;;;AD5DxB;;;;;;;;;;;;;AC4DA;;;cChDa,iBAAA,EAAmB,yBAAA;;;cC6MnB,aAAA,EAAe,0BAAA"}
|