@bison-lab/payload-blocks 3.2.0 → 3.4.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/dist/react.d.mts CHANGED
@@ -1,8 +1,44 @@
1
1
 
2
- import { C as DefaultBlockImage, S as BlockImageProps, _ as BlockLinkProps, a as NavLinkBlockData, b as renderLinkWith, c as ShowcasePanelsBlockData, d as BlockRegistryFor, f as BlockRendererProps, g as BlockLinkComponent, h as RenderBlocksProps, i as NapBlockData, l as TestimonialMasonryBlockData, m as RenderBlocks, n as HeroBlockData, o as ProcessStepsBlockData, p as DEFAULT_CONTAINER, r as MegaMenuBlockData, t as FaqColumnsBlockData, u as BlockLike, v as DefaultBlockLink, x as BlockImageComponent, y as newTabAttributes } from "./types-CJAvoZMk.mjs";
2
+ import { A as BlockImageProps, C as resolveLink, D as newTabAttributes, E as DefaultBlockLink, O as renderLinkWith, S as linkTypeOf, T as BlockLinkProps, _ as RenderBlocksProps, a as NavLinkBlockData, b as LinkValue, c as ShowcasePanelsBlockData, d as BLOCK_ID_ATTRIBUTE, f as BlockLike, g as RenderBlocks, h as DEFAULT_CONTAINER, i as NapBlockData, j as DefaultBlockImage, k as BlockImageComponent, l as StatsBandBlockData, m as BlockRendererProps, n as HeroBlockData, o as ProcessStepsBlockData, p as BlockRegistryFor, r as MegaMenuBlockData, t as FaqColumnsBlockData, u as TestimonialMasonryBlockData, v as LinkDestination, w as BlockLinkComponent, x as ResolveLink, y as LinkPageDoc } from "./types-ODMRyOpH.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { FloatingNavItem, MegaMenuIcons, MegaMenuPanelData, MegaMenuVariants } from "@bison-lab/ui";
5
5
 
6
+ //#region src/seam.d.ts
7
+ /**
8
+ * The seam contract: how a block that floats across the join between two
9
+ * bands gets its neighbours to make room.
10
+ *
11
+ * A floating block pulls itself up over the block above and down over the
12
+ * block below with `SEAM_PULL_UP` / `SEAM_PULL_DOWN`, and each neighbour adds
13
+ * the same distance on its own side, so the block sits across the seam
14
+ * without covering copy. `RenderBlocks` decides which rows float (its
15
+ * `floats` prop, defaulting to `overlapsSeam`) and hands every renderer two
16
+ * booleans, `overlapAbove` and `overlapBelow`; a renderer's band wrapper adds
17
+ * `seamClasses(props)` and never looks at a neighbour's row.
18
+ *
19
+ * The four distances are one number in two directions, which is why they all
20
+ * live here: change 16/20 in one place.
21
+ */
22
+ /** How far a floating block pulls itself up over the block above. */
23
+ declare const SEAM_PULL_UP = "-mt-16 lg:-mt-20";
24
+ /** How far a floating block pulls itself down over the block below. */
25
+ declare const SEAM_PULL_DOWN = "-mb-16 lg:-mb-20";
26
+ /** Extra top padding for the block *below* a floating block. */
27
+ declare const OVERLAP_ABOVE_CLEARANCE = "pt-16 lg:pt-20";
28
+ /** Extra bottom padding for the block *above* a floating block. */
29
+ declare const OVERLAP_BELOW_CLEARANCE = "pb-16 lg:pb-20";
30
+ /**
31
+ * The default `floats`: the package's stats band with `overlap` on. A site
32
+ * with its own floating block composes it —
33
+ * `floats={(row) => overlapsSeam(row) || row.blockType === "bookingCard"}`.
34
+ */
35
+ declare function overlapsSeam(block: BlockLike | undefined): boolean;
36
+ /** The clearance a band wrapper needs for its neighbours, as one class string. */
37
+ declare function seamClasses({
38
+ overlapAbove,
39
+ overlapBelow
40
+ }: Pick<BlockRendererProps, "overlapAbove" | "overlapBelow">): string;
41
+ //#endregion
6
42
  //#region src/blocks/hero/component.d.ts
