@brandboostinggmbh/painless
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -16,2 +16,22 @@ const defineSchema = (schema) => { | ||
}; | ||
const isInputSetting = (setting) => { | ||
return setting.type !== "header" && setting.type !== "paragraph"; | ||
}; | ||
const useGlobalBlock = (prefix, block) => { | ||
var _a; | ||
const settings = ((_a = block.settings) == null ? void 0 : _a.map((setting) => { | ||
if (isInputSetting(setting)) { | ||
return { | ||
...setting, | ||
id: `${prefix}_${setting.id}` | ||
}; | ||
} else { | ||
return setting; | ||
} | ||
})) ?? []; | ||
return { | ||
...block, | ||
settings | ||
}; | ||
}; | ||
export { | ||
@@ -22,3 +42,4 @@ defineBlock, | ||
defineThemeBlockSchema, | ||
defineThemeSettingsSchema | ||
defineThemeSettingsSchema, | ||
useGlobalBlock | ||
}; |
export * from './defineSchema'; | ||
export * from './defineTemplate'; | ||
export * from './defineThemeSettingsSchema'; | ||
export * from './useGlobalBlock'; |
{ | ||
"name": "@brandboostinggmbh/painless", | ||
"private": false, | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
43657
33
1332