@wordpress/core-data 7.32.0 → 7.32.1-next.ff1cebbba.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/build/actions.js +375 -632
  2. package/build/actions.js.map +7 -1
  3. package/build/batch/create-batch.js +49 -62
  4. package/build/batch/create-batch.js.map +7 -1
  5. package/build/batch/default-processor.js +43 -39
  6. package/build/batch/default-processor.js.map +7 -1
  7. package/build/batch/index.js +38 -17
  8. package/build/batch/index.js.map +7 -1
  9. package/build/dynamic-entities.js +30 -32
  10. package/build/dynamic-entities.js.map +7 -1
  11. package/build/entities.js +298 -410
  12. package/build/entities.js.map +7 -1
  13. package/build/entity-context.js +29 -12
  14. package/build/entity-context.js.map +7 -1
  15. package/build/entity-provider.js +38 -46
  16. package/build/entity-provider.js.map +7 -1
  17. package/build/entity-types/attachment.js +16 -5
  18. package/build/entity-types/attachment.js.map +7 -1
  19. package/build/entity-types/base-entity-records.js +16 -42
  20. package/build/entity-types/base-entity-records.js.map +7 -1
  21. package/build/entity-types/base.js +16 -5
  22. package/build/entity-types/base.js.map +7 -1
  23. package/build/entity-types/comment.js +16 -5
  24. package/build/entity-types/comment.js.map +7 -1
  25. package/build/entity-types/global-styles-revision.js +16 -5
  26. package/build/entity-types/global-styles-revision.js.map +7 -1
  27. package/build/entity-types/helpers.js +16 -5
  28. package/build/entity-types/helpers.js.map +7 -1
  29. package/build/entity-types/index.js +16 -5
  30. package/build/entity-types/index.js.map +7 -1
  31. package/build/entity-types/menu-location.js +16 -5
  32. package/build/entity-types/menu-location.js.map +7 -1
  33. package/build/entity-types/nav-menu-item.js +16 -5
  34. package/build/entity-types/nav-menu-item.js.map +7 -1
  35. package/build/entity-types/nav-menu.js +16 -5
  36. package/build/entity-types/nav-menu.js.map +7 -1
  37. package/build/entity-types/page.js +16 -5
  38. package/build/entity-types/page.js.map +7 -1
  39. package/build/entity-types/plugin.js +16 -5
  40. package/build/entity-types/plugin.js.map +7 -1
  41. package/build/entity-types/post-revision.js +16 -5
  42. package/build/entity-types/post-revision.js.map +7 -1
  43. package/build/entity-types/post-status.js +16 -5
  44. package/build/entity-types/post-status.js.map +7 -1
  45. package/build/entity-types/post.js +16 -5
  46. package/build/entity-types/post.js.map +7 -1
  47. package/build/entity-types/settings.js +16 -5
  48. package/build/entity-types/settings.js.map +7 -1
  49. package/build/entity-types/sidebar.js +16 -5
  50. package/build/entity-types/sidebar.js.map +7 -1
  51. package/build/entity-types/taxonomy.js +16 -5
  52. package/build/entity-types/taxonomy.js.map +7 -1
  53. package/build/entity-types/term.js +16 -5
  54. package/build/entity-types/term.js.map +7 -1
  55. package/build/entity-types/theme.js +16 -5
  56. package/build/entity-types/theme.js.map +7 -1
  57. package/build/entity-types/type.js +16 -5
  58. package/build/entity-types/type.js.map +7 -1
  59. package/build/entity-types/user.js +16 -5
  60. package/build/entity-types/user.js.map +7 -1
  61. package/build/entity-types/widget-type.js +16 -5
  62. package/build/entity-types/widget-type.js.map +7 -1
  63. package/build/entity-types/widget.js +16 -5
  64. package/build/entity-types/widget.js.map +7 -1
  65. package/build/entity-types/wp-template-part.js +16 -5
  66. package/build/entity-types/wp-template-part.js.map +7 -1
  67. package/build/entity-types/wp-template.js +16 -5
  68. package/build/entity-types/wp-template.js.map +7 -1
  69. package/build/fetch/__experimental-fetch-link-suggestions.js +141 -154
  70. package/build/fetch/__experimental-fetch-link-suggestions.js.map +7 -1
  71. package/build/fetch/__experimental-fetch-url-data.js +47 -59
  72. package/build/fetch/__experimental-fetch-url-data.js.map +7 -1
  73. package/build/fetch/index.js +53 -32
  74. package/build/fetch/index.js.map +7 -1
  75. package/build/footnotes/get-footnotes-order.js +38 -25
  76. package/build/footnotes/get-footnotes-order.js.map +7 -1
  77. package/build/footnotes/get-rich-text-values-cached.js +26 -27
  78. package/build/footnotes/get-rich-text-values-cached.js.map +7 -1
  79. package/build/footnotes/index.js +68 -55
  80. package/build/footnotes/index.js.map +7 -1
  81. package/build/hooks/constants.js +33 -12
  82. package/build/hooks/constants.js.map +7 -1
  83. package/build/hooks/index.js +59 -68
  84. package/build/hooks/index.js.map +7 -1
  85. package/build/hooks/memoize.js +34 -12
  86. package/build/hooks/memoize.js.map +7 -1
  87. package/build/hooks/use-entity-block-editor.js +111 -119
  88. package/build/hooks/use-entity-block-editor.js.map +7 -1
  89. package/build/hooks/use-entity-id.js +25 -23
  90. package/build/hooks/use-entity-id.js.map +7 -1
  91. package/build/hooks/use-entity-prop.js +59 -60
  92. package/build/hooks/use-entity-prop.js.map +7 -1
  93. package/build/hooks/use-entity-record.js +95 -155
  94. package/build/hooks/use-entity-record.js.map +7 -1
  95. package/build/hooks/use-entity-records.js +131 -139
  96. package/build/hooks/use-entity-records.js.map +7 -1
  97. package/build/hooks/use-query-select.js +65 -84
  98. package/build/hooks/use-query-select.js.map +7 -1
  99. package/build/hooks/use-resource-permissions.js +92 -145
  100. package/build/hooks/use-resource-permissions.js.map +7 -1
  101. package/build/index.js +96 -153
  102. package/build/index.js.map +7 -1
  103. package/build/lock-unlock.js +31 -14
  104. package/build/lock-unlock.js.map +7 -1
  105. package/build/locks/actions.js +36 -19
  106. package/build/locks/actions.js.map +7 -1
  107. package/build/locks/engine.js +48 -47
  108. package/build/locks/engine.js.map +7 -1
  109. package/build/locks/reducer.js +54 -63
  110. package/build/locks/reducer.js.map +7 -1
  111. package/build/locks/selectors.js +35 -30
  112. package/build/locks/selectors.js.map +7 -1
  113. package/build/locks/utils.js +37 -16
  114. package/build/locks/utils.js.map +7 -1
  115. package/build/name.js +27 -12
  116. package/build/name.js.map +7 -1
  117. package/build/private-actions.js +67 -75
  118. package/build/private-actions.js.map +7 -1
  119. package/build/private-apis.js +33 -16
  120. package/build/private-apis.js.map +7 -1
  121. package/build/private-selectors.js +204 -184
  122. package/build/private-selectors.js.map +7 -1
  123. package/build/queried-data/actions.js +32 -41
  124. package/build/queried-data/actions.js.map +7 -1
  125. package/build/queried-data/get-query-parts.js +41 -79
  126. package/build/queried-data/get-query-parts.js.map +7 -1
  127. package/build/queried-data/index.js +39 -36
  128. package/build/queried-data/index.js.map +7 -1
  129. package/build/queried-data/reducer.js +162 -193
  130. package/build/queried-data/reducer.js.map +7 -1
  131. package/build/queried-data/selectors.js +57 -85
  132. package/build/queried-data/selectors.js.map +7 -1
  133. package/build/reducer.js +279 -404
  134. package/build/reducer.js.map +7 -1
  135. package/build/resolvers.js +553 -600
  136. package/build/resolvers.js.map +7 -1
  137. package/build/selectors.js +456 -981
  138. package/build/selectors.js.map +7 -1
  139. package/build/sync.js +34 -22
  140. package/build/sync.js.map +7 -1
  141. package/build/types.js +16 -5
  142. package/build/types.js.map +7 -1
  143. package/build/utils/conservative-map-item.js +34 -27
  144. package/build/utils/conservative-map-item.js.map +7 -1
  145. package/build/utils/crdt-blocks.js +289 -0
  146. package/build/utils/crdt-blocks.js.map +7 -0
  147. package/build/utils/crdt.js +202 -0
  148. package/build/utils/crdt.js.map +7 -0
  149. package/build/utils/forward-resolver.js +24 -16
  150. package/build/utils/forward-resolver.js.map +7 -1
  151. package/build/utils/get-nested-value.js +26 -21
  152. package/build/utils/get-nested-value.js.map +7 -1
  153. package/build/utils/get-normalized-comma-separable.js +25 -17
  154. package/build/utils/get-normalized-comma-separable.js.map +7 -1
  155. package/build/utils/if-matching-action.js +25 -19
  156. package/build/utils/if-matching-action.js.map +7 -1
  157. package/build/utils/index.js +77 -108
  158. package/build/utils/index.js.map +7 -1
  159. package/build/utils/is-numeric-id.js +22 -12
  160. package/build/utils/is-numeric-id.js.map +7 -1
  161. package/build/utils/is-raw-attribute.js +22 -13
  162. package/build/utils/is-raw-attribute.js.map +7 -1
  163. package/build/utils/log-entity-deprecation.js +37 -38
  164. package/build/utils/log-entity-deprecation.js.map +7 -1
  165. package/build/utils/on-sub-key.js +30 -24
  166. package/build/utils/on-sub-key.js.map +7 -1
  167. package/build/utils/receive-intermediate-results.js +29 -6
  168. package/build/utils/receive-intermediate-results.js.map +7 -1
  169. package/build/utils/replace-action.js +24 -17
  170. package/build/utils/replace-action.js.map +7 -1
  171. package/build/utils/set-nested-value.js +25 -30
  172. package/build/utils/set-nested-value.js.map +7 -1
  173. package/build/utils/user-permissions.js +41 -13
  174. package/build/utils/user-permissions.js.map +7 -1
  175. package/build/utils/with-weak-map-cache.js +26 -22
  176. package/build/utils/with-weak-map-cache.js.map +7 -1
  177. package/build-module/actions.js +322 -601
  178. package/build-module/actions.js.map +7 -1
  179. package/build-module/batch/create-batch.js +21 -57
  180. package/build-module/batch/create-batch.js.map +7 -1
  181. package/build-module/batch/default-processor.js +14 -33
  182. package/build-module/batch/default-processor.js.map +7 -1
  183. package/build-module/batch/index.js +7 -3
  184. package/build-module/batch/index.js.map +7 -1
  185. package/build-module/dynamic-entities.js +7 -28
  186. package/build-module/dynamic-entities.js.map +7 -1
  187. package/build-module/entities.js +263 -399
  188. package/build-module/entities.js.map +7 -1
  189. package/build-module/entity-context.js +7 -7
  190. package/build-module/entity-context.js.map +7 -1
  191. package/build-module/entity-provider.js +19 -42
  192. package/build-module/entity-provider.js.map +7 -1
  193. package/build-module/entity-types/attachment.js +1 -2
  194. package/build-module/entity-types/attachment.js.map +7 -1
  195. package/build-module/entity-types/base-entity-records.js +1 -37
  196. package/build-module/entity-types/base-entity-records.js.map +7 -1
  197. package/build-module/entity-types/base.js +1 -2
  198. package/build-module/entity-types/base.js.map +7 -1
  199. package/build-module/entity-types/comment.js +1 -2
  200. package/build-module/entity-types/comment.js.map +7 -1
  201. package/build-module/entity-types/global-styles-revision.js +1 -2
  202. package/build-module/entity-types/global-styles-revision.js.map +7 -1
  203. package/build-module/entity-types/helpers.js +1 -2
  204. package/build-module/entity-types/helpers.js.map +7 -1
  205. package/build-module/entity-types/index.js +1 -2
  206. package/build-module/entity-types/index.js.map +7 -1
  207. package/build-module/entity-types/menu-location.js +1 -2
  208. package/build-module/entity-types/menu-location.js.map +7 -1
  209. package/build-module/entity-types/nav-menu-item.js +1 -2
  210. package/build-module/entity-types/nav-menu-item.js.map +7 -1
  211. package/build-module/entity-types/nav-menu.js +1 -2
  212. package/build-module/entity-types/nav-menu.js.map +7 -1
  213. package/build-module/entity-types/page.js +1 -2
  214. package/build-module/entity-types/page.js.map +7 -1
  215. package/build-module/entity-types/plugin.js +1 -2
  216. package/build-module/entity-types/plugin.js.map +7 -1
  217. package/build-module/entity-types/post-revision.js +1 -2
  218. package/build-module/entity-types/post-revision.js.map +7 -1
  219. package/build-module/entity-types/post-status.js +1 -2
  220. package/build-module/entity-types/post-status.js.map +7 -1
  221. package/build-module/entity-types/post.js +1 -2
  222. package/build-module/entity-types/post.js.map +7 -1
  223. package/build-module/entity-types/settings.js +1 -2
  224. package/build-module/entity-types/settings.js.map +7 -1
  225. package/build-module/entity-types/sidebar.js +1 -2
  226. package/build-module/entity-types/sidebar.js.map +7 -1
  227. package/build-module/entity-types/taxonomy.js +1 -2
  228. package/build-module/entity-types/taxonomy.js.map +7 -1
  229. package/build-module/entity-types/term.js +1 -2
  230. package/build-module/entity-types/term.js.map +7 -1
  231. package/build-module/entity-types/theme.js +1 -2
  232. package/build-module/entity-types/theme.js.map +7 -1
  233. package/build-module/entity-types/type.js +1 -2
  234. package/build-module/entity-types/type.js.map +7 -1
  235. package/build-module/entity-types/user.js +1 -2
  236. package/build-module/entity-types/user.js.map +7 -1
  237. package/build-module/entity-types/widget-type.js +1 -2
  238. package/build-module/entity-types/widget-type.js.map +7 -1
  239. package/build-module/entity-types/widget.js +1 -2
  240. package/build-module/entity-types/widget.js.map +7 -1
  241. package/build-module/entity-types/wp-template-part.js +1 -2
  242. package/build-module/entity-types/wp-template-part.js.map +7 -1
  243. package/build-module/entity-types/wp-template.js +1 -2
  244. package/build-module/entity-types/wp-template.js.map +7 -1
  245. package/build-module/fetch/__experimental-fetch-link-suggestions.js +111 -149
  246. package/build-module/fetch/__experimental-fetch-link-suggestions.js.map +7 -1
  247. package/build-module/fetch/__experimental-fetch-url-data.js +20 -49
  248. package/build-module/fetch/__experimental-fetch-url-data.js.map +7 -1
  249. package/build-module/fetch/index.js +20 -15
  250. package/build-module/fetch/index.js.map +7 -1
  251. package/build-module/footnotes/get-footnotes-order.js +10 -19
  252. package/build-module/footnotes/get-footnotes-order.js.map +7 -1
  253. package/build-module/footnotes/get-rich-text-values-cached.js +8 -23
  254. package/build-module/footnotes/get-rich-text-values-cached.js.map +7 -1
  255. package/build-module/footnotes/index.js +34 -47
  256. package/build-module/footnotes/index.js.map +7 -1
  257. package/build-module/hooks/constants.js +11 -8
  258. package/build-module/hooks/constants.js.map +7 -1
  259. package/build-module/hooks/index.js +27 -15
  260. package/build-module/hooks/index.js.map +7 -1
  261. package/build-module/hooks/memoize.js +6 -8
  262. package/build-module/hooks/memoize.js.map +7 -1
  263. package/build-module/hooks/use-entity-block-editor.js +80 -110
  264. package/build-module/hooks/use-entity-block-editor.js.map +7 -1
  265. package/build-module/hooks/use-entity-id.js +7 -19
  266. package/build-module/hooks/use-entity-id.js.map +7 -1
  267. package/build-module/hooks/use-entity-prop.js +31 -55
  268. package/build-module/hooks/use-entity-prop.js.map +7 -1
  269. package/build-module/hooks/use-entity-record.js +63 -148
  270. package/build-module/hooks/use-entity-record.js.map +7 -1
  271. package/build-module/hooks/use-entity-records.js +98 -131
  272. package/build-module/hooks/use-entity-records.js.map +7 -1
  273. package/build-module/hooks/use-query-select.js +27 -71
  274. package/build-module/hooks/use-query-select.js.map +7 -1
  275. package/build-module/hooks/use-resource-permissions.js +57 -136
  276. package/build-module/hooks/use-resource-permissions.js.map +7 -1
  277. package/build-module/index.js +49 -71
  278. package/build-module/index.js.map +7 -1
  279. package/build-module/lock-unlock.js +8 -7
  280. package/build-module/lock-unlock.js.map +7 -1
  281. package/build-module/locks/actions.js +8 -13
  282. package/build-module/locks/actions.js.map +7 -1
  283. package/build-module/locks/engine.js +17 -38
  284. package/build-module/locks/engine.js.map +7 -1
  285. package/build-module/locks/reducer.js +37 -59
  286. package/build-module/locks/reducer.js.map +7 -1
  287. package/build-module/locks/selectors.js +16 -23
  288. package/build-module/locks/selectors.js.map +7 -1
  289. package/build-module/locks/utils.js +15 -12
  290. package/build-module/locks/utils.js.map +7 -1
  291. package/build-module/name.js +5 -8
  292. package/build-module/name.js.map +7 -1
  293. package/build-module/private-actions.js +35 -69
  294. package/build-module/private-actions.js.map +7 -1
  295. package/build-module/private-apis.js +8 -8
  296. package/build-module/private-apis.js.map +7 -1
  297. package/build-module/private-selectors.js +167 -174
  298. package/build-module/private-selectors.js.map +7 -1
  299. package/build-module/queried-data/actions.js +11 -38
  300. package/build-module/queried-data/actions.js.map +7 -1
  301. package/build-module/queried-data/get-query-parts.js +20 -75
  302. package/build-module/queried-data/get-query-parts.js.map +7 -1
  303. package/build-module/queried-data/index.js +7 -4
  304. package/build-module/queried-data/index.js.map +7 -1
  305. package/build-module/queried-data/reducer.js +134 -185
  306. package/build-module/queried-data/reducer.js.map +7 -1
  307. package/build-module/queried-data/selectors.js +23 -78
  308. package/build-module/queried-data/selectors.js.map +7 -1
  309. package/build-module/reducer.js +243 -393
  310. package/build-module/reducer.js.map +7 -1
  311. package/build-module/resolvers.js +478 -549
  312. package/build-module/resolvers.js.map +7 -1
  313. package/build-module/selectors.js +410 -953
  314. package/build-module/selectors.js.map +7 -1
  315. package/build-module/sync.js +14 -17
  316. package/build-module/sync.js.map +7 -1
  317. package/build-module/types.js +1 -2
  318. package/build-module/types.js.map +7 -1
  319. package/build-module/utils/conservative-map-item.js +6 -22
  320. package/build-module/utils/conservative-map-item.js.map +7 -1
  321. package/build-module/utils/crdt-blocks.js +255 -0
  322. package/build-module/utils/crdt-blocks.js.map +7 -0
  323. package/build-module/utils/crdt.js +167 -0
  324. package/build-module/utils/crdt.js.map +7 -0
  325. package/build-module/utils/forward-resolver.js +6 -12
  326. package/build-module/utils/forward-resolver.js.map +7 -1
  327. package/build-module/utils/get-nested-value.js +9 -18
  328. package/build-module/utils/get-nested-value.js.map +7 -1
  329. package/build-module/utils/get-normalized-comma-separable.js +7 -13
  330. package/build-module/utils/get-normalized-comma-separable.js.map +7 -1
  331. package/build-module/utils/if-matching-action.js +7 -15
  332. package/build-module/utils/if-matching-action.js.map +7 -1
  333. package/build-module/utils/index.js +35 -14
  334. package/build-module/utils/index.js.map +7 -1
  335. package/build-module/utils/is-numeric-id.js +5 -9
  336. package/build-module/utils/is-numeric-id.js.map +7 -1
  337. package/build-module/utils/is-raw-attribute.js +5 -10
  338. package/build-module/utils/is-raw-attribute.js.map +7 -1
  339. package/build-module/utils/log-entity-deprecation.js +8 -31
  340. package/build-module/utils/log-entity-deprecation.js.map +7 -1
  341. package/build-module/utils/on-sub-key.js +8 -19
  342. package/build-module/utils/on-sub-key.js.map +7 -1
  343. package/build-module/utils/receive-intermediate-results.js +7 -2
  344. package/build-module/utils/receive-intermediate-results.js.map +7 -1
  345. package/build-module/utils/replace-action.js +6 -13
  346. package/build-module/utils/replace-action.js.map +7 -1
  347. package/build-module/utils/set-nested-value.js +8 -27
  348. package/build-module/utils/set-nested-value.js.map +7 -1
  349. package/build-module/utils/user-permissions.js +19 -9
  350. package/build-module/utils/user-permissions.js.map +7 -1
  351. package/build-module/utils/with-weak-map-cache.js +8 -18
  352. package/build-module/utils/with-weak-map-cache.js.map +7 -1
  353. package/build-types/actions.d.ts.map +1 -1
  354. package/build-types/entities.d.ts +0 -56
  355. package/build-types/entities.d.ts.map +1 -1
  356. package/build-types/index.d.ts.map +1 -1
  357. package/build-types/private-selectors.d.ts.map +1 -1
  358. package/build-types/resolvers.d.ts +3 -0
  359. package/build-types/resolvers.d.ts.map +1 -1
  360. package/build-types/selectors.d.ts.map +1 -1
  361. package/build-types/sync.d.ts +6 -1
  362. package/build-types/sync.d.ts.map +1 -1
  363. package/build-types/types.d.ts +9 -0
  364. package/build-types/types.d.ts.map +1 -1
  365. package/build-types/utils/crdt-blocks.d.ts +30 -0
  366. package/build-types/utils/crdt-blocks.d.ts.map +1 -0
  367. package/build-types/utils/crdt.d.ts +49 -0
  368. package/build-types/utils/crdt.d.ts.map +1 -0
  369. package/package.json +26 -19
  370. package/src/actions.js +56 -74
  371. package/src/entities.js +59 -113
  372. package/src/private-selectors.ts +32 -7
  373. package/src/resolvers.js +173 -120
  374. package/src/selectors.ts +0 -13
  375. package/src/sync.ts +12 -0
  376. package/src/test/resolvers.js +183 -0
  377. package/src/types.ts +12 -0
  378. package/src/utils/crdt-blocks.ts +503 -0
  379. package/src/utils/crdt.ts +310 -0
  380. package/src/utils/test/crdt-blocks.ts +375 -0
  381. package/src/utils/test/crdt.ts +254 -0
  382. package/tsconfig.tsbuildinfo +1 -1
  383. package/src/sync.js +0 -27
