@wordpress/core-data 7.52.0 → 7.53.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 (473) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -0
  3. package/build/actions.cjs +18 -9
  4. package/build/actions.cjs.map +2 -2
  5. package/build/awareness/awareness-state.cjs.map +2 -2
  6. package/build/awareness/base-awareness.cjs.map +2 -2
  7. package/build/awareness/block-lookup.cjs.map +2 -2
  8. package/build/awareness/post-editor-awareness.cjs +7 -0
  9. package/build/awareness/post-editor-awareness.cjs.map +2 -2
  10. package/build/awareness/typed-awareness.cjs.map +2 -2
  11. package/build/awareness/types.cjs.map +1 -1
  12. package/build/awareness/utils.cjs.map +2 -2
  13. package/build/batch/create-batch.cjs.map +2 -2
  14. package/build/batch/default-processor.cjs.map +2 -2
  15. package/build/components/entities-saved-states/entity-record-item.cjs.map +2 -2
  16. package/build/components/entities-saved-states/entity-type-list.cjs.map +2 -2
  17. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs +4 -0
  18. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs.map +2 -2
  19. package/build/components/entities-saved-states/index.cjs.map +2 -2
  20. package/build/dynamic-entities.cjs.map +2 -2
  21. package/build/entities.cjs.map +2 -2
  22. package/build/entity-context.cjs.map +2 -2
  23. package/build/entity-provider.cjs.map +2 -2
  24. package/build/entity-types/attachment.cjs.map +1 -1
  25. package/build/entity-types/base.cjs.map +1 -1
  26. package/build/entity-types/comment.cjs.map +1 -1
  27. package/build/entity-types/font-collection.cjs.map +1 -1
  28. package/build/entity-types/font-family.cjs.map +1 -1
  29. package/build/entity-types/global-styles-revision.cjs.map +1 -1
  30. package/build/entity-types/helpers.cjs.map +1 -1
  31. package/build/entity-types/icon.cjs.map +1 -1
  32. package/build/entity-types/index.cjs.map +1 -1
  33. package/build/entity-types/menu-location.cjs.map +1 -1
  34. package/build/entity-types/nav-menu-item.cjs.map +1 -1
  35. package/build/entity-types/nav-menu.cjs.map +1 -1
  36. package/build/entity-types/page.cjs.map +1 -1
  37. package/build/entity-types/plugin.cjs.map +1 -1
  38. package/build/entity-types/post-revision.cjs.map +1 -1
  39. package/build/entity-types/post-status.cjs.map +1 -1
  40. package/build/entity-types/post.cjs.map +1 -1
  41. package/build/entity-types/settings.cjs.map +1 -1
  42. package/build/entity-types/sidebar.cjs.map +1 -1
  43. package/build/entity-types/taxonomy.cjs.map +1 -1
  44. package/build/entity-types/term.cjs.map +1 -1
  45. package/build/entity-types/theme.cjs.map +1 -1
  46. package/build/entity-types/type.cjs.map +1 -1
  47. package/build/entity-types/user.cjs.map +1 -1
  48. package/build/entity-types/widget-type.cjs.map +1 -1
  49. package/build/entity-types/widget.cjs.map +1 -1
  50. package/build/entity-types/wp-template-part.cjs.map +1 -1
  51. package/build/entity-types/wp-template.cjs.map +1 -1
  52. package/build/fetch/__experimental-fetch-link-suggestions.cjs.map +2 -2
  53. package/build/fetch/__experimental-fetch-url-data.cjs.map +2 -2
  54. package/build/fetch/index.cjs.map +2 -2
  55. package/build/footnotes/get-footnotes-order.cjs.map +2 -2
  56. package/build/footnotes/get-rich-text-values-cached.cjs.map +2 -2
  57. package/build/footnotes/index.cjs +12 -1
  58. package/build/footnotes/index.cjs.map +3 -3
  59. package/build/hooks/index.cjs.map +2 -2
  60. package/build/hooks/use-entity-block-editor.cjs.map +2 -2
  61. package/build/hooks/use-entity-id.cjs.map +2 -2
  62. package/build/hooks/use-entity-prop.cjs.map +2 -2
  63. package/build/hooks/use-entity-record.cjs.map +2 -2
  64. package/build/hooks/use-entity-records.cjs +2 -2
  65. package/build/hooks/use-entity-records.cjs.map +2 -2
  66. package/build/hooks/use-post-editor-awareness-state.cjs.map +2 -2
  67. package/build/hooks/use-query-select.cjs.map +2 -2
  68. package/build/hooks/use-resource-permissions.cjs.map +2 -2
  69. package/build/hooks/utils.cjs.map +2 -2
  70. package/build/index.cjs.map +2 -2
  71. package/build/lock-unlock.cjs.map +2 -2
  72. package/build/locks/actions.cjs.map +2 -2
  73. package/build/locks/engine.cjs.map +2 -2
  74. package/build/locks/reducer.cjs.map +2 -2
  75. package/build/locks/selectors.cjs.map +2 -2
  76. package/build/private-actions.cjs +54 -7
  77. package/build/private-actions.cjs.map +2 -2
  78. package/build/private-apis.cjs +3 -0
  79. package/build/private-apis.cjs.map +2 -2
  80. package/build/private-selectors.cjs +5 -0
  81. package/build/private-selectors.cjs.map +2 -2
  82. package/build/queried-data/get-query-parts.cjs.map +2 -2
  83. package/build/queried-data/reducer.cjs.map +2 -2
  84. package/build/queried-data/selectors.cjs.map +2 -2
  85. package/build/reducer.cjs.map +2 -2
  86. package/build/resolvers.cjs +21 -26
  87. package/build/resolvers.cjs.map +2 -2
  88. package/build/selectors.cjs.map +2 -2
  89. package/build/sync.cjs +26 -0
  90. package/build/sync.cjs.map +2 -2
  91. package/build/types.cjs.map +1 -1
  92. package/build/utils/block-selection-history.cjs.map +2 -2
  93. package/build/utils/clear-unchanged-edits.cjs.map +2 -2
  94. package/build/utils/conservative-map-item.cjs.map +2 -2
  95. package/build/utils/crdt-blocks.cjs.map +2 -2
  96. package/build/utils/crdt-selection.cjs.map +2 -2
  97. package/build/utils/crdt-text.cjs.map +2 -2
  98. package/build/utils/crdt-user-selections.cjs +43 -16
  99. package/build/utils/crdt-user-selections.cjs.map +3 -3
  100. package/build/utils/crdt-utils.cjs.map +2 -2
  101. package/build/utils/crdt.cjs.map +2 -2
  102. package/build/utils/get-template-info.cjs.map +2 -2
  103. package/build/utils/get-template-part-icon.cjs.map +2 -2
  104. package/build/utils/log-entity-deprecation.cjs.map +2 -2
  105. package/build/utils/save-crdt-doc.cjs.map +2 -2
  106. package/build-module/actions.mjs +19 -9
  107. package/build-module/actions.mjs.map +2 -2
  108. package/build-module/awareness/awareness-state.mjs.map +2 -2
  109. package/build-module/awareness/base-awareness.mjs.map +2 -2
  110. package/build-module/awareness/block-lookup.mjs.map +2 -2
  111. package/build-module/awareness/post-editor-awareness.mjs +7 -0
  112. package/build-module/awareness/post-editor-awareness.mjs.map +2 -2
  113. package/build-module/awareness/typed-awareness.mjs.map +2 -2
  114. package/build-module/awareness/utils.mjs.map +2 -2
  115. package/build-module/batch/create-batch.mjs.map +2 -2
  116. package/build-module/batch/default-processor.mjs.map +2 -2
  117. package/build-module/components/entities-saved-states/entity-record-item.mjs.map +2 -2
  118. package/build-module/components/entities-saved-states/entity-type-list.mjs.map +2 -2
  119. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs +4 -0
  120. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs.map +2 -2
  121. package/build-module/components/entities-saved-states/index.mjs.map +2 -2
  122. package/build-module/dynamic-entities.mjs.map +2 -2
  123. package/build-module/entities.mjs.map +2 -2
  124. package/build-module/entity-context.mjs.map +2 -2
  125. package/build-module/entity-provider.mjs.map +2 -2
  126. package/build-module/fetch/__experimental-fetch-link-suggestions.mjs.map +2 -2
  127. package/build-module/fetch/__experimental-fetch-url-data.mjs.map +2 -2
  128. package/build-module/fetch/index.mjs.map +2 -2
  129. package/build-module/footnotes/get-footnotes-order.mjs.map +2 -2
  130. package/build-module/footnotes/get-rich-text-values-cached.mjs.map +2 -2
  131. package/build-module/footnotes/index.mjs +12 -1
  132. package/build-module/footnotes/index.mjs.map +2 -2
  133. package/build-module/hooks/index.mjs.map +2 -2
  134. package/build-module/hooks/use-entity-block-editor.mjs.map +2 -2
  135. package/build-module/hooks/use-entity-id.mjs.map +2 -2
  136. package/build-module/hooks/use-entity-prop.mjs.map +2 -2
  137. package/build-module/hooks/use-entity-record.mjs.map +2 -2
  138. package/build-module/hooks/use-entity-records.mjs +2 -2
  139. package/build-module/hooks/use-entity-records.mjs.map +2 -2
  140. package/build-module/hooks/use-post-editor-awareness-state.mjs.map +2 -2
  141. package/build-module/hooks/use-query-select.mjs.map +2 -2
  142. package/build-module/hooks/use-resource-permissions.mjs.map +2 -2
  143. package/build-module/hooks/utils.mjs.map +2 -2
  144. package/build-module/index.mjs.map +2 -2
  145. package/build-module/lock-unlock.mjs.map +2 -2
  146. package/build-module/locks/actions.mjs.map +2 -2
  147. package/build-module/locks/engine.mjs.map +2 -2
  148. package/build-module/locks/reducer.mjs.map +2 -2
  149. package/build-module/locks/selectors.mjs.map +2 -2
  150. package/build-module/private-actions.mjs +54 -7
  151. package/build-module/private-actions.mjs.map +2 -2
  152. package/build-module/private-apis.mjs +9 -1
  153. package/build-module/private-apis.mjs.map +2 -2
  154. package/build-module/private-selectors.mjs +4 -0
  155. package/build-module/private-selectors.mjs.map +2 -2
  156. package/build-module/queried-data/get-query-parts.mjs.map +2 -2
  157. package/build-module/queried-data/reducer.mjs.map +2 -2
  158. package/build-module/queried-data/selectors.mjs.map +2 -2
  159. package/build-module/reducer.mjs.map +2 -2
  160. package/build-module/resolvers.mjs +21 -26
  161. package/build-module/resolvers.mjs.map +2 -2
  162. package/build-module/selectors.mjs.map +2 -2
  163. package/build-module/sync.mjs +23 -0
  164. package/build-module/sync.mjs.map +2 -2
  165. package/build-module/utils/block-selection-history.mjs.map +2 -2
  166. package/build-module/utils/clear-unchanged-edits.mjs.map +2 -2
  167. package/build-module/utils/conservative-map-item.mjs.map +2 -2
  168. package/build-module/utils/crdt-blocks.mjs.map +2 -2
  169. package/build-module/utils/crdt-selection.mjs.map +2 -2
  170. package/build-module/utils/crdt-text.mjs.map +2 -2
  171. package/build-module/utils/crdt-user-selections.mjs +43 -16
  172. package/build-module/utils/crdt-user-selections.mjs.map +3 -3
  173. package/build-module/utils/crdt-utils.mjs.map +2 -2
  174. package/build-module/utils/crdt.mjs.map +2 -2
  175. package/build-module/utils/get-template-info.mjs.map +2 -2
  176. package/build-module/utils/get-template-part-icon.mjs.map +2 -2
  177. package/build-module/utils/log-entity-deprecation.mjs.map +2 -2
  178. package/build-module/utils/save-crdt-doc.mjs.map +2 -2
  179. package/build-types/actions.d.ts +4 -0
  180. package/build-types/actions.d.ts.map +1 -1
  181. package/build-types/awareness/awareness-state.d.ts.map +1 -1
  182. package/build-types/awareness/base-awareness.d.ts +0 -3
  183. package/build-types/awareness/base-awareness.d.ts.map +1 -1
  184. package/build-types/awareness/block-lookup.d.ts +0 -3
  185. package/build-types/awareness/block-lookup.d.ts.map +1 -1
  186. package/build-types/awareness/post-editor-awareness.d.ts +0 -3
  187. package/build-types/awareness/post-editor-awareness.d.ts.map +1 -1
  188. package/build-types/awareness/typed-awareness.d.ts +0 -3
  189. package/build-types/awareness/typed-awareness.d.ts.map +1 -1
  190. package/build-types/awareness/types.d.ts +0 -6
  191. package/build-types/awareness/types.d.ts.map +1 -1
  192. package/build-types/awareness/utils.d.ts +0 -3
  193. package/build-types/awareness/utils.d.ts.map +1 -1
  194. package/build-types/batch/create-batch.d.ts.map +1 -1
  195. package/build-types/batch/default-processor.d.ts.map +1 -1
  196. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  197. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  198. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
  199. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  200. package/build-types/dynamic-entities.d.ts +0 -3
  201. package/build-types/dynamic-entities.d.ts.map +1 -1
  202. package/build-types/entities.d.ts.map +1 -1
  203. package/build-types/entity-context.d.ts.map +1 -1
  204. package/build-types/entity-provider.d.ts.map +1 -1
  205. package/build-types/entity-types/attachment.d.ts +0 -3
  206. package/build-types/entity-types/attachment.d.ts.map +1 -1
  207. package/build-types/entity-types/base.d.ts +0 -3
  208. package/build-types/entity-types/base.d.ts.map +1 -1
  209. package/build-types/entity-types/comment.d.ts +0 -3
  210. package/build-types/entity-types/comment.d.ts.map +1 -1
  211. package/build-types/entity-types/font-collection.d.ts +0 -3
  212. package/build-types/entity-types/font-collection.d.ts.map +1 -1
  213. package/build-types/entity-types/font-family.d.ts +0 -3
  214. package/build-types/entity-types/font-family.d.ts.map +1 -1
  215. package/build-types/entity-types/global-styles-revision.d.ts +0 -3
  216. package/build-types/entity-types/global-styles-revision.d.ts.map +1 -1
  217. package/build-types/entity-types/helpers.d.ts +0 -3
  218. package/build-types/entity-types/helpers.d.ts.map +1 -1
  219. package/build-types/entity-types/icon.d.ts +0 -3
  220. package/build-types/entity-types/icon.d.ts.map +1 -1
  221. package/build-types/entity-types/index.d.ts +0 -3
  222. package/build-types/entity-types/index.d.ts.map +1 -1
  223. package/build-types/entity-types/menu-location.d.ts +0 -3
  224. package/build-types/entity-types/menu-location.d.ts.map +1 -1
  225. package/build-types/entity-types/nav-menu-item.d.ts +0 -3
  226. package/build-types/entity-types/nav-menu-item.d.ts.map +1 -1
  227. package/build-types/entity-types/nav-menu.d.ts +0 -3
  228. package/build-types/entity-types/nav-menu.d.ts.map +1 -1
  229. package/build-types/entity-types/page.d.ts +0 -3
  230. package/build-types/entity-types/page.d.ts.map +1 -1
  231. package/build-types/entity-types/plugin.d.ts +0 -3
  232. package/build-types/entity-types/plugin.d.ts.map +1 -1
  233. package/build-types/entity-types/post-revision.d.ts +0 -3
  234. package/build-types/entity-types/post-revision.d.ts.map +1 -1
  235. package/build-types/entity-types/post-status.d.ts +0 -3
  236. package/build-types/entity-types/post-status.d.ts.map +1 -1
  237. package/build-types/entity-types/post.d.ts +0 -3
  238. package/build-types/entity-types/post.d.ts.map +1 -1
  239. package/build-types/entity-types/settings.d.ts +0 -3
  240. package/build-types/entity-types/settings.d.ts.map +1 -1
  241. package/build-types/entity-types/sidebar.d.ts +0 -3
  242. package/build-types/entity-types/sidebar.d.ts.map +1 -1
  243. package/build-types/entity-types/taxonomy.d.ts +0 -3
  244. package/build-types/entity-types/taxonomy.d.ts.map +1 -1
  245. package/build-types/entity-types/term.d.ts +0 -3
  246. package/build-types/entity-types/term.d.ts.map +1 -1
  247. package/build-types/entity-types/test/attachment.test.d.ts +0 -8
  248. package/build-types/entity-types/test/attachment.test.d.ts.map +1 -1
  249. package/build-types/entity-types/theme.d.ts +0 -3
  250. package/build-types/entity-types/theme.d.ts.map +1 -1
  251. package/build-types/entity-types/type.d.ts +0 -3
  252. package/build-types/entity-types/type.d.ts.map +1 -1
  253. package/build-types/entity-types/user.d.ts +0 -3
  254. package/build-types/entity-types/user.d.ts.map +1 -1
  255. package/build-types/entity-types/widget-type.d.ts +0 -3
  256. package/build-types/entity-types/widget-type.d.ts.map +1 -1
  257. package/build-types/entity-types/widget.d.ts +0 -3
  258. package/build-types/entity-types/widget.d.ts.map +1 -1
  259. package/build-types/entity-types/wp-template-part.d.ts +0 -3
  260. package/build-types/entity-types/wp-template-part.d.ts.map +1 -1
  261. package/build-types/entity-types/wp-template.d.ts +0 -3
  262. package/build-types/entity-types/wp-template.d.ts.map +1 -1
  263. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts.map +1 -1
  264. package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -1
  265. package/build-types/fetch/index.d.ts.map +1 -1
  266. package/build-types/footnotes/get-footnotes-order.d.ts.map +1 -1
  267. package/build-types/footnotes/get-rich-text-values-cached.d.ts.map +1 -1
  268. package/build-types/footnotes/index.d.ts.map +1 -1
  269. package/build-types/hooks/index.d.ts +0 -3
  270. package/build-types/hooks/index.d.ts.map +1 -1
  271. package/build-types/hooks/use-entity-block-editor.d.ts.map +1 -1
  272. package/build-types/hooks/use-entity-id.d.ts.map +1 -1
  273. package/build-types/hooks/use-entity-prop.d.ts.map +1 -1
  274. package/build-types/hooks/use-entity-record.d.ts.map +1 -1
  275. package/build-types/hooks/use-entity-records.d.ts.map +1 -1
  276. package/build-types/hooks/use-post-editor-awareness-state.d.ts.map +1 -1
  277. package/build-types/hooks/use-query-select.d.ts.map +1 -1
  278. package/build-types/hooks/use-resource-permissions.d.ts.map +1 -1
  279. package/build-types/hooks/utils.d.ts +0 -6
  280. package/build-types/hooks/utils.d.ts.map +1 -1
  281. package/build-types/index.d.ts +1 -0
  282. package/build-types/index.d.ts.map +1 -1
  283. package/build-types/lock-unlock.d.ts.map +1 -1
  284. package/build-types/locks/actions.d.ts.map +1 -1
  285. package/build-types/locks/engine.d.ts.map +1 -1
  286. package/build-types/locks/reducer.d.ts.map +1 -1
  287. package/build-types/locks/selectors.d.ts.map +1 -1
  288. package/build-types/private-actions.d.ts +1 -1
  289. package/build-types/private-actions.d.ts.map +1 -1
  290. package/build-types/private-apis.d.ts +4 -3
  291. package/build-types/private-apis.d.ts.map +1 -1
  292. package/build-types/private-selectors.d.ts +12 -3
  293. package/build-types/private-selectors.d.ts.map +1 -1
  294. package/build-types/queried-data/get-query-parts.d.ts.map +1 -1
  295. package/build-types/queried-data/reducer.d.ts.map +1 -1
  296. package/build-types/queried-data/selectors.d.ts.map +1 -1
  297. package/build-types/reducer.d.ts.map +1 -1
  298. package/build-types/resolvers.d.ts +1 -2
  299. package/build-types/resolvers.d.ts.map +1 -1
  300. package/build-types/selectors.d.ts.map +1 -1
  301. package/build-types/sync.d.ts +31 -3
  302. package/build-types/sync.d.ts.map +1 -1
  303. package/build-types/types.d.ts +9 -8
  304. package/build-types/types.d.ts.map +1 -1
  305. package/build-types/utils/block-selection-history.d.ts +0 -6
  306. package/build-types/utils/block-selection-history.d.ts.map +1 -1
  307. package/build-types/utils/clear-unchanged-edits.d.ts.map +1 -1
  308. package/build-types/utils/conservative-map-item.d.ts.map +1 -1
  309. package/build-types/utils/crdt-blocks.d.ts +0 -3
  310. package/build-types/utils/crdt-blocks.d.ts.map +1 -1
  311. package/build-types/utils/crdt-selection.d.ts +0 -3
  312. package/build-types/utils/crdt-selection.d.ts.map +1 -1
  313. package/build-types/utils/crdt-text.d.ts +0 -3
  314. package/build-types/utils/crdt-text.d.ts.map +1 -1
  315. package/build-types/utils/crdt-user-selections.d.ts.map +1 -1
  316. package/build-types/utils/crdt-utils.d.ts +0 -6
  317. package/build-types/utils/crdt-utils.d.ts.map +1 -1
  318. package/build-types/utils/crdt.d.ts.map +1 -1
  319. package/build-types/utils/get-template-info.d.ts.map +1 -1
  320. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  321. package/build-types/utils/log-entity-deprecation.d.ts.map +1 -1
  322. package/build-types/utils/save-crdt-doc.d.ts.map +1 -1
  323. package/package.json +24 -23
  324. package/src/actions.js +45 -29
  325. package/src/awareness/awareness-state.ts +0 -3
  326. package/src/awareness/base-awareness.ts +0 -8
  327. package/src/awareness/block-lookup.ts +1 -8
  328. package/src/awareness/post-editor-awareness.ts +13 -10
  329. package/src/awareness/test/awareness-state.ts +0 -11
  330. package/src/awareness/test/base-awareness.ts +0 -7
  331. package/src/awareness/test/block-lookup.ts +0 -8
  332. package/src/awareness/test/post-editor-awareness.ts +0 -7
  333. package/src/awareness/test/typed-awareness.ts +0 -11
  334. package/src/awareness/test/utils.ts +0 -3
  335. package/src/awareness/typed-awareness.ts +0 -7
  336. package/src/awareness/types.ts +0 -7
  337. package/src/awareness/utils.ts +0 -3
  338. package/src/batch/create-batch.js +0 -3
  339. package/src/batch/default-processor.js +0 -4
  340. package/src/batch/test/create-batch.js +0 -3
  341. package/src/batch/test/default-processor.js +0 -7
  342. package/src/components/entities-saved-states/entity-record-item.js +0 -7
  343. package/src/components/entities-saved-states/entity-type-list.js +0 -7
  344. package/src/components/entities-saved-states/hooks/use-is-dirty.js +4 -7
  345. package/src/components/entities-saved-states/index.js +0 -11
  346. package/src/components/entities-saved-states/test/use-is-dirty.js +70 -11
  347. package/src/dynamic-entities.ts +0 -3
  348. package/src/entities.js +0 -11
  349. package/src/entity-context.js +0 -3
  350. package/src/entity-provider.js +0 -7
  351. package/src/entity-types/attachment.ts +0 -4
  352. package/src/entity-types/base.ts +0 -3
  353. package/src/entity-types/comment.ts +0 -3
  354. package/src/entity-types/font-collection.ts +0 -3
  355. package/src/entity-types/font-family.ts +0 -3
  356. package/src/entity-types/global-styles-revision.ts +0 -4
  357. package/src/entity-types/helpers.ts +0 -3
  358. package/src/entity-types/icon.ts +0 -4
  359. package/src/entity-types/index.ts +0 -3
  360. package/src/entity-types/menu-location.ts +0 -4
  361. package/src/entity-types/nav-menu-item.ts +0 -4
  362. package/src/entity-types/nav-menu.ts +0 -4
  363. package/src/entity-types/page.ts +0 -4
  364. package/src/entity-types/plugin.ts +0 -4
  365. package/src/entity-types/post-revision.ts +0 -4
  366. package/src/entity-types/post-status.ts +0 -3
  367. package/src/entity-types/post.ts +0 -4
  368. package/src/entity-types/settings.ts +0 -4
  369. package/src/entity-types/sidebar.ts +0 -4
  370. package/src/entity-types/taxonomy.ts +0 -4
  371. package/src/entity-types/term.ts +0 -4
  372. package/src/entity-types/test/attachment.test.ts +0 -4
  373. package/src/entity-types/theme.ts +0 -4
  374. package/src/entity-types/type.ts +0 -4
  375. package/src/entity-types/user.ts +0 -4
  376. package/src/entity-types/widget-type.ts +0 -4
  377. package/src/entity-types/widget.ts +0 -4
  378. package/src/entity-types/wp-template-part.ts +0 -4
  379. package/src/entity-types/wp-template.ts +0 -4
  380. package/src/fetch/__experimental-fetch-link-suggestions.ts +0 -3
  381. package/src/fetch/__experimental-fetch-url-data.js +0 -3
  382. package/src/fetch/index.js +0 -7
  383. package/src/fetch/test/__experimental-fetch-link-suggestions.js +0 -3
  384. package/src/fetch/test/__experimental-fetch-url-data.js +1 -7
  385. package/src/footnotes/get-footnotes-order.js +0 -3
  386. package/src/footnotes/get-rich-text-values-cached.js +0 -7
  387. package/src/footnotes/index.js +21 -8
  388. package/src/footnotes/test/index.js +57 -0
  389. package/src/hooks/index.ts +0 -3
  390. package/src/hooks/test/use-entity-record.js +0 -12
  391. package/src/hooks/test/use-entity-records.js +0 -12
  392. package/src/hooks/test/use-post-editor-awareness-state.ts +0 -7
  393. package/src/hooks/test/use-query-select.js +0 -11
  394. package/src/hooks/test/use-resource-permissions.js +0 -12
  395. package/src/hooks/use-entity-block-editor.js +0 -7
  396. package/src/hooks/use-entity-id.js +0 -7
  397. package/src/hooks/use-entity-prop.js +0 -7
  398. package/src/hooks/use-entity-record.ts +0 -7
  399. package/src/hooks/use-entity-records.ts +2 -9
  400. package/src/hooks/use-post-editor-awareness-state.ts +0 -7
  401. package/src/hooks/use-query-select.ts +0 -7
  402. package/src/hooks/use-resource-permissions.ts +0 -7
  403. package/src/hooks/utils.ts +0 -7
  404. package/src/index.js +0 -7
  405. package/src/lock-unlock.ts +0 -3
  406. package/src/locks/actions.js +0 -3
  407. package/src/locks/engine.js +0 -3
  408. package/src/locks/reducer.js +0 -3
  409. package/src/locks/selectors.js +0 -3
  410. package/src/locks/test/engine.js +0 -3
  411. package/src/locks/test/reducer.js +0 -7
  412. package/src/locks/test/selectors.js +0 -7
  413. package/src/locks/test/utils.js +0 -7
  414. package/src/private-actions.js +63 -15
  415. package/src/private-apis.ts +9 -4
  416. package/src/private-selectors.ts +22 -7
  417. package/src/queried-data/get-query-parts.js +0 -7
  418. package/src/queried-data/reducer.js +0 -7
  419. package/src/queried-data/selectors.js +0 -7
  420. package/src/queried-data/test/actions.js +0 -3
  421. package/src/queried-data/test/get-query-parts.js +0 -3
  422. package/src/queried-data/test/reducer.js +0 -7
  423. package/src/queried-data/test/selectors.js +0 -3
  424. package/src/reducer.js +0 -11
  425. package/src/resolvers.js +23 -40
  426. package/src/selectors.ts +0 -7
  427. package/src/sync.ts +64 -7
  428. package/src/test/actions.js +256 -8
  429. package/src/test/deprecated-entity-logging.js +0 -7
  430. package/src/test/entities.js +0 -8
  431. package/src/test/entity-provider.js +0 -11
  432. package/src/test/private-actions.js +297 -7
  433. package/src/test/private-selectors.js +0 -3
  434. package/src/test/reducer.js +0 -7
  435. package/src/test/resolvers.js +0 -12
  436. package/src/test/rtc-rich-text-offset-space.test.js +0 -12
  437. package/src/test/selectors.js +0 -7
  438. package/src/test/store.js +8 -15
  439. package/src/types.ts +14 -12
  440. package/src/utils/block-selection-history.ts +0 -10
  441. package/src/utils/clear-unchanged-edits.ts +0 -3
  442. package/src/utils/conservative-map-item.js +0 -3
  443. package/src/utils/crdt-blocks.ts +0 -11
  444. package/src/utils/crdt-selection.ts +0 -7
  445. package/src/utils/crdt-text.ts +0 -3
  446. package/src/utils/crdt-user-selections.ts +85 -23
  447. package/src/utils/crdt-utils.ts +0 -7
  448. package/src/utils/crdt.ts +0 -11
  449. package/src/utils/get-template-info.js +0 -6
  450. package/src/utils/get-template-part-icon.js +0 -3
  451. package/src/utils/log-entity-deprecation.ts +0 -7
  452. package/src/utils/save-crdt-doc.js +0 -7
  453. package/src/utils/test/block-selection-history.test.ts +0 -7
  454. package/src/utils/test/clear-unchanged-edits.js +0 -3
  455. package/src/utils/test/conservative-map-item.js +0 -3
  456. package/src/utils/test/crdt-blocks.ts +0 -17
  457. package/src/utils/test/crdt-user-selections.ts +107 -30
  458. package/src/utils/test/crdt-utils.ts +0 -7
  459. package/src/utils/test/crdt.ts +0 -16
  460. package/src/utils/test/get-nested-value.js +0 -3
  461. package/src/utils/test/get-normalized-comma-separable.js +0 -3
  462. package/src/utils/test/get-template-info.js +0 -6
  463. package/src/utils/test/if-matching-action.js +0 -7
  464. package/src/utils/test/is-numeric-id.js +0 -3
  465. package/src/utils/test/log-entity-deprecation.js +0 -7
  466. package/src/utils/test/replace-action.js +0 -3
  467. package/src/utils/test/rtc-rich-text-cursor-scope.test.js +0 -14
  468. package/src/utils/test/rtc-rich-text-offset-space.test.js +0 -14
  469. package/src/utils/test/save-crdt-doc.js +0 -7
  470. package/src/utils/test/set-nested-value.js +0 -3
  471. package/src/utils/test/with-weak-map-cache.js +0 -3
  472. package/build-types/utils/on-sub-key.d.ts +0 -4
  473. package/build-types/utils/on-sub-key.d.ts.map +0 -1
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context } from './helpers';
5
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
3
  import type { FontFace, FontFamily } from './font-family';
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  Context,
6
3
  ContextualField,
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, ContextualField, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { EntityRecord } from './index';
5
2
 
