@wordpress/editor 14.2.0 → 14.3.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 (695) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/pattern-overrides.js +8 -5
  3. package/build/bindings/pattern-overrides.js.map +1 -1
  4. package/build/bindings/post-meta.js +4 -0
  5. package/build/bindings/post-meta.js.map +1 -1
  6. package/build/components/editor-interface/index.js +2 -1
  7. package/build/components/editor-interface/index.js.map +1 -1
  8. package/build/components/entities-saved-states/index.js +1 -1
  9. package/build/components/entities-saved-states/index.js.map +1 -1
  10. package/build/components/inserter-sidebar/index.js +10 -21
  11. package/build/components/inserter-sidebar/index.js.map +1 -1
  12. package/build/components/list-view-sidebar/index.js +19 -47
  13. package/build/components/list-view-sidebar/index.js.map +1 -1
  14. package/build/components/page-attributes/parent.js +2 -1
  15. package/build/components/page-attributes/parent.js.map +1 -1
  16. package/build/components/post-actions/actions.js +67 -215
  17. package/build/components/post-actions/actions.js.map +1 -1
  18. package/build/components/post-actions/index.js +1 -1
  19. package/build/components/post-actions/index.js.map +1 -1
  20. package/build/components/post-excerpt/panel.js +1 -1
  21. package/build/components/post-excerpt/panel.js.map +1 -1
  22. package/build/components/post-preview-button/index.js +1 -1
  23. package/build/components/post-preview-button/index.js.map +1 -1
  24. package/build/components/post-publish-panel/index.js +1 -1
  25. package/build/components/post-publish-panel/index.js.map +1 -1
  26. package/build/components/post-saved-state/index.js +11 -1
  27. package/build/components/post-saved-state/index.js.map +1 -1
  28. package/build/components/post-schedule/index.js +3 -0
  29. package/build/components/post-schedule/index.js.map +1 -1
  30. package/build/components/post-status/index.js +2 -1
  31. package/build/components/post-status/index.js.map +1 -1
  32. package/build/components/post-title/index.js +5 -13
  33. package/build/components/post-title/index.js.map +1 -1
  34. package/build/components/preview-dropdown/index.js +1 -1
  35. package/build/components/preview-dropdown/index.js.map +1 -1
  36. package/build/components/provider/index.native.js +0 -4
  37. package/build/components/provider/index.native.js.map +1 -1
  38. package/build/components/provider/use-block-editor-settings.js +7 -4
  39. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  40. package/build/components/save-publish-panels/index.js +30 -16
  41. package/build/components/save-publish-panels/index.js.map +1 -1
  42. package/build/components/sidebar/index.js +3 -1
  43. package/build/components/sidebar/index.js.map +1 -1
  44. package/build/components/sidebar/post-summary.js +1 -2
  45. package/build/components/sidebar/post-summary.js.map +1 -1
  46. package/build/components/template-content-panel/index.js +29 -4
  47. package/build/components/template-content-panel/index.js.map +1 -1
  48. package/build/components/visual-editor/index.js +1 -1
  49. package/build/components/visual-editor/index.js.map +1 -1
  50. package/build/dataviews/actions/delete-post.js +96 -0
  51. package/build/dataviews/actions/delete-post.js.map +1 -0
  52. package/build/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +11 -20
  53. package/build/dataviews/actions/export-pattern.js.map +1 -0
  54. package/build/dataviews/actions/index.js +32 -0
  55. package/build/dataviews/actions/index.js.map +1 -0
  56. package/build/dataviews/actions/reset-post.js +111 -0
  57. package/build/dataviews/actions/reset-post.js.map +1 -0
  58. package/build/dataviews/actions/utils.js +50 -0
  59. package/build/dataviews/actions/utils.js.map +1 -0
  60. package/build/dataviews/store/private-actions.js.map +1 -1
  61. package/build/dataviews/store/private-selectors.js +6 -6
  62. package/build/dataviews/store/private-selectors.js.map +1 -1
  63. package/build/dataviews/store/reducer.js +6 -2
  64. package/build/dataviews/store/reducer.js.map +1 -1
  65. package/build/dataviews/types.js +6 -0
  66. package/build/dataviews/types.js.map +1 -0
  67. package/build/hooks/pattern-overrides.js +2 -2
  68. package/build/hooks/pattern-overrides.js.map +1 -1
  69. package/build/private-apis.js +2 -0
  70. package/build/private-apis.js.map +1 -1
  71. package/build/private-apis.native.js +0 -2
  72. package/build/private-apis.native.js.map +1 -1
  73. package/build/store/constants.js.map +1 -1
  74. package/build/store/private-actions.js +1 -1
  75. package/build/store/private-actions.js.map +1 -1
  76. package/build/store/private-selectors.js +0 -18
  77. package/build/store/private-selectors.js.map +1 -1
  78. package/build/store/utils/is-template-revertable.js +6 -8
  79. package/build/store/utils/is-template-revertable.js.map +1 -1
  80. package/build-module/bindings/pattern-overrides.js +8 -5
  81. package/build-module/bindings/pattern-overrides.js.map +1 -1
  82. package/build-module/bindings/post-meta.js +4 -0
  83. package/build-module/bindings/post-meta.js.map +1 -1
  84. package/build-module/components/editor-interface/index.js +2 -1
  85. package/build-module/components/editor-interface/index.js.map +1 -1
  86. package/build-module/components/entities-saved-states/index.js +1 -1
  87. package/build-module/components/entities-saved-states/index.js.map +1 -1
  88. package/build-module/components/inserter-sidebar/index.js +11 -22
  89. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  90. package/build-module/components/list-view-sidebar/index.js +20 -49
  91. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  92. package/build-module/components/page-attributes/parent.js +2 -1
  93. package/build-module/components/page-attributes/parent.js.map +1 -1
  94. package/build-module/components/post-actions/actions.js +63 -210
  95. package/build-module/components/post-actions/actions.js.map +1 -1
  96. package/build-module/components/post-actions/index.js +1 -1
  97. package/build-module/components/post-actions/index.js.map +1 -1
  98. package/build-module/components/post-excerpt/panel.js +1 -1
  99. package/build-module/components/post-excerpt/panel.js.map +1 -1
  100. package/build-module/components/post-preview-button/index.js +1 -1
  101. package/build-module/components/post-preview-button/index.js.map +1 -1
  102. package/build-module/components/post-publish-panel/index.js +1 -1
  103. package/build-module/components/post-publish-panel/index.js.map +1 -1
  104. package/build-module/components/post-saved-state/index.js +11 -1
  105. package/build-module/components/post-saved-state/index.js.map +1 -1
  106. package/build-module/components/post-schedule/index.js +3 -0
  107. package/build-module/components/post-schedule/index.js.map +1 -1
  108. package/build-module/components/post-status/index.js +1 -1
  109. package/build-module/components/post-status/index.js.map +1 -1
  110. package/build-module/components/post-title/index.js +5 -13
  111. package/build-module/components/post-title/index.js.map +1 -1
  112. package/build-module/components/preview-dropdown/index.js +1 -1
  113. package/build-module/components/preview-dropdown/index.js.map +1 -1
  114. package/build-module/components/provider/index.native.js +0 -4
  115. package/build-module/components/provider/index.native.js.map +1 -1
  116. package/build-module/components/provider/use-block-editor-settings.js +7 -4
  117. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  118. package/build-module/components/save-publish-panels/index.js +30 -16
  119. package/build-module/components/save-publish-panels/index.js.map +1 -1
  120. package/build-module/components/sidebar/index.js +3 -1
  121. package/build-module/components/sidebar/index.js.map +1 -1
  122. package/build-module/components/sidebar/post-summary.js +1 -2
  123. package/build-module/components/sidebar/post-summary.js.map +1 -1
  124. package/build-module/components/template-content-panel/index.js +30 -5
  125. package/build-module/components/template-content-panel/index.js.map +1 -1
  126. package/build-module/components/visual-editor/index.js +1 -1
  127. package/build-module/components/visual-editor/index.js.map +1 -1
  128. package/build-module/dataviews/actions/delete-post.js +87 -0
  129. package/build-module/dataviews/actions/delete-post.js.map +1 -0
  130. package/build-module/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +10 -19
  131. package/build-module/dataviews/actions/export-pattern.js.map +1 -0
  132. package/build-module/dataviews/actions/index.js +24 -0
  133. package/build-module/dataviews/actions/index.js.map +1 -0
  134. package/build-module/dataviews/actions/reset-post.js +104 -0
  135. package/build-module/dataviews/actions/reset-post.js.map +1 -0
  136. package/build-module/dataviews/actions/utils.js +41 -0
  137. package/build-module/dataviews/actions/utils.js.map +1 -0
  138. package/build-module/dataviews/store/private-actions.js.map +1 -1
  139. package/build-module/dataviews/store/private-selectors.js +5 -5
  140. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  141. package/build-module/dataviews/store/reducer.js +6 -2
  142. package/build-module/dataviews/store/reducer.js.map +1 -1
  143. package/build-module/dataviews/types.js +2 -0
  144. package/build-module/dataviews/types.js.map +1 -0
  145. package/build-module/hooks/pattern-overrides.js +3 -1
  146. package/build-module/hooks/pattern-overrides.js.map +1 -1
  147. package/build-module/private-apis.js +2 -0
  148. package/build-module/private-apis.js.map +1 -1
  149. package/build-module/private-apis.native.js +0 -2
  150. package/build-module/private-apis.native.js.map +1 -1
  151. package/build-module/store/constants.js.map +1 -1
  152. package/build-module/store/private-actions.js +1 -1
  153. package/build-module/store/private-actions.js.map +1 -1
  154. package/build-module/store/private-selectors.js +0 -17
  155. package/build-module/store/private-selectors.js.map +1 -1
  156. package/build-module/store/utils/is-template-revertable.js +6 -8
  157. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  158. package/build-style/style-rtl.css +15 -53
  159. package/build-style/style.css +15 -53
  160. package/build-types/bindings/index.d.ts +2 -0
  161. package/build-types/bindings/index.d.ts.map +1 -0
  162. package/build-types/bindings/pattern-overrides.d.ts +18 -0
  163. package/build-types/bindings/pattern-overrides.d.ts.map +1 -0
  164. package/build-types/bindings/post-meta.d.ts +25 -0
  165. package/build-types/bindings/post-meta.d.ts.map +1 -0
  166. package/build-types/components/autocompleters/index.d.ts +2 -0
  167. package/build-types/components/autocompleters/index.d.ts.map +1 -0
  168. package/build-types/components/autocompleters/user.d.ts +6 -0
  169. package/build-types/components/autocompleters/user.d.ts.map +1 -0
  170. package/build-types/components/autosave-monitor/index.d.ts +15 -0
  171. package/build-types/components/autosave-monitor/index.d.ts.map +1 -0
  172. package/build-types/components/block-manager/category.d.ts +6 -0
  173. package/build-types/components/block-manager/category.d.ts.map +1 -0
  174. package/build-types/components/block-manager/checklist.d.ts +7 -0
  175. package/build-types/components/block-manager/checklist.d.ts.map +1 -0
  176. package/build-types/components/block-manager/index.d.ts +3 -0
  177. package/build-types/components/block-manager/index.d.ts.map +1 -0
  178. package/build-types/components/block-removal-warnings/index.d.ts +2 -0
  179. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -0
  180. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +2 -0
  181. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -0
  182. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +65 -0
  183. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -0
  184. package/build-types/components/blog-title/index.d.ts +2 -0
  185. package/build-types/components/blog-title/index.d.ts.map +1 -0
  186. package/build-types/components/character-count/index.d.ts +7 -0
  187. package/build-types/components/character-count/index.d.ts.map +1 -0
  188. package/build-types/components/collapsible-block-toolbar/index.d.ts +6 -0
  189. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -0
  190. package/build-types/components/commands/index.d.ts +2 -0
  191. package/build-types/components/commands/index.d.ts.map +1 -0
  192. package/build-types/components/create-template-part-modal/index.d.ts +14 -0
  193. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -0
  194. package/build-types/components/create-template-part-modal/utils.d.ts +4 -0
  195. package/build-types/components/create-template-part-modal/utils.d.ts.map +1 -0
  196. package/build-types/components/deprecated.d.ts +182 -0
  197. package/build-types/components/deprecated.d.ts.map +1 -0
  198. package/build-types/components/document-bar/index.d.ts +22 -0
  199. package/build-types/components/document-bar/index.d.ts.map +1 -0
  200. package/build-types/components/document-outline/check.d.ts +12 -0
  201. package/build-types/components/document-outline/check.d.ts.map +1 -0
  202. package/build-types/components/document-outline/index.d.ts +16 -0
  203. package/build-types/components/document-outline/index.d.ts.map +1 -0
  204. package/build-types/components/document-outline/item.d.ts +9 -0
  205. package/build-types/components/document-outline/item.d.ts.map +1 -0
  206. package/build-types/components/document-tools/index.d.ts +6 -0
  207. package/build-types/components/document-tools/index.d.ts.map +1 -0
  208. package/build-types/components/editor/index.d.ts +14 -0
  209. package/build-types/components/editor/index.d.ts.map +1 -0
  210. package/build-types/components/editor-history/redo.d.ts +4 -0
  211. package/build-types/components/editor-history/redo.d.ts.map +1 -0
  212. package/build-types/components/editor-history/undo.d.ts +4 -0
  213. package/build-types/components/editor-history/undo.d.ts.map +1 -0
  214. package/build-types/components/editor-interface/content-slot-fill.d.ts +3 -0
  215. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -0
  216. package/build-types/components/editor-interface/index.d.ts +17 -0
  217. package/build-types/components/editor-interface/index.d.ts.map +1 -0
  218. package/build-types/components/editor-notices/index.d.ts +13 -0
  219. package/build-types/components/editor-notices/index.d.ts.map +1 -0
  220. package/build-types/components/editor-snackbars/index.d.ts +7 -0
  221. package/build-types/components/editor-snackbars/index.d.ts.map +1 -0
  222. package/build-types/components/entities-saved-states/entity-record-item.d.ts +6 -0
  223. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -0
  224. package/build-types/components/entities-saved-states/entity-type-list.d.ts +6 -0
  225. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -0
  226. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +2 -0
  227. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -0
  228. package/build-types/components/entities-saved-states/index.d.ts +43 -0
  229. package/build-types/components/entities-saved-states/index.d.ts.map +1 -0
  230. package/build-types/components/error-boundary/index.d.ts +14 -0
  231. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  232. package/build-types/components/global-keyboard-shortcuts/index.d.ts +9 -0
  233. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -0
  234. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +8 -0
  235. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -0
  236. package/build-types/components/global-styles-provider/index.d.ts +20 -0
  237. package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
  238. package/build-types/components/header/back-button.d.ts +6 -0
  239. package/build-types/components/header/back-button.d.ts.map +1 -0
  240. package/build-types/components/header/index.d.ts +10 -0
  241. package/build-types/components/header/index.d.ts.map +1 -0
  242. package/build-types/components/index.d.ts +108 -0
  243. package/build-types/components/index.d.ts.map +1 -0
  244. package/build-types/components/inserter-sidebar/index.d.ts +2 -0
  245. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -0
  246. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +26 -0
  247. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
  248. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
  249. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
  250. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +3 -0
  251. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
  252. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +8 -0
  253. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
  254. package/build-types/components/list-view-sidebar/index.d.ts +2 -0
  255. package/build-types/components/list-view-sidebar/index.d.ts.map +1 -0
  256. package/build-types/components/list-view-sidebar/list-view-outline.d.ts +2 -0
  257. package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -0
  258. package/build-types/components/local-autosave-monitor/index.d.ts +3 -0
  259. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -0
  260. package/build-types/components/media-categories/index.d.ts +7 -0
  261. package/build-types/components/media-categories/index.d.ts.map +1 -0
  262. package/build-types/components/mode-switcher/index.d.ts +3 -0
  263. package/build-types/components/mode-switcher/index.d.ts.map +1 -0
  264. package/build-types/components/more-menu/copy-content-menu-item.d.ts +2 -0
  265. package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -0
  266. package/build-types/components/more-menu/index.d.ts +2 -0
  267. package/build-types/components/more-menu/index.d.ts.map +1 -0
  268. package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
  269. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
  270. package/build-types/components/more-menu/view-more-menu-group.d.ts +6 -0
  271. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -0
  272. package/build-types/components/page-attributes/check.d.ts +13 -0
  273. package/build-types/components/page-attributes/check.d.ts.map +1 -0
  274. package/build-types/components/page-attributes/order.d.ts +9 -0
  275. package/build-types/components/page-attributes/order.d.ts.map +1 -0
  276. package/build-types/components/page-attributes/panel.d.ts +7 -0
  277. package/build-types/components/page-attributes/panel.d.ts.map +1 -0
  278. package/build-types/components/page-attributes/parent.d.ts +11 -0
  279. package/build-types/components/page-attributes/parent.d.ts.map +1 -0
  280. package/build-types/components/pattern-duplicate-modal/index.d.ts +3 -0
  281. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -0
  282. package/build-types/components/pattern-overrides-panel/index.d.ts +2 -0
  283. package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -0
  284. package/build-types/components/pattern-rename-modal/index.d.ts +3 -0
  285. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -0
  286. package/build-types/components/plugin-document-setting-panel/index.d.ts +69 -0
  287. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -0
  288. package/build-types/components/plugin-more-menu-item/index.d.ts +3 -0
  289. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -0
  290. package/build-types/components/plugin-post-publish-panel/index.d.ts +47 -0
  291. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -0
  292. package/build-types/components/plugin-post-status-info/index.d.ts +57 -0
  293. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -0
  294. package/build-types/components/plugin-pre-publish-panel/index.d.ts +50 -0
  295. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -0
  296. package/build-types/components/plugin-sidebar/index.d.ts +73 -0
  297. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -0
  298. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +52 -0
  299. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -0
  300. package/build-types/components/post-actions/actions.d.ts +31 -0
  301. package/build-types/components/post-actions/actions.d.ts.map +1 -0
  302. package/build-types/components/post-actions/index.d.ts +5 -0
  303. package/build-types/components/post-actions/index.d.ts.map +1 -0
  304. package/build-types/components/post-author/check.d.ts +13 -0
  305. package/build-types/components/post-author/check.d.ts.map +1 -0
  306. package/build-types/components/post-author/combobox.d.ts +2 -0
  307. package/build-types/components/post-author/combobox.d.ts.map +1 -0
  308. package/build-types/components/post-author/constants.d.ts +9 -0
  309. package/build-types/components/post-author/constants.d.ts.map +1 -0
  310. package/build-types/components/post-author/hook.d.ts +6 -0
  311. package/build-types/components/post-author/hook.d.ts.map +1 -0
  312. package/build-types/components/post-author/index.d.ts +8 -0
  313. package/build-types/components/post-author/index.d.ts.map +1 -0
  314. package/build-types/components/post-author/panel.d.ts +8 -0
  315. package/build-types/components/post-author/panel.d.ts.map +1 -0
  316. package/build-types/components/post-author/select.d.ts +2 -0
  317. package/build-types/components/post-author/select.d.ts.map +1 -0
  318. package/build-types/components/post-card-panel/index.d.ts +4 -0
  319. package/build-types/components/post-card-panel/index.d.ts.map +1 -0
  320. package/build-types/components/post-comments/index.d.ts +3 -0
  321. package/build-types/components/post-comments/index.d.ts.map +1 -0
  322. package/build-types/components/post-content-information/index.d.ts +2 -0
  323. package/build-types/components/post-content-information/index.d.ts.map +1 -0
  324. package/build-types/components/post-discussion/panel.d.ts +10 -0
  325. package/build-types/components/post-discussion/panel.d.ts.map +1 -0
  326. package/build-types/components/post-excerpt/check.d.ts +13 -0
  327. package/build-types/components/post-excerpt/check.d.ts.map +1 -0
  328. package/build-types/components/post-excerpt/index.d.ts +15 -0
  329. package/build-types/components/post-excerpt/index.d.ts.map +1 -0
  330. package/build-types/components/post-excerpt/panel.d.ts +8 -0
  331. package/build-types/components/post-excerpt/panel.d.ts.map +1 -0
  332. package/build-types/components/post-excerpt/plugin.d.ts +53 -0
  333. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -0
  334. package/build-types/components/post-featured-image/check.d.ts +14 -0
  335. package/build-types/components/post-featured-image/check.d.ts.map +1 -0
  336. package/build-types/components/post-featured-image/index.d.ts +3 -0
  337. package/build-types/components/post-featured-image/index.d.ts.map +1 -0
  338. package/build-types/components/post-featured-image/panel.d.ts +13 -0
  339. package/build-types/components/post-featured-image/panel.d.ts.map +1 -0
  340. package/build-types/components/post-format/check.d.ts +5 -0
  341. package/build-types/components/post-format/check.d.ts.map +1 -0
  342. package/build-types/components/post-format/index.d.ts +16 -0
  343. package/build-types/components/post-format/index.d.ts.map +1 -0
  344. package/build-types/components/post-format/panel.d.ts +8 -0
  345. package/build-types/components/post-format/panel.d.ts.map +1 -0
  346. package/build-types/components/post-last-edited-panel/index.d.ts +2 -0
  347. package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -0
  348. package/build-types/components/post-last-revision/check.d.ts +13 -0
  349. package/build-types/components/post-last-revision/check.d.ts.map +1 -0
  350. package/build-types/components/post-last-revision/index.d.ts +9 -0
  351. package/build-types/components/post-last-revision/index.d.ts.map +1 -0
  352. package/build-types/components/post-last-revision/panel.d.ts +8 -0
  353. package/build-types/components/post-last-revision/panel.d.ts.map +1 -0
  354. package/build-types/components/post-locked-modal/index.d.ts +8 -0
  355. package/build-types/components/post-locked-modal/index.d.ts.map +1 -0
  356. package/build-types/components/post-panel-row/index.d.ts +3 -0
  357. package/build-types/components/post-panel-row/index.d.ts.map +1 -0
  358. package/build-types/components/post-panel-section/index.d.ts +6 -0
  359. package/build-types/components/post-panel-section/index.d.ts.map +1 -0
  360. package/build-types/components/post-pending-status/check.d.ts +15 -0
  361. package/build-types/components/post-pending-status/check.d.ts.map +1 -0
  362. package/build-types/components/post-pending-status/index.d.ts +8 -0
  363. package/build-types/components/post-pending-status/index.d.ts.map +1 -0
  364. package/build-types/components/post-pingbacks/index.d.ts +3 -0
  365. package/build-types/components/post-pingbacks/index.d.ts.map +1 -0
  366. package/build-types/components/post-preview-button/index.d.ts +23 -0
  367. package/build-types/components/post-preview-button/index.d.ts.map +1 -0
  368. package/build-types/components/post-publish-button/index.d.ts +17 -0
  369. package/build-types/components/post-publish-button/index.d.ts.map +1 -0
  370. package/build-types/components/post-publish-button/label.d.ts +7 -0
  371. package/build-types/components/post-publish-button/label.d.ts.map +1 -0
  372. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +17 -0
  373. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -0
  374. package/build-types/components/post-publish-panel/index.d.ts +10 -0
  375. package/build-types/components/post-publish-panel/index.d.ts.map +1 -0
  376. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +3 -0
  377. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -0
  378. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts +2 -0
  379. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -0
  380. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +3 -0
  381. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -0
  382. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +2 -0
  383. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -0
  384. package/build-types/components/post-publish-panel/postpublish.d.ts +3 -0
  385. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -0
  386. package/build-types/components/post-publish-panel/prepublish.d.ts +5 -0
  387. package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -0
  388. package/build-types/components/post-saved-state/index.d.ts +13 -0
  389. package/build-types/components/post-saved-state/index.d.ts.map +1 -0
  390. package/build-types/components/post-schedule/check.d.ts +12 -0
  391. package/build-types/components/post-schedule/check.d.ts.map +1 -0
  392. package/build-types/components/post-schedule/index.d.ts +17 -0
  393. package/build-types/components/post-schedule/index.d.ts.map +1 -0
  394. package/build-types/components/post-schedule/label.d.ts +25 -0
  395. package/build-types/components/post-schedule/label.d.ts.map +1 -0
  396. package/build-types/components/post-schedule/panel.d.ts +7 -0
  397. package/build-types/components/post-schedule/panel.d.ts.map +1 -0
  398. package/build-types/components/post-slug/check.d.ts +12 -0
  399. package/build-types/components/post-slug/check.d.ts.map +1 -0
  400. package/build-types/components/post-slug/index.d.ts +7 -0
  401. package/build-types/components/post-slug/index.d.ts.map +1 -0
  402. package/build-types/components/post-slug/panel.d.ts +3 -0
  403. package/build-types/components/post-slug/panel.d.ts.map +1 -0
  404. package/build-types/components/post-status/index.d.ts +6 -0
  405. package/build-types/components/post-status/index.d.ts.map +1 -0
  406. package/build-types/components/post-sticky/check.d.ts +12 -0
  407. package/build-types/components/post-sticky/check.d.ts.map +1 -0
  408. package/build-types/components/post-sticky/index.d.ts +7 -0
  409. package/build-types/components/post-sticky/index.d.ts.map +1 -0
  410. package/build-types/components/post-sticky/panel.d.ts +3 -0
  411. package/build-types/components/post-sticky/panel.d.ts.map +1 -0
  412. package/build-types/components/post-switch-to-draft-button/index.d.ts +7 -0
  413. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -0
  414. package/build-types/components/post-sync-status/index.d.ts +7 -0
  415. package/build-types/components/post-sync-status/index.d.ts.map +1 -0
  416. package/build-types/components/post-taxonomies/check.d.ts +12 -0
  417. package/build-types/components/post-taxonomies/check.d.ts.map +1 -0
  418. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +64 -0
  419. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -0
  420. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +102 -0
  421. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -0
  422. package/build-types/components/post-taxonomies/index.d.ts +5 -0
  423. package/build-types/components/post-taxonomies/index.d.ts.map +1 -0
  424. package/build-types/components/post-taxonomies/most-used-terms.d.ts +5 -0
  425. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -0
  426. package/build-types/components/post-taxonomies/panel.d.ts +3 -0
  427. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -0
  428. package/build-types/components/post-template/block-theme.d.ts +4 -0
  429. package/build-types/components/post-template/block-theme.d.ts.map +1 -0
  430. package/build-types/components/post-template/classic-theme.d.ts +3 -0
  431. package/build-types/components/post-template/classic-theme.d.ts.map +1 -0
  432. package/build-types/components/post-template/create-new-template-modal.d.ts +4 -0
  433. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -0
  434. package/build-types/components/post-template/create-new-template.d.ts +4 -0
  435. package/build-types/components/post-template/create-new-template.d.ts.map +1 -0
  436. package/build-types/components/post-template/hooks.d.ts +8 -0
  437. package/build-types/components/post-template/hooks.d.ts.map +1 -0
  438. package/build-types/components/post-template/panel.d.ts +7 -0
  439. package/build-types/components/post-template/panel.d.ts.map +1 -0
  440. package/build-types/components/post-template/reset-default-template.d.ts +4 -0
  441. package/build-types/components/post-template/reset-default-template.d.ts.map +1 -0
  442. package/build-types/components/post-template/swap-template-button.d.ts +4 -0
  443. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -0
  444. package/build-types/components/post-text-editor/index.d.ts +7 -0
  445. package/build-types/components/post-text-editor/index.d.ts.map +1 -0
  446. package/build-types/components/post-title/constants.d.ts +3 -0
  447. package/build-types/components/post-title/constants.d.ts.map +1 -0
  448. package/build-types/components/post-title/index.d.ts +3 -0
  449. package/build-types/components/post-title/index.d.ts.map +1 -0
  450. package/build-types/components/post-title/post-title-raw.d.ts +3 -0
  451. package/build-types/components/post-title/post-title-raw.d.ts.map +1 -0
  452. package/build-types/components/post-title/use-post-title-focus.d.ts +9 -0
  453. package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -0
  454. package/build-types/components/post-title/use-post-title.d.ts +7 -0
  455. package/build-types/components/post-title/use-post-title.d.ts.map +1 -0
  456. package/build-types/components/post-transform-panel/hooks.d.ts +2 -0
  457. package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -0
  458. package/build-types/components/post-transform-panel/index.d.ts +2 -0
  459. package/build-types/components/post-transform-panel/index.d.ts.map +1 -0
  460. package/build-types/components/post-trash/check.d.ts +12 -0
  461. package/build-types/components/post-trash/check.d.ts.map +1 -0
  462. package/build-types/components/post-trash/index.d.ts +7 -0
  463. package/build-types/components/post-trash/index.d.ts.map +1 -0
  464. package/build-types/components/post-type-support-check/index.d.ts +18 -0
  465. package/build-types/components/post-type-support-check/index.d.ts.map +1 -0
  466. package/build-types/components/post-url/check.d.ts +12 -0
  467. package/build-types/components/post-url/check.d.ts.map +1 -0
  468. package/build-types/components/post-url/index.d.ts +14 -0
  469. package/build-types/components/post-url/index.d.ts.map +1 -0
  470. package/build-types/components/post-url/label.d.ts +13 -0
  471. package/build-types/components/post-url/label.d.ts.map +1 -0
  472. package/build-types/components/post-url/panel.d.ts +7 -0
  473. package/build-types/components/post-url/panel.d.ts.map +1 -0
  474. package/build-types/components/post-view-link/index.d.ts +2 -0
  475. package/build-types/components/post-view-link/index.d.ts.map +1 -0
  476. package/build-types/components/post-visibility/check.d.ts +13 -0
  477. package/build-types/components/post-visibility/check.d.ts.map +1 -0
  478. package/build-types/components/post-visibility/index.d.ts +11 -0
  479. package/build-types/components/post-visibility/index.d.ts.map +1 -0
  480. package/build-types/components/post-visibility/label.d.ts +13 -0
  481. package/build-types/components/post-visibility/label.d.ts.map +1 -0
  482. package/build-types/components/post-visibility/utils.d.ts +21 -0
  483. package/build-types/components/post-visibility/utils.d.ts.map +1 -0
  484. package/build-types/components/posts-per-page/index.d.ts +2 -0
  485. package/build-types/components/posts-per-page/index.d.ts.map +1 -0
  486. package/build-types/components/preferences-modal/enable-panel.d.ts +3 -0
  487. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -0
  488. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +14 -0
  489. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -0
  490. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +3 -0
  491. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -0
  492. package/build-types/components/preferences-modal/index.d.ts +4 -0
  493. package/build-types/components/preferences-modal/index.d.ts.map +1 -0
  494. package/build-types/components/preview-dropdown/index.d.ts +5 -0
  495. package/build-types/components/preview-dropdown/index.d.ts.map +1 -0
  496. package/build-types/components/provider/disable-non-page-content-blocks.d.ts +6 -0
  497. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -0
  498. package/build-types/components/provider/index.d.ts +65 -0
  499. package/build-types/components/provider/index.d.ts.map +1 -0
  500. package/build-types/components/provider/navigation-block-editing-mode.d.ts +9 -0
  501. package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -0
  502. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +7 -0
  503. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -0
  504. package/build-types/components/provider/use-block-editor-settings.d.ts +13 -0
  505. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -0
  506. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +9 -0
  507. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -0
  508. package/build-types/components/provider/with-registry-provider.d.ts +3 -0
  509. package/build-types/components/provider/with-registry-provider.d.ts.map +1 -0
  510. package/build-types/components/resizable-editor/index.d.ts +8 -0
  511. package/build-types/components/resizable-editor/index.d.ts.map +1 -0
  512. package/build-types/components/resizable-editor/resize-handle.d.ts +5 -0
  513. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -0
  514. package/build-types/components/save-publish-panels/index.d.ts +11 -0
  515. package/build-types/components/save-publish-panels/index.d.ts.map +1 -0
  516. package/build-types/components/sidebar/constants.d.ts +5 -0
  517. package/build-types/components/sidebar/constants.d.ts.map +1 -0
  518. package/build-types/components/sidebar/header.d.ts +3 -0
  519. package/build-types/components/sidebar/header.d.ts.map +1 -0
  520. package/build-types/components/sidebar/index.d.ts +6 -0
  521. package/build-types/components/sidebar/index.d.ts.map +1 -0
  522. package/build-types/components/sidebar/post-summary.d.ts +4 -0
  523. package/build-types/components/sidebar/post-summary.d.ts.map +1 -0
  524. package/build-types/components/site-discussion/index.d.ts +2 -0
  525. package/build-types/components/site-discussion/index.d.ts.map +1 -0
  526. package/build-types/components/start-page-options/index.d.ts +2 -0
  527. package/build-types/components/start-page-options/index.d.ts.map +1 -0
  528. package/build-types/components/start-template-options/index.d.ts +2 -0
  529. package/build-types/components/start-template-options/index.d.ts.map +1 -0
  530. package/build-types/components/table-of-contents/index.d.ts +7 -0
  531. package/build-types/components/table-of-contents/index.d.ts.map +1 -0
  532. package/build-types/components/table-of-contents/panel.d.ts +6 -0
  533. package/build-types/components/table-of-contents/panel.d.ts.map +1 -0
  534. package/build-types/components/template-content-panel/index.d.ts +4 -0
  535. package/build-types/components/template-content-panel/index.d.ts.map +1 -0
  536. package/build-types/components/template-part-content-panel/index.d.ts +2 -0
  537. package/build-types/components/template-part-content-panel/index.d.ts.map +1 -0
  538. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts +5 -0
  539. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -0
  540. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +5 -0
  541. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -0
  542. package/build-types/components/template-part-menu-items/index.d.ts +2 -0
  543. package/build-types/components/template-part-menu-items/index.d.ts.map +1 -0
  544. package/build-types/components/template-validation-notice/index.d.ts +2 -0
  545. package/build-types/components/template-validation-notice/index.d.ts.map +1 -0
  546. package/build-types/components/text-editor/index.d.ts +4 -0
  547. package/build-types/components/text-editor/index.d.ts.map +1 -0
  548. package/build-types/components/theme-support-check/index.d.ts +14 -0
  549. package/build-types/components/theme-support-check/index.d.ts.map +1 -0
  550. package/build-types/components/time-to-read/index.d.ts +7 -0
  551. package/build-types/components/time-to-read/index.d.ts.map +1 -0
  552. package/build-types/components/unsaved-changes-warning/index.d.ts +8 -0
  553. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -0
  554. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +18 -0
  555. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -0
  556. package/build-types/components/visual-editor/index.d.ts +10 -0
  557. package/build-types/components/visual-editor/index.d.ts.map +1 -0
  558. package/build-types/components/word-count/index.d.ts +7 -0
  559. package/build-types/components/word-count/index.d.ts.map +1 -0
  560. package/build-types/dataviews/actions/delete-post.d.ts +5 -0
  561. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -0
  562. package/build-types/dataviews/actions/export-pattern.d.ts +8 -0
  563. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -0
  564. package/build-types/dataviews/actions/index.d.ts +2 -0
  565. package/build-types/dataviews/actions/index.d.ts.map +1 -0
  566. package/build-types/dataviews/actions/reset-post.d.ts +5 -0
  567. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -0
  568. package/build-types/dataviews/actions/utils.d.ts +11 -0
  569. package/build-types/dataviews/actions/utils.d.ts.map +1 -0
  570. package/build-types/dataviews/api.d.ts +27 -0
  571. package/build-types/dataviews/api.d.ts.map +1 -0
  572. package/build-types/dataviews/store/private-actions.d.ts +2 -2
  573. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  574. package/build-types/dataviews/store/private-selectors.d.ts +2 -5
  575. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  576. package/build-types/dataviews/store/reducer.d.ts +5 -1
  577. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  578. package/build-types/dataviews/types.d.ts +34 -0
  579. package/build-types/dataviews/types.d.ts.map +1 -0
  580. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +10 -0
  581. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -0
  582. package/build-types/hooks/default-autocompleters.d.ts +2 -0
  583. package/build-types/hooks/default-autocompleters.d.ts.map +1 -0
  584. package/build-types/hooks/index.d.ts +2 -0
  585. package/build-types/hooks/index.d.ts.map +1 -0
  586. package/build-types/hooks/media-upload.d.ts +2 -0
  587. package/build-types/hooks/media-upload.d.ts.map +1 -0
  588. package/build-types/hooks/pattern-overrides.d.ts +2 -0
  589. package/build-types/hooks/pattern-overrides.d.ts.map +1 -0
  590. package/build-types/hooks/use-select-nearest-editable-block.d.ts +4 -0
  591. package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +1 -0
  592. package/build-types/index.d.ts +6 -0
  593. package/build-types/index.d.ts.map +1 -0
  594. package/build-types/lock-unlock.d.ts +3 -0
  595. package/build-types/lock-unlock.d.ts.map +1 -0
  596. package/build-types/private-apis.d.ts +2 -0
  597. package/build-types/private-apis.d.ts.map +1 -0
  598. package/build-types/store/actions.d.ts +367 -0
  599. package/build-types/store/actions.d.ts.map +1 -0
  600. package/build-types/store/constants.d.ts +31 -0
  601. package/build-types/store/constants.d.ts.map +1 -0
  602. package/build-types/store/defaults.d.ts +21 -0
  603. package/build-types/store/defaults.d.ts.map +1 -0
  604. package/build-types/store/index.d.ts +17 -0
  605. package/build-types/store/index.d.ts.map +1 -0
  606. package/build-types/store/local-autosave.d.ts +4 -0
  607. package/build-types/store/local-autosave.d.ts.map +1 -0
  608. package/build-types/store/private-actions.d.ts +37 -0
  609. package/build-types/store/private-actions.d.ts.map +1 -0
  610. package/build-types/store/private-selectors.d.ts +24 -0
  611. package/build-types/store/private-selectors.d.ts.map +1 -0
  612. package/build-types/store/reducer.d.ts +228 -0
  613. package/build-types/store/reducer.d.ts.map +1 -0
  614. package/build-types/store/selectors.d.ts +854 -0
  615. package/build-types/store/selectors.d.ts.map +1 -0
  616. package/build-types/store/utils/get-filtered-template-parts.d.ts +3 -0
  617. package/build-types/store/utils/get-filtered-template-parts.d.ts.map +1 -0
  618. package/build-types/store/utils/is-template-revertable.d.ts +8 -0
  619. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -0
  620. package/build-types/store/utils/notice-builder.d.ts +27 -0
  621. package/build-types/store/utils/notice-builder.d.ts.map +1 -0
  622. package/build-types/utils/get-template-part-icon.d.ts +9 -0
  623. package/build-types/utils/get-template-part-icon.d.ts.map +1 -0
  624. package/build-types/utils/index.d.ts +5 -0
  625. package/build-types/utils/index.d.ts.map +1 -0
  626. package/build-types/utils/media-upload/index.d.ts +21 -0
  627. package/build-types/utils/media-upload/index.d.ts.map +1 -0
  628. package/build-types/utils/set-nested-value.d.ts +20 -0
  629. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  630. package/build-types/utils/terms.d.ts +12 -0
  631. package/build-types/utils/terms.d.ts.map +1 -0
  632. package/build-types/utils/url.d.ts +18 -0
  633. package/build-types/utils/url.d.ts.map +1 -0
  634. package/package.json +36 -35
  635. package/src/bindings/pattern-overrides.js +9 -10
  636. package/src/bindings/post-meta.js +5 -0
  637. package/src/components/editor-interface/index.js +17 -12
  638. package/src/components/entities-saved-states/index.js +1 -1
  639. package/src/components/inserter-sidebar/index.js +4 -24
  640. package/src/components/list-view-sidebar/index.js +34 -62
  641. package/src/components/list-view-sidebar/style.scss +0 -34
  642. package/src/components/page-attributes/parent.js +6 -3
  643. package/src/components/post-actions/actions.js +82 -277
  644. package/src/components/post-actions/index.js +1 -1
  645. package/src/components/post-excerpt/panel.js +1 -1
  646. package/src/components/post-featured-image/style.scss +15 -0
  647. package/src/components/post-panel-row/style.scss +1 -0
  648. package/src/components/post-preview-button/index.js +1 -1
  649. package/src/components/post-publish-panel/index.js +1 -1
  650. package/src/components/post-saved-state/index.js +11 -1
  651. package/src/components/post-schedule/index.js +5 -0
  652. package/src/components/post-status/index.js +1 -1
  653. package/src/components/post-taxonomies/README.md +1 -1
  654. package/src/components/post-title/index.js +5 -12
  655. package/src/components/preview-dropdown/index.js +1 -1
  656. package/src/components/provider/index.native.js +3 -11
  657. package/src/components/provider/use-block-editor-settings.js +10 -5
  658. package/src/components/save-publish-panels/index.js +33 -23
  659. package/src/components/sidebar/index.js +1 -3
  660. package/src/components/sidebar/post-summary.js +0 -2
  661. package/src/components/template-content-panel/index.js +29 -5
  662. package/src/components/visual-editor/index.js +1 -1
  663. package/src/components/visual-editor/style.scss +1 -1
  664. package/src/dataviews/actions/delete-post.tsx +107 -0
  665. package/src/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.tsx} +19 -19
  666. package/src/dataviews/actions/index.ts +25 -0
  667. package/src/dataviews/actions/reset-post.tsx +144 -0
  668. package/src/dataviews/actions/utils.ts +54 -0
  669. package/src/dataviews/store/private-actions.ts +2 -2
  670. package/src/dataviews/store/private-selectors.ts +13 -6
  671. package/src/dataviews/store/reducer.ts +12 -5
  672. package/src/dataviews/types.ts +33 -0
  673. package/src/hooks/pattern-overrides.js +4 -1
  674. package/src/private-apis.js +2 -0
  675. package/src/private-apis.native.js +0 -2
  676. package/src/store/private-actions.js +1 -6
  677. package/src/store/private-selectors.js +0 -25
  678. package/src/store/utils/is-template-revertable.js +8 -8
  679. package/src/style.scss +0 -1
  680. package/tsconfig.json +3 -2
  681. package/tsconfig.tsbuildinfo +1 -1
  682. package/build/components/post-actions/export-pattern-action.js.map +0 -1
  683. package/build/components/post-actions/export-pattern-action.native.js +0 -11
  684. package/build/components/post-actions/export-pattern-action.native.js.map +0 -1
  685. package/build/components/template-areas/index.js +0 -84
  686. package/build/components/template-areas/index.js.map +0 -1
  687. package/build-module/components/post-actions/export-pattern-action.js.map +0 -1
  688. package/build-module/components/post-actions/export-pattern-action.native.js +0 -5
  689. package/build-module/components/post-actions/export-pattern-action.native.js.map +0 -1
  690. package/build-module/components/template-areas/index.js +0 -78
  691. package/build-module/components/template-areas/index.js.map +0 -1
  692. package/src/components/post-actions/export-pattern-action.native.js +0 -4
  693. package/src/components/template-areas/index.js +0 -94
  694. package/src/components/template-areas/style.scss +0 -22
  695. /package/src/store/{constants.js → constants.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["registerEntityAction","kind","name","config","type","unregisterEntityAction","actionId"],"sources":["@wordpress/editor/src/dataviews/store/private-actions.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport type { Action, AnyItem } from '@wordpress/dataviews';\n\nexport function registerEntityAction< Item extends AnyItem >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA,OAAO,SAASA,oBAAoBA,CACnCC,IAAY,EACZC,IAAY,EACZC,MAAsB,EACrB;EACD,OAAO;IACNC,IAAI,EAAE,wBAAiC;IACvCH,IAAI;IACJC,IAAI;IACJC;EACD,CAAC;AACF;AAEA,OAAO,SAASE,sBAAsBA,CACrCJ,IAAY,EACZC,IAAY,EACZI,QAAgB,EACf;EACD,OAAO;IACNF,IAAI,EAAE,0BAAmC;IACzCH,IAAI;IACJC,IAAI;IACJI;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["registerEntityAction","kind","name","config","type","unregisterEntityAction","actionId"],"sources":["@wordpress/editor/src/dataviews/store/private-actions.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport type { Action } from '@wordpress/dataviews';\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA,OAAO,SAASA,oBAAoBA,CACnCC,IAAY,EACZC,IAAY,EACZC,MAAsB,EACrB;EACD,OAAO;IACNC,IAAI,EAAE,wBAAiC;IACvCH,IAAI;IACJC,IAAI;IACJC;EACD,CAAC;AACF;AAEA,OAAO,SAASE,sBAAsBA,CACrCJ,IAAY,EACZC,IAAY,EACZI,QAAgB,EACf;EACD,OAAO;IACNF,IAAI,EAAE,0BAAmC;IACzCH,IAAI;IACJC,IAAI;IACJI;EACD,CAAC;AACF","ignoreList":[]}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { createSelector } from '@wordpress/data';
4
5
 
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
8
9
 
9
- const EMPTY_ARRAY = [];
10
- export function getEntityActions(state, kind, name) {
11
- var _state$actions$kind$n;
12
- return (_state$actions$kind$n = state.actions[kind]?.[name]) !== null && _state$actions$kind$n !== void 0 ? _state$actions$kind$n : EMPTY_ARRAY;
13
- }
10
+ export const getEntityActions = createSelector((state, kind, name) => {
11
+ var _state$actions$kind$n, _state$actions$kind$;
12
+ return [...((_state$actions$kind$n = state.actions[kind]?.[name]) !== null && _state$actions$kind$n !== void 0 ? _state$actions$kind$n : []), ...((_state$actions$kind$ = state.actions[kind]?.['*']) !== null && _state$actions$kind$ !== void 0 ? _state$actions$kind$ : [])];
13
+ }, (state, kind, name) => [state.actions[kind]?.[name], state.actions[kind]?.['*']]);
14
14
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["EMPTY_ARRAY","getEntityActions","state","kind","name","_state$actions$kind$n","actions"],"sources":["@wordpress/editor/src/dataviews/store/private-selectors.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport type { Action } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport type { State } from './reducer';\n\nconst EMPTY_ARRAY: Action< any >[] = [];\n\nexport function getEntityActions( state: State, kind: string, name: string ) {\n\treturn state.actions[ kind ]?.[ name ] ?? EMPTY_ARRAY;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMA,WAA4B,GAAG,EAAE;AAEvC,OAAO,SAASC,gBAAgBA,CAAEC,KAAY,EAAEC,IAAY,EAAEC,IAAY,EAAG;EAAA,IAAAC,qBAAA;EAC5E,QAAAA,qBAAA,GAAOH,KAAK,CAACI,OAAO,CAAEH,IAAI,CAAE,GAAIC,IAAI,CAAE,cAAAC,qBAAA,cAAAA,qBAAA,GAAIL,WAAW;AACtD","ignoreList":[]}
1
+ {"version":3,"names":["createSelector","getEntityActions","state","kind","name","_state$actions$kind$n","_state$actions$kind$","actions"],"sources":["@wordpress/editor/src/dataviews/store/private-selectors.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport type { State } from './reducer';\n\nexport const getEntityActions = createSelector(\n\t( state: State, kind: string, name: string ) => {\n\t\treturn [\n\t\t\t...( state.actions[ kind ]?.[ name ] ?? [] ),\n\t\t\t...( state.actions[ kind ]?.[ '*' ] ?? [] ),\n\t\t];\n\t},\n\t( state: State, kind: string, name: string ) => [\n\t\tstate.actions[ kind ]?.[ name ],\n\t\tstate.actions[ kind ]?.[ '*' ],\n\t]\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,iBAAiB;;AAEhD;AACA;AACA;;AAGA,OAAO,MAAMC,gBAAgB,GAAGD,cAAc,CAC7C,CAAEE,KAAY,EAAEC,IAAY,EAAEC,IAAY,KAAM;EAAA,IAAAC,qBAAA,EAAAC,oBAAA;EAC/C,OAAO,CACN,KAAAD,qBAAA,GAAKH,KAAK,CAACK,OAAO,CAAEJ,IAAI,CAAE,GAAIC,IAAI,CAAE,cAAAC,qBAAA,cAAAA,qBAAA,GAAI,EAAE,CAAE,EAC5C,KAAAC,oBAAA,GAAKJ,KAAK,CAACK,OAAO,CAAEJ,IAAI,CAAE,GAAI,GAAG,CAAE,cAAAG,oBAAA,cAAAA,oBAAA,GAAI,EAAE,CAAE,CAC3C;AACF,CAAC,EACD,CAAEJ,KAAY,EAAEC,IAAY,EAAEC,IAAY,KAAM,CAC/CF,KAAK,CAACK,OAAO,CAAEJ,IAAI,CAAE,GAAIC,IAAI,CAAE,EAC/BF,KAAK,CAACK,OAAO,CAAEJ,IAAI,CAAE,GAAI,GAAG,CAAE,CAEhC,CAAC","ignoreList":[]}
@@ -9,7 +9,8 @@ function actions(state = {}, action) {
9
9
  return {
10
10
  ...state,
11
11
  [action.kind]: {
12
- [action.name]: [...((_state$action$kind$ac = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac !== void 0 ? _state$action$kind$ac : []), action.config]
12
+ ...state[action.kind],
13
+ [action.name]: [...((_state$action$kind$ac = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac !== void 0 ? _state$action$kind$ac : []).filter(_action => _action.id !== action.config.id), action.config]
13
14
  }
14
15
  };
15
16
  case 'UNREGISTER_ENTITY_ACTION':
@@ -17,7 +18,10 @@ function actions(state = {}, action) {
17
18
  var _state$action$kind$ac2;
18
19
  return {
19
20
  ...state,
20
- [action.kind]: ((_state$action$kind$ac2 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac2 !== void 0 ? _state$action$kind$ac2 : []).filter(_action => _action.id !== action.actionId)
21
+ [action.kind]: {
22
+ ...state[action.kind],
23
+ [action.name]: ((_state$action$kind$ac2 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac2 !== void 0 ? _state$action$kind$ac2 : []).filter(_action => _action.id !== action.actionId)
24
+ }
21
25
  };
22
26
  }
23
27
  }
@@ -1 +1 @@
1
- {"version":3,"names":["combineReducers","actions","state","action","_state$action$kind$ac","type","kind","name","config","_state$action$kind$ac2","filter","_action","id","actionId"],"sources":["@wordpress/editor/src/dataviews/store/reducer.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport type { Action } from '@wordpress/dataviews';\n\ntype ReduxAction =\n\t| ReturnType< typeof import('./private-actions').registerEntityAction >\n\t| ReturnType< typeof import('./private-actions').unregisterEntityAction >;\n\nexport type ActionState = Record< string, Record< string, Action< any >[] > >;\nexport type State = {\n\tactions: ActionState;\n};\n\nfunction actions( state: ActionState = {}, action: ReduxAction ) {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_ENTITY_ACTION':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t[ action.name ]: [\n\t\t\t\t\t\t...( state[ action.kind ]?.[ action.name ] ?? [] ),\n\t\t\t\t\t\taction.config,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'UNREGISTER_ENTITY_ACTION': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: (\n\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t).filter( ( _action ) => _action.id !== action.actionId ),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tactions,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;AAajD,SAASC,OAAOA,CAAEC,KAAkB,GAAG,CAAC,CAAC,EAAEC,MAAmB,EAAG;EAAA,IAAAC,qBAAA;EAChE,QAASD,MAAM,CAACE,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAO;QACN,GAAGH,KAAK;QACR,CAAEC,MAAM,CAACG,IAAI,GAAI;UAChB,CAAEH,MAAM,CAACI,IAAI,GAAI,CAChB,KAAAH,qBAAA,GAAKF,KAAK,CAAEC,MAAM,CAACG,IAAI,CAAE,GAAIH,MAAM,CAACI,IAAI,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,EAAE,CAAE,EAClDD,MAAM,CAACK,MAAM;QAEf;MACD,CAAC;IACF,KAAK,0BAA0B;MAAE;QAAA,IAAAC,sBAAA;QAChC,OAAO;UACN,GAAGP,KAAK;UACR,CAAEC,MAAM,CAACG,IAAI,GAAI,EAAAG,sBAAA,GAChBP,KAAK,CAAEC,MAAM,CAACG,IAAI,CAAE,GAAIH,MAAM,CAACI,IAAI,CAAE,cAAAE,sBAAA,cAAAA,sBAAA,GAAI,EAAE,EAC1CC,MAAM,CAAIC,OAAO,IAAMA,OAAO,CAACC,EAAE,KAAKT,MAAM,CAACU,QAAS;QACzD,CAAC;MACF;EACD;EAEA,OAAOX,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["combineReducers","actions","state","action","_state$action$kind$ac","type","kind","name","filter","_action","id","config","_state$action$kind$ac2","actionId"],"sources":["@wordpress/editor/src/dataviews/store/reducer.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\nimport type { Action } from '@wordpress/dataviews';\n\ntype ReduxAction =\n\t| ReturnType< typeof import('./private-actions').registerEntityAction >\n\t| ReturnType< typeof import('./private-actions').unregisterEntityAction >;\n\nexport type ActionState = Record< string, Record< string, Action< any >[] > >;\nexport type State = {\n\tactions: ActionState;\n};\n\nfunction actions( state: ActionState = {}, action: ReduxAction ) {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_ENTITY_ACTION':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: [\n\t\t\t\t\t\t...(\n\t\t\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t\t\t).filter(\n\t\t\t\t\t\t\t( _action ) => _action.id !== action.config.id\n\t\t\t\t\t\t),\n\t\t\t\t\t\taction.config,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'UNREGISTER_ENTITY_ACTION': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: (\n\t\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t\t).filter( ( _action ) => _action.id !== action.actionId ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tactions,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;AAYjD,SAASC,OAAOA,CAAEC,KAAkB,GAAG,CAAC,CAAC,EAAEC,MAAmB,EAAG;EAAA,IAAAC,qBAAA;EAChE,QAASD,MAAM,CAACE,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAO;QACN,GAAGH,KAAK;QACR,CAAEC,MAAM,CAACG,IAAI,GAAI;UAChB,GAAGJ,KAAK,CAAEC,MAAM,CAACG,IAAI,CAAE;UACvB,CAAEH,MAAM,CAACI,IAAI,GAAI,CAChB,GAAG,EAAAH,qBAAA,GACFF,KAAK,CAAEC,MAAM,CAACG,IAAI,CAAE,GAAIH,MAAM,CAACI,IAAI,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,EAAE,EAC1CI,MAAM,CACLC,OAAO,IAAMA,OAAO,CAACC,EAAE,KAAKP,MAAM,CAACQ,MAAM,CAACD,EAC7C,CAAC,EACDP,MAAM,CAACQ,MAAM;QAEf;MACD,CAAC;IACF,KAAK,0BAA0B;MAAE;QAAA,IAAAC,sBAAA;QAChC,OAAO;UACN,GAAGV,KAAK;UACR,CAAEC,MAAM,CAACG,IAAI,GAAI;YAChB,GAAGJ,KAAK,CAAEC,MAAM,CAACG,IAAI,CAAE;YACvB,CAAEH,MAAM,CAACI,IAAI,GAAI,EAAAK,sBAAA,GAChBV,KAAK,CAAEC,MAAM,CAACG,IAAI,CAAE,GAAIH,MAAM,CAACI,IAAI,CAAE,cAAAK,sBAAA,cAAAA,sBAAA,GAAI,EAAE,EAC1CJ,MAAM,CAAIC,OAAO,IAAMA,OAAO,CAACC,EAAE,KAAKP,MAAM,CAACU,QAAS;UACzD;QACD,CAAC;MACF;EACD;EAEA,OAAOX,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC;AACD,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["@wordpress/editor/src/dataviews/types.ts"],"sourcesContent":["type PostStatus =\n\t| 'published'\n\t| 'draft'\n\t| 'pending'\n\t| 'private'\n\t| 'future'\n\t| 'auto-draft'\n\t| 'trash';\n\nexport interface BasePost {\n\tstatus?: PostStatus;\n\ttitle: string | { rendered: string } | { raw: string };\n\ttype: string;\n\tid: string | number;\n}\nexport interface TemplateOrTemplatePart extends BasePost {\n\ttype: 'wp_template' | 'wp_template_part';\n\tsource: string;\n\thas_theme_file: boolean;\n\tid: string;\n}\n\nexport interface Pattern extends BasePost {\n\tslug: string;\n\ttitle: { raw: string };\n\tcontent: { raw: string } | string;\n\twp_pattern_sync_status: string;\n}\n\nexport type Post = TemplateOrTemplatePart | Pattern | BasePost;\n\n// Will be unnecessary after typescript 5.0 upgrade.\nexport type CoreDataError = { message?: string; code?: string };\n"],"mappings":"","ignoreList":[]}
@@ -13,6 +13,8 @@ import { store as blocksStore } from '@wordpress/blocks';
13
13
  */
14
14
  import { store as editorStore } from '../store';
15
15
  import { unlock } from '../lock-unlock';
16
+
17
+ /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
16
18
  import { jsx as _jsx } from "react/jsx-runtime";
17
19
  import { Fragment as _Fragment } from "react/jsx-runtime";
18
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -43,7 +45,7 @@ const withPatternOverrideControls = createHigherOrderComponent(BlockEdit => prop
43
45
  ...props
44
46
  }), isSupportedBlock && /*#__PURE__*/_jsx(PatternOverridesBlockControls, {})]
45
47
  });
46
- });
48
+ }, 'withPatternOverrideControls');
47
49
 
48
50
  // Split into a separate component to avoid a store subscription
49
51
  // on every block.
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","useSelect","store","blocksStore","editorStore","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternOverridesControls","ResetOverridesControl","PatternOverridesBlockControls","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","PATTERN_SYNC_TYPES","withPatternOverrideControls","BlockEdit","props","isSupportedBlock","name","children","isSelected","ControlsWithStoreSubscription","blockEditingMode","hasPatternOverridesSource","isEditingSyncedPattern","select","getBlockBindingsSource","getCurrentPostType","getEditedPostAttribute","user","wp_pattern_sync_status","unsynced","bindings","attributes","metadata","hasPatternBindings","Object","values","some","binding","source","shouldShowPatternOverridesControls","shouldShowResetOverridesControl"],"sources":["@wordpress/editor/src/hooks/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst {\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\tPatternOverridesBlockControls,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPatternOverrideControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock =\n\t\t\t!! PARTIAL_SYNCING_SUPPORTED_BLOCKS[ props.name ];\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t\t{ isSupportedBlock && <PatternOverridesBlockControls /> }\n\t\t\t</>\n\t\t);\n\t}\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { hasPatternOverridesSource, isEditingSyncedPattern } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst { getCurrentPostType, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t\tisEditingSyncedPattern:\n\t\t\t\t\tgetCurrentPostType() === PATTERN_TYPES.user &&\n\t\t\t\t\tgetEditedPostAttribute( 'meta' )?.wp_pattern_sync_status !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced &&\n\t\t\t\t\tgetEditedPostAttribute( 'wp_pattern_sync_status' ) !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst bindings = props.attributes.metadata?.bindings;\n\tconst hasPatternBindings =\n\t\t!! bindings &&\n\t\tObject.values( bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t);\n\n\tconst shouldShowPatternOverridesControls =\n\t\tisEditingSyncedPattern && blockEditingMode === 'default';\n\tconst shouldShowResetOverridesControl =\n\t\t! isEditingSyncedPattern &&\n\t\t!! props.attributes.metadata?.name &&\n\t\tblockEditingMode !== 'disabled' &&\n\t\thasPatternBindings;\n\n\tif ( ! hasPatternOverridesSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ shouldShowPatternOverridesControls && (\n\t\t\t\t<PatternOverridesControls { ...props } />\n\t\t\t) }\n\t\t\t{ shouldShowResetOverridesControl && (\n\t\t\t\t<ResetOverridesControl { ...props } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-pattern-override-controls',\n\twithPatternOverrideControls\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;A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AAEAxB,SAAS,CACR,kBAAkB,EAClB,4CAA4C,EAC5CsB,2BACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","useSelect","store","blocksStore","editorStore","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternOverridesControls","ResetOverridesControl","PatternOverridesBlockControls","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","PATTERN_SYNC_TYPES","withPatternOverrideControls","BlockEdit","props","isSupportedBlock","name","children","isSelected","ControlsWithStoreSubscription","blockEditingMode","hasPatternOverridesSource","isEditingSyncedPattern","select","getBlockBindingsSource","getCurrentPostType","getEditedPostAttribute","user","wp_pattern_sync_status","unsynced","bindings","attributes","metadata","hasPatternBindings","Object","values","some","binding","source","shouldShowPatternOverridesControls","shouldShowResetOverridesControl"],"sources":["@wordpress/editor/src/hooks/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\nconst {\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\tPatternOverridesBlockControls,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPatternOverrideControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock =\n\t\t\t!! PARTIAL_SYNCING_SUPPORTED_BLOCKS[ props.name ];\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t\t{ isSupportedBlock && <PatternOverridesBlockControls /> }\n\t\t\t</>\n\t\t);\n\t},\n\t'withPatternOverrideControls'\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { hasPatternOverridesSource, isEditingSyncedPattern } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst { getCurrentPostType, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t\tisEditingSyncedPattern:\n\t\t\t\t\tgetCurrentPostType() === PATTERN_TYPES.user &&\n\t\t\t\t\tgetEditedPostAttribute( 'meta' )?.wp_pattern_sync_status !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced &&\n\t\t\t\t\tgetEditedPostAttribute( 'wp_pattern_sync_status' ) !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst bindings = props.attributes.metadata?.bindings;\n\tconst hasPatternBindings =\n\t\t!! bindings &&\n\t\tObject.values( bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t);\n\n\tconst shouldShowPatternOverridesControls =\n\t\tisEditingSyncedPattern && blockEditingMode === 'default';\n\tconst shouldShowResetOverridesControl =\n\t\t! isEditingSyncedPattern &&\n\t\t!! props.attributes.metadata?.name &&\n\t\tblockEditingMode !== 'disabled' &&\n\t\thasPatternBindings;\n\n\tif ( ! hasPatternOverridesSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ shouldShowPatternOverridesControls && (\n\t\t\t\t<PatternOverridesControls { ...props } />\n\t\t\t) }\n\t\t\t{ shouldShowResetOverridesControl && (\n\t\t\t\t<ResetOverridesControl { ...props } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-pattern-override-controls',\n\twithPatternOverrideControls\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;AACxE,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,UAAU;AAC/C,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEA,MAAM;EACLC,wBAAwB;EACxBC,qBAAqB;EACrBC,6BAA6B;EAC7BC,aAAa;EACbC,gCAAgC;EAChCC;AACD,CAAC,GAAGZ,MAAM,CAAEP,mBAAoB,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMoB,2BAA2B,GAAGnB,0BAA0B,CAC3DoB,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,gBAAgB,GACrB,CAAC,CAAEL,gCAAgC,CAAEI,KAA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AAK,wBACnC,CAAC;EAEF,MAAMC,kCAAkC,GACvCjB,sBAAsB,IAAIF,gBAAgB,KAAK,SAAS;EACzD,MAAMoB,+BAA+B,GACpC,CAAElB,sBAAsB,IACxB,CAAC,CAAER,KAAK,CAACiB,UAAU,CAACC,QAAQ,EAAEhB,IAAI,IAClCI,gBAAgB,KAAK,UAAU,IAC/Ba,kBAAkB;EAEnB,IAAK,CAAEZ,yBAAyB,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,oBACChB,KAAA,CAAAF,SAAA;IAAAc,QAAA,GACGsB,kCAAkC,iBACnCtC,IAAA,CAACK,wBAAwB;MAAA,GAAMQ;IAAK,CAAI,CACxC,EACC0B,+BAA+B,iBAChCvC,IAAA,CAACM,qBAAqB;MAAA,GAAMO;IAAK,CAAI,CACrC;EAAA,CACA,CAAC;AAEL;AAEAxB,SAAS,CACR,kBAAkB,EAClB,4CAA4C,EAC5CsB,2BACD,CAAC","ignoreList":[]}
@@ -20,6 +20,7 @@ import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
20
20
  import ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';
21
21
  import ResizableEditor from './components/resizable-editor';
22
22
  import { mergeBaseAndUserConfigs, GlobalStylesProvider } from './components/global-styles-provider';
23
+ import registerDefaultActions from './dataviews/actions';
23
24
  const {
24
25
  store: interfaceStore,
25
26
  ...remainingInterfaceApis
@@ -39,6 +40,7 @@ lock(privateApis, {
39
40
  ToolsMoreMenuGroup,
40
41
  ViewMoreMenuGroup,
41
42
  ResizableEditor,
43
+ registerDefaultActions,
42
44
  // This is a temporary private API while we're updating the site editor to use EditorProvider.
43
45
  useBlockEditorSettings,
44
46
  interfaceStore,
@@ -1 +1 @@
1
- {"version":3,"names":["interfaceApis","lock","EntitiesSavedStatesExtensible","EditorContentSlotFill","useBlockEditorSettings","BackButton","CreateTemplatePartModal","Editor","PluginPostExcerpt","PreferencesModal","usePostActions","ToolsMoreMenuGroup","ViewMoreMenuGroup","ResizableEditor","mergeBaseAndUserConfigs","GlobalStylesProvider","store","interfaceStore","remainingInterfaceApis","privateApis"],"sources":["@wordpress/editor/src/private-apis.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport * as interfaceApis from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport EditorContentSlotFill from './components/editor-interface/content-slot-fill';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport BackButton from './components/header/back-button';\nimport CreateTemplatePartModal from './components/create-template-part-modal';\nimport Editor from './components/editor';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PreferencesModal from './components/preferences-modal';\nimport { usePostActions } from './components/post-actions/actions';\nimport ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';\nimport ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';\nimport ResizableEditor from './components/resizable-editor';\nimport {\n\tmergeBaseAndUserConfigs,\n\tGlobalStylesProvider,\n} from './components/global-styles-provider';\n\nconst { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;\n\nexport const privateApis = {};\nlock( privateApis, {\n\tCreateTemplatePartModal,\n\tBackButton,\n\tEntitiesSavedStatesExtensible,\n\tEditor,\n\tEditorContentSlotFill,\n\tGlobalStylesProvider,\n\tmergeBaseAndUserConfigs,\n\tPluginPostExcerpt,\n\tPreferencesModal,\n\tusePostActions,\n\tToolsMoreMenuGroup,\n\tViewMoreMenuGroup,\n\tResizableEditor,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n\tinterfaceStore,\n\t...remainingInterfaceApis,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,aAAa,MAAM,sBAAsB;;AAErD;AACA;AACA;AACA,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,qBAAqB,MAAM,iDAAiD;AACnF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,UAAU,MAAM,iCAAiC;AACxD,OAAOC,uBAAuB,MAAM,yCAAyC;AAC7E,OAAOC,MAAM,MAAM,qBAAqB;AACxC,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,SAASC,cAAc,QAAQ,mCAAmC;AAClE,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,iBAAiB,MAAM,6CAA6C;AAC3E,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,SACCC,uBAAuB,EACvBC,oBAAoB,QACd,qCAAqC;AAE5C,MAAM;EAAEC,KAAK,EAAEC,cAAc;EAAE,GAAGC;AAAuB,CAAC,GAAGlB,aAAa;AAE1E,OAAO,MAAMmB,WAAW,GAAG,CAAC,CAAC;AAC7BlB,IAAI,CAAEkB,WAAW,EAAE;EAClBb,uBAAuB;EACvBD,UAAU;EACVH,6BAA6B;EAC7BK,MAAM;EACNJ,qBAAqB;EACrBY,oBAAoB;EACpBD,uBAAuB;EACvBN,iBAAiB;EACjBC,gBAAgB;EAChBC,cAAc;EACdC,kBAAkB;EAClBC,iBAAiB;EACjBC,eAAe;EAEf;EACAT,sBAAsB;EACtBa,cAAc;EACd,GAAGC;AACJ,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["interfaceApis","lock","EntitiesSavedStatesExtensible","EditorContentSlotFill","useBlockEditorSettings","BackButton","CreateTemplatePartModal","Editor","PluginPostExcerpt","PreferencesModal","usePostActions","ToolsMoreMenuGroup","ViewMoreMenuGroup","ResizableEditor","mergeBaseAndUserConfigs","GlobalStylesProvider","registerDefaultActions","store","interfaceStore","remainingInterfaceApis","privateApis"],"sources":["@wordpress/editor/src/private-apis.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport * as interfaceApis from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport EditorContentSlotFill from './components/editor-interface/content-slot-fill';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport BackButton from './components/header/back-button';\nimport CreateTemplatePartModal from './components/create-template-part-modal';\nimport Editor from './components/editor';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PreferencesModal from './components/preferences-modal';\nimport { usePostActions } from './components/post-actions/actions';\nimport ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';\nimport ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';\nimport ResizableEditor from './components/resizable-editor';\nimport {\n\tmergeBaseAndUserConfigs,\n\tGlobalStylesProvider,\n} from './components/global-styles-provider';\nimport registerDefaultActions from './dataviews/actions';\n\nconst { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;\n\nexport const privateApis = {};\nlock( privateApis, {\n\tCreateTemplatePartModal,\n\tBackButton,\n\tEntitiesSavedStatesExtensible,\n\tEditor,\n\tEditorContentSlotFill,\n\tGlobalStylesProvider,\n\tmergeBaseAndUserConfigs,\n\tPluginPostExcerpt,\n\tPreferencesModal,\n\tusePostActions,\n\tToolsMoreMenuGroup,\n\tViewMoreMenuGroup,\n\tResizableEditor,\n\tregisterDefaultActions,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n\tinterfaceStore,\n\t...remainingInterfaceApis,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,aAAa,MAAM,sBAAsB;;AAErD;AACA;AACA;AACA,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,qBAAqB,MAAM,iDAAiD;AACnF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,UAAU,MAAM,iCAAiC;AACxD,OAAOC,uBAAuB,MAAM,yCAAyC;AAC7E,OAAOC,MAAM,MAAM,qBAAqB;AACxC,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,SAASC,cAAc,QAAQ,mCAAmC;AAClE,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,iBAAiB,MAAM,6CAA6C;AAC3E,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,SACCC,uBAAuB,EACvBC,oBAAoB,QACd,qCAAqC;AAC5C,OAAOC,sBAAsB,MAAM,qBAAqB;AAExD,MAAM;EAAEC,KAAK,EAAEC,cAAc;EAAE,GAAGC;AAAuB,CAAC,GAAGnB,aAAa;AAE1E,OAAO,MAAMoB,WAAW,GAAG,CAAC,CAAC;AAC7BnB,IAAI,CAAEmB,WAAW,EAAE;EAClBd,uBAAuB;EACvBD,UAAU;EACVH,6BAA6B;EAC7BK,MAAM;EACNJ,qBAAqB;EACrBY,oBAAoB;EACpBD,uBAAuB;EACvBN,iBAAiB;EACjBC,gBAAgB;EAChBC,cAAc;EACdC,kBAAkB;EAClBC,iBAAiB;EACjBC,eAAe;EACfG,sBAAsB;EAEtB;EACAZ,sBAAsB;EACtBc,cAAc;EACd,GAAGC;AACJ,CAAE,CAAC","ignoreList":[]}
@@ -12,7 +12,6 @@ import { EntitiesSavedStatesExtensible } from './components/entities-saved-state
12
12
  import useBlockEditorSettings from './components/provider/use-block-editor-settings';
13
13
  import PluginPostExcerpt from './components/post-excerpt/plugin';
14
14
  import PreferencesModal from './components/preferences-modal';
15
- import { usePostActions } from './components/post-actions/actions';
16
15
  import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
17
16
  import ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';
18
17
  const {
@@ -25,7 +24,6 @@ lock(privateApis, {
25
24
  EntitiesSavedStatesExtensible,
26
25
  PluginPostExcerpt,
27
26
  PreferencesModal,
28
- usePostActions,
29
27
  ToolsMoreMenuGroup,
30
28
  ViewMoreMenuGroup,
31
29
  // This is a temporary private API while we're updating the site editor to use EditorProvider.
@@ -1 +1 @@
1
- {"version":3,"names":["interfaceApis","VisualEditor","lock","EntitiesSavedStatesExtensible","useBlockEditorSettings","PluginPostExcerpt","PreferencesModal","usePostActions","ToolsMoreMenuGroup","ViewMoreMenuGroup","store","interfaceStore","remainingInterfaceApis","privateApis"],"sources":["@wordpress/editor/src/private-apis.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport * as interfaceApis from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport VisualEditor from './components/visual-editor';\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PreferencesModal from './components/preferences-modal';\nimport { usePostActions } from './components/post-actions/actions';\nimport ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';\nimport ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';\n\nconst { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;\n\nexport const privateApis = {};\nlock( privateApis, {\n\tVisualEditor,\n\tEntitiesSavedStatesExtensible,\n\tPluginPostExcerpt,\n\tPreferencesModal,\n\tusePostActions,\n\tToolsMoreMenuGroup,\n\tViewMoreMenuGroup,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n\tinterfaceStore,\n\t...remainingInterfaceApis,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,aAAa,MAAM,sBAAsB;;AAErD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,4BAA4B;AACrD,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,SAASC,cAAc,QAAQ,mCAAmC;AAClE,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,iBAAiB,MAAM,6CAA6C;AAE3E,MAAM;EAAEC,KAAK,EAAEC,cAAc;EAAE,GAAGC;AAAuB,CAAC,GAAGZ,aAAa;AAE1E,OAAO,MAAMa,WAAW,GAAG,CAAC,CAAC;AAC7BX,IAAI,CAAEW,WAAW,EAAE;EAClBZ,YAAY;EACZE,6BAA6B;EAC7BE,iBAAiB;EACjBC,gBAAgB;EAChBC,cAAc;EACdC,kBAAkB;EAClBC,iBAAiB;EAEjB;EACAL,sBAAsB;EACtBO,cAAc;EACd,GAAGC;AACJ,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["interfaceApis","VisualEditor","lock","EntitiesSavedStatesExtensible","useBlockEditorSettings","PluginPostExcerpt","PreferencesModal","ToolsMoreMenuGroup","ViewMoreMenuGroup","store","interfaceStore","remainingInterfaceApis","privateApis"],"sources":["@wordpress/editor/src/private-apis.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport * as interfaceApis from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport VisualEditor from './components/visual-editor';\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PreferencesModal from './components/preferences-modal';\nimport ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';\nimport ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';\n\nconst { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;\n\nexport const privateApis = {};\nlock( privateApis, {\n\tVisualEditor,\n\tEntitiesSavedStatesExtensible,\n\tPluginPostExcerpt,\n\tPreferencesModal,\n\tToolsMoreMenuGroup,\n\tViewMoreMenuGroup,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n\tinterfaceStore,\n\t...remainingInterfaceApis,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,aAAa,MAAM,sBAAsB;;AAErD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,4BAA4B;AACrD,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,iBAAiB,MAAM,6CAA6C;AAE3E,MAAM;EAAEC,KAAK,EAAEC,cAAc;EAAE,GAAGC;AAAuB,CAAC,GAAGX,aAAa;AAE1E,OAAO,MAAMY,WAAW,GAAG,CAAC,CAAC;AAC7BV,IAAI,CAAEU,WAAW,EAAE;EAClBX,YAAY;EACZE,6BAA6B;EAC7BE,iBAAiB;EACjBC,gBAAgB;EAChBC,kBAAkB;EAClBC,iBAAiB;EAEjB;EACAJ,sBAAsB;EACtBM,cAAc;EACd,GAAGC;AACJ,CAAE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["EDIT_MERGE_PROPERTIES","Set","STORE_NAME","SAVE_POST_NOTICE_ID","TRASH_POST_NOTICE_ID","PERMALINK_POSTNAME_REGEX","ONE_MINUTE_IN_MS","AUTOSAVE_PROPERTIES","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES"],"sources":["@wordpress/editor/src/store/constants.js"],"sourcesContent":["/**\n * Set of post properties for which edits should assume a merging behavior,\n * assuming an object value.\n *\n * @type {Set}\n */\nexport const EDIT_MERGE_PROPERTIES = new Set( [ 'meta' ] );\n\n/**\n * Constant for the store module (or reducer) key.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/editor';\n\nexport const SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID';\nexport const TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID';\nexport const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\nexport const ONE_MINUTE_IN_MS = 60 * 1000;\nexport const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const PATTERN_POST_TYPE = 'wp_block';\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\nexport const GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAE,CAAE,MAAM,CAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,aAAa;AAEvC,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,oBAAoB,GAAG,sBAAsB;AAC1D,OAAO,MAAMC,wBAAwB,GAAG,yBAAyB;AACjE,OAAO,MAAMC,gBAAgB,GAAG,EAAE,GAAG,IAAI;AACzC,OAAO,MAAMC,mBAAmB,GAAG,CAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAE;AACpE,OAAO,MAAMC,mCAAmC,GAAG,eAAe;AAClE,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,iBAAiB,GAAG,UAAU;AAC3C,OAAO,MAAMC,oBAAoB,GAAG,eAAe;AACnD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACD,OAAO,MAAMC,mBAAmB,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE;AACxE,OAAO,MAAMC,iBAAiB,GAAG,CAChC,GAAGD,mBAAmB,EACtB,UAAU,EACV,eAAe,CACf","ignoreList":[]}
1
+ {"version":3,"names":["EDIT_MERGE_PROPERTIES","Set","STORE_NAME","SAVE_POST_NOTICE_ID","TRASH_POST_NOTICE_ID","PERMALINK_POSTNAME_REGEX","ONE_MINUTE_IN_MS","AUTOSAVE_PROPERTIES","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES"],"sources":["@wordpress/editor/src/store/constants.ts"],"sourcesContent":["/**\n * Set of post properties for which edits should assume a merging behavior,\n * assuming an object value.\n *\n * @type {Set}\n */\nexport const EDIT_MERGE_PROPERTIES = new Set( [ 'meta' ] );\n\n/**\n * Constant for the store module (or reducer) key.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/editor';\n\nexport const SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID';\nexport const TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID';\nexport const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\nexport const ONE_MINUTE_IN_MS = 60 * 1000;\nexport const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const PATTERN_POST_TYPE = 'wp_block';\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\nexport const GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAE,CAAE,MAAM,CAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,aAAa;AAEvC,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,oBAAoB,GAAG,sBAAsB;AAC1D,OAAO,MAAMC,wBAAwB,GAAG,yBAAyB;AACjE,OAAO,MAAMC,gBAAgB,GAAG,EAAE,GAAG,IAAI;AACzC,OAAO,MAAMC,mBAAmB,GAAG,CAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAE;AACpE,OAAO,MAAMC,mCAAmC,GAAG,eAAe;AAClE,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,iBAAiB,GAAG,UAAU;AAC3C,OAAO,MAAMC,oBAAoB,GAAG,eAAe;AACnD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACD,OAAO,MAAMC,mBAAmB,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE;AACxE,OAAO,MAAMC,iBAAiB,GAAG,CAChC,GAAGD,mBAAmB,EACtB,UAAU,EACV,eAAe,CACf","ignoreList":[]}
@@ -254,7 +254,7 @@ export const revertTemplate = (template, {
254
254
  export const removeTemplates = items => async ({
255
255
  registry
256
256
  }) => {
257
- const isResetting = items.every(item => !!item && (item.has_theme_file || item.templatePart && item.templatePart.has_theme_file));
257
+ const isResetting = items.every(item => item?.has_theme_file);
258
258
  const promiseResult = await Promise.allSettled(items.map(item => {
259
259
  return registry.dispatch(coreStore).deleteEntityRecord('postType', item.type, item.id, {
260
260
  force: true
@@ -1 +1 @@
1
- {"version":3,"names":["store","coreStore","__","sprintf","noticesStore","blockEditorStore","preferencesStore","addQueryArgs","apiFetch","parse","__unstableSerializeAndClean","decodeEntities","isTemplateRevertable","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set","saveDirtyEntities","onSave","dirtyEntityRecords","entitiesToSkip","close","PUBLISH_ON_SAVE_ENTITIES","kind","name","saveNoticeId","homeUrl","getUnstableBase","home","removeNotice","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","push","typeToPublish","status","saveEditedEntityRecord","length","__experimentalSaveSpecifiedEntityEdits","undefined","__unstableMarkLastChangeAsPersistent","Promise","all","then","values","value","createErrorNotice","url","catch","error","revertTemplate","allowUndo","noticeId","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","context","source","fileTemplate","path","serializeBlocks","blocks","blocksForSerialization","edited","getEditedEntityRecord","content","undoIgnore","raw","undoRevert","errorMessage","message","code","removeTemplates","items","isResetting","every","item","has_theme_file","templatePart","promiseResult","allSettled","map","deleteEntityRecord","force","throwOnError","successMessage","title","rendered","reason","errorMessages","failedPromises","failedPromise","add","size","join"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from './utils/is-template-revertable';\nexport * from '../dataviews/store/private-actions';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\treturn savedTemplate;\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n\n/**\n * Save entity records marked as dirty.\n *\n * @param {Object} options Options for the action.\n * @param {Function} [options.onSave] Callback when saving happens.\n * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.\n * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving.\n * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`.\n */\nexport const saveDirtyEntities =\n\t( { onSave, dirtyEntityRecords = [], entitiesToSkip = [], close } = {} ) =>\n\t( { registry } ) => {\n\t\tconst PUBLISH_ON_SAVE_ENTITIES = [\n\t\t\t{ kind: 'postType', name: 'wp_navigation' },\n\t\t];\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tconst homeUrl = registry.select( coreStore ).getUnstableBase()?.home;\n\t\tregistry.dispatch( noticesStore ).removeNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! entitiesToSkip.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tclose?.( entitiesToSave );\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord( kind, name, key, {\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.saveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__experimentalSaveSpecifiedEntityEdits(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'site',\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tsiteItemsToSave\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave ? onSave( values ) : values;\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t`${ __( 'Saving failed.' ) } ${ error }`\n\t\t\t\t\t)\n\t\t\t);\n\t};\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reset.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that removes an array of templates, template parts or patterns.\n *\n * @param {Array} items An array of template,template part or pattern objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isResetting = items.every(\n\t\t\t( item ) =>\n\t\t\t\t!! item &&\n\t\t\t\t( item.has_theme_file ||\n\t\t\t\t\t( item.templatePart && item.templatePart.has_theme_file ) )\n\t\t);\n\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with sucess.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tconst title =\n\t\t\t\t\ttypeof items[ 0 ].title === 'string'\n\t\t\t\t\t\t? items[ 0 ].title\n\t\t\t\t\t\t: items[ 0 ].title?.rendered;\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t\t\t__( '\"%s\" reset.' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? __( 'Items reset.' )\n\t\t\t\t\t: __( 'Items deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? __( 'An error occurred while reverting the item.' )\n\t\t\t\t\t\t: __( 'An error occurred while deleting the item.' );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t'An error occurred while deleting the items.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASH,KAAK,IAAII,YAAY,QAAQ,oBAAoB;AAC1D,S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AAO,EACP;QACAD,EAAE,CACD,oDACD,CAAC,EACD,CAAE,GAAG6H,aAAa,CAAE,CAACK,IAAI,CAAE,GAAI,CAC/B,CAAC,GACDjI,OAAO,EACP;QACAD,EAAE,CACD,mDACD,CAAC,EACD,CAAE,GAAG6H,aAAa,CAAE,CAACK,IAAI,CAAE,GAAI,CAC/B,CAAC;MACL;IACD;IACAhH,QAAQ,CACND,QAAQ,CAAEf,YAAa,CAAC,CACxB+E,iBAAiB,CAAEwB,YAAY,EAAE;MAAE5F,IAAI,EAAE;IAAW,CAAE,CAAC;EAC1D;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["store","coreStore","__","sprintf","noticesStore","blockEditorStore","preferencesStore","addQueryArgs","apiFetch","parse","__unstableSerializeAndClean","decodeEntities","isTemplateRevertable","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set","saveDirtyEntities","onSave","dirtyEntityRecords","entitiesToSkip","close","PUBLISH_ON_SAVE_ENTITIES","kind","name","saveNoticeId","homeUrl","getUnstableBase","home","removeNotice","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","push","typeToPublish","status","saveEditedEntityRecord","length","__experimentalSaveSpecifiedEntityEdits","undefined","__unstableMarkLastChangeAsPersistent","Promise","all","then","values","value","createErrorNotice","url","catch","error","revertTemplate","allowUndo","noticeId","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","context","source","fileTemplate","path","serializeBlocks","blocks","blocksForSerialization","edited","getEditedEntityRecord","content","undoIgnore","raw","undoRevert","errorMessage","message","code","removeTemplates","items","isResetting","every","item","has_theme_file","promiseResult","allSettled","map","deleteEntityRecord","force","throwOnError","successMessage","title","rendered","reason","errorMessages","failedPromises","failedPromise","add","size","join"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from './utils/is-template-revertable';\nexport * from '../dataviews/store/private-actions';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\treturn savedTemplate;\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n\n/**\n * Save entity records marked as dirty.\n *\n * @param {Object} options Options for the action.\n * @param {Function} [options.onSave] Callback when saving happens.\n * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.\n * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving.\n * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`.\n */\nexport const saveDirtyEntities =\n\t( { onSave, dirtyEntityRecords = [], entitiesToSkip = [], close } = {} ) =>\n\t( { registry } ) => {\n\t\tconst PUBLISH_ON_SAVE_ENTITIES = [\n\t\t\t{ kind: 'postType', name: 'wp_navigation' },\n\t\t];\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tconst homeUrl = registry.select( coreStore ).getUnstableBase()?.home;\n\t\tregistry.dispatch( noticesStore ).removeNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! entitiesToSkip.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tclose?.( entitiesToSave );\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord( kind, name, key, {\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.saveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__experimentalSaveSpecifiedEntityEdits(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'site',\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tsiteItemsToSave\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave ? onSave( values ) : values;\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t`${ __( 'Saving failed.' ) } ${ error }`\n\t\t\t\t\t)\n\t\t\t);\n\t};\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reset.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that removes an array of templates, template parts or patterns.\n *\n * @param {Array} items An array of template,template part or pattern objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isResetting = items.every( ( item ) => item?.has_theme_file );\n\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with sucess.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tconst title =\n\t\t\t\t\ttypeof items[ 0 ].title === 'string'\n\t\t\t\t\t\t? items[ 0 ].title\n\t\t\t\t\t\t: items[ 0 ].title?.rendered;\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t\t\t__( '\"%s\" reset.' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? __( 'Items reset.' )\n\t\t\t\t\t: __( 'Items deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? __( 'An error occurred while reverting the item.' )\n\t\t\t\t\t\t: __( 'An error occurred while deleting the item.' );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t'An error occurred while deleting the items.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE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AAO,EACP;QACAD,EAAE,CACD,oDACD,CAAC,EACD,CAAE,GAAG4H,aAAa,CAAE,CAACK,IAAI,CAAE,GAAI,CAC/B,CAAC,GACDhI,OAAO,EACP;QACAD,EAAE,CACD,mDACD,CAAC,EACD,CAAE,GAAG4H,aAAa,CAAE,CAACK,IAAI,CAAE,GAAI,CAC/B,CAAC;MACL;IACD;IACA/G,QAAQ,CACND,QAAQ,CAAEf,YAAa,CAAC,CACxB+E,iBAAiB,CAAEwB,YAAY,EAAE;MAAE5F,IAAI,EAAE;IAAW,CAAE,CAAC;EAC1D;AACD,CAAC","ignoreList":[]}
@@ -15,8 +15,6 @@ import { store as coreStore } from '@wordpress/core-data';
15
15
  * Internal dependencies
16
16
  */
17
17
  import { getRenderingMode, getCurrentPost, __experimentalGetDefaultTemplatePartAreas } from './selectors';
18
- import { TEMPLATE_PART_POST_TYPE } from './constants';
19
- import { getFilteredTemplatePartBlocks } from './utils/get-filtered-template-parts';
20
18
  import { getEntityActions as _getEntityActions } from '../dataviews/store/private-selectors';
21
19
  const EMPTY_INSERTION_POINT = {
22
20
  rootClientId: undefined,
@@ -81,21 +79,6 @@ export const getPostIcon = createRegistrySelector(select => (state, postType, op
81
79
  }
82
80
  });
83
81
 
84
- /**
85
- * Returns the template parts and their blocks for the current edited template.
86
- *
87
- * @param {Object} state Global application state.
88
- * @return {Array} Template parts and their blocks in an array.
89
- */
90
- export const getCurrentTemplateTemplateParts = createRegistrySelector(select => () => {
91
- const templateParts = select(coreStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
92
- per_page: -1
93
- });
94
- const clientIds = select(blockEditorStore).getBlocksByName('core/template-part');
95
- const blocks = select(blockEditorStore).getBlocksByClientId(clientIds);
96
- return getFilteredTemplatePartBlocks(blocks, templateParts);
97
- });
98
-
99
82
  /**
100
83
  * Returns true if there are unsaved changes to the
101
84
  * post's meta fields, and false otherwise.
@@ -1 +1 @@
1
- {"version":3,"names":["fastDeepEqual","store","blockEditorStore","createSelector","createRegistrySelector","layout","symbol","navigation","page","pageIcon","verse","coreStore","getRenderingMode","getCurrentPost","__experimentalGetDefaultTemplatePartAreas","TEMPLATE_PART_POST_TYPE","getFilteredTemplatePartBlocks","getEntityActions","_getEntityActions","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","getBlocksByName","getListViewToggleRef","listViewToggleRef","getInserterSidebarToggleRef","inserterSidebarToggleRef","CARD_ICONS","wp_block","wp_navigation","post","getPostIcon","postType","options","find","item","area","icon","postTypeEntity","getPostType","startsWith","slice","getCurrentTemplateTemplateParts","templateParts","getEntityRecords","per_page","clientIds","blocks","getBlocksByClientId","hasPostMetaChanges","postId","type","currentPostType","id","currentPostId","edits","getEntityRecordNonTransientEdits","meta","originalPostMeta","getEntityRecord","footnotes","args","dataviews"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tpage as pageIcon,\n\tverse,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetRenderingMode,\n\tgetCurrentPost,\n\t__experimentalGetDefaultTemplatePartAreas,\n} from './selectors';\nimport { TEMPLATE_PART_POST_TYPE } from './constants';\nimport { getFilteredTemplatePartBlocks } from './utils/get-filtered-template-parts';\nimport { getEntityActions as _getEntityActions } from '../dataviews/store/private-selectors';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInsertionPoint = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\t\treturn state.blockInserterPanel;\n\t\t\t}\n\n\t\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\t\tconst [ postContentClientId ] =\n\t\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t\t'core/post-content'\n\t\t\t\t\t);\n\t\t\t\tif ( postContentClientId ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t},\n\t\t( state ) => {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\treturn [\n\t\t\t\tstate.blockInserterPanel,\n\t\t\t\tgetRenderingMode( state ),\n\t\t\t\tpostContentClientId,\n\t\t\t];\n\t\t}\n\t)\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n\tpage: pageIcon,\n\tpost: verse,\n};\n\nexport const getPostIcon = createRegistrySelector(\n\t( select ) => ( state, postType, options ) => {\n\t\t{\n\t\t\tif (\n\t\t\t\tpostType === 'wp_template_part' ||\n\t\t\t\tpostType === 'wp_template'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\t__experimentalGetDefaultTemplatePartAreas( state ).find(\n\t\t\t\t\t\t( item ) => options.area === item.area\n\t\t\t\t\t)?.icon || layout\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( CARD_ICONS[ postType ] ) {\n\t\t\t\treturn CARD_ICONS[ postType ];\n\t\t\t}\n\t\t\tconst postTypeEntity = select( coreStore ).getPostType( postType );\n\t\t\t// `icon` is the `menu_icon` property of a post type. We\n\t\t\t// only handle `dashicons` for now, even if the `menu_icon`\n\t\t\t// also supports urls and svg as values.\n\t\t\tif ( postTypeEntity?.icon?.startsWith( 'dashicons-' ) ) {\n\t\t\t\treturn postTypeEntity.icon.slice( 10 );\n\t\t\t}\n\t\t\treturn pageIcon;\n\t\t}\n\t}\n);\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).getBlocksByName( 'core/template-part' );\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns true if there are unsaved changes to the\n * post's meta fields, and false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} postType The post type of the post.\n * @param {number} postId The ID of the post.\n *\n * @return {boolean} Whether there are edits or not in the meta fields of the relevant post.\n */\nexport const hasPostMetaChanges = createRegistrySelector(\n\t( select ) => ( state, postType, postId ) => {\n\t\tconst { type: currentPostType, id: currentPostId } =\n\t\t\tgetCurrentPost( state );\n\t\t// If no postType or postId is passed, use the current post.\n\t\tconst edits = select( coreStore ).getEntityRecordNonTransientEdits(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t);\n\n\t\tif ( ! edits?.meta ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Compare if anything apart from `footnotes` has changed.\n\t\tconst originalPostMeta = select( coreStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t)?.meta;\n\n\t\treturn ! fastDeepEqual(\n\t\t\t{ ...originalPostMeta, footnotes: undefined },\n\t\t\t{ ...edits.meta, footnotes: undefined }\n\t\t);\n\t}\n);\n\nexport function getEntityActions( state, ...args ) {\n\treturn _getEntityActions( state.dataviews, ...args );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;AACxE,SACCC,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,IAAI,IAAIC,QAAQ,EAChBC,KAAK,QACC,kBAAkB;AACzB,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,cAAc,EACdC,yCAAyC,QACnC,aAAa;AACpB,SAASC,uBAAuB,QAAQ,aAAa;AACrD,SAASC,6BAA6B,QAAQ,qCAAqC;AACnF,SAASC,gBAAgB,IAAIC,iBAAiB,QAAQ,sCAAsC;AAE5F,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,iBAAiB,GAAGpB,sBAAsB,CAAIqB,MAAM,IAChEtB,cAAc,CACXuB,KAAK,IAAM;EACZ,IAAK,OAAOA,KAAK,CAACC,kBAAkB,KAAK,QAAQ,EAAG;IACnD,OAAOD,KAAK,CAACC,kBAAkB;EAChC;EAEA,IAAKf,gBAAgB,CAAEc,KAAM,CAAC,KAAK,iBAAiB,EAAG;IACtD,MAAM,CAAEE,mBAAmB,CAAE,GAC5BH,MAAM,CAAEvB,gB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;;EAEA;EACA,MAAMC,gBAAgB,GAAGxC,MAAM,CAAEd,SAAU,CAAC,CAACuD,eAAe,CAC3D,UAAU,EACV3B,QAAQ,IAAIoB,eAAe,EAC3BF,MAAM,IAAII,aACX,CAAC,EAAEG,IAAI;EAEP,OAAO,CAAEhE,aAAa,CACrB;IAAE,GAAGiE,gBAAgB;IAAEE,SAAS,EAAE9C;EAAU,CAAC,EAC7C;IAAE,GAAGyC,KAAK,CAACE,IAAI;IAAEG,SAAS,EAAE9C;EAAU,CACvC,CAAC;AACF,CACD,CAAC;AAED,OAAO,SAASJ,gBAAgBA,CAAES,KAAK,EAAE,GAAG0C,IAAI,EAAG;EAClD,OAAOlD,iBAAiB,CAAEQ,KAAK,CAAC2C,SAAS,EAAE,GAAGD,IAAK,CAAC;AACrD","ignoreList":[]}
1
+ {"version":3,"names":["fastDeepEqual","store","blockEditorStore","createSelector","createRegistrySelector","layout","symbol","navigation","page","pageIcon","verse","coreStore","getRenderingMode","getCurrentPost","__experimentalGetDefaultTemplatePartAreas","getEntityActions","_getEntityActions","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","getBlocksByName","getListViewToggleRef","listViewToggleRef","getInserterSidebarToggleRef","inserterSidebarToggleRef","CARD_ICONS","wp_block","wp_navigation","post","getPostIcon","postType","options","find","item","area","icon","postTypeEntity","getPostType","startsWith","slice","hasPostMetaChanges","postId","type","currentPostType","id","currentPostId","edits","getEntityRecordNonTransientEdits","meta","originalPostMeta","getEntityRecord","footnotes","args","dataviews"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tpage as pageIcon,\n\tverse,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetRenderingMode,\n\tgetCurrentPost,\n\t__experimentalGetDefaultTemplatePartAreas,\n} from './selectors';\nimport { getEntityActions as _getEntityActions } from '../dataviews/store/private-selectors';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInsertionPoint = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\t\treturn state.blockInserterPanel;\n\t\t\t}\n\n\t\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\t\tconst [ postContentClientId ] =\n\t\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t\t'core/post-content'\n\t\t\t\t\t);\n\t\t\t\tif ( postContentClientId ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t},\n\t\t( state ) => {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\treturn [\n\t\t\t\tstate.blockInserterPanel,\n\t\t\t\tgetRenderingMode( state ),\n\t\t\t\tpostContentClientId,\n\t\t\t];\n\t\t}\n\t)\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n\tpage: pageIcon,\n\tpost: verse,\n};\n\nexport const getPostIcon = createRegistrySelector(\n\t( select ) => ( state, postType, options ) => {\n\t\t{\n\t\t\tif (\n\t\t\t\tpostType === 'wp_template_part' ||\n\t\t\t\tpostType === 'wp_template'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\t__experimentalGetDefaultTemplatePartAreas( state ).find(\n\t\t\t\t\t\t( item ) => options.area === item.area\n\t\t\t\t\t)?.icon || layout\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( CARD_ICONS[ postType ] ) {\n\t\t\t\treturn CARD_ICONS[ postType ];\n\t\t\t}\n\t\t\tconst postTypeEntity = select( coreStore ).getPostType( postType );\n\t\t\t// `icon` is the `menu_icon` property of a post type. We\n\t\t\t// only handle `dashicons` for now, even if the `menu_icon`\n\t\t\t// also supports urls and svg as values.\n\t\t\tif ( postTypeEntity?.icon?.startsWith( 'dashicons-' ) ) {\n\t\t\t\treturn postTypeEntity.icon.slice( 10 );\n\t\t\t}\n\t\t\treturn pageIcon;\n\t\t}\n\t}\n);\n\n/**\n * Returns true if there are unsaved changes to the\n * post's meta fields, and false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} postType The post type of the post.\n * @param {number} postId The ID of the post.\n *\n * @return {boolean} Whether there are edits or not in the meta fields of the relevant post.\n */\nexport const hasPostMetaChanges = createRegistrySelector(\n\t( select ) => ( state, postType, postId ) => {\n\t\tconst { type: currentPostType, id: currentPostId } =\n\t\t\tgetCurrentPost( state );\n\t\t// If no postType or postId is passed, use the current post.\n\t\tconst edits = select( coreStore ).getEntityRecordNonTransientEdits(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t);\n\n\t\tif ( ! edits?.meta ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Compare if anything apart from `footnotes` has changed.\n\t\tconst originalPostMeta = select( coreStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t)?.meta;\n\n\t\treturn ! fastDeepEqual(\n\t\t\t{ ...originalPostMeta, footnotes: undefined },\n\t\t\t{ ...edits.meta, footnotes: undefined }\n\t\t);\n\t}\n);\n\nexport function getEntityActions( state, ...args ) {\n\treturn _getEntityActions( state.dataviews, ...args );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;AACxE,SACCC,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,IAAI,IAAIC,QAAQ,EAChBC,KAAK,QACC,kBAAkB;AACzB,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,cAAc,EACdC,yCAAyC,QACnC,aAAa;AACpB,SAASC,gBAAgB,IAAIC,iBAAiB,QAAQ,sCAAsC;AAE5F,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,iBAAiB,GAAGlB,sBAAsB,CAAImB,MAAM,IAChEpB,cAAc,CACXqB,KAAK,IAAM;EACZ,IAAK,OAAOA,KAAK,CAACC,kBAAkB,KAAK,QAAQ,EAAG;IACnD,OAAOD,KAAK,CAACC,kBAAkB;EAChC;EAEA,IAAKb,gBAAgB,CAAEY,KAAM,CAAC,KAAK,iBAAiB,EAAG;IACtD,MAAM,CAAEE,mBAAmB,CAAE,GAC5BH,MAAM,CAAErB,gBAAiB,CAAC,CAACyB,eAAe,CACzC,mBACD,CAAC;IACF,IAAKD,mBAAmB,EAAG;MAC1B,OAAO;QACNR,YAAY,EAAEQ,mBAAmB;QACjCN,cAAc,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C,EAAG;MACvD,OAAOF,cAAc,CAACD,IAAI,CAACI,KAAK,CAAE,EAAG,CAAC;IACvC;IACA,OAAOrC,QAAQ;EAChB;AACD,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMsC,kBAAkB,GAAG3C,sBAAsB,CACrDmB,MAAM,IAAM,CAAEC,KAAK,EAAEa,QAAQ,EAAEW,MAAM,KAAM;EAC5C,MAAM;IAAEC,IAAI,EAAEC,eAAe;IAAEC,EAAE,EAAEC;EAAc,CAAC,GACjDvC,cAAc,CAAEW,KAAM,CAAC;EACxB;EACA,MAAM6B,KAAK,GAAG9B,MAAM,CAAEZ,SAAU,CAAC,CAAC2C,gCAAgC,CACjE,UAAU,EACVjB,QAAQ,IAAIa,eAAe,EAC3BF,MAAM,IAAII,aACX,CAAC;EAED,IAAK,CAAEC,KAAK,EAAEE,IAAI,EAAG;IACpB,OAAO,KAAK;EACb;;EAEA;EACA,MAAMC,gBAAgB,GAAGjC,MAAM,CAAEZ,SAAU,CAAC,CAAC8C,eAAe,CAC3D,UAAU,EACVpB,QAAQ,IAAIa,eAAe,EAC3BF,MAAM,IAAII,aACX,CAAC,EAAEG,IAAI;EAEP,OAAO,CAAEvD,aAAa,CACrB;IAAE,GAAGwD,gBAAgB;IAAEE,SAAS,EAAEvC;EAAU,CAAC,EAC7C;IAAE,GAAGkC,KAAK,CAACE,IAAI;IAAEG,SAAS,EAAEvC;EAAU,CACvC,CAAC;AACF,CACD,CAAC;AAED,OAAO,SAASJ,gBAAgBA,CAAES,KAAK,EAAE,GAAGmC,IAAI,EAAG;EAClD,OAAO3C,iBAAiB,CAAEQ,KAAK,CAACoC,SAAS,EAAE,GAAGD,IAAK,CAAC;AACrD","ignoreList":[]}
@@ -6,17 +6,15 @@ import { TEMPLATE_ORIGINS } from '../constants';
6
6
  // Copy of the function from packages/edit-site/src/utils/is-template-revertable.js
7
7
 
8
8
  /**
9
- * Check if a template is revertable to its original theme-provided template file.
9
+ * Check if a template or template part is revertable to its original theme-provided file.
10
10
  *
11
- * @param {Object} template The template entity to check.
12
- * @return {boolean} Whether the template is revertable.
11
+ * @param {Object} templateOrTemplatePart The entity to check.
12
+ * @return {boolean} Whether the entity is revertable.
13
13
  */
14
- export default function isTemplateRevertable(template) {
15
- if (!template) {
14
+ export default function isTemplateRevertable(templateOrTemplatePart) {
15
+ if (!templateOrTemplatePart) {
16
16
  return false;
17
17
  }
18
- /* eslint-disable camelcase */
19
- return template?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file;
20
- /* eslint-enable camelcase */
18
+ return templateOrTemplatePart.source === TEMPLATE_ORIGINS.custom && templateOrTemplatePart.has_theme_file;
21
19
  }
22
20
  //# sourceMappingURL=is-template-revertable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TEMPLATE_ORIGINS","isTemplateRevertable","template","source","custom","has_theme_file"],"sources":["@wordpress/editor/src/store/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from '../constants';\n\n// Copy of the function from packages/edit-site/src/utils/is-template-revertable.js\n\n/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn (\n\t\ttemplate?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file\n\t);\n\t/* eslint-enable camelcase */\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,cAAc;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OACCA,QAAQ,EAAEC,MAAM,KAAKH,gBAAgB,CAACI,MAAM,IAAIF,QAAQ,EAAEG,cAAc;EAEzE;AACD","ignoreList":[]}
1
+ {"version":3,"names":["TEMPLATE_ORIGINS","isTemplateRevertable","templateOrTemplatePart","source","custom","has_theme_file"],"sources":["@wordpress/editor/src/store/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from '../constants';\n\n// Copy of the function from packages/edit-site/src/utils/is-template-revertable.js\n\n/**\n * Check if a template or template part is revertable to its original theme-provided file.\n *\n * @param {Object} templateOrTemplatePart The entity to check.\n * @return {boolean} Whether the entity is revertable.\n */\nexport default function isTemplateRevertable( templateOrTemplatePart ) {\n\tif ( ! templateOrTemplatePart ) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\ttemplateOrTemplatePart.source === TEMPLATE_ORIGINS.custom &&\n\t\ttemplateOrTemplatePart.has_theme_file\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,cAAc;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAEC,sBAAsB,EAAG;EACtE,IAAK,CAAEA,sBAAsB,EAAG;IAC/B,OAAO,KAAK;EACb;EAEA,OACCA,sBAAsB,CAACC,MAAM,KAAKH,gBAAgB,CAACI,MAAM,IACzDF,sBAAsB,CAACG,cAAc;AAEvC","ignoreList":[]}