@@ -1,115 +1,57 @@
1
- /**
2
- * External dependencies
3
- */
4
- import fastDeepEqual from 'fast-deep-equal/es6';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { compose } from '@wordpress/compose';
10
- import { combineReducers } from '@wordpress/data';
11
- import { createUndoManager } from '@wordpress/undo-manager';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import { ifMatchingAction, replaceAction } from './utils';
17
- import { reducer as queriedDataReducer } from './queried-data';
18
- import { rootEntitiesConfig, DEFAULT_ENTITY_KEY } from './entities';
19
-
20
- /** @typedef {import('./types').AnyFunction} AnyFunction */
21
-
22
- /**
23
- * Reducer managing authors state. Keyed by id.
24
- *
25
- * @param {Object} state Current state.
26
- * @param {Object} action Dispatched action.
27
- *
28
- * @return {Object} Updated state.
29
- */
30
- export function users(state = {
31
- byId: {},
32
- queries: {}
33
- }, action) {
1
+ import fastDeepEqual from "fast-deep-equal/es6";
2
+ import { compose } from "@wordpress/compose";
3
+ import { combineReducers } from "@wordpress/data";
4
+ import { createUndoManager } from "@wordpress/undo-manager";
5
+ import { ifMatchingAction, replaceAction } from "./utils";
6
+ import { reducer as queriedDataReducer } from "./queried-data";
7
+ import { rootEntitiesConfig, DEFAULT_ENTITY_KEY } from "./entities";
8
+ function users(state = { byId: {}, queries: {} }, action) {
34
9
  switch (action.type) {
35
- case 'RECEIVE_USER_QUERY':
10
+ case "RECEIVE_USER_QUERY":
36
11
  return {
37
12
  byId: {
38
13
  ...state.byId,
39
14
  // Key users by their ID.
40
- ...action.users.reduce((newUsers, user) => ({
41
- ...newUsers,
42
- [user.id]: user
43
- }), {})
15
+ ...action.users.reduce(
16
+ (newUsers, user) => ({
17
+ ...newUsers,
18
+ [user.id]: user
19
+ }),
20
+ {}
21
+ )
44
22
  },
45
23
  queries: {
46
24
  ...state.queries,
47
- [action.queryID]: action.users.map(user => user.id)
25
+ [action.queryID]: action.users.map((user) => user.id)
48
26
  }
49
27
  };
50
28
  }
51
29
  return state;
52
30
  }
53
-
54
- /**
55
- * Reducer managing current user state.
56
- *
57
- * @param {Object} state Current state.
58
- * @param {Object} action Dispatched action.
59
- *
60
- * @return {Object} Updated state.
61
- */
62
- export function currentUser(state = {}, action) {
31
+ function currentUser(state = {}, action) {
63
32
  switch (action.type) {
64
- case 'RECEIVE_CURRENT_USER':
33
+ case "RECEIVE_CURRENT_USER":
65
34
  return action.currentUser;
66
35
  }
67
36
  return state;
68
37
  }
69
-
70
- /**
71
- * Reducer managing the current theme.
72
- *
73
- * @param {string|undefined} state Current state.
74
- * @param {Object} action Dispatched action.
75
- *
76
- * @return {string|undefined} Updated state.
77
- */
78
- export function currentTheme(state = undefined, action) {
38
+ function currentTheme(state = void 0, action) {
79
39
  switch (action.type) {
80
- case 'RECEIVE_CURRENT_THEME':
40
+ case "RECEIVE_CURRENT_THEME":
81
41
  return action.currentTheme.stylesheet;
82
42
  }
83
43
  return state;
84
44
  }
85
-
86
- /**
87
- * Reducer managing the current global styles id.
88
- *
89
- * @param {string|undefined} state Current state.
90
- * @param {Object} action Dispatched action.
91
- *
92
- * @return {string|undefined} Updated state.
93
- */
94
- export function currentGlobalStylesId(state = undefined, action) {
45
+ function currentGlobalStylesId(state = void 0, action) {
95
46
  switch (action.type) {
96
- case 'RECEIVE_CURRENT_GLOBAL_STYLES_ID':
47
+ case "RECEIVE_CURRENT_GLOBAL_STYLES_ID":
97
48
  return action.id;
98
49
  }
99
50
  return state;
100
51
  }
101
-
102
- /**
103
- * Reducer managing the theme base global styles.
104
- *
105
- * @param {Record<string, object>} state Current state.
106
- * @param {Object} action Dispatched action.
107
- *
108
- * @return {Record<string, object>} Updated state.
109
- */
110
- export function themeBaseGlobalStyles(state = {}, action) {
52
+ function themeBaseGlobalStyles(state = {}, action) {
111
53
  switch (action.type) {
112
- case 'RECEIVE_THEME_GLOBAL_STYLES':
54
+ case "RECEIVE_THEME_GLOBAL_STYLES":
113
55
  return {
114
56
  ...state,
115
57
  [action.stylesheet]: action.globalStyles
@@ -117,18 +59,9 @@ export function themeBaseGlobalStyles(state = {}, action) {
117
59
  }
118
60
  return state;
119
61
  }
120
-
121
- /**
122
- * Reducer managing the theme global styles variations.
123
- *
124
- * @param {Record<string, object>} state Current state.
125
- * @param {Object} action Dispatched action.
126
- *
127
- * @return {Record<string, object>} Updated state.
128
- */
129
- export function themeGlobalStyleVariations(state = {}, action) {
62
+ function themeGlobalStyleVariations(state = {}, action) {
130
63
  switch (action.type) {
131
- case 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS':
64
+ case "RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS":
132
65
  return {
133
66
  ...state,
134
67
  [action.stylesheet]: action.variations
@@ -136,241 +69,202 @@ export function themeGlobalStyleVariations(state = {}, action) {
136
69
  }
137
70
  return state;
138
71
  }
139
- const withMultiEntityRecordEdits = reducer => (state, action) => {
140
- if (action.type === 'UNDO' || action.type === 'REDO') {
141
- const {
142
- record
143
- } = action;
72
+ const withMultiEntityRecordEdits = (reducer) => (state, action) => {
73
+ if (action.type === "UNDO" || action.type === "REDO") {
74
+ const { record } = action;
144
75
  let newState = state;
145
- record.forEach(({
146
- id: {
147
- kind,
148
- name,
149
- recordId
150
- },
151
- changes
152
- }) => {
76
+ record.forEach(({ id: { kind, name, recordId }, changes }) => {
153
77
  newState = reducer(newState, {
154
- type: 'EDIT_ENTITY_RECORD',
78
+ type: "EDIT_ENTITY_RECORD",
155
79
  kind,
156
80
  name,
157
81
  recordId,
158
- edits: Object.entries(changes).reduce((acc, [key, value]) => {
159
- acc[key] = action.type === 'UNDO' ? value.from : value.to;
160
- return acc;
161
- }, {})
82
+ edits: Object.entries(changes).reduce(
83
+ (acc, [key, value]) => {
84
+ acc[key] = action.type === "UNDO" ? value.from : value.to;
85
+ return acc;
86
+ },
87
+ {}
88
+ )
162
89
  });
163
90
  });
164
91
  return newState;
165
92
  }
166
93
  return reducer(state, action);
167
94
  };
168
-
169
- /**
170
- * Higher Order Reducer for a given entity config. It supports:
171
- *
172
- * - Fetching
173
- * - Editing
174
- * - Saving
175
- *
176
- * @param {Object} entityConfig Entity config.
177
- *
178
- * @return {AnyFunction} Reducer.
179
- */
180
95
  function entity(entityConfig) {
181
- return compose([withMultiEntityRecordEdits,
182
- // Limit to matching action type so we don't attempt to replace action on
183
- // an unhandled action.
184
- ifMatchingAction(action => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind),
185
- // Inject the entity config into the action.
186
- replaceAction(action => {
187
- return {
188
- key: entityConfig.key || DEFAULT_ENTITY_KEY,
189
- ...action
190
- };
191
- })])(combineReducers({
192
- queriedData: queriedDataReducer,
193
- edits: (state = {}, action) => {
194
- var _action$query$context;
195
- switch (action.type) {
196
- case 'RECEIVE_ITEMS':
197
- const context = (_action$query$context = action?.query?.context) !== null && _action$query$context !== void 0 ? _action$query$context : 'default';
198
- if (context !== 'default') {
199
- return state;
200
- }
201
- const nextState = {
202
- ...state
203
- };
204
- for (const record of action.items) {
205
- const recordId = record?.[action.key];
206
- const edits = nextState[recordId];
207
- if (!edits) {
208
- continue;
96
+ return compose([
97
+ withMultiEntityRecordEdits,
98
+ // Limit to matching action type so we don't attempt to replace action on
99
+ // an unhandled action.
100
+ ifMatchingAction(
101
+ (action) => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind
102
+ ),
103
+ // Inject the entity config into the action.
104
+ replaceAction((action) => {
105
+ return {
106
+ key: entityConfig.key || DEFAULT_ENTITY_KEY,
107
+ ...action
108
+ };
109
+ })
110
+ ])(
111
+ combineReducers({
112
+ queriedData: queriedDataReducer,
113
+ edits: (state = {}, action) => {
114
+ switch (action.type) {
115
+ case "RECEIVE_ITEMS":
116
+ const context = action?.query?.context ?? "default";
117
+ if (context !== "default") {
118
+ return state;
209
119
  }
210
- const nextEdits = Object.keys(edits).reduce((acc, key) => {
211
- var _record$key$raw;
212
- // If the edited value is still different to the persisted value,
213
- // keep the edited value in edits.
214
- if (
215
- // Edits are the "raw" attribute values, but records may have
216
- // objects with more properties, so we use `get` here for the
217
- // comparison.
218
- !fastDeepEqual(edits[key], (_record$key$raw = record[key]?.raw) !== null && _record$key$raw !== void 0 ? _record$key$raw : record[key]) && (
219
- // Sometimes the server alters the sent value which means
220
- // we need to also remove the edits before the api request.
221
- !action.persistedEdits || !fastDeepEqual(edits[key], action.persistedEdits[key]))) {
222
- acc[key] = edits[key];
120
+ const nextState = { ...state };
121
+ for (const record of action.items) {
122
+ const recordId = record?.[action.key];
123
+ const edits = nextState[recordId];
124
+ if (!edits) {
125
+ continue;
126
+ }
127
+ const nextEdits2 = Object.keys(edits).reduce(
128
+ (acc, key) => {
129
+ if (
130
+ // Edits are the "raw" attribute values, but records may have
131
+ // objects with more properties, so we use `get` here for the
132
+ // comparison.
133
+ !fastDeepEqual(
134
+ edits[key],
135
+ record[key]?.raw ?? record[key]
136
+ ) && // Sometimes the server alters the sent value which means
137
+ // we need to also remove the edits before the api request.
138
+ (!action.persistedEdits || !fastDeepEqual(
139
+ edits[key],
140
+ action.persistedEdits[key]
141
+ ))
142
+ ) {
143
+ acc[key] = edits[key];
144
+ }
145
+ return acc;
146
+ },
147
+ {}
148
+ );
149
+ if (Object.keys(nextEdits2).length) {
150
+ nextState[recordId] = nextEdits2;
151
+ } else {
152
+ delete nextState[recordId];
223
153
  }
224
- return acc;
225
- }, {});
226
- if (Object.keys(nextEdits).length) {
227
- nextState[recordId] = nextEdits;
228
- } else {
229
- delete nextState[recordId];
230
- }
231
- }
232
- return nextState;
233
- case 'EDIT_ENTITY_RECORD':
234
- const nextEdits = {
235
- ...state[action.recordId],
236
- ...action.edits
237
- };
238
- Object.keys(nextEdits).forEach(key => {
239
- // Delete cleared edits so that the properties
240
- // are not considered dirty.
241
- if (nextEdits[key] === undefined) {
242
- delete nextEdits[key];
243
154
  }
155
+ return nextState;
156
+ case "EDIT_ENTITY_RECORD":
157
+ const nextEdits = {
158
+ ...state[action.recordId],
159
+ ...action.edits
160
+ };
161
+ Object.keys(nextEdits).forEach((key) => {
162
+ if (nextEdits[key] === void 0) {
163
+ delete nextEdits[key];
164
+ }
165
+ });
166
+ return {
167
+ ...state,
168
+ [action.recordId]: nextEdits
169
+ };
170
+ }
171
+ return state;
172
+ },
173
+ saving: (state = {}, action) => {
174
+ switch (action.type) {
175
+ case "SAVE_ENTITY_RECORD_START":
176
+ case "SAVE_ENTITY_RECORD_FINISH":
177
+ return {
178
+ ...state,
179
+ [action.recordId]: {
180
+ pending: action.type === "SAVE_ENTITY_RECORD_START",
181
+ error: action.error,
182
+ isAutosave: action.isAutosave
183
+ }
184
+ };
185
+ }
186
+ return state;
187
+ },
188
+ deleting: (state = {}, action) => {
189
+ switch (action.type) {
190
+ case "DELETE_ENTITY_RECORD_START":
191
+ case "DELETE_ENTITY_RECORD_FINISH":
192
+ return {
193
+ ...state,
194
+ [action.recordId]: {
195
+ pending: action.type === "DELETE_ENTITY_RECORD_START",
196
+ error: action.error
197
+ }
198
+ };
199
+ }
200
+ return state;
201
+ },
202
+ revisions: (state = {}, action) => {
203
+ if (action.type === "RECEIVE_ITEM_REVISIONS") {
204
+ const recordKey = action.recordKey;
205
+ delete action.recordKey;
206
+ const newState = queriedDataReducer(state[recordKey], {
207
+ ...action,
208
+ type: "RECEIVE_ITEMS"
244
209
  });
245
210
  return {
246
211
  ...state,
247
- [action.recordId]: nextEdits
248
- };
249
- }
250
- return state;
251
- },
252
- saving: (state = {}, action) => {
253
- switch (action.type) {
254
- case 'SAVE_ENTITY_RECORD_START':
255
- case 'SAVE_ENTITY_RECORD_FINISH':
256
- return {
257
- ...state,
258
- [action.recordId]: {
259
- pending: action.type === 'SAVE_ENTITY_RECORD_START',
260
- error: action.error,
261
- isAutosave: action.isAutosave
262
- }
212
+ [recordKey]: newState
263
213
  };
214
+ }
215
+ if (action.type === "REMOVE_ITEMS") {
216
+ return Object.fromEntries(
217
+ Object.entries(state).filter(
218
+ ([id]) => !action.itemIds.some((itemId) => {
219
+ if (Number.isInteger(itemId)) {
220
+ return itemId === +id;
221
+ }
222
+ return itemId === id;
223
+ })
224
+ )
225
+ );
226
+ }
227
+ return state;
264
228
  }
265
- return state;
266
- },
267
- deleting: (state = {}, action) => {
268
- switch (action.type) {
269
- case 'DELETE_ENTITY_RECORD_START':
270
- case 'DELETE_ENTITY_RECORD_FINISH':
271
- return {
272
- ...state,
273
- [action.recordId]: {
274
- pending: action.type === 'DELETE_ENTITY_RECORD_START',
275
- error: action.error
276
- }
277
- };
278
- }
279
- return state;
280
- },
281
- revisions: (state = {}, action) => {
282
- // Use the same queriedDataReducer shape for revisions.
283
- if (action.type === 'RECEIVE_ITEM_REVISIONS') {
284
- const recordKey = action.recordKey;
285
- delete action.recordKey;
286
- const newState = queriedDataReducer(state[recordKey], {
287
- ...action,
288
- type: 'RECEIVE_ITEMS'
289
- });
290
- return {
291
- ...state,
292
- [recordKey]: newState
293
- };
294
- }
295
- if (action.type === 'REMOVE_ITEMS') {
296
- return Object.fromEntries(Object.entries(state).filter(([id]) => !action.itemIds.some(itemId => {
297
- if (Number.isInteger(itemId)) {
298
- return itemId === +id;
299
- }
300
- return itemId === id;
301
- })));
302
- }
303
- return state;
304
- }
305
- }));
229
+ })
230
+ );
306
231
  }
307
-
308
- /**
309
- * Reducer keeping track of the registered entities.
310
- *
311
- * @param {Object} state Current state.
312
- * @param {Object} action Dispatched action.
313
- *
314
- * @return {Object} Updated state.
315
- */
316
- export function entitiesConfig(state = rootEntitiesConfig, action) {
232
+ function entitiesConfig(state = rootEntitiesConfig, action) {
317
233
  switch (action.type) {
318
- case 'ADD_ENTITIES':
234
+ case "ADD_ENTITIES":
319
235
  return [...state, ...action.entities];
320
236
  }
321
237
  return state;
322
238
  }
323
-
324
- /**
325
- * Reducer keeping track of the registered entities config and data.
326
- *
327
- * @param {Object} state Current state.
328
- * @param {Object} action Dispatched action.
329
- *
330
- * @return {Object} Updated state.
331
- */
332
- export const entities = (state = {}, action) => {
239
+ const entities = (state = {}, action) => {
333
240
  const newConfig = entitiesConfig(state.config, action);
334
-
335
- // Generates a reducer for the entities nested by `kind` and `name`.
336
- // A config array with shape:
337
- // ```
338
- // [
339
- // { kind: 'taxonomy', name: 'category' },
340
- // { kind: 'taxonomy', name: 'post_tag' },
341
- // { kind: 'postType', name: 'post' },
342
- // { kind: 'postType', name: 'page' },
343
- // ]
344
- // ```
345
- // generates a reducer for state tree with shape:
346
- // ```
347
- // {
348
- // taxonomy: {
349
- // category,
350
- // post_tag,
351
- // },
352
- // postType: {
353
- // post,
354
- // page,
355
- // },
356
- // }
357
- // ```
358
241
  let entitiesDataReducer = state.reducer;
359
242
  if (!entitiesDataReducer || newConfig !== state.config) {
360
243
  const entitiesByKind = newConfig.reduce((acc, record) => {
361
- const {
362
- kind
363
- } = record;
244
+ const { kind } = record;
364
245
  if (!acc[kind]) {
365
246
  acc[kind] = [];
366
247
  }
367
248
  acc[kind].push(record);
368
249
  return acc;
369
250
  }, {});
370
- entitiesDataReducer = combineReducers(Object.fromEntries(Object.entries(entitiesByKind).map(([kind, subEntities]) => {
371
- const kindReducer = combineReducers(Object.fromEntries(subEntities.map(entityConfig => [entityConfig.name, entity(entityConfig)])));
372
- return [kind, kindReducer];
373
- })));
251
+ entitiesDataReducer = combineReducers(
252
+ Object.fromEntries(
253
+ Object.entries(entitiesByKind).map(
254
+ ([kind, subEntities]) => {
255
+ const kindReducer = combineReducers(
256
+ Object.fromEntries(
257
+ subEntities.map((entityConfig) => [
258
+ entityConfig.name,
259
+ entity(entityConfig)
260
+ ])
261
+ )
262
+ );
263
+ return [kind, kindReducer];
264
+ }
265
+ )
266
+ )
267
+ );
374
268
  }
375
269
  const newData = entitiesDataReducer(state.records, action);
376
270
  if (newData === state.records && newConfig === state.config && entitiesDataReducer === state.reducer) {
@@ -382,38 +276,22 @@ export const entities = (state = {}, action) => {
382
276
  config: newConfig
383
277
  };
384
278
  };
385
-
386
- /**
387
- * @type {UndoManager}
388
- */
389
- export function undoManager(state = createUndoManager()) {
279
+ function undoManager(state = createUndoManager()) {
390
280
  return state;
391
281
  }
392
- export function editsReference(state = {}, action) {
282
+ function editsReference(state = {}, action) {
393
283
  switch (action.type) {
394
- case 'EDIT_ENTITY_RECORD':
395
- case 'UNDO':
396
- case 'REDO':
284
+ case "EDIT_ENTITY_RECORD":
285
+ case "UNDO":
286
+ case "REDO":
397
287
  return {};
398
288
  }
399
289
  return state;
400
290
  }
401
-
402
- /**
403
- * Reducer managing embed preview data.
404
- *
405
- * @param {Object} state Current state.
406
- * @param {Object} action Dispatched action.
407
- *
408
- * @return {Object} Updated state.
409
- */
410
- export function embedPreviews(state = {}, action) {
291
+ function embedPreviews(state = {}, action) {
411
292
  switch (action.type) {
412
- case 'RECEIVE_EMBED_PREVIEW':
413
- const {
414
- url,
415
- preview
416
- } = action;
293
+ case "RECEIVE_EMBED_PREVIEW":
294
+ const { url, preview } = action;
417
295
  return {
418
296
  ...state,
419
297
  [url]: preview
@@ -421,24 +299,14 @@ export function embedPreviews(state = {}, action) {
421
299
  }
422
300
  return state;
423
301
  }
424
-
425
- /**
426
- * State which tracks whether the user can perform an action on a REST
427
- * resource.
428
- *
429
- * @param {Object} state Current state.
430
- * @param {Object} action Dispatched action.
431
- *
432
- * @return {Object} Updated state.
433
- */
434
- export function userPermissions(state = {}, action) {
302
+ function userPermissions(state = {}, action) {
435
303
  switch (action.type) {
436
- case 'RECEIVE_USER_PERMISSION':
304
+ case "RECEIVE_USER_PERMISSION":
437
305
  return {
438
306
  ...state,
439
307
  [action.key]: action.isAllowed
440
308
  };
441
- case 'RECEIVE_USER_PERMISSIONS':
309
+ case "RECEIVE_USER_PERMISSIONS":
442
310
  return {
443
311
  ...state,
444
312
  ...action.permissions
@@ -446,22 +314,10 @@ export function userPermissions(state = {}, action) {
446
314
  }
447
315
  return state;
448
316
  }
449
-
450
- /**
451
- * Reducer returning autosaves keyed by their parent's post id.
452
- *
453
- * @param {Object} state Current state.
454
- * @param {Object} action Dispatched action.
455
- *
456
- * @return {Object} Updated state.
457
- */
458
- export function autosaves(state = {}, action) {
317
+ function autosaves(state = {}, action) {
459
318
  switch (action.type) {
460
- case 'RECEIVE_AUTOSAVES':
461
- const {
462
- postId,
463
- autosaves: autosavesData
464
- } = action;
319
+ case "RECEIVE_AUTOSAVES":
320
+ const { postId, autosaves: autosavesData } = action;
465
321
  return {
466
322
  ...state,
467
323
  [postId]: autosavesData
@@ -469,46 +325,37 @@ export function autosaves(state = {}, action) {
469
325
  }
470
326
  return state;
471
327
  }
472
- export function blockPatterns(state = [], action) {
328
+ function blockPatterns(state = [], action) {
473
329
  switch (action.type) {
474
- case 'RECEIVE_BLOCK_PATTERNS':
330
+ case "RECEIVE_BLOCK_PATTERNS":
475
331
  return action.patterns;
476
332
  }
477
333
  return state;
478
334
  }
479
- export function blockPatternCategories(state = [], action) {
335
+ function blockPatternCategories(state = [], action) {
480
336
  switch (action.type) {
481
- case 'RECEIVE_BLOCK_PATTERN_CATEGORIES':
337
+ case "RECEIVE_BLOCK_PATTERN_CATEGORIES":
482
338
  return action.categories;
483
339
  }
484
340
  return state;
485
341
  }
486
- export function userPatternCategories(state = [], action) {
342
+ function userPatternCategories(state = [], action) {
487
343
  switch (action.type) {
488
- case 'RECEIVE_USER_PATTERN_CATEGORIES':
344
+ case "RECEIVE_USER_PATTERN_CATEGORIES":
489
345
  return action.patternCategories;
490
346
  }
491
347
  return state;
492
348
  }
493
- export function navigationFallbackId(state = null, action) {
349
+ function navigationFallbackId(state = null, action) {
494
350
  switch (action.type) {
495
- case 'RECEIVE_NAVIGATION_FALLBACK_ID':
351
+ case "RECEIVE_NAVIGATION_FALLBACK_ID":
496
352
  return action.fallbackId;
497
353
  }
498
354
  return state;
499
355
  }
500
-
501
- /**
502
- * Reducer managing the theme global styles revisions.
503
- *
504
- * @param {Record<string, object>} state Current state.
505
- * @param {Object} action Dispatched action.
506
- *
507
- * @return {Record<string, object>} Updated state.
508
- */
509
- export function themeGlobalStyleRevisions(state = {}, action) {
356
+ function themeGlobalStyleRevisions(state = {}, action) {
510
357
  switch (action.type) {
511
- case 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS':
358
+ case "RECEIVE_THEME_GLOBAL_STYLE_REVISIONS":
512
359
  return {
513
360
  ...state,
514
361
  [action.currentId]: action.revisions
@@ -516,18 +363,9 @@ export function themeGlobalStyleRevisions(state = {}, action) {
516
363
  }
517
364
  return state;
518
365
  }
519
-
520
- /**
521
- * Reducer managing the template lookup per query.
522
- *
523
- * @param {Record<string, string>} state Current state.
524
- * @param {Object} action Dispatched action.
525
- *
526
- * @return {Record<string, string>} Updated state.
527
- */
528
- export function defaultTemplates(state = {}, action) {
366
+ function defaultTemplates(state = {}, action) {
529
367
  switch (action.type) {
530
- case 'RECEIVE_DEFAULT_TEMPLATE':
368
+ case "RECEIVE_DEFAULT_TEMPLATE":
531
369
  return {
532
370
  ...state,
533
371
  [JSON.stringify(action.query)]: action.templateId
@@ -535,18 +373,9 @@ export function defaultTemplates(state = {}, action) {
535
373
  }
536
374
  return state;
537
375
  }
538
-
539
- /**
540
- * Reducer returning an object of registered post meta.
541
- *
542
- * @param {Object} state Current state.
543
- * @param {Object} action Dispatched action.
544
- *
545
- * @return {Object} Updated state.
546
- */
547
- export function registeredPostMeta(state = {}, action) {
376
+ function registeredPostMeta(state = {}, action) {
548
377
  switch (action.type) {
549
- case 'RECEIVE_REGISTERED_POST_META':
378
+ case "RECEIVE_REGISTERED_POST_META":
550
379
  return {
551
380
  ...state,
552
381
  [action.postType]: action.registeredPostMeta
@@ -554,13 +383,10 @@ export function registeredPostMeta(state = {}, action) {
554
383
  }
555
384
  return state;
556
385
  }
557
- export function templateAutoDraftId(state = {}, action) {
558
- return action.type === 'RECEIVE_TEMPLATE_AUTO_DRAFT_ID' ? {
559
- ...state,
560
- [action.target]: action.id
561
- } : state;
386
+ function templateAutoDraftId(state = {}, action) {
387
+ return action.type === "RECEIVE_TEMPLATE_AUTO_DRAFT_ID" ? { ...state, [action.target]: action.id } : state;
562
388
  }
563
- export default combineReducers({
389
+ var reducer_default = combineReducers({
564
390
  users,
565
391
  currentTheme,
566
392
  currentGlobalStylesId,
@@ -582,4 +408,28 @@ export default combineReducers({
582
408
  registeredPostMeta,
583
409
  templateAutoDraftId
584
410
  });
585
- //# sourceMappingURL=reducer.js.map
411
+ export {
412
+ autosaves,
413
+ blockPatternCategories,
414
+ blockPatterns,
415
+ currentGlobalStylesId,
416
+ currentTheme,
417
+ currentUser,
418
+ reducer_default as default,
419
+ defaultTemplates,
420
+ editsReference,
421
+ embedPreviews,
422
+ entities,
423
+ entitiesConfig,
424
+ navigationFallbackId,
425
+ registeredPostMeta,
426
+ templateAutoDraftId,
427
+ themeBaseGlobalStyles,
428
+ themeGlobalStyleRevisions,
429
+ themeGlobalStyleVariations,
430
+ undoManager,
431
+ userPatternCategories,
432
+ userPermissions,
433
+ users
434
+ };
435
+ //# sourceMappingURL=reducer.js.map