6
3
  export interface AvatarUrls {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, Updatable } from './helpers';
5
2
  import type { Attachment } from './attachment';
6
3
  import type { Base, TemplatePartArea, TemplateType } from './base';
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,13 +1,9 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  RenderedText,
6
3
  Context,
7
4
  ContextualField,
8
5
  OmitNevers,
9
6
  } from './helpers';
10
-
11
7
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
12
8
 
13
9
  export type NavMenuItemType =
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, ContextualField, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  CommentingStatus,
6
3
  Context,
@@ -10,7 +7,6 @@ import type {
10
7
  RenderedText,
11
8
  OmitNevers,
12
9
  } from './helpers';
13
-
14
10
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
15
11
 
16
12
  declare module './base-entity-records' {
@@ -1,13 +1,9 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  Context,
6
3
  ContextualField,
7
4
  RenderedText,
8
5
  OmitNevers,
9
6
  } from './helpers';
10
-
11
7
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
12
8
 
13
9
  declare module './base-entity-records' {
@@ -1,13 +1,9 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  Context,
6
3
  ContextualField,
7
4
  RenderedText,
8
5
  OmitNevers,
9
6
  } from './helpers';
10
-
11
7
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
12
8
 
13
9
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, OmitNevers } from './helpers';
5
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
3
 
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  CommentingStatus,
6
3
  Context,
