import { StoreContextFactory } from 'refun' ; import { store } from './store' ; import { injectReducerFactory } from './utils' ; import { reducer } from './reducers' ; import { navigateAction , resetTransformAction , setWidthAction , setHeightAction , setResolutionAction , setTransformAction , toggleGridAction , toggleCanvasDarkModeAction , toggleControlsSidebarAction , toggleNavigationSidebarAction , toggleInspectAction , toggleStretchAction , } from './actions' ; import type { TNavigateAction , TSetWidthAction , TSetHeightAction , TSetResolutionAction , TSetTransformAction } from './actions' ; const StoreContext = StoreContextFactory ( store ) ; export const mapStoreState = StoreContext . mapStoreState ; export const injectReducer = injectReducerFactory ( store , reducer , StoreContext . Context ) ; export const navigate = ( payload ) => { store . dispatch ( navigateAction ( payload ) ) ; } ; export const resetTransform = ( ) => { store . dispatch ( resetTransformAction ( ) ) ; } ; export const setWidth = ( payload ) => { store . dispatch ( setWidthAction ( payload ) ) ; } ; export const setHeight = ( payload ) => { store . dispatch ( setHeightAction ( payload ) ) ; } ; export const setResolution = ( payload ) => { store . dispatch ( setResolutionAction ( payload ) ) ; } ; export const setTransform = ( payload ) => { store . dispatch ( setTransformAction ( payload ) ) ; } ; export const toggleGrid = ( ) => { store . dispatch ( toggleGridAction ( ) ) ; } ; export const toggleCanvasDarkMode = ( ) => { store . dispatch ( toggleCanvasDarkModeAction ( ) ) ; } ; export const toggleControlsSidebar = ( ) => { store . dispatch ( toggleControlsSidebarAction ( ) ) ; } ; export const toggleNavigationSidebar = ( ) => { store . dispatch ( toggleNavigationSidebarAction ( ) ) ; } ; export const toggleInspect = ( ) => { store . dispatch ( toggleInspectAction ( ) ) ; } ; export const toggleStretch = ( ) => { store . dispatch ( toggleStretchAction ( ) ) ; } ; export type { TAction , TActionCreator , TActionWithPayload , TAnyAction , TState } from './types' ;