7
43
  /**
8
44
  * The package's hero: deliberately plain.
@@ -14,14 +50,19 @@ import { FloatingNavItem, MegaMenuIcons, MegaMenuPanelData, MegaMenuVariants } f
14
50
  declare function HeroBlockRenderer({
15
51
  block,
16
52
  index,
53
+ overlapAbove,
54
+ overlapBelow,
17
55
  containerClassName,
18
56
  imageComponent: Image,
19
- linkComponent: Link
57
+ linkComponent: Link,
58
+ resolveLink: resolve
20
59
  }: BlockRendererProps<HeroBlockData>): react_jsx_runtime0.JSX.Element;
21
60
  //#endregion
22
61
  //#region src/blocks/showcase-panels/component.d.ts
23
62
  declare function ShowcasePanelsBlockRenderer({
24
63
  block,
64
+ overlapAbove,
65
+ overlapBelow,
25
66
  containerClassName,
26
67
  imageComponent: Image,
27
68
  linkComponent
@@ -30,6 +71,8 @@ declare function ShowcasePanelsBlockRenderer({
30
71
  //#region src/blocks/process-steps/component.d.ts
31
72
  declare function ProcessStepsBlockRenderer({
32
73
  block,
74
+ overlapAbove,
75
+ overlapBelow,
33
76
  containerClassName,
34
77
  imageComponent: Image
35
78
  }: BlockRendererProps<ProcessStepsBlockData>): react_jsx_runtime0.JSX.Element | null;
@@ -37,31 +80,52 @@ declare function ProcessStepsBlockRenderer({
37
80
  //#region src/blocks/faq-columns/component.d.ts
38
81
  declare function FaqColumnsBlockRenderer({
39
82
  block,
83
+ overlapAbove,
84
+ overlapBelow,
40
85
  containerClassName,
41
- linkComponent
86
+ linkComponent,
87
+ resolveLink: resolve
42
88
  }: BlockRendererProps<FaqColumnsBlockData>): react_jsx_runtime0.JSX.Element | null;
43
89
  //#endregion
44
90
  //#region src/blocks/testimonial-masonry/component.d.ts
45
91
  declare function TestimonialMasonryBlockRenderer({
46
92
  block,
93
+ overlapAbove,
94
+ overlapBelow,
47
95
  containerClassName,
48
- linkComponent
96
+ linkComponent,
97
+ resolveLink: resolve
49
98
  }: BlockRendererProps<TestimonialMasonryBlockData>): react_jsx_runtime0.JSX.Element | null;
50
99
  //#endregion
51
100
  //#region src/blocks/nap/component.d.ts
52
101
  declare function NapBlockRenderer({
53
102
  block,
103
+ overlapAbove,
104
+ overlapBelow,
54
105
  containerClassName,
55
106
  linkComponent
56
107
  }: BlockRendererProps<NapBlockData>): react_jsx_runtime0.JSX.Element | null;
57
108
  //#endregion
109
+ //#region src/blocks/stats-band/component.d.ts
110
+ declare function StatsBandBlockRenderer({
111
+ block,
112
+ index,
113
+ isLast,
114
+ overlapAbove,
115
+ overlapBelow,
116
+ containerClassName,
117
+ linkComponent
118
+ }: BlockRendererProps<StatsBandBlockData>): react_jsx_runtime0.JSX.Element | null;
119
+ //#endregion
58
120
  //#region src/blocks/mega-menu/component.d.ts
59
121
  /**
60
122
  * The row as `MegaMenuPanel` data, or `null` when there is nothing to open:
61
123
  * no columns, or columns whose links are not yet complete. Draft saves skip
62
124
  * validation, so a live preview genuinely hands this half-built rows.
125
+ * `resolve` turns each link's page into a path; the package's own is the
126
+ * default.
63
127
  */
