@bison-lab/payload-core 4.12.4 → 4.15.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 +93 -5
- package/dist/admin.d.mts +14 -1
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +170 -22
- package/dist/admin.mjs.map +1 -1
- package/dist/block-library.d.mts +30 -2
- package/dist/block-library.d.mts.map +1 -0
- package/dist/block-library.mjs +33 -1
- package/dist/block-library.mjs.map +1 -0
- package/dist/{catalogue-9MO2jy69.d.mts → catalogue-CFXM1yAZ.d.mts} +8 -1
- package/dist/catalogue-CFXM1yAZ.d.mts.map +1 -0
- package/dist/{facet-field-DHpNdS_u.d.mts → facet-field-_8bYI1i0.d.mts} +1 -1
- package/dist/{facet-field-DHpNdS_u.d.mts.map → facet-field-_8bYI1i0.d.mts.map} +1 -1
- package/dist/index.d.mts +53 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +199 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{looks-BbL309kO.mjs → island-97l5VY8l.mjs} +23 -2
- package/dist/island-97l5VY8l.mjs.map +1 -0
- package/dist/metadata.d.mts +1 -1
- package/dist/navigation.d.mts +1 -1
- package/dist/{preview-D-Psltpf.d.mts → preview-Vaa1KXJP.d.mts} +1 -1
- package/dist/{preview-D-Psltpf.d.mts.map → preview-Vaa1KXJP.d.mts.map} +1 -1
- package/dist/published-BjmUCpdY.mjs.map +1 -1
- package/dist/{published-DhARD4W8.d.mts → published-FUgC5Mc8.d.mts} +1 -1
- package/dist/{published-DhARD4W8.d.mts.map → published-FUgC5Mc8.d.mts.map} +1 -1
- package/dist/react.d.mts +21 -1
- package/dist/react.d.mts.map +1 -1
- package/dist/react.mjs +47 -3
- package/dist/react.mjs.map +1 -1
- package/dist/taxonomy.d.mts +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{title-7VASfaFO.d.mts → title-ImlifZ_6.d.mts} +1 -1
- package/dist/{title-7VASfaFO.d.mts.map → title-ImlifZ_6.d.mts.map} +1 -1
- package/dist/wireframe-BTocmmyY.mjs +298 -0
- package/dist/wireframe-BTocmmyY.mjs.map +1 -0
- package/dist/wireframe-cli.d.mts +1 -0
- package/dist/wireframe-cli.mjs +110 -0
- package/dist/wireframe-cli.mjs.map +1 -0
- package/dist/wireframe.d.mts +119 -0
- package/dist/wireframe.d.mts.map +1 -0
- package/dist/wireframe.mjs +2 -0
- package/package.json +11 -4
- package/dist/catalogue-9MO2jy69.d.mts.map +0 -1
- package/dist/looks-BbL309kO.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -2083,9 +2083,14 @@ function createBlockLibrary({ access, blocks = [], previewPath }) {
|
|
|
2083
2083
|
return Response.json(usage);
|
|
2084
2084
|
}
|
|
2085
2085
|
}],
|
|
2086
|
-
fields: [blocksField]
|
|
2086
|
+
fields: [blocksField],
|
|
2087
|
+
custom: { blockLibraryThumbnails: thumbnailsOf$1(blocks) }
|
|
2087
2088
|
};
|
|
2088
2089
|
}
|
|
2090
|
+
/** Each site extra's drawer picture, by slug. */
|
|
2091
|
+
function thumbnailsOf$1(blocks) {
|
|
2092
|
+
return Object.fromEntries(blocks.flatMap((entry) => entry.thumbnail ? [[entry.slug, entry.thumbnail]] : []));
|
|
2093
|
+
}
|
|
2089
2094
|
//#endregion
|
|
2090
2095
|
//#region src/features/fields.ts
|
|
2091
2096
|
const FEATURES_MATRIX_FIELD = "@bison-lab/payload-core/admin#FeaturesMatrixField";
|
|
@@ -3957,6 +3962,198 @@ const listAlign = definePlugin({
|
|
|
3957
3962
|
}
|
|
3958
3963
|
});
|
|
3959
3964
|
//#endregion
|
|
3960
|
-
|
|
3965
|
+
//#region src/admin/block-drawer-key.ts
|
|
3966
|
+
/** Import-map key for the provider `blockDrawer()` mounts. */
|
|
3967
|
+
const BLOCK_DRAWER_STYLES = "@bison-lab/payload-core/admin#BlockDrawerStyles";
|
|
3968
|
+
//#endregion
|
|
3969
|
+
//#region src/block-library/wireframes.generated.ts
|
|
3970
|
+
const PACKAGE_WIREFRAMES = {
|
|
3971
|
+
"hero": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='0' y='52.2' width='480' height='215.6' fill='%23262626'/%3E%3Crect data-k='surface' x='0' y='52.2' width='480' height='215.6' fill='%23262626'/%3E%3Crect data-k='image' x='292.1' y='106.2' width='178.9' height='119.3' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M292.1 106.2L471 225.5M471 106.2L292.1 225.5' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='button' x='9' y='207.8' width='81' height='18' rx='9' fill='%23d4d4d4'/%3E%3Crect data-k='button' x='94.5' y='207.8' width='73.9' height='18' rx='9' fill='%23d4d4d4'/%3E%3Crect data-k='heading' x='9' y='123.8' width='160.1' height='13.9' rx='7' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='9' y='146.3' width='203.3' height='13.9' rx='7' fill='%23f5f5f5'/%3E%3Crect data-k='text' x='9' y='108.4' width='107.3' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='9' y='177.4' width='243.4' height='3.4' rx='1.7' fill='%238a8a8a'/%3E%3Crect data-k='text' x='9' y='188.3' width='200.3' height='3.4' rx='1.7' fill='%238a8a8a'/%3E%3C/g%3E%3C/svg%3E",
|
|
3972
|
+
"heroSweep": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='50.7' width='462' height='218.6' fill='%23262626'/%3E%3Crect data-k='image' x='290.3' y='110.7' width='165.4' height='110.3' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M290.3 110.7L455.7 221M455.7 110.7L290.3 221' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='button' x='27.4' y='206.3' width='79.5' height='21' rx='10.5' fill='%23d4d4d4'/%3E%3Crect data-k='button' x='111.4' y='206.3' width='72.4' height='21' rx='10.5' fill='%23d4d4d4'/%3E%3Crect data-k='heading' x='27.4' y='122.3' width='187.1' height='13.9' rx='7' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='27.4' y='144.8' width='244.1' height='13.9' rx='7' fill='%23f5f5f5'/%3E%3Crect data-k='text' x='27.4' y='107.3' width='104.6' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='175.9' width='238.9' height='3.4' rx='1.7' fill='%238a8a8a'/%3E%3Crect data-k='text' x='27.4' y='186.8' width='199.1' height='3.4' rx='1.7' fill='%238a8a8a'/%3E%3C/g%3E%3C/svg%3E",
|
|
3973
|
+
"heroCompact": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='75.3' width='462' height='169.5' fill='%23262626'/%3E%3Crect data-k='surface' x='9' y='75.3' width='462' height='169.5' fill='%23262626'/%3E%3Crect data-k='image' x='9' y='75.3' width='462' height='169.5' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M9 75.3L471 244.8M471 75.3L9 244.8' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='button' x='27.4' y='199.8' width='62.3' height='21' rx='10.5' fill='%23d4d4d4'/%3E%3Crect data-k='button' x='94.1' y='199.8' width='63' height='21' rx='10.5' fill='%23d4d4d4'/%3E%3Crect data-k='heading' x='27.4' y='132.6' width='177' height='11.3' rx='5.7' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='27.4' y='150.6' width='169.1' height='11.3' rx='5.7' fill='%23f5f5f5'/%3E%3Crect data-k='text' x='27.4' y='119.9' width='30.4' height='2.6' rx='1.3' fill='%238a8a8a'/%3E%3Crect data-k='text' x='27.4' y='174.6' width='205.5' height='3' rx='1.5' fill='%238a8a8a'/%3E%3Crect data-k='text' x='27.4' y='184.4' width='50.3' height='3' rx='1.5' fill='%238a8a8a'/%3E%3C/g%3E%3C/svg%3E",
|
|
3974
|
+
"showcasePanels": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='9' width='462' height='312' fill='%23f0f0f0'/%3E%3Crect data-k='surface' x='27.4' y='57' width='428.3' height='216' fill='%23262626'/%3E%3Crect data-k='surface' x='27.4' y='57' width='255.8' height='216' fill='%23262626'/%3E%3Crect data-k='surface' x='284.3' y='57' width='85.1' height='216' fill='%23262626'/%3E%3Crect data-k='surface' x='284.3' y='57' width='85.1' height='216' fill='%23262626'/%3E%3Crect data-k='surface' x='370.5' y='57' width='85.1' height='216' fill='%23262626'/%3E%3Crect data-k='surface' x='370.5' y='57' width='85.1' height='216' fill='%23262626'/%3E%3Crect data-k='image' x='27.4' y='57' width='255.8' height='216' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.4 57L283.2 273M283.2 57L27.4 273' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='284.3' y='57' width='85.1' height='216' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M284.3 57L369.4 273M369.4 57L284.3 273' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='370.5' y='57' width='85.1' height='216' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M370.5 57L455.6 273M455.6 57L370.5 273' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Ccircle data-k='icon' cx='268.1' cy='72' r='3' fill='%238a8a8a'/%3E%3Crect data-k='heading' x='149.6' y='84.4' width='11.3' height='5.6' rx='2.8' fill='%23262626'/%3E%3Crect data-k='heading' x='34.9' y='239.6' width='75.4' height='5.6' rx='2.8' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='320.6' y='84.4' width='12.4' height='5.6' rx='2.8' fill='%23262626'/%3E%3Crect data-k='heading' x='406.9' y='84.4' width='12.8' height='5.6' rx='2.8' fill='%23262626'/%3E%3Crect data-k='text' x='151.1' y='163.5' width='7.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='138' y='245.3' width='34.1' height='1.9' rx='1' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='34.9' y='230.3' width='28.9' height='1.9' rx='1' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='34.9' y='253.1' width='167.6' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='34.9' y='260.3' width='132.8' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='322.5' y='163.5' width='7.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='309.8' y='245.3' width='34.1' height='1.9' rx='1' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='408.8' y='163.5' width='7.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='396' y='245.3' width='34.1' height='1.9' rx='1' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E",
|
|
3975
|
+
"processSteps": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='9' width='462' height='367.1' fill='%23f0f0f0'/%3E%3Crect data-k='surface' x='27.4' y='57' width='428.3' height='271.1' fill='%23262626'/%3E%3Crect data-k='surface' x='27.4' y='57' width='428.3' height='240.8' fill='%23262626'/%3E%3Crect data-k='surface' x='27.4' y='57' width='285.4' height='240.8' fill='%23262626'/%3E%3Crect data-k='surface' x='27.4' y='297.8' width='428.3' height='30.4' fill='%23262626'/%3E%3Crect data-k='image' x='27.4' y='57' width='428.3' height='240.8' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.4 57L455.7 297.8M455.7 57L27.4 297.8' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='27.4' y='57' width='428.3' height='240.8' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.4 57L455.7 297.8M455.7 57L27.4 297.8' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='27.4' y='57' width='428.3' height='240.8' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.4 57L455.7 297.8M455.7 57L27.4 297.8' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='27.4' y='57' width='428.3' height='240.8' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.4 57L455.7 297.8M455.7 57L27.4 297.8' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Ccircle data-k='icon' cx='440.6' cy='72' r='3' fill='%238a8a8a'/%3E%3Crect data-k='heading' x='51.4' y='214.5' width='186.8' height='22.5' rx='11.3' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='51.4' y='220.5' width='145.1' height='22.5' rx='11.3' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='51.4' y='220.5' width='157.9' height='22.5' rx='11.3' fill='%23f5f5f5'/%3E%3Crect data-k='heading' x='51.4' y='220.5' width='343.9' height='22.5' rx='11.3' fill='%23f5f5f5'/%3E%3Crect data-k='text' x='70.9' y='194.6' width='30.4' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='258.4' width='187.5' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='269.6' width='113.6' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='70.9' y='200.6' width='30.4' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='264.4' width='181.1' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='275.6' width='148.5' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='70.9' y='200.6' width='30.4' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='264.4' width='187.1' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='275.6' width='183' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='70.9' y='200.6' width='30.4' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='264.4' width='189.4' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='51.4' y='275.6' width='72' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='72' y='306.8' width='18' height='1.9' rx='1' fill='%238a8a8a'/%3E%3Crect data-k='text' x='65.3' y='315.4' width='31.1' height='3' rx='1.5' fill='%238a8a8a'/%3E%3Crect data-k='text' x='178.9' y='306.8' width='18' height='1.9' rx='1' fill='%238a8a8a'/%3E%3Crect data-k='text' x='175.9' y='315.4' width='24' height='3' rx='1.5' fill='%238a8a8a'/%3E%3Crect data-k='text' x='286.1' y='306.8' width='18' height='1.9' rx='1' fill='%238a8a8a'/%3E%3Crect data-k='text' x='282' y='315.4' width='26.3' height='3' rx='1.5' fill='%238a8a8a'/%3E%3Crect data-k='text' x='393' y='306.8' width='18' height='1.9' rx='1' fill='%238a8a8a'/%3E%3Crect data-k='text' x='373.5' y='315.4' width='57.4' height='3' rx='1.5' fill='%238a8a8a'/%3E%3C/g%3E%3C/svg%3E",
|
|
3976
|
+
"faqColumns": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='47.1' width='462' height='225.8' fill='%23f0f0f0'/%3E%3Crect data-k='frame' x='27.4' y='197.5' width='168.4' height='27.4' rx='4' fill='none' stroke='%23d4d4d4'/%3E%3Ccircle data-k='icon' cx='191.3' cy='99.6' r='4.5' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='72.8' cy='220.5' r='2.7' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='452.6' cy='105.6' r='3' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='452.6' cy='131.5' r='3' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='452.6' cy='157.4' r='3' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='452.6' cy='183.3' r='3' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='452.6' cy='209.1' r='3' fill='%23a3a3a3'/%3E%3Crect data-k='heading' x='27.4' y='121.4' width='164.6' height='11.3' rx='5.7' fill='%23262626'/%3E%3Crect data-k='heading' x='27.4' y='140.1' width='147.8' height='11.3' rx='5.7' fill='%23262626'/%3E%3Crect data-k='heading' x='219.8' y='106' width='57.8' height='4.1' rx='2.1' fill='%23262626'/%3E%3Crect data-k='heading' x='219.8' y='131.9' width='89.3' height='4.1' rx='2.1' fill='%23262626'/%3E%3Crect data-k='heading' x='219.8' y='157.8' width='57.4' height='4.1' rx='2.1' fill='%23262626'/%3E%3Crect data-k='heading' x='219.8' y='183.6' width='98.3' height='4.1' rx='2.1' fill='%23262626'/%3E%3Crect data-k='heading' x='219.8' y='209.5' width='88.1' height='4.1' rx='2.1' fill='%23262626'/%3E%3Crect data-k='text' x='32.3' y='99.3' width='28.1' height='2.3' rx='1.2' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='167.1' width='164.6' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='176.1' width='70.1' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='209.1' width='47.3' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='218.9' width='39.8' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E",
|
|
3977
|
+
"testimonialMasonry": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='9' width='462' height='331.5' fill='%23f0f0f0'/%3E%3Crect data-k='image' x='36.4' y='178.9' width='13.5' height='13.5' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M36.4 178.9L49.9 192.4M49.9 178.9L36.4 192.4' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='181.1' y='178.9' width='13.5' height='13.5' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M181.1 178.9L194.6 192.4M194.6 178.9L181.1 192.4' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='36.4' y='256.9' width='13.5' height='13.5' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M36.4 256.9L49.9 270.4M49.9 256.9L36.4 270.4' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='325.9' y='256.9' width='13.5' height='13.5' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M325.9 256.9L339.4 270.4M339.4 256.9L325.9 270.4' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='button' x='205.1' y='271.5' width='73.1' height='21' rx='10.5' fill='%23525252'/%3E%3Crect data-k='heading' x='115.5' y='76.1' width='252' height='11.3' rx='5.7' fill='%23262626'/%3E%3Crect data-k='text' x='218.3' y='59.3' width='46.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='130.1' y='102.8' width='223.1' height='3.4' rx='1.7' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='142.9' width='116.3' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='152.6' width='102.8' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='162.4' width='106.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='54.4' y='180' width='41.3' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='54.4' y='188.6' width='75.8' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='181.1' y='142.9' width='105.8' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='181.1' y='152.6' width='76.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='199.1' y='180' width='34.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='199.1' y='188.6' width='37.5' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='325.9' y='142.9' width='103.1' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='325.9' y='152.6' width='106.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='325.9' y='162.4' width='37.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='330' y='184.5' width='5.6' height='2.3' rx='1.2' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='343.9' y='180' width='30.4' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='343.9' y='188.6' width='44.3' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='220.9' width='116.3' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='230.6' width='118.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='240.4' width='48.8' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='54.4' y='258' width='45.4' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='54.4' y='266.6' width='37.1' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='181.1' y='220.9' width='103.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='181.1' y='230.6' width='112.1' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='181.1' y='240.4' width='40.1' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='184.9' y='263.6' width='6.4' height='2.3' rx='1.2' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='199.1' y='262.9' width='43.9' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='325.9' y='220.9' width='118.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='325.9' y='230.6' width='108' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='343.9' y='258' width='29.6' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='343.9' y='266.6' width='28.5' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E",
|
|
3978
|
+
"statsBand": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='82' width='462' height='156' fill='%23f0f0f0'/%3E%3Crect data-k='heading' x='39.8' y='145.8' width='28.5' height='8.3' rx='4.2' fill='%23262626'/%3E%3Crect data-k='heading' x='146.6' y='145.8' width='45.8' height='8.3' rx='4.2' fill='%23262626'/%3E%3Crect data-k='heading' x='253.9' y='145.8' width='42.8' height='8.3' rx='4.2' fill='%23262626'/%3E%3Crect data-k='heading' x='360.8' y='145.8' width='12.8' height='8.3' rx='4.2' fill='%23262626'/%3E%3Crect data-k='text' x='39.8' y='163.4' width='80.6' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='39.8' y='171.6' width='30.8' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='146.6' y='163.4' width='72.8' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='146.6' y='171.6' width='39.4' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='253.9' y='163.4' width='80.6' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='253.9' y='171.6' width='46.1' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='360.8' y='163.4' width='78' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='360.8' y='171.6' width='28.5' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E",
|
|
3979
|
+
"richText": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='9' width='462' height='366.4' fill='%23f0f0f0'/%3E%3Crect data-k='image' x='27.4' y='111' width='252.8' height='189.4' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.4 111L280.2 300.4M280.2 111L27.4 300.4' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='heading' x='27.4' y='59.6' width='83.6' height='3.8' rx='1.9' fill='%23262626'/%3E%3Crect data-k='text' x='27.4' y='69' width='234.4' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='78' width='242.6' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='87' width='36.8' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='96' width='248.6' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='105' width='22.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='303.4' width='76.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='312.4' width='91.5' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='321.4' width='108' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E",
|
|
3980
|
+
"nap": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='85' width='462' height='150' fill='%23f0f0f0'/%3E%3Ccircle data-k='icon' cx='30.4' cy='151.8' r='3' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='30.4' cy='172.8' r='3' fill='%23a3a3a3'/%3E%3Ccircle data-k='icon' cx='30.4' cy='183.3' r='3' fill='%23a3a3a3'/%3E%3Crect data-k='heading' x='27.4' y='135.6' width='61.1' height='3.8' rx='1.9' fill='%23262626'/%3E%3Crect data-k='text' x='36.4' y='150.6' width='68.6' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='158.1' width='44.6' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='171.6' width='65.3' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.4' y='182.1' width='90.4' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E",
|
|
3981
|
+
"resources": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 320'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Crect width='480' height='320'/%3E%3C/clipPath%3E%3C/defs%3E%3Crect width='480' height='320' fill='%23ffffff'/%3E%3Cg clip-path='url(%23c)'%3E%3Crect data-k='surface' x='9' y='9' width='462' height='369.4' fill='%23f0f0f0'/%3E%3Crect data-k='image' x='27.8' y='117.4' width='207.4' height='116.6' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M27.8 117.4L235.2 234M235.2 117.4L27.8 234' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='36.8' y='309' width='12' height='12' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M36.8 309L48.8 321M48.8 309L36.8 321' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='253.9' y='123.4' width='36' height='36' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M253.9 123.4L289.9 159.4M289.9 123.4L253.9 159.4' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='295.9' y='163.9' width='12' height='12' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M295.9 163.9L307.9 175.9M307.9 163.9L295.9 175.9' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='image' x='295.9' y='312' width='12' height='12' rx='3' fill='%23e5e5e5' stroke='%23a3a3a3'/%3E%3Cpath data-k='image-x' d='M295.9 312L307.9 324M307.9 312L295.9 324' stroke='%23a3a3a3' stroke-width='0.75'/%3E%3Crect data-k='heading' x='27.4' y='76.5' width='154.1' height='7.1' rx='3.6' fill='%23262626'/%3E%3Crect data-k='heading' x='36.8' y='261.4' width='171.8' height='5.6' rx='2.8' fill='%23262626'/%3E%3Crect data-k='heading' x='36.8' y='273.4' width='54' height='5.6' rx='2.8' fill='%23262626'/%3E%3Crect data-k='heading' x='295.9' y='137.3' width='105.8' height='3.8' rx='1.9' fill='%23262626'/%3E%3Crect data-k='heading' x='295.9' y='211.1' width='93.4' height='3.8' rx='1.9' fill='%23262626'/%3E%3Crect data-k='heading' x='295.9' y='285.4' width='104.3' height='3.8' rx='1.9' fill='%23262626'/%3E%3Crect data-k='text' x='32.3' y='61.1' width='20.3' height='2.3' rx='1.2' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='27.4' y='93' width='216' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='40.9' y='246.4' width='19.1' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='70.5' y='246.4' width='15.8' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='36.8' y='288' width='173.3' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='36.8' y='297' width='60.4' height='3' rx='1.5' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='52.5' y='313.9' width='61.1' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='300' y='126.8' width='21' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='331.5' y='126.8' width='15' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='295.9' y='146.3' width='129' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='311.6' y='168.4' width='66' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='300' y='201' width='18.8' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='298.9' y='242.6' width='6' height='2.3' rx='1.2' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='311.6' y='242.6' width='61.9' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='300' y='274.9' width='19.1' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='329.6' y='274.9' width='16.9' height='2.3' rx='1.2' fill='%238a8a8a'/%3E%3Crect data-k='text' x='295.9' y='294.4' width='94.5' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3Crect data-k='text' x='311.6' y='316.9' width='70.5' height='2.6' rx='1.3' fill='%23a3a3a3'/%3E%3C/g%3E%3C/svg%3E"
|
|
3982
|
+
};
|
|
3983
|
+
//#endregion
|
|
3984
|
+
//#region src/plugins/block-drawer.ts
|
|
3985
|
+
/**
|
|
3986
|
+
* Payload's Add Block drawer, larger: three cards across instead of six,
|
|
3987
|
+
* two at Payload's mid breakpoint (1024px), one on small (768px). One size
|
|
3988
|
+
* for every block. Payload's own rules sit in `@layer payload-default`, so
|
|
3989
|
+
* these unlayered ones win without raising specificity.
|
|
3990
|
+
*/
|
|
3991
|
+
const BLOCK_DRAWER_CSS = [
|
|
3992
|
+
".blocks-drawer__blocks{grid-template-columns:repeat(3,minmax(0,1fr))}",
|
|
3993
|
+
"@media (max-width:1024px){.blocks-drawer__blocks{grid-template-columns:repeat(2,minmax(0,1fr))}}",
|
|
3994
|
+
"@media (max-width:768px){.blocks-drawer__blocks{grid-template-columns:minmax(0,1fr)}}"
|
|
3995
|
+
].join("\n");
|
|
3996
|
+
const CATEGORY_LABELS = new Map(BLOCK_LIBRARY_CATEGORIES.map((entry) => [entry.id, entry.label]));
|
|
3997
|
+
const CATEGORY_ORDER = new Map(BLOCK_LIBRARY_CATEGORIES.map((entry, index) => [entry.id, index]));
|
|
3998
|
+
/**
|
|
3999
|
+
* Each catalogue block gets its category's label as `admin.group`, the
|
|
4000
|
+
* heading Payload's drawer files it under, and the list is ordered by
|
|
4001
|
+
* category, then catalogue order, so the drawer reads the way the Block
|
|
4002
|
+
* library does. A block outside the catalogue keeps its own settings and
|
|
4003
|
+
* goes last. Payload draws ungrouped blocks last too: its `_none` group is
|
|
4004
|
+
* built first but `.blocks-drawer__block-group-none` has `order: 1` in the
|
|
4005
|
+
* drawer's column. Blocks are copied, never written to: one config can sit
|
|
4006
|
+
* in several fields.
|
|
4007
|
+
*/
|
|
4008
|
+
function groupBlocksByCategory(blocks, catalogue) {
|
|
4009
|
+
const rank = (slug) => {
|
|
4010
|
+
const index = catalogue.findIndex((entry) => entry.slug === slug);
|
|
4011
|
+
if (index < 0) return [Number.MAX_SAFE_INTEGER, 0];
|
|
4012
|
+
const category = catalogue[index].category;
|
|
4013
|
+
return [CATEGORY_ORDER.get(category) ?? BLOCK_LIBRARY_CATEGORIES.length, index];
|
|
4014
|
+
};
|
|
4015
|
+
const stamped = blocks.map((block, position) => {
|
|
4016
|
+
const entry = catalogue.find((row) => row.slug === block.slug);
|
|
4017
|
+
const label = entry ? CATEGORY_LABELS.get(entry.category) : void 0;
|
|
4018
|
+
return {
|
|
4019
|
+
block: label ? {
|
|
4020
|
+
...block,
|
|
4021
|
+
admin: {
|
|
4022
|
+
...block.admin,
|
|
4023
|
+
group: label
|
|
4024
|
+
}
|
|
4025
|
+
} : block,
|
|
4026
|
+
rank: rank(block.slug),
|
|
4027
|
+
position
|
|
4028
|
+
};
|
|
4029
|
+
});
|
|
4030
|
+
stamped.sort((a, b) => a.rank[0] - b.rank[0] || a.rank[1] - b.rank[1] || a.position - b.position);
|
|
4031
|
+
return stamped.map((entry) => entry.block);
|
|
4032
|
+
}
|
|
4033
|
+
/**
|
|
4034
|
+
* A block's drawer picture: its own `admin.images.thumbnail` or `imageURL`
|
|
4035
|
+
* when it has one, otherwise the wireframe for its slug. Copies, never writes.
|
|
4036
|
+
*/
|
|
4037
|
+
function withThumbnail(block, thumbnails) {
|
|
4038
|
+
const url = thumbnails[block.slug];
|
|
4039
|
+
if (!url || block.admin?.images?.thumbnail || block.imageURL) return block;
|
|
4040
|
+
const singular = block.labels?.singular;
|
|
4041
|
+
const label = typeof singular === "string" ? singular : block.slug;
|
|
4042
|
+
return {
|
|
4043
|
+
...block,
|
|
4044
|
+
admin: {
|
|
4045
|
+
...block.admin,
|
|
4046
|
+
images: {
|
|
4047
|
+
...block.admin?.images,
|
|
4048
|
+
thumbnail: {
|
|
4049
|
+
url,
|
|
4050
|
+
alt: `${label} layout`
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4053
|
+
}
|
|
4054
|
+
};
|
|
4055
|
+
}
|
|
4056
|
+
/** The drawer pictures: the package's wireframes, then the site extras' own. */
|
|
4057
|
+
function thumbnailsOf(config) {
|
|
4058
|
+
const site = ((config.globals?.find((entry) => entry.slug === BLOCK_LIBRARY_SLUG))?.custom)?.blockLibraryThumbnails;
|
|
4059
|
+
return {
|
|
4060
|
+
...PACKAGE_WIREFRAMES,
|
|
4061
|
+
...site
|
|
4062
|
+
};
|
|
4063
|
+
}
|
|
4064
|
+
/** The catalogue the site's Block library holds (package rows plus its extras). */
|
|
4065
|
+
function catalogueOf(config) {
|
|
4066
|
+
const rows = (((config.globals?.find((entry) => entry.slug === BLOCK_LIBRARY_SLUG))?.fields.find((entry) => "name" in entry && entry.name === "blocks"))?.admin)?.custom?.rows;
|
|
4067
|
+
if (Array.isArray(rows)) return rows.filter((row) => Boolean(row) && typeof row === "object" && typeof row.slug === "string" && typeof row.category === "string");
|
|
4068
|
+
return blockLibraryCatalogue([]).map(({ slug, category }) => ({
|
|
4069
|
+
slug,
|
|
4070
|
+
category
|
|
4071
|
+
}));
|
|
4072
|
+
}
|
|
4073
|
+
/**
|
|
4074
|
+
* Every field, with each `blocks` field's list grouped and pictured. Only
|
|
4075
|
+
* catalogue blocks are touched, so a header's item blocks keep Payload's
|
|
4076
|
+
* defaults. Blocks inside blocks are walked too.
|
|
4077
|
+
*/
|
|
4078
|
+
function withDrawer(fields, inputs) {
|
|
4079
|
+
return fields.map((field) => {
|
|
4080
|
+
if (field.type === "tabs") return {
|
|
4081
|
+
...field,
|
|
4082
|
+
tabs: field.tabs.map((tab) => ({
|
|
4083
|
+
...tab,
|
|
4084
|
+
fields: withDrawer(tab.fields, inputs)
|
|
4085
|
+
}))
|
|
4086
|
+
};
|
|
4087
|
+
if (field.type === "blocks") {
|
|
4088
|
+
const inCatalogue = (slug) => inputs.catalogue.some((entry) => entry.slug === slug);
|
|
4089
|
+
const blocks = groupBlocksByCategory(field.blocks ?? [], inputs.catalogue).map((block) => ({
|
|
4090
|
+
...inCatalogue(block.slug) ? withThumbnail(block, inputs.thumbnails) : block,
|
|
4091
|
+
fields: withDrawer(block.fields, inputs)
|
|
4092
|
+
}));
|
|
4093
|
+
return {
|
|
4094
|
+
...field,
|
|
4095
|
+
blocks
|
|
4096
|
+
};
|
|
4097
|
+
}
|
|
4098
|
+
if ("fields" in field && Array.isArray(field.fields)) return {
|
|
4099
|
+
...field,
|
|
4100
|
+
fields: withDrawer(field.fields, inputs)
|
|
4101
|
+
};
|
|
4102
|
+
return field;
|
|
4103
|
+
});
|
|
4104
|
+
}
|
|
4105
|
+
function withoutBlockDrawer(providers) {
|
|
4106
|
+
return providers.filter((entry) => {
|
|
4107
|
+
if (typeof entry === "string") return entry !== BLOCK_DRAWER_STYLES;
|
|
4108
|
+
if (entry && typeof entry === "object" && "path" in entry) return entry.path !== BLOCK_DRAWER_STYLES;
|
|
4109
|
+
return true;
|
|
4110
|
+
});
|
|
4111
|
+
}
|
|
4112
|
+
/**
|
|
4113
|
+
* Payload's Add Block drawer, read from the Block library. Payload has no
|
|
4114
|
+
* slot to replace the drawer, and three places open it (the field's Add,
|
|
4115
|
+
* Add below in a row's menu, the Preview overlay), so this plugin sets what
|
|
4116
|
+
* the drawer itself reads on each catalogue block: `admin.group` (its
|
|
4117
|
+
* category heading, in Block library order) and `admin.images.thumbnail`
|
|
4118
|
+
* (a black-and-white wireframe: the package's for its blocks, a site
|
|
4119
|
+
* extra's `thumbnail` for its own; a block config that sets a picture
|
|
4120
|
+
* keeps it). One stylesheet makes the cards larger.
|
|
4121
|
+
*
|
|
4122
|
+
* Runs late (`order`) so blocks other plugins add are grouped too.
|
|
4123
|
+
*/
|
|
4124
|
+
const blockDrawer = definePlugin({
|
|
4125
|
+
slug: "block-drawer",
|
|
4126
|
+
order: 1e3,
|
|
4127
|
+
plugin: ({ config }) => {
|
|
4128
|
+
const inputs = {
|
|
4129
|
+
catalogue: catalogueOf(config),
|
|
4130
|
+
thumbnails: thumbnailsOf(config)
|
|
4131
|
+
};
|
|
4132
|
+
const providers = withoutBlockDrawer(config.admin?.components?.providers ?? []);
|
|
4133
|
+
return {
|
|
4134
|
+
...config,
|
|
4135
|
+
collections: config.collections?.map((collection) => ({
|
|
4136
|
+
...collection,
|
|
4137
|
+
fields: withDrawer(collection.fields, inputs)
|
|
4138
|
+
})),
|
|
4139
|
+
globals: config.globals?.map((global) => ({
|
|
4140
|
+
...global,
|
|
4141
|
+
fields: withDrawer(global.fields, inputs)
|
|
4142
|
+
})),
|
|
4143
|
+
admin: {
|
|
4144
|
+
...config.admin,
|
|
4145
|
+
components: {
|
|
4146
|
+
...config.admin?.components,
|
|
4147
|
+
providers: [...providers, {
|
|
4148
|
+
path: BLOCK_DRAWER_STYLES,
|
|
4149
|
+
clientProps: { css: BLOCK_DRAWER_CSS }
|
|
4150
|
+
}]
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
};
|
|
4154
|
+
}
|
|
4155
|
+
});
|
|
4156
|
+
//#endregion
|
|
4157
|
+
export { ADMIN_NAV, ADMIN_NAV_ENTITY_FIELD, ADMIN_NAV_ITEM_ROW_LABEL, ADMIN_NAV_ROW_LABEL, ADMIN_NAV_SLUG, BLOCK_DRAWER_CSS, BLOCK_DRAWER_STYLES, BLOCK_LIBRARY_CATEGORIES, BLOCK_LIBRARY_FIELD, BLOCK_LIBRARY_SLUG, BRAND_ASSETS_MIME_TYPES, BRAND_ASSETS_SLUG, CAPABILITIES, CAPABILITY_FEATURES, DEFAULT_ROLE_GRANTS, DEFAULT_ROLE_MATRIX, DEFAULT_SECTION_CONTROLS, DESCRIPTION_LENGTH, DEVELOPER_DESCRIPTION, DOCUMENT_CREATE_NEW, DOCUMENT_TITLE_ACTIONS, DUPLICATE_ROLE_NAME_MESSAGE, DUPLICATE_ROLE_SLUG_MESSAGE, EXISTING_PARENT_MESSAGE, EXTERNAL_HREF_MESSAGE, FEATURES_MATRIX_FIELD, FEATURES_SLUG, FEATURE_GROUPS, FEATURE_GROUP_LABELS, FOOTER_COLUMNS_FIELD, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, HERO_SECTION_CONTROLS, INVALID_ROLE_NAME_MESSAGE, LAST_ADMIN_DELETE_MESSAGE, LAST_ADMIN_DEMOTE_MESSAGE, LAST_USERS_TICK_MESSAGE, LAYOUT_DESCRIPTION, LAYOUT_REQUIRED_LABEL, LAYOUT_REQUIRED_MESSAGE, LIST_ALIGN, LOOK_FIELD, MEDIA_ALT_AUTOFILL, MEDIA_IN_USE_PATH, MEDIA_LIST, MISSING_PACKAGE_FEATURES_MESSAGE, MISSING_SEED_ROLES_MESSAGE, NAVIGATION_DB_NAME, NAVIGATION_FEATURE, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, NEW_FOLDER_PARENT, NO_SECTION_CONTROLS, PACKAGE_BLOCK_SLUGS, PACKAGE_FEATURES, PACKAGE_FEATURE_SLUGS, PAGE_EDITOR_SYSTEM_KEYS, PAGE_SLUG_CELL, PAGE_TITLE_CELL, QUESTIONS_FEATURE, QUESTIONS_LIST, QUESTIONS_SLUG, REDIRECTS_SLUG, REQUIRED_PAGE_CELL, REQUIRED_PAGE_DELETE_MESSAGE, REQUIRED_PAGE_FIELD, REQUIRED_PAGE_UNPUBLISH_MESSAGE, ROLES, ROLES_CELL, ROLES_FIELD, ROLES_FIELD_DESCRIPTION, ROLES_GLOBAL_DESCRIPTION, ROLES_GRANTS_FIELD, ROLES_LOCKOUT_MESSAGE, ROLES_MATRIX_FIELD, ROLES_ROW_LABEL, ROLES_SLUG, ROLE_LABELS, ROLE_NAME_FIELD, ROLE_SLUG_FIELD, ROOT_PAGE_KEY, ROOT_PAGE_SLUG, SECTION_CONTROL_KEYS, SECTION_CONTROL_LABELS, SHARE_IMAGE_SIZE, SLUG_FIELD, SLUG_UNLOCK_WARNING, SYSTEM_COLOR_KEYS, THEME_APPEARANCE_FIELD, THEME_APPEARANCE_SLUG, THEME_COLORS_SLUG, THEME_COLOR_FIELD, THEME_COLOR_SCALE_FIELD, THEME_CONTRAST_REPORT, THEME_DOCUMENT_CONTROLS, THEME_FEATURE_SLUGS, THEME_FONT_FIELD, THEME_GREY_SCALE_FIELD, THEME_IDENTITY_FALLBACK, THEME_IDENTITY_SLUG, THEME_LIBRARY_FIELD, THEME_PAIRING_FIELD, THEME_PREVIEW_BREAKPOINTS, THEME_PUBLISH_FIELD, THEME_SAVE_BUTTON, THEME_SECTION_HEADING, THEME_SLUG, THEME_TYPOGRAPHY_SLUG, adminNav, adminOnlyApiTab, allowedFeaturesForUser, altFromFilename, applyRoleSlugsFromNames, authenticatedOrPublished, blockDrawer, blockLibraryCatalogue, blockLibraryEntriesFromConfig, blockUsage, canManageBrand, canManageContent, canPublish, canUseFeature, colorTokenField, composeSlug, createAdminNav, createBlockLibrary, createBrandAssets, createFeatures, createMedia, createNavigation, createPages, createQuestions, createRedirects, createRoles, createTaxonomy, createTheme, createUsers, defaultBlockLibraryValue, defaultFeaturesFieldValue, defaultRolesFieldValue, defaultSectionControls, deleteLibraryColor, developerOnlyAccess, documentCreateNew, documentTitle, documentTitleActions, ensureRootPage, facetField, featureCatalogue, featureGroupLabel, fillBlankAltFromFilename, findColorTokens, findColorUsages, firstImageIn, footerDesktopTracks, getFeaturesMatrix, getNavigation, getRolesMatrix, getSectionControls, groupBlocksByCategory, hasCapability, hasFeature, hasGrant, hasRole, headerCtaEnabled, hideUnlessDeveloper, hideUnlessFeature, inferredFolders, isAdmin, isAdminOrSelf, isAuthenticated, isDeveloper, isDeveloperTab, isFeatureGroupId, isFeatureSlug, isLockedFeature, isPackageFeatureSlug, isPrivilegedRole, isRole, isRoleName, isRoleSlug, isRootPageKey, isValidExternalHref, lexicalPlainText, listAlign, listAlignColumns, listAlignCss, lockSlugOnPublish, lookField, noIndexField, normalizeFooterDesktop, normalizeSlug, normalizeStoredRoles, pageEditorLooks, pageEditorTokens, parentPrefix, parseFeaturesMatrix, parseRolesMatrix, persistThemeChild, pruneUserRoles, publishThemeChild, recordPublishedSlugRedirect, redirectPath, replaceClientOriginalWithResizedFile, requireLayoutOnPublish, resetRolesMatrix, resolveAdminNav, resolveThemeIdentity, rewriteColorToken, rewriteColorTokens, rewriteColorUsages, roleDescription, roleLabel, roleSelectOptions, sanitizeRoleNameInput, sanitizeSvg, sectionControlsFromLibrary, sectionControlsOf, seedFeatures, seedRoleRows, seedRoles, seedTheme, seoPlugin, slugDepth, slugField, slugLeaf, slugifyRoleName, stampBlockLibrary, stampFeatureCatalogue, storedRoles, stripDrafts, syncAnswerText, themeColorKeys, themeLibraryFromDoc, titleTemplate, truncateAtWord, validateBlockLibrary, validateExternalHref, validateFeaturesMatrix, validateFooterColumns, validateFooterSocialUrl, validateHeaderCta, validateRolesMatrix, withThumbnail, writePublishedSlugRedirect };
|
|
3961
4158
|
|
|
3962
4159
|
//# sourceMappingURL=index.mjs.map
|