@bison-lab/payload-core 4.10.1 → 4.11.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 +51 -1
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +106 -4
- package/dist/admin.mjs.map +1 -1
- package/dist/block-library.d.mts +2 -0
- package/dist/block-library.mjs +2 -0
- package/dist/catalogue-qKbnBeEY.d.mts +197 -0
- package/dist/catalogue-qKbnBeEY.d.mts.map +1 -0
- package/dist/index.d.mts +5 -101
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +14 -199
- package/dist/index.mjs.map +1 -1
- package/dist/metadata.d.mts +1 -1
- package/dist/navigation.d.mts +1 -1
- package/dist/navigation.mjs +1 -1
- package/dist/{preview-DtBDy2kv.d.mts → preview-BafqwipZ.d.mts} +1 -1
- package/dist/{preview-DtBDy2kv.d.mts.map → preview-BafqwipZ.d.mts.map} +1 -1
- package/dist/{published-y1Nrly7r.d.mts → published-1JRfuEO4.d.mts} +1 -1
- package/dist/{published-y1Nrly7r.d.mts.map → published-1JRfuEO4.d.mts.map} +1 -1
- package/dist/published-BjmUCpdY.mjs +376 -0
- package/dist/published-BjmUCpdY.mjs.map +1 -0
- package/dist/{published-BvTPQqAF.mjs → published-CcW9bqLJ.mjs} +1 -1
- package/dist/{published-BvTPQqAF.mjs.map → published-CcW9bqLJ.mjs.map} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{title-sWwcCqHT.d.mts → title-DjTfxz6F.d.mts} +1 -1
- package/dist/{title-sWwcCqHT.d.mts.map → title-DjTfxz6F.d.mts.map} +1 -1
- package/package.json +6 -2
package/dist/metadata.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-
|
|
1
|
+
import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-DjTfxz6F.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/seo/metadata.d.ts
|
|
4
4
|
/** A page as the reader needs it; a site's generated `Page` is assignable. */
|
package/dist/navigation.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as NAVIGATION_FOOTER_SLUG, D as NavigationFooter, E as NavigationDoc, O as NavigationHeader, S as NAVIGATION_FOOTER_DB_NAME, T as NavigationBar, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, b as NAVIGATION_DB_NAME, c as FooterColumnWidth, d as normalizeFooterDesktop, g as isValidExternalHref, i as FOOTER_MAX_COLUMNS, l as FooterSocial, m as EXTERNAL_HREF_MESSAGE, o as FOOTER_SOCIALS, p as validateFooterSocialUrl, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as footerDesktopTracks, v as validateHeaderCta, w as NAVIGATION_SLUG } from "./published-
|
|
1
|
+
import { C as NAVIGATION_FOOTER_SLUG, D as NavigationFooter, E as NavigationDoc, O as NavigationHeader, S as NAVIGATION_FOOTER_DB_NAME, T as NavigationBar, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, b as NAVIGATION_DB_NAME, c as FooterColumnWidth, d as normalizeFooterDesktop, g as isValidExternalHref, i as FOOTER_MAX_COLUMNS, l as FooterSocial, m as EXTERNAL_HREF_MESSAGE, o as FOOTER_SOCIALS, p as validateFooterSocialUrl, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as footerDesktopTracks, v as validateHeaderCta, w as NAVIGATION_SLUG } from "./published-1JRfuEO4.mjs";
|
|
2
2
|
export { EXTERNAL_HREF_MESSAGE, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, type FooterColumnWidth, type FooterSocial, NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, type NavigationBar, type NavigationDoc, type NavigationFooter, type NavigationHeader, footerDesktopTracks, getNavigation, isValidExternalHref, normalizeFooterDesktop, validateExternalHref, validateFooterSocialUrl, validateHeaderCta };
|
package/dist/navigation.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as NAVIGATION_SLUG, S as NAVIGATION_FOOTER_SLUG, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, c as footerDesktopTracks, f as validateFooterSocialUrl, h as isValidExternalHref, i as FOOTER_MAX_COLUMNS, o as FOOTER_SOCIALS, p as EXTERNAL_HREF_MESSAGE, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as normalizeFooterDesktop, v as validateHeaderCta, x as NAVIGATION_FOOTER_DB_NAME, y as NAVIGATION_DB_NAME } from "./published-
|
|
1
|
+
import { C as NAVIGATION_SLUG, S as NAVIGATION_FOOTER_SLUG, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, c as footerDesktopTracks, f as validateFooterSocialUrl, h as isValidExternalHref, i as FOOTER_MAX_COLUMNS, o as FOOTER_SOCIALS, p as EXTERNAL_HREF_MESSAGE, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as normalizeFooterDesktop, v as validateHeaderCta, x as NAVIGATION_FOOTER_DB_NAME, y as NAVIGATION_DB_NAME } from "./published-CcW9bqLJ.mjs";
|
|
2
2
|
export { EXTERNAL_HREF_MESSAGE, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, footerDesktopTracks, getNavigation, isValidExternalHref, normalizeFooterDesktop, validateExternalHref, validateFooterSocialUrl, validateHeaderCta };
|
|
@@ -349,4 +349,4 @@ declare const THEME_PREVIEW_BREAKPOINTS: readonly [{
|
|
|
349
349
|
}];
|
|
350
350
|
//#endregion
|
|
351
351
|
export { ThemeHeadOptions as A, rewriteColorUsages as B, THEME_COLORS_SLUG as C, ThemeColorDoc as D, THEME_TYPOGRAPHY_SLUG as E, resolveThemeIdentity as F, ColorUsage as I, ColorUsagesList as L, ThemeUploadDoc as M, ResolvedThemeIdentity as N, ThemeDoc as O, ThemeIdentityFallback as P, ColorUsagesOption as R, THEME_APPEARANCE_SLUG as S, THEME_SLUG as T, themeColorKeys as _, pageEditorLooks as a, SYSTEM_COLOR_KEYS as b, LookFieldMode as c, lookField as d, ColorTokenHit as f, rewriteColorToken as g, deleteLibraryColor as h, PageEditorSystemKey as i, ThemeLibraryColorDoc as j, ThemeHead as k, LookFieldOptions as l, rewriteColorTokens as m, LookOption as n, pageEditorTokens as o, findColorTokens as p, PAGE_EDITOR_SYSTEM_KEYS as r, themeLibraryFromDoc as s, THEME_PREVIEW_BREAKPOINTS as t, colorTokenField as u, CreateThemeOptions as v, THEME_IDENTITY_SLUG as w, SystemColorKey as x, EditableTheme as y, findColorUsages as z };
|
|
352
|
-
//# sourceMappingURL=preview-
|
|
352
|
+
//# sourceMappingURL=preview-BafqwipZ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-
|
|
1
|
+
{"version":3,"file":"preview-BafqwipZ.d.mts","names":[],"sources":["../src/theme/color-usages.ts","../src/theme/identity.ts","../src/theme/types.ts","../src/theme/library.ts","../src/theme/color-tokens.ts","../src/theme/look-field.ts","../src/theme/looks.ts","../src/theme/preview.ts"],"mappings":";;;;;UAOiB,eAAA;EACf,WAAA;EACA,OAAA;AAAA;;;;AAQF;;KAAY,iBAAA,UAA2B,eAAA;AAAA,UAEtB,UAAA;EACf,UAAA;EACA,MAAA;EACA,EAAA;EACA,IAAA;EACA,KAAA;AAAA;AAA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AA;EACA,KAAA,GAAQ,WAAA;EACR,QAAA;EACA,KAAA,GAAQ,SAAA;EACR,QAAA,GAAW,yBAAA;AAAA;AAAA,KAGD,aAAA;;;;;ALMZ;;iBKqCgB,SAAA,CAAU,SAAA,GAAW,gBAAA,GAAwB,SAAA;;;;iBAO7C,eAAA,CAAgB,SAAA,GAAW,gBAAA,GAAwB,SAAA;;;;;;;cCtDtD,uBAAA;AAAA,KAED,mBAAA,WAA8B,uBAAA;AAAA,UAEzB,UAAA;EACf,KAAA;EACA,KAAA;AAAA;AAAA,iBAiBc,mBAAA,CAAoB,GAAA,EAAK,QAAA,sBAA8B,oBAAA;;;;ANbvE;;iBMkCgB,eAAA,CAAgB,GAAA,EAAK,QAAA,sBAA8B,UAAA;;;;;iBAmBnD,gBAAA,CAAiB,GAAA,EAAK,QAAA,sBAA8B,UAAA;;;;;;;cCpEvD,yBAAA;EAAA"}
|
|
@@ -134,4 +134,4 @@ declare function getNavigation({
|
|
|
134
134
|
}: GetNavigationArgs): Promise<NavigationDoc>;
|
|
135
135
|
//#endregion
|
|
136
136
|
export { NAVIGATION_FOOTER_SLUG as C, NavigationFooter as D, NavigationDoc as E, NavigationHeader as O, NAVIGATION_FOOTER_DB_NAME as S, NavigationBar as T, validateExternalHref as _, FOOTER_MAX_LINK_COLUMNS as a, NAVIGATION_DB_NAME as b, FooterColumnWidth as c, normalizeFooterDesktop as d, validateFooterColumns as f, isValidExternalHref as g, headerCtaEnabled as h, FOOTER_MAX_COLUMNS as i, FooterSocial as l, EXTERNAL_HREF_MESSAGE as m, FOOTER_COLUMNS_FIELD as n, FOOTER_SOCIALS as o, validateFooterSocialUrl as p, FOOTER_COLUMN_WIDTHS as r, FOOTER_TWELFTHS as s, getNavigation as t, footerDesktopTracks as u, validateHeaderCta as v, NAVIGATION_SLUG as w, NAVIGATION_FEATURE as x, CreateNavigationOptions as y };
|
|
137
|
-
//# sourceMappingURL=published-
|
|
137
|
+
//# sourceMappingURL=published-1JRfuEO4.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"published-
|
|
1
|
+
{"version":3,"file":"published-1JRfuEO4.d.mts","names":[],"sources":["../src/navigation/types.ts","../src/navigation/link.ts","../src/navigation/footer.ts","../src/navigation/published.ts"],"mappings":";;;cAWa,eAAA;AAAA,cACA,kBAAA;AAAA,cACA,sBAAA;AAAA,cACA,yBAAA;AAAA,cAEA,kBAAA;AAAA,UAEI,uBAAA;;;;AAJjB;EASE,MAAA,EAAQ,KAAA;;;;AAPV;EAYE,OAAA,GAAU,WAAA,CAAY,WAAA,CAAY,YAAA;EAClC,WAAA,GAAc,WAAA,CAAY,WAAA,CAAY,YAAA;EAbT;;AAE/B;;EAgBE,aAAA;EAXQ;EAaR,eAAA;EARsB;EAUtB,mBAAA;AAAA;AAAA,UAGe,gBAAA;EACf,KAAA;EACA,GAAA;AAAA;AAAA,UAGe,aAAA;EACf,YAAA;EACA,QAAA;EACA,eAAA;AAAA;AAAA,UAGe,gBAAA;EACf,OAAA;EACA,KAAA;AAAA;AAAA,UAGe,aAAA;EACf,MAAA,EAAQ,gBAAA;EACR,MAAA,EAAQ,gBAAA;EACR,GAAA,EAAK,aAAA;AAAA;AAAA,UAGU,iBAAA;EACf,OAAA;IACE,UAAA,GAAa,IAAA;MACX,IAAA;MACA,KAAA;MACA,cAAA;MACA,KAAA;IAAA,MACI,OAAA;EAAA;EAER,KAAA;AAAA;;;KC9DG,QAAA;AAAA,cAaQ,qBAAA;ADZb;;;;;AAAA,iBCoBgB,mBAAA,CAAoB,KAAA;AAAA,iBAcpB,oBAAA,CAAqB,KAAA,WAAgB,QAAA;AAAA,UAyFpC,cAAA;EACf,OAAA;EACA,IAAA,GAAO,QAAA;EACP,IAAA;EACA,IAAA;EACA,KAAA;AAAA;;iBAIc,gBAAA,CAAiB,GAAA,EAAK,cAAA;;;;;iBAWtB,iBAAA,CAAkB,KAAA;;;;;AD/IlC;;cEHa,oBAAA;AAAA,KACD,iBAAA,WAA4B,oBAAA;;cAG3B,kBAAA;;cAEA,uBAAA;AAAA,cAEA,cAAA;AAAA,KACD,YAAA,WAAuB,cAAA;AFJnC;AAAA,cEea,eAAA,EAAiB,MAAA,CAAO,iBAAA;AAAA,cASxB,oBAAA;;iBA+BG,sBAAA,CAAuB,KAAA,WAAgB,iBAAA;AFtDvD;;;;;AAAA,iBE+DgB,mBAAA,CACd,KAAA,EAAO,iBAAA,qBACP,OAAA,EAAS,KAAA,CAAM,iBAAA;EAEf,YAAA;EACA,aAAA;EACA,aAAA;AAAA;AFjEF;;;;;;AAAA,cE0Fa,qBAAA,EAAuB,oBAAA;AAAA,iBA6CpB,uBAAA,CAAwB,KAAA;;;;;AF9IxC;;;;;iBG4BsB,aAAA,CAAA;EAAgB,OAAA;EAAS;AAAA,GAAiB,iBAAA,GAAoB,OAAA,CAAQ,aAAA"}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
//#region src/block-library/controls.ts
|
|
2
|
+
/**
|
|
3
|
+
* Which of the four section settings a block offers its editors. The
|
|
4
|
+
* settings group on every page block keeps all four fields, so the page
|
|
5
|
+
* schema never moves; a tick off hides the control in the editor and the
|
|
6
|
+
* renderer ignores its stored value (payload-blocks, BIS-138). The choice
|
|
7
|
+
* lives on the Block library row, seeded from the catalogue, so turning
|
|
8
|
+
* one control off for one block is a Save, not a release (BIS-136).
|
|
9
|
+
*/
|
|
10
|
+
const SECTION_CONTROL_KEYS = [
|
|
11
|
+
"background",
|
|
12
|
+
"spacing",
|
|
13
|
+
"anchor",
|
|
14
|
+
"hidden"
|
|
15
|
+
];
|
|
16
|
+
/** The words the settings fold uses, so the ticks read as the controls they hide. */
|
|
17
|
+
const SECTION_CONTROL_LABELS = {
|
|
18
|
+
background: "Background",
|
|
19
|
+
spacing: "Spacing",
|
|
20
|
+
anchor: "Anchor",
|
|
21
|
+
hidden: "Hidden"
|
|
22
|
+
};
|
|
23
|
+
/** A section: every control. Also what a slug no catalogue knows gets. */
|
|
24
|
+
const DEFAULT_SECTION_CONTROLS = {
|
|
25
|
+
background: true,
|
|
26
|
+
spacing: true,
|
|
27
|
+
anchor: true,
|
|
28
|
+
hidden: true
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A hero: Anchor only. Background would compete with the hero's own tone,
|
|
32
|
+
* Spacing is header clearance the editor should not change, and a hidden
|
|
33
|
+
* hero is a published page with no opening.
|
|
34
|
+
*/
|
|
35
|
+
const HERO_SECTION_CONTROLS = {
|
|
36
|
+
background: false,
|
|
37
|
+
spacing: false,
|
|
38
|
+
anchor: true,
|
|
39
|
+
hidden: false
|
|
40
|
+
};
|
|
41
|
+
/** A navbar is not a section; the ticks do not render on its card. */
|
|
42
|
+
const NO_SECTION_CONTROLS = {
|
|
43
|
+
background: false,
|
|
44
|
+
spacing: false,
|
|
45
|
+
anchor: false,
|
|
46
|
+
hidden: false
|
|
47
|
+
};
|
|
48
|
+
function defaultSectionControls(kind) {
|
|
49
|
+
if (kind === "hero") return { ...HERO_SECTION_CONTROLS };
|
|
50
|
+
if (kind === "navbar") return { ...NO_SECTION_CONTROLS };
|
|
51
|
+
return { ...DEFAULT_SECTION_CONTROLS };
|
|
52
|
+
}
|
|
53
|
+
/** The entry's kind, from `kind` or else its category. */
|
|
54
|
+
function kindOf(entry) {
|
|
55
|
+
return entry.kind ?? (entry.category === "hero" ? "hero" : entry.category === "navigation" ? "navbar" : "section");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reads four booleans off a stored or partial value, taking `fallback` for
|
|
59
|
+
* any key that is absent or not a boolean. A row saved before the columns
|
|
60
|
+
* existed, or an entry that names only one key, resolves this way.
|
|
61
|
+
*/
|
|
62
|
+
function sectionControlsOf(value, fallback) {
|
|
63
|
+
const source = value && typeof value === "object" ? value : {};
|
|
64
|
+
const out = { ...fallback };
|
|
65
|
+
for (const key of SECTION_CONTROL_KEYS) if (typeof source[key] === "boolean") out[key] = source[key];
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
/** The catalogue default for one entry: its own `sectionControls` over the kind's. */
|
|
69
|
+
function entrySectionControls(entry) {
|
|
70
|
+
return sectionControlsOf(entry.sectionControls, defaultSectionControls(kindOf(entry)));
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/block-library/types.ts
|
|
74
|
+
const BLOCK_LIBRARY_SLUG = "block-library";
|
|
75
|
+
const BLOCK_LIBRARY_CATEGORIES = [
|
|
76
|
+
{
|
|
77
|
+
id: "hero",
|
|
78
|
+
label: "Hero"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "feature",
|
|
82
|
+
label: "Feature"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "process",
|
|
86
|
+
label: "Process"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "faq",
|
|
90
|
+
label: "FAQ"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "testimonials",
|
|
94
|
+
label: "Testimonials"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "stats",
|
|
98
|
+
label: "Stats"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "content",
|
|
102
|
+
label: "Content"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "contact",
|
|
106
|
+
label: "Contact"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "cta",
|
|
110
|
+
label: "CTA"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "navigation",
|
|
114
|
+
label: "Navigation"
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
/**
|
|
118
|
+
* Package catalogue. `megaMenu` and `navLink` are header item blocks, not
|
|
119
|
+
* cards. Navigation's card is `floatingNav`. CTA is a category for a site
|
|
120
|
+
* extra; the package ships no CTA slug. The preview route is SPI-53.
|
|
121
|
+
*/
|
|
122
|
+
const PACKAGE_BLOCK_SLUGS = [
|
|
123
|
+
"hero",
|
|
124
|
+
"heroSweep",
|
|
125
|
+
"heroCompact",
|
|
126
|
+
"showcasePanels",
|
|
127
|
+
"processSteps",
|
|
128
|
+
"faqColumns",
|
|
129
|
+
"testimonialMasonry",
|
|
130
|
+
"statsBand",
|
|
131
|
+
"richText",
|
|
132
|
+
"nap",
|
|
133
|
+
"floatingNav"
|
|
134
|
+
];
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/block-library/catalogue.ts
|
|
137
|
+
const NOT_CATALOGUE = new Set(["megaMenu", "navLink"]);
|
|
138
|
+
/**
|
|
139
|
+
* Section controls are written out per entry so the defaults are read here,
|
|
140
|
+
* not inferred: heroes Anchor only, sections all four, the navbar none.
|
|
141
|
+
*/
|
|
142
|
+
const PACKAGE_BLOCKS = [
|
|
143
|
+
{
|
|
144
|
+
slug: "hero",
|
|
145
|
+
label: "Hero",
|
|
146
|
+
category: "hero",
|
|
147
|
+
kind: "hero",
|
|
148
|
+
sectionControls: HERO_SECTION_CONTROLS
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
slug: "heroSweep",
|
|
152
|
+
label: "Sweep hero",
|
|
153
|
+
category: "hero",
|
|
154
|
+
kind: "hero",
|
|
155
|
+
sectionControls: HERO_SECTION_CONTROLS
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
slug: "heroCompact",
|
|
159
|
+
label: "Compact hero",
|
|
160
|
+
category: "hero",
|
|
161
|
+
kind: "hero",
|
|
162
|
+
sectionControls: HERO_SECTION_CONTROLS
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
slug: "showcasePanels",
|
|
166
|
+
label: "Showcase panels",
|
|
167
|
+
category: "feature",
|
|
168
|
+
kind: "section",
|
|
169
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
slug: "processSteps",
|
|
173
|
+
label: "Process steps",
|
|
174
|
+
category: "process",
|
|
175
|
+
kind: "section",
|
|
176
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
slug: "faqColumns",
|
|
180
|
+
label: "FAQ",
|
|
181
|
+
category: "faq",
|
|
182
|
+
kind: "section",
|
|
183
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
slug: "testimonialMasonry",
|
|
187
|
+
label: "Testimonials",
|
|
188
|
+
category: "testimonials",
|
|
189
|
+
kind: "section",
|
|
190
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
slug: "statsBand",
|
|
194
|
+
label: "Stats",
|
|
195
|
+
category: "stats",
|
|
196
|
+
kind: "section",
|
|
197
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
slug: "richText",
|
|
201
|
+
label: "Rich text",
|
|
202
|
+
category: "content",
|
|
203
|
+
kind: "section",
|
|
204
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
slug: "nap",
|
|
208
|
+
label: "Contact",
|
|
209
|
+
category: "contact",
|
|
210
|
+
kind: "section",
|
|
211
|
+
sectionControls: DEFAULT_SECTION_CONTROLS
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
slug: "floatingNav",
|
|
215
|
+
label: "Floating navbar",
|
|
216
|
+
category: "navigation",
|
|
217
|
+
kind: "navbar",
|
|
218
|
+
supportsMega: true,
|
|
219
|
+
sectionControls: NO_SECTION_CONTROLS
|
|
220
|
+
}
|
|
221
|
+
];
|
|
222
|
+
function blockLibraryCatalogue(extras = []) {
|
|
223
|
+
const extra = extras.filter((entry) => !NOT_CATALOGUE.has(entry.slug));
|
|
224
|
+
return [...PACKAGE_BLOCKS.map((entry) => ({
|
|
225
|
+
...entry,
|
|
226
|
+
sectionControls: { ...entry.sectionControls }
|
|
227
|
+
})), ...extra];
|
|
228
|
+
}
|
|
229
|
+
function defaultBlockLibraryValue(options) {
|
|
230
|
+
return blockLibraryCatalogue(options.blocks).map((entry) => toRow(entry, true));
|
|
231
|
+
}
|
|
232
|
+
function toRow(entry, enabled = true, sectionControls) {
|
|
233
|
+
return {
|
|
234
|
+
id: entry.slug,
|
|
235
|
+
slug: entry.slug,
|
|
236
|
+
label: entry.label,
|
|
237
|
+
category: entry.category,
|
|
238
|
+
enabled,
|
|
239
|
+
kind: kindOf(entry),
|
|
240
|
+
sectionControls: sectionControls ?? entrySectionControls(entry)
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The stored rows, one per catalogue entry in catalogue order. A stored
|
|
245
|
+
* `enabled` and each stored tick are kept; anything else (a row that is
|
|
246
|
+
* not there, a column that did not exist when it was saved) takes the
|
|
247
|
+
* entry's default. A block that arrives in a later release gets its
|
|
248
|
+
* catalogue default this way, without a migration beyond the new columns.
|
|
249
|
+
*/
|
|
250
|
+
function stampBlockLibrary(value, options) {
|
|
251
|
+
const catalogue = blockLibraryCatalogue(options.blocks);
|
|
252
|
+
const incoming = /* @__PURE__ */ new Map();
|
|
253
|
+
if (Array.isArray(value)) for (const item of value) {
|
|
254
|
+
if (!item || typeof item !== "object" || !("slug" in item)) continue;
|
|
255
|
+
const slug = item.slug;
|
|
256
|
+
if (typeof slug !== "string" || NOT_CATALOGUE.has(slug)) continue;
|
|
257
|
+
if (!catalogue.some((entry) => entry.slug === slug)) continue;
|
|
258
|
+
const row = item;
|
|
259
|
+
incoming.set(slug, {
|
|
260
|
+
enabled: typeof row.enabled === "boolean" ? row.enabled : void 0,
|
|
261
|
+
sectionControls: row.sectionControls
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return catalogue.map((entry) => {
|
|
265
|
+
const stored = incoming.get(entry.slug);
|
|
266
|
+
return toRow(entry, stored?.enabled ?? true, sectionControlsOf(stored?.sectionControls, entrySectionControls(entry)));
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function isKind(value) {
|
|
270
|
+
return value === "hero" || value === "section" || value === "navbar";
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Every slug to the controls its row offers: the stored ticks when the
|
|
274
|
+
* document holds the row, else the catalogue default. A stored row is kept
|
|
275
|
+
* whether or not its slug is in the catalogue, so a site extra's saved
|
|
276
|
+
* ticks are read without the site passing its `blocks` here (its stored
|
|
277
|
+
* `kind` fills a key the row lacks). `extras` adds the catalogue default
|
|
278
|
+
* for a site extra the document does not hold yet; `getSectionControls`
|
|
279
|
+
* reads them off the Global's config. A slug in neither is absent from the
|
|
280
|
+
* map, and a consumer treats that as every control
|
|
281
|
+
* (`DEFAULT_SECTION_CONTROLS`). A disabled block keeps its ticks.
|
|
282
|
+
*/
|
|
283
|
+
function sectionControlsFromLibrary(doc, extras = []) {
|
|
284
|
+
const rows = stampBlockLibrary(doc?.blocks, {
|
|
285
|
+
blocks: extras,
|
|
286
|
+
previewPath: () => ""
|
|
287
|
+
});
|
|
288
|
+
const map = Object.fromEntries(rows.map((row) => [row.slug, row.sectionControls]));
|
|
289
|
+
const stored = Array.isArray(doc?.blocks) ? doc.blocks : [];
|
|
290
|
+
for (const item of stored) {
|
|
291
|
+
if (!item || typeof item !== "object") continue;
|
|
292
|
+
const row = item;
|
|
293
|
+
if (typeof row.slug !== "string" || !row.slug || NOT_CATALOGUE.has(row.slug) || row.slug in map) continue;
|
|
294
|
+
map[row.slug] = sectionControlsOf(row.sectionControls, defaultSectionControls(isKind(row.kind) ? row.kind : "section"));
|
|
295
|
+
}
|
|
296
|
+
return map;
|
|
297
|
+
}
|
|
298
|
+
function enabledOf(rows, kind) {
|
|
299
|
+
return rows.filter((row) => row.kind === kind && row.enabled).length;
|
|
300
|
+
}
|
|
301
|
+
function holderLabel(holder) {
|
|
302
|
+
const title = holder.title?.trim() || "Untitled";
|
|
303
|
+
const slug = holder.slug?.trim();
|
|
304
|
+
return slug ? `${title} (${slug})` : title;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Refuses Hidden on a hero row (a page cannot publish without its hero),
|
|
308
|
+
* then a disable: the last hero, the last navbar, or a slug a published
|
|
309
|
+
* document holds. Drafts alone never refuse; the Save that turns the slug
|
|
310
|
+
* off strips them (`stripDrafts`). Pure — writes nothing.
|
|
311
|
+
*/
|
|
312
|
+
async function validateBlockLibrary(value, options, check = {}) {
|
|
313
|
+
const next = stampBlockLibrary(value, options);
|
|
314
|
+
const hiddenHero = next.find((row) => row.kind === "hero" && row.sectionControls.hidden);
|
|
315
|
+
if (hiddenHero) return `${hiddenHero.label} cannot offer Hidden: a page cannot publish without its hero.`;
|
|
316
|
+
const previous = check.originals ?? defaultBlockLibraryValue(options);
|
|
317
|
+
const turningOff = next.filter((row) => {
|
|
318
|
+
return previous.find((entry) => entry.slug === row.slug)?.enabled !== false && row.enabled === false;
|
|
319
|
+
});
|
|
320
|
+
if (turningOff.length === 0) return true;
|
|
321
|
+
if (turningOff.some((row) => row.kind === "hero") && enabledOf(next, "hero") === 0) return "Cannot disable the last hero.";
|
|
322
|
+
if (turningOff.some((row) => row.kind === "navbar") && enabledOf(next, "navbar") === 0) return "Cannot disable the last navbar.";
|
|
323
|
+
const holders = check.holders ?? [];
|
|
324
|
+
if (holders.length > 0) {
|
|
325
|
+
const names = holders.map(holderLabel).join(", ");
|
|
326
|
+
const slugs = turningOff.map((row) => row.label).join(", ");
|
|
327
|
+
const drafts = check.drafts ?? [];
|
|
328
|
+
return `Cannot disable ${slugs}. Still published on: ${names}. Remove it from those first.${drafts.length > 0 ? ` Drafts also use it and were left as they are: ${drafts.map(holderLabel).join(", ")}.` : ""}`;
|
|
329
|
+
}
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/block-library/published.ts
|
|
334
|
+
const PACKAGE_SLUGS = new Set(PACKAGE_BLOCK_SLUGS);
|
|
335
|
+
/**
|
|
336
|
+
* A site's own Block library entries, read back off the registered Global:
|
|
337
|
+
* `createBlockLibrary` keeps the rows it seeded (package and extras) on the
|
|
338
|
+
* `blocks` field's `admin.custom.rows`, so a site block's catalogue default
|
|
339
|
+
* is known here without the site passing `blocks` a second time. Package
|
|
340
|
+
* slugs are left out; the catalogue already has them.
|
|
341
|
+
*/
|
|
342
|
+
function blockLibraryEntriesFromConfig(payload) {
|
|
343
|
+
const rows = ((Array.isArray(payload.config?.globals) ? payload.config.globals : []).find((global) => typeof global === "object" && global !== null && global.slug === "block-library")?.fields ?? []).find((field) => typeof field === "object" && field !== null && field.name === "blocks")?.admin?.custom?.rows;
|
|
344
|
+
if (!Array.isArray(rows)) return [];
|
|
345
|
+
return rows.flatMap((row) => {
|
|
346
|
+
if (!row || typeof row !== "object") return [];
|
|
347
|
+
const { slug, label, category, kind, sectionControls } = row;
|
|
348
|
+
if (typeof slug !== "string" || !slug || PACKAGE_SLUGS.has(slug)) return [];
|
|
349
|
+
return [{
|
|
350
|
+
slug,
|
|
351
|
+
label: typeof label === "string" ? label : slug,
|
|
352
|
+
category: typeof category === "string" ? category : "content",
|
|
353
|
+
...kind === "hero" || kind === "section" || kind === "navbar" ? { kind } : {},
|
|
354
|
+
...sectionControls && typeof sectionControls === "object" ? { sectionControls } : {}
|
|
355
|
+
}];
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* The Block library's section controls at request time, for a page route
|
|
360
|
+
* to hand `RenderBlocks` as `sectionControls`. Access is overridden: the
|
|
361
|
+
* Global is read by editors, and the page is read by everyone. A site
|
|
362
|
+
* extra's stored ticks are kept, and one the document does not hold yet
|
|
363
|
+
* takes its catalogue default from the Global's config; pass `extras` only
|
|
364
|
+
* to add entries the config does not know.
|
|
365
|
+
*/
|
|
366
|
+
async function getSectionControls(payload, extras = blockLibraryEntriesFromConfig(payload)) {
|
|
367
|
+
return sectionControlsFromLibrary(await payload.findGlobal({
|
|
368
|
+
slug: BLOCK_LIBRARY_SLUG,
|
|
369
|
+
depth: 0,
|
|
370
|
+
overrideAccess: true
|
|
371
|
+
}), extras);
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
export { sectionControlsOf as _, sectionControlsFromLibrary as a, BLOCK_LIBRARY_CATEGORIES as c, DEFAULT_SECTION_CONTROLS as d, HERO_SECTION_CONTROLS as f, defaultSectionControls as g, SECTION_CONTROL_LABELS as h, defaultBlockLibraryValue as i, BLOCK_LIBRARY_SLUG as l, SECTION_CONTROL_KEYS as m, getSectionControls as n, stampBlockLibrary as o, NO_SECTION_CONTROLS as p, blockLibraryCatalogue as r, validateBlockLibrary as s, blockLibraryEntriesFromConfig as t, PACKAGE_BLOCK_SLUGS as u };
|
|
375
|
+
|
|
376
|
+
//# sourceMappingURL=published-BjmUCpdY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"published-BjmUCpdY.mjs","names":[],"sources":["../src/block-library/controls.ts","../src/block-library/types.ts","../src/block-library/catalogue.ts","../src/block-library/published.ts"],"sourcesContent":["import type { BlockLibraryEntry, BlockLibraryKind } from \"./types\";\n\n/**\n * Which of the four section settings a block offers its editors. The\n * settings group on every page block keeps all four fields, so the page\n * schema never moves; a tick off hides the control in the editor and the\n * renderer ignores its stored value (payload-blocks, BIS-138). The choice\n * lives on the Block library row, seeded from the catalogue, so turning\n * one control off for one block is a Save, not a release (BIS-136).\n */\nexport const SECTION_CONTROL_KEYS = [\"background\", \"spacing\", \"anchor\", \"hidden\"] as const;\n\nexport type SectionControlKey = (typeof SECTION_CONTROL_KEYS)[number];\n\nexport type SectionControls = Record<SectionControlKey, boolean>;\n\n/** The words the settings fold uses, so the ticks read as the controls they hide. */\nexport const SECTION_CONTROL_LABELS: Record<SectionControlKey, string> = {\n background: \"Background\",\n spacing: \"Spacing\",\n anchor: \"Anchor\",\n hidden: \"Hidden\",\n};\n\n/** A section: every control. Also what a slug no catalogue knows gets. */\nexport const DEFAULT_SECTION_CONTROLS: SectionControls = {\n background: true,\n spacing: true,\n anchor: true,\n hidden: true,\n};\n\n/**\n * A hero: Anchor only. Background would compete with the hero's own tone,\n * Spacing is header clearance the editor should not change, and a hidden\n * hero is a published page with no opening.\n */\nexport const HERO_SECTION_CONTROLS: SectionControls = {\n background: false,\n spacing: false,\n anchor: true,\n hidden: false,\n};\n\n/** A navbar is not a section; the ticks do not render on its card. */\nexport const NO_SECTION_CONTROLS: SectionControls = {\n background: false,\n spacing: false,\n anchor: false,\n hidden: false,\n};\n\nexport function defaultSectionControls(kind: BlockLibraryKind): SectionControls {\n if (kind === \"hero\") return { ...HERO_SECTION_CONTROLS };\n if (kind === \"navbar\") return { ...NO_SECTION_CONTROLS };\n return { ...DEFAULT_SECTION_CONTROLS };\n}\n\n/** The entry's kind, from `kind` or else its category. */\nexport function kindOf(entry: Pick<BlockLibraryEntry, \"kind\" | \"category\">): BlockLibraryKind {\n return entry.kind ?? (entry.category === \"hero\" ? \"hero\" : entry.category === \"navigation\" ? \"navbar\" : \"section\");\n}\n\n/**\n * Reads four booleans off a stored or partial value, taking `fallback` for\n * any key that is absent or not a boolean. A row saved before the columns\n * existed, or an entry that names only one key, resolves this way.\n */\nexport function sectionControlsOf(value: unknown, fallback: SectionControls): SectionControls {\n const source = value && typeof value === \"object\" ? (value as Record<string, unknown>) : {};\n const out = { ...fallback };\n for (const key of SECTION_CONTROL_KEYS) {\n if (typeof source[key] === \"boolean\") out[key] = source[key] as boolean;\n }\n return out;\n}\n\n/** The catalogue default for one entry: its own `sectionControls` over the kind's. */\nexport function entrySectionControls(entry: BlockLibraryEntry): SectionControls {\n return sectionControlsOf(entry.sectionControls, defaultSectionControls(kindOf(entry)));\n}\n","import type { SectionControls } from \"./controls\";\n\nexport const BLOCK_LIBRARY_SLUG = \"block-library\";\n\nexport const BLOCK_LIBRARY_CATEGORIES = [\n { id: \"hero\", label: \"Hero\" },\n { id: \"feature\", label: \"Feature\" },\n { id: \"process\", label: \"Process\" },\n { id: \"faq\", label: \"FAQ\" },\n { id: \"testimonials\", label: \"Testimonials\" },\n { id: \"stats\", label: \"Stats\" },\n { id: \"content\", label: \"Content\" },\n { id: \"contact\", label: \"Contact\" },\n { id: \"cta\", label: \"CTA\" },\n { id: \"navigation\", label: \"Navigation\" },\n] as const;\n\nexport type BlockLibraryCategoryId = (typeof BLOCK_LIBRARY_CATEGORIES)[number][\"id\"];\n\nexport type BlockLibraryKind = \"hero\" | \"section\" | \"navbar\";\n\n/**\n * Package catalogue. `megaMenu` and `navLink` are header item blocks, not\n * cards. Navigation's card is `floatingNav`. CTA is a category for a site\n * extra; the package ships no CTA slug. The preview route is SPI-53.\n */\nexport const PACKAGE_BLOCK_SLUGS = [\n \"hero\",\n \"heroSweep\",\n \"heroCompact\",\n \"showcasePanels\",\n \"processSteps\",\n \"faqColumns\",\n \"testimonialMasonry\",\n \"statsBand\",\n \"richText\",\n \"nap\",\n \"floatingNav\",\n] as const;\n\nexport type PackageBlockSlug = (typeof PACKAGE_BLOCK_SLUGS)[number];\n\nexport interface BlockLibraryEntry {\n slug: string;\n label: string;\n category: string;\n /** Defaults from the category: hero, navbar for navigation, otherwise section. */\n kind?: BlockLibraryKind;\n supportsMega?: boolean;\n sample?: unknown;\n /**\n * Which section settings the block offers, as the catalogue default its\n * row is seeded with. A key left out follows `kind`: a hero offers\n * Anchor only, a section all four, a navbar none. The row is what an\n * Admin then edits; this is only where it starts.\n */\n sectionControls?: Partial<SectionControls>;\n}\n\nexport interface BlockLibraryRow {\n id: string;\n slug: string;\n label: string;\n category: string;\n enabled: boolean;\n kind: BlockLibraryKind;\n /** Four checkboxes beside Enabled. Hidden stays off on a hero row. */\n sectionControls: SectionControls;\n}\n\n/** The Block library Global as `findGlobal` returns it; rows are read loosely. */\nexport interface BlockLibraryDoc {\n blocks?: unknown;\n}\n\nexport interface BlockLibraryHolder {\n title?: string | null;\n slug?: string | null;\n}\n\n/** A draft that still holds a slug: a collection document or a Global. */\nexport interface BlockLibraryDraftHolder extends BlockLibraryHolder {\n collection?: string;\n id?: string | number;\n global?: string;\n}\n\n/** Where a slug is used. `published` refuses a disable; `drafts` are stripped. */\nexport interface BlockLibraryUsage {\n published: BlockLibraryHolder[];\n drafts: BlockLibraryDraftHolder[];\n}\n","import {\n DEFAULT_SECTION_CONTROLS,\n defaultSectionControls,\n entrySectionControls,\n HERO_SECTION_CONTROLS,\n kindOf,\n NO_SECTION_CONTROLS,\n sectionControlsOf,\n type SectionControls,\n} from \"./controls\";\nimport type {\n BlockLibraryDoc,\n BlockLibraryEntry,\n BlockLibraryHolder,\n BlockLibraryKind,\n BlockLibraryRow,\n} from \"./types\";\nimport { PACKAGE_BLOCK_SLUGS } from \"./types\";\n\nconst NOT_CATALOGUE = new Set([\"megaMenu\", \"navLink\"]);\n\n/**\n * Section controls are written out per entry so the defaults are read here,\n * not inferred: heroes Anchor only, sections all four, the navbar none.\n */\nconst PACKAGE_BLOCKS: readonly BlockLibraryEntry[] = [\n { slug: \"hero\", label: \"Hero\", category: \"hero\", kind: \"hero\", sectionControls: HERO_SECTION_CONTROLS },\n { slug: \"heroSweep\", label: \"Sweep hero\", category: \"hero\", kind: \"hero\", sectionControls: HERO_SECTION_CONTROLS },\n { slug: \"heroCompact\", label: \"Compact hero\", category: \"hero\", kind: \"hero\", sectionControls: HERO_SECTION_CONTROLS },\n { slug: \"showcasePanels\", label: \"Showcase panels\", category: \"feature\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"processSteps\", label: \"Process steps\", category: \"process\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"faqColumns\", label: \"FAQ\", category: \"faq\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"testimonialMasonry\", label: \"Testimonials\", category: \"testimonials\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"statsBand\", label: \"Stats\", category: \"stats\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"richText\", label: \"Rich text\", category: \"content\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"nap\", label: \"Contact\", category: \"contact\", kind: \"section\", sectionControls: DEFAULT_SECTION_CONTROLS },\n { slug: \"floatingNav\", label: \"Floating navbar\", category: \"navigation\", kind: \"navbar\", supportsMega: true, sectionControls: NO_SECTION_CONTROLS },\n];\n\nexport interface BlockLibraryOptions {\n blocks?: readonly BlockLibraryEntry[];\n previewPath: (slug: string) => string;\n}\n\nexport interface BlockLibraryCheck {\n originals?: readonly BlockLibraryRow[];\n /** Published documents that hold a slug being turned off. Any refuses. */\n holders?: readonly BlockLibraryHolder[];\n /** Drafts that hold it. Named in a refusal; never a reason to refuse. */\n drafts?: readonly BlockLibraryHolder[];\n pages?: unknown[];\n}\n\nexport function blockLibraryCatalogue(extras: readonly BlockLibraryEntry[] = []): BlockLibraryEntry[] {\n const extra = extras.filter((entry) => !NOT_CATALOGUE.has(entry.slug));\n return [\n ...PACKAGE_BLOCKS.map((entry) => ({ ...entry, sectionControls: { ...entry.sectionControls } })),\n ...extra,\n ];\n}\n\nexport function defaultBlockLibraryValue(options: BlockLibraryOptions): BlockLibraryRow[] {\n return blockLibraryCatalogue(options.blocks).map((entry) => toRow(entry, true));\n}\n\nfunction toRow(entry: BlockLibraryEntry, enabled = true, sectionControls?: SectionControls): BlockLibraryRow {\n return {\n id: entry.slug,\n slug: entry.slug,\n label: entry.label,\n category: entry.category,\n enabled,\n kind: kindOf(entry),\n sectionControls: sectionControls ?? entrySectionControls(entry),\n };\n}\n\n/**\n * The stored rows, one per catalogue entry in catalogue order. A stored\n * `enabled` and each stored tick are kept; anything else (a row that is\n * not there, a column that did not exist when it was saved) takes the\n * entry's default. A block that arrives in a later release gets its\n * catalogue default this way, without a migration beyond the new columns.\n */\nexport function stampBlockLibrary(value: unknown, options: BlockLibraryOptions): BlockLibraryRow[] {\n const catalogue = blockLibraryCatalogue(options.blocks);\n const incoming = new Map<string, { enabled?: boolean; sectionControls?: unknown }>();\n if (Array.isArray(value)) {\n for (const item of value) {\n if (!item || typeof item !== \"object\" || !(\"slug\" in item)) continue;\n const slug = item.slug;\n if (typeof slug !== \"string\" || NOT_CATALOGUE.has(slug)) continue;\n if (!catalogue.some((entry) => entry.slug === slug)) continue;\n const row = item as { enabled?: unknown; sectionControls?: unknown };\n incoming.set(slug, {\n enabled: typeof row.enabled === \"boolean\" ? row.enabled : undefined,\n sectionControls: row.sectionControls,\n });\n }\n }\n return catalogue.map((entry) => {\n const stored = incoming.get(entry.slug);\n return toRow(\n entry,\n stored?.enabled ?? true,\n sectionControlsOf(stored?.sectionControls, entrySectionControls(entry)),\n );\n });\n}\n\nfunction isKind(value: unknown): value is BlockLibraryKind {\n return value === \"hero\" || value === \"section\" || value === \"navbar\";\n}\n\n/**\n * Every slug to the controls its row offers: the stored ticks when the\n * document holds the row, else the catalogue default. A stored row is kept\n * whether or not its slug is in the catalogue, so a site extra's saved\n * ticks are read without the site passing its `blocks` here (its stored\n * `kind` fills a key the row lacks). `extras` adds the catalogue default\n * for a site extra the document does not hold yet; `getSectionControls`\n * reads them off the Global's config. A slug in neither is absent from the\n * map, and a consumer treats that as every control\n * (`DEFAULT_SECTION_CONTROLS`). A disabled block keeps its ticks.\n */\nexport function sectionControlsFromLibrary(\n doc: BlockLibraryDoc | null | undefined,\n extras: readonly BlockLibraryEntry[] = [],\n): Record<string, SectionControls> {\n const rows = stampBlockLibrary(doc?.blocks, { blocks: extras, previewPath: () => \"\" });\n const map = Object.fromEntries(rows.map((row) => [row.slug, row.sectionControls]));\n const stored = Array.isArray(doc?.blocks) ? doc.blocks : [];\n for (const item of stored) {\n if (!item || typeof item !== \"object\") continue;\n const row = item as { slug?: unknown; kind?: unknown; sectionControls?: unknown };\n if (typeof row.slug !== \"string\" || !row.slug || NOT_CATALOGUE.has(row.slug) || row.slug in map) continue;\n map[row.slug] = sectionControlsOf(\n row.sectionControls,\n defaultSectionControls(isKind(row.kind) ? row.kind : \"section\"),\n );\n }\n return map;\n}\n\nfunction enabledOf(rows: readonly BlockLibraryRow[], kind: BlockLibraryKind): number {\n return rows.filter((row) => row.kind === kind && row.enabled).length;\n}\n\nfunction holderLabel(holder: BlockLibraryHolder): string {\n const title = holder.title?.trim() || \"Untitled\";\n const slug = holder.slug?.trim();\n return slug ? `${title} (${slug})` : title;\n}\n\n/**\n * Refuses Hidden on a hero row (a page cannot publish without its hero),\n * then a disable: the last hero, the last navbar, or a slug a published\n * document holds. Drafts alone never refuse; the Save that turns the slug\n * off strips them (`stripDrafts`). Pure — writes nothing.\n */\nexport async function validateBlockLibrary(\n value: unknown,\n options: BlockLibraryOptions,\n check: BlockLibraryCheck = {},\n): Promise<true | string> {\n const next = stampBlockLibrary(value, options);\n const hiddenHero = next.find((row) => row.kind === \"hero\" && row.sectionControls.hidden);\n if (hiddenHero) {\n return `${hiddenHero.label} cannot offer Hidden: a page cannot publish without its hero.`;\n }\n\n const previous = check.originals ?? defaultBlockLibraryValue(options);\n const turningOff = next.filter((row) => {\n const before = previous.find((entry) => entry.slug === row.slug);\n return before?.enabled !== false && row.enabled === false;\n });\n if (turningOff.length === 0) return true;\n\n if (turningOff.some((row) => row.kind === \"hero\") && enabledOf(next, \"hero\") === 0) {\n return \"Cannot disable the last hero.\";\n }\n if (turningOff.some((row) => row.kind === \"navbar\") && enabledOf(next, \"navbar\") === 0) {\n return \"Cannot disable the last navbar.\";\n }\n\n const holders = check.holders ?? [];\n if (holders.length > 0) {\n const names = holders.map(holderLabel).join(\", \");\n const slugs = turningOff.map((row) => row.label).join(\", \");\n const drafts = check.drafts ?? [];\n const draftNote =\n drafts.length > 0 ? ` Drafts also use it and were left as they are: ${drafts.map(holderLabel).join(\", \")}.` : \"\";\n return `Cannot disable ${slugs}. Still published on: ${names}. Remove it from those first.${draftNote}`;\n }\n\n return true;\n}\n\nexport function packageBlockSlugs(): readonly string[] {\n return PACKAGE_BLOCK_SLUGS;\n}\n","import type { Payload } from \"payload\";\n\nimport { sectionControlsFromLibrary } from \"./catalogue\";\nimport type { SectionControls } from \"./controls\";\nimport { BLOCK_LIBRARY_SLUG, PACKAGE_BLOCK_SLUGS, type BlockLibraryDoc, type BlockLibraryEntry } from \"./types\";\n\n/** The slice of `Payload` these readers need, so a test can pass a stub. */\nexport interface BlockLibraryReader {\n findGlobal: (args: { slug: string; depth: number; overrideAccess: boolean }) => Promise<unknown>;\n config?: { globals?: unknown };\n}\n\nconst PACKAGE_SLUGS = new Set<string>(PACKAGE_BLOCK_SLUGS);\n\n/**\n * A site's own Block library entries, read back off the registered Global:\n * `createBlockLibrary` keeps the rows it seeded (package and extras) on the\n * `blocks` field's `admin.custom.rows`, so a site block's catalogue default\n * is known here without the site passing `blocks` a second time. Package\n * slugs are left out; the catalogue already has them.\n */\nexport function blockLibraryEntriesFromConfig(payload: Pick<BlockLibraryReader, \"config\">): BlockLibraryEntry[] {\n const globals = Array.isArray(payload.config?.globals) ? payload.config.globals : [];\n const library = globals.find(\n (global): global is { slug: string; fields?: unknown[] } =>\n typeof global === \"object\" && global !== null && (global as { slug?: unknown }).slug === BLOCK_LIBRARY_SLUG,\n );\n const blocks = (library?.fields ?? []).find(\n (field): field is { admin?: { custom?: { rows?: unknown } } } =>\n typeof field === \"object\" && field !== null && (field as { name?: unknown }).name === \"blocks\",\n );\n const rows = blocks?.admin?.custom?.rows;\n if (!Array.isArray(rows)) return [];\n return rows.flatMap((row): BlockLibraryEntry[] => {\n if (!row || typeof row !== \"object\") return [];\n const { slug, label, category, kind, sectionControls } = row as Record<string, unknown>;\n if (typeof slug !== \"string\" || !slug || PACKAGE_SLUGS.has(slug)) return [];\n return [\n {\n slug,\n label: typeof label === \"string\" ? label : slug,\n category: typeof category === \"string\" ? category : \"content\",\n ...(kind === \"hero\" || kind === \"section\" || kind === \"navbar\" ? { kind } : {}),\n ...(sectionControls && typeof sectionControls === \"object\"\n ? { sectionControls: sectionControls as BlockLibraryEntry[\"sectionControls\"] }\n : {}),\n },\n ];\n });\n}\n\n/**\n * The Block library's section controls at request time, for a page route\n * to hand `RenderBlocks` as `sectionControls`. Access is overridden: the\n * Global is read by editors, and the page is read by everyone. A site\n * extra's stored ticks are kept, and one the document does not hold yet\n * takes its catalogue default from the Global's config; pass `extras` only\n * to add entries the config does not know.\n */\nexport async function getSectionControls(\n payload: BlockLibraryReader | Payload,\n extras: readonly BlockLibraryEntry[] = blockLibraryEntriesFromConfig(payload as BlockLibraryReader),\n): Promise<Record<string, SectionControls>> {\n const doc = (await payload.findGlobal({ slug: BLOCK_LIBRARY_SLUG, depth: 0, overrideAccess: true })) as\n | BlockLibraryDoc\n | null\n | undefined;\n return sectionControlsFromLibrary(doc, extras);\n}\n"],"mappings":";;;;;;;;;AAUA,MAAa,uBAAuB;CAAC;CAAc;CAAW;CAAU;CAAS;;AAOjF,MAAa,yBAA4D;CACvE,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,QAAQ;CACT;;AAGD,MAAa,2BAA4C;CACvD,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,QAAQ;CACT;;;;;;AAOD,MAAa,wBAAyC;CACpD,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,QAAQ;CACT;;AAGD,MAAa,sBAAuC;CAClD,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,QAAQ;CACT;AAED,SAAgB,uBAAuB,MAAyC;AAC9E,KAAI,SAAS,OAAQ,QAAO,EAAE,GAAG,uBAAuB;AACxD,KAAI,SAAS,SAAU,QAAO,EAAE,GAAG,qBAAqB;AACxD,QAAO,EAAE,GAAG,0BAA0B;;;AAIxC,SAAgB,OAAO,OAAuE;AAC5F,QAAO,MAAM,SAAS,MAAM,aAAa,SAAS,SAAS,MAAM,aAAa,eAAe,WAAW;;;;;;;AAQ1G,SAAgB,kBAAkB,OAAgB,UAA4C;CAC5F,MAAM,SAAS,SAAS,OAAO,UAAU,WAAY,QAAoC,EAAE;CAC3F,MAAM,MAAM,EAAE,GAAG,UAAU;AAC3B,MAAK,MAAM,OAAO,qBAChB,KAAI,OAAO,O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AO,UAAU,EAAE,EAC5D,MACrB,WACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAA8B,SAAA,gBACnF,EACwB,UAAU,EAAE,EAAE,MACpC,UACC,OAAO,UAAU,YAAY,UAAU,QAAS,MAA6B,SAAS,SACzF,EACoB,OAAO,QAAQ;AACpC,KAAI,CAAC,MAAM,QAAQ,KAAK,CAAE,QAAO,EAAE;AACnC,QAAO,KAAK,SAAS,QAA6B;AAChD,MAAI,CAAC,OAAO,OAAO,QAAQ,SAAU,QAAO,EAAE;EAC9C,MAAM,EAAE,MAAM,OAAO,UAAU,MAAM,oBAAoB;AACzD,MAAI,OAAO,SAAS,YAAY,CAAC,QAAQ,cAAc,IAAI,KAAK,CAAE,QAAO,EAAE;AAC3E,SAAO,CACL;GACE;GACA,OAAO,OAAO,UAAU,WAAW,QAAQ;GAC3C,UAAU,OAAO,aAAa,WAAW,WAAW;GACpD,GAAI,SAAS,UAAU,SAAS,aAAa,SAAS,WAAW,EAAE,MAAM,GAAG,EAAE;GAC9E,GAAI,mBAAmB,OAAO,oBAAoB,WAC9C,EAAmB,iBAAyD,GAC5E,EAAE;GACP,CACF;GACD;;;;;;;;;;AAWJ,eAAsB,mBACpB,SACA,SAAuC,8BAA8B,QAA8B,EACzD;AAK1C,QAAO,2BAJM,MAAM,QAAQ,WAAW;EAAE,MAAM;EAAoB,OAAO;EAAG,gBAAgB;EAAM,CAAC,EAI5D,OAAO"}
|
|
@@ -417,4 +417,4 @@ async function getNavigation({ payload, draft = false }) {
|
|
|
417
417
|
//#endregion
|
|
418
418
|
export { NAVIGATION_SLUG as C, NAVIGATION_FOOTER_SLUG as S, validateExternalHref as _, FOOTER_MAX_LINK_COLUMNS as a, NAVIGATION_FEATURE as b, footerDesktopTracks as c, validateFooterColumns as d, validateFooterSocialUrl as f, linkField as g, isValidExternalHref as h, FOOTER_MAX_COLUMNS as i, footerFields as l, headerCtaEnabled as m, FOOTER_COLUMNS_FIELD as n, FOOTER_SOCIALS as o, EXTERNAL_HREF_MESSAGE as p, FOOTER_COLUMN_WIDTHS as r, FOOTER_TWELFTHS as s, getNavigation as t, normalizeFooterDesktop as u, validateHeaderCta as v, NAVIGATION_FOOTER_DB_NAME as x, NAVIGATION_DB_NAME as y };
|
|
419
419
|
|
|
420
|
-
//# sourceMappingURL=published-
|
|
420
|
+
//# sourceMappingURL=published-CcW9bqLJ.mjs.map
|