@@ -11,7 +8,6 @@ import type {
11
8
  RenderedText,
12
9
  OmitNevers,
13
10
  } from './helpers';
14
-
15
11
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
16
12
 
17
13
  declare module './base-entity-records' {
@@ -1,13 +1,9 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  CommentingStatus,
6
3
  Context,
7
4
  OmitNevers,
8
5
  PingStatus,
9
6
  } from './helpers';
10
-
11
7
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
12
8
 
13
9
  declare module './base-entity-records' {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, ContextualField, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, ContextualField, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -6,10 +6,6 @@
6
6
  * are from the REST API's edit context, which includes edit-only fields like
7
7
  * permalink_template, generated_slug, and missing_image_sizes.
8
8
  */
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
9
  import type { Attachment } from '../attachment';
14
10
  import imageAttachmentFixture from './fixtures/attachment-image.json';
15
11
  import zipAttachmentFixture from './fixtures/attachment-zip.json';
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, PostFormat, RenderedText, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, ContextualField, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,13 +1,9 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  AvatarUrls,
6
3
  Context,
7
4
  ContextualField,
8
5
  OmitNevers,
9
6
  } from './helpers';
10
-
11
7
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
12
8
 
13
9
  declare module './base-entity-records' {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,8 +1,4 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { Context, ContextualField, OmitNevers } from './helpers';
5
-
6
2
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
7
3
 
8
4
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  Context,
6
3
  PostStatus,
@@ -8,7 +5,6 @@ import type {
8
5
  OmitNevers,
9
6
  ContextualField,
10
7
  } from './helpers';
11
-
12
8
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
13
9
 
14
10
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type {
5
2
  Context,
6
3
  PostStatus,
@@ -8,7 +5,6 @@ import type {
8
5
  OmitNevers,
9
6
  ContextualField,
10
7
  } from './helpers';
11
-
12
8
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
13
9
 
14
10
  declare module './base-entity-records' {
@@ -1,6 +1,3 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import apiFetch from '@wordpress/api-fetch';
5
2
  import { addQueryArgs } from '@wordpress/url';
6
3
  import { decodeEntities } from '@wordpress/html-entities';
@@ -1,6 +1,3 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import apiFetch from '@wordpress/api-fetch';
5
2
  import {
6
3
  addQueryArgs,
@@ -1,11 +1,4 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import { camelCase } from 'change-case';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
2
  import apiFetch from '@wordpress/api-fetch';
10
3
 
11
4
  export { default as __experimentalFetchLinkSuggestions } from './__experimental-fetch-link-suggestions';
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import {
5
2
  default as fetchLinkSuggestions,
6
3
  sortResults,
@@ -1,11 +1,5 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import fetchUrlData from '../__experimental-fetch-url-data';
5
- /**
6
- * WordPress dependencies
7
- */
8
1
  import apiFetch from '@wordpress/api-fetch';
2
+ import fetchUrlData from '../__experimental-fetch-url-data';
9
3
 
10
4
  jest.mock( '@wordpress/api-fetch' );
11
5
 
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import getRichTextValuesCached from './get-rich-text-values-cached';
5
2
 
6
3
  const cache = new WeakMap();
@@ -1,11 +1,4 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
2
  import { unlock } from '../lock-unlock';
10
3
 
11
4
  // TODO: The following line should have been:
@@ -1,11 +1,5 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { RichTextData, create, toHTMLString } from '@wordpress/rich-text';
5
-
6
- /**
7
- * Internal dependencies
8
- */
2
+ import warning from '@wordpress/warning';
9
3
  import getFootnotesOrder from './get-footnotes-order';
10
4
 
11
5
  let oldFootnotes = {};
@@ -23,7 +17,26 @@ export function updateFootnotesFromMeta( blocks, meta ) {
23
17
 
24
18
  const newOrder = getFootnotesOrder( blocks );
25
19
 
26
- const footnotes = meta.footnotes ? JSON.parse( meta.footnotes ) : [];
20
+ // This meta is a string that something else may have written: a plugin, an
21
+ // import, or a direct database edit can leave it malformed or holding
22
+ // something other than an array. Parsing it unguarded throws inside a store
23
+ // subscriber, where no error boundary catches it and the edit is dropped
24
+ // before it reaches editEntityRecord, so the post silently stops saving.
25
+ let parsed;
26
+ try {
27
+ parsed = JSON.parse( meta.footnotes || '[]' );
28
+ } catch {
29
+ // Left undefined, which the check below reports along with a value of
30
+ // the wrong shape.
31
+ }
32
+
33
+ let footnotes = [];
34
+ if ( Array.isArray( parsed ) ) {
35
+ footnotes = parsed;
36
+ } else {
37
+ warning( 'Footnotes post meta is not a JSON array; ignoring it.' );
38
+ }
39
+
27
40
  const currentOrder = footnotes.map( ( fn ) => fn.id );
28
41
 
29
42
  if ( currentOrder.join( '' ) === newOrder.join( '' ) ) {
@@ -0,0 +1,57 @@
1
+ import warning from '@wordpress/warning';
2
+ import { updateFootnotesFromMeta } from '../';
3
+
4
+ // The real implementation logs once per distinct message, which would make
5
+ // per-case assertions depend on the order the cases run in.
6
+ jest.mock( '@wordpress/warning' );
7
+
8
+ describe( 'updateFootnotesFromMeta', () => {
9
+ const blocks = [];
10
+
11
+ beforeEach( () => {
12
+ warning.mockClear();
13
+ } );
14
+
15
+ it( 'returns the blocks untouched when there is no meta', () => {
16
+ expect( updateFootnotesFromMeta( blocks, undefined ) ).toEqual( {
17
+ blocks,
18
+ } );
19
+ } );
20
+
21
+ it( 'returns the blocks untouched when the meta is not registered', () => {
22
+ expect( updateFootnotesFromMeta( blocks, {} ) ).toEqual( { blocks } );
23
+ } );
24
+
25
+ it( 'accepts an empty footnotes array without warning', () => {
26
+ expect(
27
+ updateFootnotesFromMeta( blocks, { footnotes: '[]' } )
28
+ ).toEqual( { blocks } );
29
+ expect( warning ).not.toHaveBeenCalled();
30
+ } );
31
+
32
+ describe( 'meta this code did not write', () => {
33
+ // Each of these threw before being guarded, inside a store subscriber
34
+ // where no error boundary catches it, so the user's edit was dropped
35
+ // and the post silently stopped saving.
36
+ it.each( [
37
+ [ 'valid JSON holding null', 'null' ],
38
+ [ 'valid JSON holding a number', '5' ],
39
+ [ 'valid JSON holding an object', '{"a":1}' ],
40
+ [ 'valid JSON holding a string', '"footnotes"' ],
41
+ [ 'malformed JSON', '{' ],
42
+ [ 'a truncated array', '[{"id":"a","content":"x"' ],
43
+ [ 'not JSON at all', 'footnotes' ],
44
+ ] )( 'does not throw on %s', ( _label, footnotes ) => {
45
+ expect( () =>
46
+ updateFootnotesFromMeta( blocks, { footnotes } )
47
+ ).not.toThrow();
48
+ expect( warning ).toHaveBeenCalled();
49
+ } );
50
+
51
+ it( 'treats an unreadable value as no footnotes', () => {
52
+ expect(
53
+ updateFootnotesFromMeta( blocks, { footnotes: 'null' } )
54
+ ).toEqual( { blocks } );
55
+ } );
56
+ } );
57
+ } );
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { WithPermissions } from './use-entity-records';
5
2
 
6
3
  /**
@@ -1,19 +1,7 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import triggerFetch from '@wordpress/api-fetch';
5
2
  import { createRegistry, RegistryProvider } from '@wordpress/data';
6
-
7
3
  jest.mock( '@wordpress/api-fetch' );
8
-
9
- /**
10
- * External dependencies
11
- */
12
4
  import { act, render, waitFor } from '@testing-library/react';
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
5
  import { store as coreDataStore } from '../../index';
18
6
  import useEntityRecord from '../use-entity-record';
19
7
 
@@ -1,19 +1,7 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import triggerFetch from '@wordpress/api-fetch';
5
2
  import { createRegistry, RegistryProvider } from '@wordpress/data';
6
-
7
3
  jest.mock( '@wordpress/api-fetch' );
8
-
9
- /**
10
- * External dependencies
11
- */
12
4
  import { render, waitFor } from '@testing-library/react';
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
5
  import { store as coreDataStore } from '../../index';
18
6
  import useEntityRecords, {
19
7
  useEntityRecordsWithPermissions,
@@ -1,11 +1,4 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import { act, renderHook, waitFor } from '@testing-library/react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
2
  import {
10
3
  useActiveCollaborators,
11
4
  useResolvedSelection,
@@ -1,20 +1,9 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import {
5
2
  createReduxStore,
6
3
  createRegistry,
7
4
  RegistryProvider,
8
5
  } from '@wordpress/data';
9
-
10
- /**
11
- * External dependencies
12
- */
13
6
  import { render, screen, waitFor } from '@testing-library/react';
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
7
  import useQuerySelect from '../use-query-select';
19
8
 
20
9
  /* eslint-disable @wordpress/wp-global-usage */
@@ -1,19 +1,7 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import triggerFetch from '@wordpress/api-fetch';
5
2
  import { createRegistry, RegistryProvider } from '@wordpress/data';
6
-
7
3
  jest.mock( '@wordpress/api-fetch' );
8
-
9
- /**
10
- * External dependencies
11
- */
12
4
  import { render, waitFor } from '@testing-library/react';
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
5
  import { store as coreDataStore } from '../../index';
18
6
  import useResourcePermissions from '../use-resource-permissions';
19
7
 
@@ -1,13 +1,6 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { useCallback, useMemo } from '@wordpress/element';
5
2
  import { useDispatch, useSelect } from '@wordpress/data';
6
3
  import { parse, __unstableSerializeAndClean } from '@wordpress/blocks';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
4
  import { STORE_NAME } from '../name';
12
5
  import useEntityId from './use-entity-id';
13
6
  import { updateFootnotesFromMeta } from '../footnotes';
@@ -1,11 +1,4 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { useContext } from '@wordpress/element';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
2
  import { EntityContext } from '../entity-context';
10
3
 
11
4
  /**
@@ -1,12 +1,5 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { useCallback, useContext } from '@wordpress/element';
5
2
  import { useDispatch, useSelect } from '@wordpress/data';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
3
  import { STORE_NAME } from '../name';
11
4
  import { DEFAULT_ENTITY_KEY } from '../entities';
12
5
  import { EntityContext } from '../entity-context';
@@ -1,13 +1,6 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { useDispatch, useSelect } from '@wordpress/data';
5
2
  import deprecated from '@wordpress/deprecated';
6
3
  import { useMemo } from '@wordpress/element';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
4
  import { store as coreStore } from '../';
12
5
  import type { Status } from './constants';
13
6
  import { getResolutionStatus } from './utils';
@@ -1,14 +1,7 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
1
  import { addQueryArgs } from '@wordpress/url';
5
2
  import deprecated from '@wordpress/deprecated';
6
3
  import { useSelect } from '@wordpress/data';
7
4
  import { useMemo } from '@wordpress/element';
8
-
9
- /**
10
- * Internal dependencies
11
- */
12
5
  import { store as coreStore } from '../';
13
6
  import type { Options } from './use-entity-record';
14
7
  import type { Status } from './constants';
@@ -208,7 +201,7 @@ export function useEntityRecordsWithPermissions< RecordType >(
208
201
  const ids = useMemo(
209
202
  () =>
210
203
  data?.map(
211
- // @ts-ignore
204
+ // @ts-expect-error `data` is `unknown[]`, so the callback signature does not line up.
212
205
  ( record: RecordType ) => record[ entityConfig?.key ?? 'id' ]
213
206
  ) ?? [],
214
207
  [ data, entityConfig?.key ]
@@ -227,7 +220,7 @@ export function useEntityRecordsWithPermissions< RecordType >(
227
220
  const dataWithPermissions = useMemo(
228
221
  () =>
229
222
  data?.map( ( record, index ) => ( {
230
- // @ts-ignore
223
+ // @ts-expect-error `record` is `unknown`, which cannot be spread.
231
224
  ...record,
232
225
  permissions: permissions[ index ],
233
226
  } ) ) ?? [],