feat: ✨ add a method to extend convertable widget types

This commit is contained in:
Mel Massadian 2024-06-05 14:25:10 +02:00
parent b1fd26fe9e
commit c1bf0ab92c
No known key found for this signature in database
GPG Key ID: 1DFF0E9F71C7C85A

View File

@ -12,6 +12,12 @@ export function getWidgetConfig(slot) {
return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]();
}
export function addValidType(type) {
if (!VALID_TYPES.includes(type)) {
VALID_TYPES.push(type);
}
}
function getConfig(widgetName) {
const { nodeData } = this.constructor;
return nodeData?.input?.required[widgetName] ?? nodeData?.input?.optional?.[widgetName];