| 1 |
/** |
| 2 |
* External dependencies |
| 3 |
*/ |
| 4 |
|
| 5 |
/** |
| 6 |
* WordPress dependencies |
| 7 |
*/ |
| 8 |
import { createReduxStore, register, combineReducers } from "@wordpress/data"; |
| 9 |
import { controls } from "@wordpress/data-controls"; |
| 10 |
|
| 11 |
/** |
| 12 |
* Internal dependencies |
| 13 |
*/ |
| 14 |
import { |
| 15 |
previewModesActions, |
| 16 |
previewModesSelectors, |
| 17 |
previewModesReducer, |
| 18 |
} from "./preview-modes"; |
| 19 |
|
| 20 |
import { |
| 21 |
typographyActions, |
| 22 |
typographySelectors, |
| 23 |
typographyResolvers, |
| 24 |
typographyReducer, |
| 25 |
postTypographyReducer, |
| 26 |
} from "./typography"; |
| 27 |
|
| 28 |
import { |
| 29 |
missingBlocksActions, |
| 30 |
missingBlocksSelectors, |
| 31 |
missingBlocksReducer, |
| 32 |
} from "./missing-blocks"; |
| 33 |
|
| 34 |
import { navRefActions, navRefSelectors, navRefReducer } from "./nav-ref"; |
| 35 |
|
| 36 |
/** |
| 37 |
* Icon library store |
| 38 |
*/ |
| 39 |
import "./icon-library"; |
| 40 |
|
| 41 |
/** |
| 42 |
* Constants |
| 43 |
*/ |
| 44 |
const storeName = "boldblocks/data"; |
| 45 |
|
| 46 |
/** |
| 47 |
* Register store |
| 48 |
*/ |
| 49 |
export const store = createReduxStore(storeName, { |
| 50 |
selectors: { |
| 51 |
...typographySelectors, |
| 52 |
...previewModesSelectors, |
| 53 |
...missingBlocksSelectors, |
| 54 |
...navRefSelectors, |
| 55 |
}, |
| 56 |
actions: { |
| 57 |
...typographyActions, |
| 58 |
...previewModesActions, |
| 59 |
...missingBlocksActions, |
| 60 |
...navRefActions, |
| 61 |
}, |
| 62 |
controls, |
| 63 |
reducer: combineReducers({ |
| 64 |
previewModes: previewModesReducer, |
| 65 |
typography: typographyReducer, |
| 66 |
postTypography: postTypographyReducer, |
| 67 |
missingBlocks: missingBlocksReducer, |
| 68 |
navRefs: navRefReducer, |
| 69 |
}), |
| 70 |
resolvers: { |
| 71 |
...typographyResolvers, |
| 72 |
}, |
| 73 |
}); |
| 74 |
|
| 75 |
register(store); |
| 76 |
|