64
- declare function megaMenuPanelFromRow(row: MegaMenuBlockData): MegaMenuPanelData | null;
128
+ declare function megaMenuPanelFromRow(row: MegaMenuBlockData, resolve?: ResolveLink): MegaMenuPanelData | null;
65
129
  interface MegaMenuBlockRendererProps extends BlockRendererProps<MegaMenuBlockData> {
66
130
  /** The look behind each `variants` value the site passed to `megaMenuBlock`. */
67
131
  variants?: MegaMenuVariants;
@@ -75,6 +139,7 @@ interface MegaMenuBlockRendererProps extends BlockRendererProps<MegaMenuBlockDat
75
139
  declare function MegaMenuBlockRenderer({
76
140
  block,
77
141
  linkComponent,
142
+ resolveLink: resolve,
78
143
  variants,
79
144
  icons
80
145
  }: MegaMenuBlockRendererProps): react_jsx_runtime0.JSX.Element | null;
@@ -89,6 +154,8 @@ interface HeaderItemsOptions {
89
154
  isActive?: (href: string) => boolean;
90
155
  /** The site's link adapter, applied to every link inside the panels. */
91
156
  linkComponent?: BlockLinkComponent;
157
+ /** The site's resolver for page links; defaults to the package's `resolveLink`. */
158
+ resolveLink?: ResolveLink;
92
159
  }
93
160
  /**
94
161
  * A global's `items` as `FloatingNavBlock` items, so a site's header is one
@@ -97,14 +164,17 @@ interface HeaderItemsOptions {
97
164
  * site added that this package does not know.
98
165
  *
99
166
  * A `navLink` row's `newTab` is not carried: `FloatingNavItem` has no such
100
- * field, because the bar renders its own links.
167
+ * field, because the bar renders its own links. A bar item whose page is
168
+ * missing or unpublished is dropped, like a panel link. A mega menu's own
169
+ * `href` (the trigger's landing page) is plain text, not a picked page.
101
170
  */
102
171
  declare function headerItemsFromBlocks(blocks: HeaderBlockRow[], {
103
172
  variants,
104
173
  icons,
105
174
  isActive,
106
- linkComponent
175
+ linkComponent,
176
+ resolveLink: resolve
107
177
  }?: HeaderItemsOptions): FloatingNavItem[];
108
178
  //#endregion
109
- export { type BlockImageComponent, type BlockImageProps, type BlockLike, type BlockLinkComponent, type BlockLinkProps, type BlockRegistryFor, type BlockRendererProps, DEFAULT_CONTAINER, DefaultBlockImage, DefaultBlockLink, FaqColumnsBlockRenderer, type HeaderBlockRow, type HeaderItemsOptions, HeroBlockRenderer, MegaMenuBlockRenderer, type MegaMenuBlockRendererProps, NapBlockRenderer, ProcessStepsBlockRenderer, RenderBlocks, type RenderBlocksProps, ShowcasePanelsBlockRenderer, TestimonialMasonryBlockRenderer, headerItemsFromBlocks, megaMenuPanelFromRow, newTabAttributes, renderLinkWith };
179
+ export { BLOCK_ID_ATTRIBUTE, type BlockImageComponent, type BlockImageProps, type BlockLike, type BlockLinkComponent, type BlockLinkProps, type BlockRegistryFor, type BlockRendererProps, DEFAULT_CONTAINER, DefaultBlockImage, DefaultBlockLink, FaqColumnsBlockRenderer, type HeaderBlockRow, type HeaderItemsOptions, HeroBlockRenderer, type LinkDestination, type LinkPageDoc, type LinkValue, MegaMenuBlockRenderer, type MegaMenuBlockRendererProps, NapBlockRenderer, OVERLAP_ABOVE_CLEARANCE, OVERLAP_BELOW_CLEARANCE, ProcessStepsBlockRenderer, RenderBlocks, type RenderBlocksProps, type ResolveLink, SEAM_PULL_DOWN, SEAM_PULL_UP, ShowcasePanelsBlockRenderer, StatsBandBlockRenderer, TestimonialMasonryBlockRenderer, headerItemsFromBlocks, linkTypeOf, megaMenuPanelFromRow, newTabAttributes, overlapsSeam, renderLinkWith, resolveLink, seamClasses };
110
180
  //# sourceMappingURL=react.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.mts","names":[],"sources":["../src/blocks/hero/component.tsx","../src/blocks/showcase-panels/component.tsx","../src/blocks/process-steps/component.tsx","../src/blocks/faq-columns/component.tsx","../src/blocks/testimonial-masonry/component.tsx","../src/blocks/nap/component.tsx","../src/blocks/mega-menu/component.tsx","../src/blocks/mega-menu/header.tsx"],"mappings":";;;;;;;;;AAyBA;;;;iBAAgB,iBAAA,CAAA;EACd,KAAA;EACA,KAAA;EACA,kBAAA;EACA,cAAA,EAAgB,KAAA;EAChB,aAAA,EAAe;AAAA,GACd,kBAAA,CAAmB,aAAA,IAAc,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCvBpB,2BAAA,CAAA;EACd,KAAA;EACA,kBAAA;EACA,cAAA,EAAgB,KAAA;EAChB;AAAA,GACC,kBAAA,CAAmB,uBAAA,IAAwB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCN9B,yBAAA,CAAA;EACd,KAAA;EACA,kBAAA;EACA,cAAA,EAAgB;AAAA,GACf,kBAAA,CAAmB,qBAAA,IAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCJ5B,uBAAA,CAAA;EACd,KAAA;EACA,kBAAA;EACA;AAAA,GACC,kBAAA,CAAmB,mBAAA,IAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCH1B,+BAAA,CAAA;EACd,KAAA;EACA,kBAAA;EACA;AAAA,GACC,kBAAA,CAAmB,2BAAA,IAA4B,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCAlC,gBAAA,CAAA;EACd,KAAA;EACA,kBAAA;EACA;AAAA,GACC,kBAAA,CAAmB,YAAA,IAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;ALSnC;;;iBMQgB,oBAAA,CACd,GAAA,EAAK,iBAAA,GACJ,iBAAA;AAAA,UA8Dc,0BAAA,SACP,kBAAA,CAAmB,iBAAA;ENtE3B;EMwEA,QAAA,GAAW,gBAAA;ENtEI;EMwEf,KAAA,GAAQ,aAAA;AAAA;;;;;iBAOM,qBAAA,CAAA;EACd,KAAA;EACA,aAAA;EACA,QAAA;EACA;AAAA,GACC,0BAAA,GAA0B,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;KCrGjB,cAAA,GAAiB,iBAAA,GAAoB,gBAAA;AAAA,UAEhC,kBAAA;EACf,QAAA,GAAW,gBAAA;EACX,KAAA,GAAQ,aAAA;EPSR;EOPA,QAAA,IAAY,IAAA;EPSZ;EOPA,aAAA,GAAgB,kBAAA;AAAA;;;;;;;;;;iBAYF,qBAAA,CACd,MAAA,EAAQ,cAAA;EACN,QAAA;EAAU,KAAA;EAAO,QAAA;EAAU;AAAA,IAAiB,kBAAA,GAC7C,eAAA"}
1
+ {"version":3,"file":"react.d.mts","names":[],"sources":["../src/seam.ts","../src/blocks/hero/component.tsx","../src/blocks/showcase-panels/component.tsx","../src/blocks/process-steps/component.tsx","../src/blocks/faq-columns/component.tsx","../src/blocks/testimonial-masonry/component.tsx","../src/blocks/nap/component.tsx","../src/blocks/stats-band/component.tsx","../src/blocks/mega-menu/component.tsx","../src/blocks/mega-menu/header.tsx"],"mappings":";;;;;;;;;;AAqBA;;;;;AAGA;;;;;AAGA;;cANa,YAAA;;cAGA,cAAA;AAMb;AAAA,cAHa,uBAAA;;cAGA,uBAAA;;AAOb;;;;iBAAgB,YAAA,CAAa,KAAA,EAAO,SAAA;AAQpC;AAAA,iBAAgB,WAAA,CAAA;EACd,YAAA;EACA;AAAA,GACC,IAAA,CAAK,kBAAA;;;;;;AA3BR;;;;iBCKgB,iBAAA,CAAA;EACd,KAAA;EACA,KAAA;EACA,YAAA;EACA,YAAA;EACA,kBAAA;EACA,cAAA,EAAgB,KAAA;EAChB,aAAA,EAAe,IAAA;EACf,WAAA,EAAa;AAAA,GACZ,kBAAA,CAAmB,aAAA,IAAc,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBC1BpB,2BAAA,CAAA;EACd,KAAA;EACA,YAAA;EACA,YAAA;EACA,kBAAA;EACA,cAAA,EAAgB,KAAA;EAChB;AAAA,GACC,kBAAA,CAAmB,uBAAA,IAAwB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBC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