@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.
@@ -1,4 +1,4 @@
1
- import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, O as BlockLibraryRow, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, j as PackageBlockSlug, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as BlockLibraryCheck, u as getSectionControls, v as defaultSectionControls, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-C2r48lET.mjs";
1
+ import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, O as BlockLibraryRow, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, j as PackageBlockSlug, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as BlockLibraryCheck, u as getSectionControls, v as defaultSectionControls, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-BC_A9eLc.mjs";
2
2
 
3
3
  //#region src/block-library/island.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { _ as sectionControlsOf, a as sectionControlsFromLibrary, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as defaultSectionControls, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, l as BLOCK_LIBRARY_SLUG, m as SECTION_CONTROL_KEYS, n as getSectionControls, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as blockLibraryEntriesFromConfig, u as PACKAGE_BLOCK_SLUGS } from "./published-Cc1a8uYp.mjs";
1
+ import { _ as sectionControlsOf, a as sectionControlsFromLibrary, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as defaultSectionControls, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, l as BLOCK_LIBRARY_SLUG, m as SECTION_CONTROL_KEYS, n as getSectionControls, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as blockLibraryEntriesFromConfig, u as PACKAGE_BLOCK_SLUGS } from "./published-niJkPGjE.mjs";
2
2
  //#region src/block-library/island.ts
