import { applyFilters, doAction } from '@wordpress/hooks';

export const getTabs = ( tabs ) => applyFilters( 'edfw.tabs', tabs );
export const getFields = ( tab, fields, state ) => applyFilters( `edfw.fields.${ tab }`, fields, state );
export const getRuleConditions = ( conditions ) => applyFilters( 'edfw.rule.conditions', conditions );
export const getPreviewContexts = ( contexts ) => applyFilters( 'edfw.preview.contexts', contexts );
export const notifySaved = ( state ) => doAction( 'edfw.saved', state );
