Files
klz-cables.com/.pnpm-store/v10/files/a0/5d67fd90898478ede6275e546069dff4ac0932c7a4e0f40e3ca498b1bc064adc09b3229841f4b64a9fd335e2543e624de2dc7fc090392800ad596073810262
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

86 lines
2.8 KiB
Plaintext

import { createClientFields } from '../../fields/config/client.js';
const serverOnlyProperties = [
'hooks',
'access',
'endpoints',
'custom',
'flattenedFields'
];
const serverOnlyGlobalAdminProperties = [
'hidden',
'components'
];
export const createClientGlobalConfig = ({ defaultIDType, global, i18n, importMap })=>{
const clientGlobal = {};
for(const key in global){
if (serverOnlyProperties.includes(key)) {
continue;
}
switch(key){
case 'admin':
if (!global.admin) {
break;
}
clientGlobal.admin = {};
for(const adminKey in global.admin){
if (serverOnlyGlobalAdminProperties.includes(adminKey)) {
continue;
}
switch(adminKey){
case 'livePreview':
if (!global.admin.livePreview) {
break;
}
clientGlobal.admin.livePreview = {};
if (global.admin.livePreview.breakpoints) {
clientGlobal.admin.livePreview.breakpoints = global.admin.livePreview.breakpoints;
}
break;
case 'preview':
clientGlobal.admin.preview = true;
break;
default:
;
clientGlobal.admin[adminKey] = global.admin[adminKey];
}
}
break;
case 'fields':
clientGlobal.fields = createClientFields({
defaultIDType,
fields: global.fields,
i18n,
importMap
});
break;
case 'label':
clientGlobal.label = typeof global.label === 'function' ? global.label({
i18n,
t: i18n.t
}) : global.label;
break;
default:
{
;
clientGlobal[key] = global[key];
break;
}
}
}
return clientGlobal;
};
export const createClientGlobalConfigs = ({ defaultIDType, globals, i18n, importMap })=>{
const clientGlobals = new Array(globals.length);
for(let i = 0; i < globals.length; i++){
const global = globals[i];
clientGlobals[i] = createClientGlobalConfig({
defaultIDType,
global: global,
i18n,
importMap
});
}
return clientGlobals;
};
//# sourceMappingURL=client.js.map