3
3
  /**
4
4
  * How a Block library island tells its card how tall it is (BIS-147).
@@ -13,7 +13,7 @@ import { parseArgs } from "node:util";
13
13
  *
14
14
  * THUMBNAIL_EMAIL=… THUMBNAIL_PASSWORD=… bison-block-thumbnails \
15
15
  * --base http://localhost:3039 \
16
- * --slugs ctaBand,productMap \
16
+ * --slugs pricingTable,productMap \
17
17
  * --out-dir public/block-thumbnails
18
18
  *
19
19
  * `--out-dir` writes `<slug>.jpg` files a site serves itself (the
@@ -1 +1 @@
1
- {"version":3,"file":"block-thumbnails-cli.mjs","names":[],"sources":["../src/block-thumbnails-cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `bison-block-thumbnails`: screenshots each block's Block library preview\n * under a neutral theme, for Payload's Add Block drawer. Run it from the\n * site, which supplies Playwright and its browser; this package depends on\n * neither.\n *\n * THUMBNAIL_EMAIL=… THUMBNAIL_PASSWORD=… bison-block-thumbnails \\\n * --base http://localhost:3039 \\\n * --slugs ctaBand,productMap \\\n * --out-dir public/block-thumbnails\n *\n * `--out-dir` writes `<slug>.jpg` files a site serves itself (the\n * `thumbnail` URL on its `createBlockLibrary` entry). `--module` writes a\n * TypeScript module of base64 JPEGs instead, which is how this package\n * ships its own. `--preview /block-library/{slug}` is the route (the\n * default), `--selector` the element that holds the sample\n * (`BlockLibraryIsland`'s by default), and `--users users` the auth\n * collection to sign in to. The login (`THUMBNAIL_EMAIL` /\n * `THUMBNAIL_PASSWORD`) is read from the environment, never from\n * arguments, and is required unless `--no-login` names a public route. A\n * preview that answers an error or renders no sample fails the run, and\n * nothing is written.\n */\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\n\nimport { captureThumbnails, THUMBNAIL_SCALE, THUMBNAIL_VIEWPORT, type ThumbnailPage } from \"./block-thumbnails\";\n\ntype Browser = {\n newContext(options: { viewport: { width: number; height: number }; deviceScaleFactor: number }): Promise<{\n newPage(): Promise<ThumbnailPage>;\n request: { post(url: string, options: { data: unknown }): Promise<{ ok(): boolean; status(): number }> };\n }>;\n close(): Promise<void>;\n};\n\nconst { values } = parseArgs({\n options: {\n base: { type: \"string\" },\n preview: { type: \"string\", default: \"/block-library/{slug}\" },\n selector: { type: \"string\" },\n slugs: { type: \"string\" },\n \"out-dir\": { type: \"string\" },\n module: { type: \"string\" },\n export: { type: \"string\", default: \"BLOCK_THUMBNAILS\" },\n users: { type: \"string\", default: \"users\" },\n \"no-login\": { type: \"boolean\", default: false },\n },\n});\n\nfunction fail(message: string): never {\n console.error(`bison-block-thumbnails: ${message}`);\n process.exit(1);\n}\n\nconst base = values.base?.replace(/\\/$/, \"\") ?? fail(\"--base is required\");\nconst slugs = (values.slugs ?? fail(\"--slugs is required\")).split(\",\").map((slug) => slug.trim()).filter(Boolean);\nif (!values[\"out-dir\"] && !values.module) fail(\"pass --out-dir (jpg files) or --module (a TypeScript module)\");\nconst email = process.env.THUMBNAIL_EMAIL;\nconst password = process.env.THUMBNAIL_PASSWORD;\n// The Block library preview refuses a logged-out request, so a missing\n// login is an error unless the route is public (`--no-login`).\nif (!values[\"no-login\"] && !(email && password)) {\n fail(\"set THUMBNAIL_EMAIL and THUMBNAIL_PASSWORD, or pass --no-login for a public preview route\");\n}\n\n// Playwright from the site running this, not from this package.\nconst require = createRequire(join(process.cwd(), \"package.json\"));\nlet chromium: { launch(): Promise<Browser> };\ntry {\n ({ chromium } = require(\"playwright\") as { chromium: typeof chromium });\n} catch {\n try {\n ({ chromium } = require(\"@playwright/test\") as { chromium: typeof chromium });\n } catch {\n fail(\"needs playwright (or @playwright/test) installed in the project it runs from\");\n }\n}\n\nconst browser = await chromium.launch();\ntry {\n const context = await browser.newContext({ viewport: { ...THUMBNAIL_VIEWPORT }, deviceScaleFactor: THUMBNAIL_SCALE });\n if (!values[\"no-login\"]) {\n const login = await context.request.post(`${base}/api/${values.users}/login`, { data: { email, password } });\n if (!login.ok()) fail(`sign-in to ${base} failed (${login.status()})`);\n }\n const page = await context.newPage();\n const previews = slugs.map((slug) => ({ slug, url: `${base}${values.preview!.replace(\"{slug}\", slug)}` }));\n const shots = await captureThumbnails(page, previews, values.selector ? { selector: values.selector } : {});\n\n if (values[\"out-dir\"]) {\n const dir = resolve(values[\"out-dir\"]);\n mkdirSync(dir, { recursive: true });\n for (const [slug, jpeg] of Object.entries(shots)) writeFileSync(join(dir, `${slug}.jpg`), jpeg);\n }\n if (values.module) {\n const lines = Object.entries(shots).map(\n ([slug, jpeg]) => ` ${JSON.stringify(slug)}: ${JSON.stringify(Buffer.from(jpeg).toString(\"base64\"))},`,\n );\n const target = resolve(values.module);\n mkdirSync(dirname(target), { recursive: true });\n writeFileSync(\n target,\n [\n \"// Generated by `bison-block-thumbnails` (@bison-lab/payload-core): each block's\",\n \"// Block library preview under the neutral theme, as a base64 JPEG. Do not\",\n \"// edit by hand: rerun it when a block's layout or sample changes.\",\n `export const ${values.export}: Record<string, string> = {`,\n ...lines,\n \"};\",\n \"\",\n ].join(\"\\n\"),\n );\n }\n console.log(`bison-block-thumbnails: captured ${slugs.length} blocks`);\n} catch (error) {\n await browser.close();\n fail(error instanceof Error ? error.message : String(error));\n} finally {\n await browser.close();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,EAAE,WAAW,UAAU,EAC3B,SAAS;CACP,MAAM,EAAE,MAAM,UAAU;CACxB,SAAS;EAAE,MAAM;EAAU,SAAS;EAAyB;CAC7D,UAAU,EAAE,MAAM,UAAU;CAC5B,OAAO,EAAE,MAAM,UAAU;CACzB,WAAW,EAAE,MAAM,UAAU;CAC7B,QAAQ,EAAE,MAAM,UAAU;CAC1B,QAAQ;EAAE,MAAM;EAAU,SAAS;EAAoB;CACvD,OAAO;EAAE,MAAM;EAAU,SAAS;EAAS;CAC3C,YAAY;EAAE,MAAM;EAAW,SAAS;EAAO;CAChD,EACF,CAAC;AAEF,SAAS,KAAK,SAAwB;AACpC,SAAQ,MAAM,2BAA2B,UAAU;AACnD,SAAQ,KAAK,EAAE;;AAGjB,MAAM,OAAO,OAAO,MAAM,QAAQ,OAAO,GAAG,IAAI,KAAK,qBAAqB;AAC1E,MAAM,SAAS,OAAO,SAAS,KAAK,sBAAsB,EAAE,MAAM,IAAI,CAAC,KAAK,SAAS,KAAK,MAAM,CAAC,CAAC,OAAO,QAAQ;AACjH,IAAI,CAAC,OAAO,cAAc,CAAC,OAAO,OAAQ,MAAK,+DAA+D;AAC9G,MAAM,QAAQ,QAAQ,IAAI;AAC1B,MAAM,WAAW,QAAQ,IAAI;AAG7B,IAAI,CAAC,OAAO,eAAe,EAAE,SAAS,UACpC,MAAK,4FAA4F;AAInG,MAAM,UAAU,cAAc,KAAK,QAAQ,KAAK,EAAE,eAAe,CAAC;AAClE,IAAI;AACJ,IAAI;AACF,EAAC,CAAE,YAAa,QAAQ,aAAa;QAC/B;AACN,KAAI;AACF,GAAC,CAAE,YAAa,QAAQ,mBAAmB;SACrC;AACN,OAA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SAAQ,IAAI,oCAAoC,MAAM,OAAO,SAAS;SAC/D,OAAO;AACd,OAAM,QAAQ,OAAO;AACrB,MAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;UACpD;AACR,OAAM,QAAQ,OAAO"}
1
+ {"version":3,"file":"block-thumbnails-cli.mjs","names":[],"sources":["../src/block-thumbnails-cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `bison-block-thumbnails`: screenshots each block's Block library preview\n * under a neutral theme, for Payload's Add Block drawer. Run it from the\n * site, which supplies Playwright and its browser; this package depends on\n * neither.\n *\n * THUMBNAIL_EMAIL=… THUMBNAIL_PASSWORD=… bison-block-thumbnails \\\n * --base http://localhost:3039 \\\n * --slugs pricingTable,productMap \\\n * --out-dir public/block-thumbnails\n *\n * `--out-dir` writes `<slug>.jpg` files a site serves itself (the\n * `thumbnail` URL on its `createBlockLibrary` entry). `--module` writes a\n * TypeScript module of base64 JPEGs instead, which is how this package\n * ships its own. `--preview /block-library/{slug}` is the route (the\n * default), `--selector` the element that holds the sample\n * (`BlockLibraryIsland`'s by default), and `--users users` the auth\n * collection to sign in to. The login (`THUMBNAIL_EMAIL` /\n * `THUMBNAIL_PASSWORD`) is read from the environment, never from\n * arguments, and is required unless `--no-login` names a public route. A\n * preview that answers an error or renders no sample fails the run, and\n * nothing is written.\n */\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { parseArgs } from \"node:util\";\n\nimport { captureThumbnails, THUMBNAIL_SCALE, THUMBNAIL_VIEWPORT, type ThumbnailPage } from \"./block-thumbnails\";\n\ntype Browser = {\n newContext(options: { viewport: { width: number; height: number }; deviceScaleFactor: number }): Promise<{\n newPage(): Promise<ThumbnailPage>;\n request: { post(url: string, options: { data: unknown }): Promise<{ ok(): boolean; status(): number }> };\n }>;\n close(): Promise<void>;\n};\n\nconst { values } = parseArgs({\n options: {\n base: { type: \"string\" },\n preview: { type: \"string\", default: \"/block-library/{slug}\" },\n selector: { type: \"string\" },\n slugs: { type: \"string\" },\n \"out-dir\": { type: \"string\" },\n module: { type: \"string\" },\n export: { type: \"string\", default: \"BLOCK_THUMBNAILS\" },\n users: { type: \"string\", default: \"users\" },\n \"no-login\": { type: \"boolean\", default: false },\n },\n});\n\nfunction fail(message: string): never {\n console.error(`bison-block-thumbnails: ${message}`);\n process.exit(1);\n}\n\nconst base = values.base?.replace(/\\/$/, \"\") ?? fail(\"--base is required\");\nconst slugs = (values.slugs ?? fail(\"--slugs is required\")).split(\",\").map((slug) => slug.trim()).filter(Boolean);\nif (!values[\"out-dir\"] && !values.module) fail(\"pass --out-dir (jpg files) or --module (a TypeScript module)\");\nconst email = process.env.THUMBNAIL_EMAIL;\nconst password = process.env.THUMBNAIL_PASSWORD;\n// The Block library preview refuses a logged-out request, so a missing\n// login is an error unless the route is public (`--no-login`).\nif (!values[\"no-login\"] && !(email && password)) {\n fail(\"set THUMBNAIL_EMAIL and THUMBNAIL_PASSWORD, or pass --no-login for a public preview route\");\n}\n\n// Playwright from the site running this, not from this package.\nconst require = createRequire(join(process.cwd(), \"package.json\"));\nlet chromium: { launch(): Promise<Browser> };\ntry {\n ({ chromium } = require(\"playwright\") as { chromium: typeof chromium });\n} catch {\n try {\n ({ chromium } = require(\"@playwright/test\") as { chromium: typeof chromium });\n } catch {\n fail(\"needs playwright (or @playwright/test) installed in the project it runs from\");\n }\n}\n\nconst browser = await chromium.launch();\ntry {\n const context = await browser.newContext({ viewport: { ...THUMBNAIL_VIEWPORT }, deviceScaleFactor: THUMBNAIL_SCALE });\n if (!values[\"no-login\"]) {\n const login = await context.request.post(`${base}/api/${values.users}/login`, { data: { email, password } });\n if (!login.ok()) fail(`sign-in to ${base} failed (${login.status()})`);\n }\n const page = await context.newPage();\n const previews = slugs.map((slug) => ({ slug, url: `${base}${values.preview!.replace(\"{slug}\", slug)}` }));\n const shots = await captureThumbnails(page, previews, values.selector ? { selector: values.selector } : {});\n\n if (values[\"out-dir\"]) {\n const dir = resolve(values[\"out-dir\"]);\n mkdirSync(dir, { recursive: true });\n for (const [slug, jpeg] of Object.entries(shots)) writeFileSync(join(dir, `${slug}.jpg`), jpeg);\n }\n if (values.module) {\n const lines = Object.entries(shots).map(\n ([slug, jpeg]) => ` ${JSON.stringify(slug)}: ${JSON.stringify(Buffer.from(jpeg).toString(\"base64\"))},`,\n );\n const target = resolve(values.module);\n mkdirSync(dirname(target), { recursive: true });\n writeFileSync(\n target,\n [\n \"// Generated by `bison-block-thumbnails` (@bison-lab/payload-core): each block's\",\n \"// Block library preview under the neutral theme, as a base64 JPEG. Do not\",\n \"// edit by hand: rerun it when a block's layout or sample changes.\",\n `export const ${values.export}: Record<string, string> = {`,\n ...lines,\n \"};\",\n \"\",\n ].join(\"\\n\"),\n );\n }\n console.log(`bison-block-thumbnails: captured ${slugs.length} blocks`);\n} catch (error) {\n await browser.close();\n fail(error instanceof Error ? error.message : String(error));\n} finally {\n await browser.close();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,EAAE,WAAW,UAAU,EAC3B,SAAS;CACP,MAAM,EAAE,MAAM,UAAU;CACxB,SAAS;EAAE,MAAM;EAAU,SAAS;EAAyB;CAC7D,UAAU,EAAE,MAAM,UAAU;CAC5B,OAAO,EAAE,MAAM,UAAU;CACzB,WAAW,EAAE,MAAM,UAAU;CAC7B,QAAQ,EAAE,MAAM,UAAU;CAC1B,QAAQ;EAAE,MAAM;EAAU,SAAS;EAAoB;CACvD,OAAO;EAAE,MAAM;EAAU,SAAS;EAAS;CAC3C,YAAY;EAAE,MAAM;EAAW,SAAS;EAAO;CAChD,EACF,CAAC;AAEF,SAAS,KAAK,SAAwB;AACpC,SAAQ,MAAM,2BAA2B,UAAU;AACnD,SAAQ,KAAK,EAAE;;AAGjB,MAAM,OAAO,OAAO,MAAM,QAAQ,OAAO,GAAG,IAAI,KAAK,qBAAqB;AAC1E,MAAM,SAA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AM,SAAS,OAAO,QAAQ,MAAM,CAAE,eAAc,KAAK,KAAK,GAAG,KAAK,MAAM,EAAE,KAAK;;AAEjG,KAAI,OAAO,QAAQ;EACjB,MAAM,QAAQ,OAAO,QAAQ,MAAM,CAAC,KACjC,CAAC,MAAM,UAAU,KAAK,KAAK,UAAU,KAAK,CAAC,IAAI,KAAK,UAAU,OAAO,KAAK,KAAK,CAAC,SAAS,SAAS,CAAC,CAAC,GACtG;EACD,MAAM,SAAS,QAAQ,OAAO,OAAO;AACrC,YAAU,QAAQ,OAAO,EAAE,EAAE,WAAW,MAAM,CAAC;AAC/C,gBACE,QACA;GACE;GACA;GACA;GACA,gBAAgB,OAAO,OAAO;GAC9B,GAAG;GACH;GACA;GACD,CAAC,KAAK,KAAK,CACb;;AAEH,SAAQ,IAAI,oCAAoC,MAAM,OAAO,SAAS;SAC/D,OAAO;AACd,OAAM,QAAQ,OAAO;AACrB,MAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;UACpD;AACR,OAAM,QAAQ,OAAO"}
@@ -37,10 +37,9 @@ type BlockLibraryCategoryId = (typeof BLOCK_LIBRARY_CATEGORIES)[number]["id"];
37
37
  type BlockLibraryKind = "hero" | "section" | "navbar";
38
38
  /**
39
39
  * Package catalogue. `megaMenu` and `navLink` are header item blocks, not
40
- * cards. Navigation's card is `floatingNav`. CTA is a category for a site
41
- * extra; the package ships no CTA slug. The preview route is SPI-53.
40
+ * cards. Navigation's card is `floatingNav`. The preview route is SPI-53.
42
41
  */
43
- declare const PACKAGE_BLOCK_SLUGS: readonly ["hero", "heroSweep", "heroCompact", "heroSimple", "showcasePanels", "featureHighlights", "featureChecklist", "processSteps", "faqColumns", "testimonialMasonry", "testimonialCarousel", "statsBand", "richText", "video", "nap", "inquiryForm", "floatingNav"];
42
+ declare const PACKAGE_BLOCK_SLUGS: readonly ["hero", "heroSweep", "heroCompact", "heroSimple", "showcasePanels", "featureHighlights", "featureChecklist", "processSteps", "faqColumns", "testimonialMasonry", "testimonialCarousel", "statsBand", "richText", "video", "nap", "inquiryForm", "ctaBand", "logoCloud", "gallery", "floatingNav"];
44
43
  type PackageBlockSlug = (typeof PACKAGE_BLOCK_SLUGS)[number];
45
44
  interface BlockLibraryEntry {
46
45
  slug: string;
@@ -145,7 +144,8 @@ interface BlockLibraryReader {
145
144
  * `createBlockLibrary` keeps the rows it seeded (package and extras) on the
146
145
  * `blocks` field's `admin.custom.rows`, so a site block's catalogue default
147
146
  * is known here without the site passing `blocks` a second time. Package
148
- * slugs are left out; the catalogue already has them.
147
+ * slugs are left out (the catalogue already has them) unless the site
148
+ * registered its own entry under one, which `siteSlugs` records.
149
149
  */
150
150
  declare function blockLibraryEntriesFromConfig(payload: Pick<BlockLibraryReader, "config">): BlockLibraryEntry[];
151
151
  /**
@@ -171,6 +171,15 @@ interface BlockLibraryCheck {
171
171
  drafts?: readonly BlockLibraryHolder[];
172
172
  pages?: unknown[];
173
173
  }
174
+ /**
175
+ * The package entries, then the site's extras. An extra whose slug the
176
+ * package ships replaces that package entry in its place: a site that
177
+ * registered its own block before the package shipped one under the same
178
+ * slug still renders its own config, so its label, category, controls,
179
+ * picture and sample are the true ones. A release that adds such a block
180
+ * therefore never yields two rows for one slug, and never relabels the
181
+ * site's block as the package's.
182
+ */
174
183
  declare function blockLibraryCatalogue(extras?: readonly BlockLibraryEntry[]): BlockLibraryEntry[];
175
184
  declare function defaultBlockLibraryValue(options: BlockLibraryOptions): BlockLibraryRow[];
176
185
  /**
@@ -202,4 +211,4 @@ declare function sectionControlsFromLibrary(doc: BlockLibraryDoc | null | undefi
202
211
  declare function validateBlockLibrary(value: unknown, options: BlockLibraryOptions, check?: BlockLibraryCheck): Promise<true | string>;
203
212
  //#endregion
204
213
  export { PACKAGE_BLOCK_SLUGS as A, BlockLibraryDoc as C, BlockLibraryKind as D, BlockLibraryHolder as E, BlockLibraryRow as O, BlockLibraryCategoryId as S, BlockLibraryEntry as T, SectionControls as _, sectionControlsFromLibrary as a, BLOCK_LIBRARY_CATEGORIES as b, BlockLibraryReader as c, DEFAULT_SECTION_CONTROLS as d, HERO_SECTION_CONTROLS as f, SectionControlKey as g, SECTION_CONTROL_LABELS as h, defaultBlockLibraryValue as i, PackageBlockSlug as j, BlockLibraryUsage as k, blockLibraryEntriesFromConfig as l, SECTION_CONTROL_KEYS as m, BlockLibraryOptions as n, stampBlockLibrary as o, NO_SECTION_CONTROLS as p, blockLibraryCatalogue as r, validateBlockLibrary as s, BlockLibraryCheck as t, getSectionControls as u, defaultSectionControls as v, BlockLibraryDraftHolder as w, BLOCK_LIBRARY_SLUG as x, sectionControlsOf as y };
205
- //# sourceMappingURL=catalogue-C2r48lET.d.mts.map
214
+ //# sourceMappingURL=catalogue-BC_A9eLc.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogue-BC_A9eLc.d.mts","names":[],"sources":["../src/block-library/types.ts","../src/block-library/controls.ts","../src/block-library/published.ts","../src/block-library/catalogue.ts"],"mappings":";;;cAEa,kBAAA;AAAA,cAEA,wBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAaD,sBAAA,WAAiC,wBAAA;AAAA,KAEjC,gBAAA;;;;;cAMC,mBAAA;AAAA,KAuBD,gBAAA,WAA2B,mBAAA;AAAA,UAEtB,iBAAA;EACf,IAAA;EACA,KAAA;EACA,QAAA;EAPQ;EASR,IAAA,GAAO,gBAAA;EACP,YAAA;EACA,MAAA;EATU;;;;;AAEZ;EAcE,eAAA,GAAkB,OAAA,CAAQ,eAAA;;;;;;;;EAQ1B,SAAA;AAAA;AAAA,UAGe,eAAA;EACf,EAAA;EACA,IAAA;EACA,KAAA;EACA,QAAA;EACA,OAAA;EACA,IAAA,EAAM,gBAAA;EATN;EAWA,eAAA,EAAiB,eAAA;AAAA;AARnB;AAAA,UAYiB,eAAA;EACf,MAAA;AAAA;AAAA,UAGe,kBAAA;EACf,KAAA;EACA,IAAA;AAAA;;UAIe,uBAAA,SAAgC,kBAA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S,mBAAA,GAAsB,eAAA;;AHxFjF;;;;;AAEA;;;;;iBG+HgB,0BAAA,CACd,GAAA,EAAK,eAAA,qBACL,MAAA,YAAiB,iBAAA,KAChB,MAAA,SAAe,eAAA;;;;;AHrGlB;;iBGqIsB,oBAAA,CACpB,KAAA,WACA,OAAA,EAAS,mBAAA,EACT,KAAA,GAAO,iBAAA,GACN,OAAA"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, E as BlockLibraryHolder, O as BlockLibraryRow, S as BlockLibraryCategoryId, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, b as BLOCK_LIBRARY_CATEGORIES, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, k as BlockLibraryUsage, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, u as getSectionControls, v as defaultSectionControls, w as BlockLibraryDraftHolder, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-C2r48lET.mjs";
1
+ import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, E as BlockLibraryHolder, O as BlockLibraryRow, S as BlockLibraryCategoryId, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, b as BLOCK_LIBRARY_CATEGORIES, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, k as BlockLibraryUsage, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, u as getSectionControls, v as defaultSectionControls, w as BlockLibraryDraftHolder, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-BC_A9eLc.mjs";
2
2
  import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-BvjHeRo5.mjs";
3
3
  import { A as ThemeDoc, B as ColorUsagesOption, C as SystemColorKey, D as THEME_SLUG, E as THEME_IDENTITY_SLUG, F as ResolvedThemeIdentity, H as rewriteColorUsages, I as ThemeIdentityFallback, L as resolveThemeIdentity, N as ThemeLibraryColorDoc, O as THEME_TYPOGRAPHY_SLUG, P as ThemeUploadDoc, R as ColorUsage, S as SYSTEM_COLOR_KEYS, T as THEME_COLORS_SLUG, V as findColorUsages, _ as deleteLibraryColor, a as PageEditorSystemKey, b as CreateThemeOptions, c as pageEditorTokens, d as LookFieldOptions, f as colorTokenField, g as rewriteColorTokens, h as findColorTokens, i as PAGE_EDITOR_SYSTEM_KEYS, k as ThemeColorDoc, l as themeLibraryFromDoc, m as ColorTokenHit, n as ColorSwatch, o as pageEditorLooks, p as lookField, r as LookOption, s as pageEditorSwatches, t as THEME_PREVIEW_BREAKPOINTS, u as LookFieldMode, v as rewriteColorToken, w as THEME_APPEARANCE_SLUG, x as EditableTheme, y as themeColorKeys, z as ColorUsagesList } from "./preview-D-G8PEEB.mjs";
4
4
  import { n as facetField, t as FacetEntry } from "./facet-field-DKzRCYrh.mjs";