import { StoreContextFactory } from 'refun' ; import type { TComponents } from '../types' ; import { setComponentListThunk , applyPropPathValue , updateComponentPropsThunk , setComponentThunk , selectElementAction } from './actions' ; import { store } from './store' ; import type { TMetaState } from './types' ; export const mapMetaStoreState = StoreContextFactory ( store ) . mapStoreState ; export const setComponentsList = ( components ) => { store . dispatch ( setComponentListThunk ( components ) ) ; } ; export const updateComponentProps = ( componentKey , propsIndex ) : Promise < void > => { return store . dispatch ( updateComponentPropsThunk ( componentKey , propsIndex ) ) ; } ; export const setComponentKey = ( componentKey ) => { store . dispatch ( setComponentThunk ( componentKey ) ) ; } ; export const applyPropValue = ( propPath , propValue ) => { store . dispatch ( applyPropPathValue ( propPath , propValue ) ) ; } ; export const selectElement = ( payload ) => { store . dispatch ( selectElementAction ( { selectedElementPath : payload } ) ) ; } ;