@wordpress/editor 14.5.0 → 14.7.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 (415) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +37 -0
  3. package/build/bindings/post-meta.js +12 -10
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +4 -1
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +5 -8
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  9. package/build/components/create-template-part-modal/index.js +1 -0
  10. package/build/components/create-template-part-modal/index.js.map +1 -1
  11. package/build/components/document-bar/index.js +4 -4
  12. package/build/components/document-bar/index.js.map +1 -1
  13. package/build/components/editor-history/redo.js +4 -1
  14. package/build/components/editor-history/redo.js.map +1 -1
  15. package/build/components/editor-history/undo.js +4 -1
  16. package/build/components/editor-history/undo.js.map +1 -1
  17. package/build/components/editor-interface/index.js +2 -3
  18. package/build/components/editor-interface/index.js.map +1 -1
  19. package/build/components/error-boundary/index.js +4 -1
  20. package/build/components/error-boundary/index.js.map +1 -1
  21. package/build/components/global-styles-provider/index.js +17 -4
  22. package/build/components/global-styles-provider/index.js.map +1 -1
  23. package/build/components/index.js +8 -0
  24. package/build/components/index.js.map +1 -1
  25. package/build/components/inserter-sidebar/index.js +8 -7
  26. package/build/components/inserter-sidebar/index.js.map +1 -1
  27. package/build/components/local-autosave-monitor/index.js +5 -5
  28. package/build/components/local-autosave-monitor/index.js.map +1 -1
  29. package/build/components/page-attributes/parent.js +10 -6
  30. package/build/components/page-attributes/parent.js.map +1 -1
  31. package/build/components/plugin-preview-menu-item/index.js +57 -0
  32. package/build/components/plugin-preview-menu-item/index.js.map +1 -0
  33. package/build/components/post-actions/actions.js +4 -499
  34. package/build/components/post-actions/actions.js.map +1 -1
  35. package/build/components/post-actions/index.js +13 -25
  36. package/build/components/post-actions/index.js.map +1 -1
  37. package/build/components/post-card-panel/index.js +20 -20
  38. package/build/components/post-card-panel/index.js.map +1 -1
  39. package/build/components/post-excerpt/panel.js +4 -1
  40. package/build/components/post-excerpt/panel.js.map +1 -1
  41. package/build/components/post-featured-image/index.js +14 -3
  42. package/build/components/post-featured-image/index.js.map +1 -1
  43. package/build/components/post-format/index.js +4 -1
  44. package/build/components/post-format/index.js.map +1 -1
  45. package/build/components/post-last-revision/index.js +4 -1
  46. package/build/components/post-last-revision/index.js.map +1 -1
  47. package/build/components/post-locked-modal/index.js +12 -3
  48. package/build/components/post-locked-modal/index.js.map +1 -1
  49. package/build/components/post-publish-panel/index.js +4 -1
  50. package/build/components/post-publish-panel/index.js.map +1 -1
  51. package/build/components/post-publish-panel/maybe-post-format-panel.js +4 -1
  52. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  53. package/build/components/post-publish-panel/maybe-upload-media.js +14 -8
  54. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  55. package/build/components/post-publish-panel/postpublish.js +4 -0
  56. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  57. package/build/components/post-slug/index.js +1 -0
  58. package/build/components/post-slug/index.js.map +1 -1
  59. package/build/components/post-status/index.js +4 -2
  60. package/build/components/post-status/index.js.map +1 -1
  61. package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -2
  62. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  63. package/build/components/post-taxonomies/most-used-terms.js +4 -1
  64. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  65. package/build/components/post-template/block-theme.js +13 -4
  66. package/build/components/post-template/block-theme.js.map +1 -1
  67. package/build/components/post-template/classic-theme.js +4 -1
  68. package/build/components/post-template/classic-theme.js.map +1 -1
  69. package/build/components/post-title/index.js +32 -46
  70. package/build/components/post-title/index.js.map +1 -1
  71. package/build/components/post-url/index.js +10 -6
  72. package/build/components/post-url/index.js.map +1 -1
  73. package/build/components/preview-dropdown/index.js +26 -14
  74. package/build/components/preview-dropdown/index.js.map +1 -1
  75. package/build/components/provider/use-block-editor-settings.js +5 -6
  76. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  77. package/build/components/save-publish-panels/index.js +8 -2
  78. package/build/components/save-publish-panels/index.js.map +1 -1
  79. package/build/components/sidebar/post-summary.js +10 -7
  80. package/build/components/sidebar/post-summary.js.map +1 -1
  81. package/build/components/start-template-options/index.js +4 -1
  82. package/build/components/start-template-options/index.js.map +1 -1
  83. package/build/components/table-of-contents/index.js +4 -1
  84. package/build/components/table-of-contents/index.js.map +1 -1
  85. package/build/components/template-content-panel/index.js +1 -1
  86. package/build/components/template-content-panel/index.js.map +1 -1
  87. package/build/components/text-editor/index.js +4 -1
  88. package/build/components/text-editor/index.js.map +1 -1
  89. package/build/components/visual-editor/index.js +1 -6
  90. package/build/components/visual-editor/index.js.map +1 -1
  91. package/build/dataviews/actions/duplicate-pattern.js +48 -0
  92. package/build/dataviews/actions/duplicate-pattern.js.map +1 -0
  93. package/build/dataviews/actions/duplicate-post.js +146 -0
  94. package/build/dataviews/actions/duplicate-post.js.map +1 -0
  95. package/build/dataviews/actions/duplicate-post.native.js +9 -0
  96. package/build/dataviews/actions/duplicate-post.native.js.map +1 -0
  97. package/build/dataviews/actions/duplicate-template-part.js +67 -0
  98. package/build/dataviews/actions/duplicate-template-part.js.map +1 -0
  99. package/build/dataviews/actions/export-pattern.js +2 -0
  100. package/build/dataviews/actions/export-pattern.js.map +1 -1
  101. package/build/dataviews/actions/permanently-delete-post.js +2 -0
  102. package/build/dataviews/actions/permanently-delete-post.js.map +1 -1
  103. package/build/dataviews/actions/rename-post.js +125 -0
  104. package/build/dataviews/actions/rename-post.js.map +1 -0
  105. package/build/dataviews/actions/reorder-page.js +116 -0
  106. package/build/dataviews/actions/reorder-page.js.map +1 -0
  107. package/build/dataviews/actions/reorder-page.native.js +9 -0
  108. package/build/dataviews/actions/reorder-page.native.js.map +1 -0
  109. package/build/dataviews/actions/reset-post.js +9 -3
  110. package/build/dataviews/actions/reset-post.js.map +1 -1
  111. package/build/dataviews/actions/trash-post.js +8 -2
  112. package/build/dataviews/actions/trash-post.js.map +1 -1
  113. package/build/dataviews/actions/utils.js +9 -1
  114. package/build/dataviews/actions/utils.js.map +1 -1
  115. package/build/dataviews/actions/view-post-revisions.js +49 -0
  116. package/build/dataviews/actions/view-post-revisions.js.map +1 -0
  117. package/build/dataviews/actions/view-post.js +36 -0
  118. package/build/dataviews/actions/view-post.js.map +1 -0
  119. package/build/dataviews/fields/index.js +32 -0
  120. package/build/dataviews/fields/index.js.map +1 -0
  121. package/build/dataviews/store/private-actions.js +16 -2
  122. package/build/dataviews/store/private-actions.js.map +1 -1
  123. package/build/dataviews/types.js.map +1 -1
  124. package/build/private-apis.js +2 -2
  125. package/build/private-apis.js.map +1 -1
  126. package/build/store/private-actions.js +2 -2
  127. package/build/store/private-actions.js.map +1 -1
  128. package/build/store/utils/is-template-revertable.js +1 -1
  129. package/build/store/utils/is-template-revertable.js.map +1 -1
  130. package/build-module/bindings/post-meta.js +12 -10
  131. package/build-module/bindings/post-meta.js.map +1 -1
  132. package/build-module/components/block-manager/index.js +4 -1
  133. package/build-module/components/block-manager/index.js.map +1 -1
  134. package/build-module/components/block-settings-menu/content-only-settings-menu.js +6 -9
  135. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  136. package/build-module/components/create-template-part-modal/index.js +1 -0
  137. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  138. package/build-module/components/document-bar/index.js +4 -4
  139. package/build-module/components/document-bar/index.js.map +1 -1
  140. package/build-module/components/editor-history/redo.js +4 -1
  141. package/build-module/components/editor-history/redo.js.map +1 -1
  142. package/build-module/components/editor-history/undo.js +4 -1
  143. package/build-module/components/editor-history/undo.js.map +1 -1
  144. package/build-module/components/editor-interface/index.js +2 -3
  145. package/build-module/components/editor-interface/index.js.map +1 -1
  146. package/build-module/components/error-boundary/index.js +4 -1
  147. package/build-module/components/error-boundary/index.js.map +1 -1
  148. package/build-module/components/global-styles-provider/index.js +17 -4
  149. package/build-module/components/global-styles-provider/index.js.map +1 -1
  150. package/build-module/components/index.js +1 -0
  151. package/build-module/components/index.js.map +1 -1
  152. package/build-module/components/inserter-sidebar/index.js +8 -7
  153. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  154. package/build-module/components/local-autosave-monitor/index.js +5 -5
  155. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  156. package/build-module/components/page-attributes/parent.js +10 -6
  157. package/build-module/components/page-attributes/parent.js.map +1 -1
  158. package/build-module/components/plugin-preview-menu-item/index.js +52 -0
  159. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -0
  160. package/build-module/components/post-actions/actions.js +5 -501
  161. package/build-module/components/post-actions/actions.js.map +1 -1
  162. package/build-module/components/post-actions/index.js +13 -25
  163. package/build-module/components/post-actions/index.js.map +1 -1
  164. package/build-module/components/post-card-panel/index.js +20 -20
  165. package/build-module/components/post-card-panel/index.js.map +1 -1
  166. package/build-module/components/post-excerpt/panel.js +4 -1
  167. package/build-module/components/post-excerpt/panel.js.map +1 -1
  168. package/build-module/components/post-featured-image/index.js +14 -3
  169. package/build-module/components/post-featured-image/index.js.map +1 -1
  170. package/build-module/components/post-format/index.js +4 -1
  171. package/build-module/components/post-format/index.js.map +1 -1
  172. package/build-module/components/post-last-revision/index.js +4 -1
  173. package/build-module/components/post-last-revision/index.js.map +1 -1
  174. package/build-module/components/post-locked-modal/index.js +12 -3
  175. package/build-module/components/post-locked-modal/index.js.map +1 -1
  176. package/build-module/components/post-publish-panel/index.js +4 -1
  177. package/build-module/components/post-publish-panel/index.js.map +1 -1
  178. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +4 -1
  179. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  180. package/build-module/components/post-publish-panel/maybe-upload-media.js +14 -8
  181. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  182. package/build-module/components/post-publish-panel/postpublish.js +4 -0
  183. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  184. package/build-module/components/post-slug/index.js +1 -0
  185. package/build-module/components/post-slug/index.js.map +1 -1
  186. package/build-module/components/post-status/index.js +4 -2
  187. package/build-module/components/post-status/index.js.map +1 -1
  188. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -3
  189. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  190. package/build-module/components/post-taxonomies/most-used-terms.js +4 -1
  191. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  192. package/build-module/components/post-template/block-theme.js +13 -4
  193. package/build-module/components/post-template/block-theme.js.map +1 -1
  194. package/build-module/components/post-template/classic-theme.js +4 -1
  195. package/build-module/components/post-template/classic-theme.js.map +1 -1
  196. package/build-module/components/post-title/index.js +33 -47
  197. package/build-module/components/post-title/index.js.map +1 -1
  198. package/build-module/components/post-url/index.js +11 -7
  199. package/build-module/components/post-url/index.js.map +1 -1
  200. package/build-module/components/preview-dropdown/index.js +26 -14
  201. package/build-module/components/preview-dropdown/index.js.map +1 -1
  202. package/build-module/components/provider/use-block-editor-settings.js +6 -7
  203. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  204. package/build-module/components/save-publish-panels/index.js +8 -2
  205. package/build-module/components/save-publish-panels/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-summary.js +10 -7
  207. package/build-module/components/sidebar/post-summary.js.map +1 -1
  208. package/build-module/components/start-template-options/index.js +4 -1
  209. package/build-module/components/start-template-options/index.js.map +1 -1
  210. package/build-module/components/table-of-contents/index.js +4 -1
  211. package/build-module/components/table-of-contents/index.js.map +1 -1
  212. package/build-module/components/template-content-panel/index.js +1 -1
  213. package/build-module/components/template-content-panel/index.js.map +1 -1
  214. package/build-module/components/text-editor/index.js +4 -1
  215. package/build-module/components/text-editor/index.js.map +1 -1
  216. package/build-module/components/visual-editor/index.js +1 -6
  217. package/build-module/components/visual-editor/index.js.map +1 -1
  218. package/build-module/dataviews/actions/duplicate-pattern.js +39 -0
  219. package/build-module/dataviews/actions/duplicate-pattern.js.map +1 -0
  220. package/build-module/dataviews/actions/duplicate-post.js +139 -0
  221. package/build-module/dataviews/actions/duplicate-post.js.map +1 -0
  222. package/build-module/dataviews/actions/duplicate-post.native.js +3 -0
  223. package/build-module/dataviews/actions/duplicate-post.native.js.map +1 -0
  224. package/build-module/dataviews/actions/duplicate-template-part.js +58 -0
  225. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -0
  226. package/build-module/dataviews/actions/export-pattern.js +2 -0
  227. package/build-module/dataviews/actions/export-pattern.js.map +1 -1
  228. package/build-module/dataviews/actions/permanently-delete-post.js +3 -0
  229. package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -1
  230. package/build-module/dataviews/actions/rename-post.js +118 -0
  231. package/build-module/dataviews/actions/rename-post.js.map +1 -0
  232. package/build-module/dataviews/actions/reorder-page.js +111 -0
  233. package/build-module/dataviews/actions/reorder-page.js.map +1 -0
  234. package/build-module/dataviews/actions/reorder-page.native.js +3 -0
  235. package/build-module/dataviews/actions/reorder-page.native.js.map +1 -0
  236. package/build-module/dataviews/actions/reset-post.js +9 -3
  237. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  238. package/build-module/dataviews/actions/trash-post.js +8 -2
  239. package/build-module/dataviews/actions/trash-post.js.map +1 -1
  240. package/build-module/dataviews/actions/utils.js +7 -1
  241. package/build-module/dataviews/actions/utils.js.map +1 -1
  242. package/build-module/dataviews/actions/view-post-revisions.js +43 -0
  243. package/build-module/dataviews/actions/view-post-revisions.js.map +1 -0
  244. package/build-module/dataviews/actions/view-post.js +30 -0
  245. package/build-module/dataviews/actions/view-post.js.map +1 -0
  246. package/build-module/dataviews/fields/index.js +26 -0
  247. package/build-module/dataviews/fields/index.js.map +1 -0
  248. package/build-module/dataviews/store/private-actions.js +16 -2
  249. package/build-module/dataviews/store/private-actions.js.map +1 -1
  250. package/build-module/dataviews/types.js.map +1 -1
  251. package/build-module/private-apis.js +2 -2
  252. package/build-module/private-apis.js.map +1 -1
  253. package/build-module/store/private-actions.js +2 -2
  254. package/build-module/store/private-actions.js.map +1 -1
  255. package/build-module/store/utils/is-template-revertable.js +1 -1
  256. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  257. package/build-style/style-rtl.css +14 -38
  258. package/build-style/style.css +14 -38
  259. package/build-types/bindings/post-meta.d.ts +0 -3
  260. package/build-types/bindings/post-meta.d.ts.map +1 -1
  261. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -1
  262. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  263. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  264. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  265. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  266. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  267. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  268. package/build-types/components/index.d.ts +1 -0
  269. package/build-types/components/index.d.ts.map +1 -1
  270. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  271. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  272. package/build-types/components/plugin-preview-menu-item/index.d.ts +3 -0
  273. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -0
  274. package/build-types/components/post-actions/actions.d.ts +1 -26
  275. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  276. package/build-types/components/post-actions/index.d.ts +3 -2
  277. package/build-types/components/post-actions/index.d.ts.map +1 -1
  278. package/build-types/components/post-card-panel/index.d.ts +4 -2
  279. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  280. package/build-types/components/post-format/index.d.ts.map +1 -1
  281. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  282. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  283. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  284. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  285. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  286. package/build-types/components/post-slug/index.d.ts.map +1 -1
  287. package/build-types/components/post-status/index.d.ts.map +1 -1
  288. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -17
  289. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  290. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  291. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  292. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  293. package/build-types/components/post-url/index.d.ts.map +1 -1
  294. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  295. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  296. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  297. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  298. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  299. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  300. package/build-types/components/text-editor/index.d.ts.map +1 -1
  301. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  302. package/build-types/dataviews/actions/duplicate-pattern.d.ts +5 -0
  303. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +1 -0
  304. package/build-types/dataviews/actions/duplicate-post.d.ts +5 -0
  305. package/build-types/dataviews/actions/duplicate-post.d.ts.map +1 -0
  306. package/build-types/dataviews/actions/duplicate-post.native.d.ts +3 -0
  307. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +1 -0
  308. package/build-types/dataviews/actions/duplicate-template-part.d.ts +5 -0
  309. package/build-types/dataviews/actions/duplicate-template-part.d.ts.map +1 -0
  310. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -1
  311. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -1
  312. package/build-types/dataviews/actions/rename-post.d.ts +5 -0
  313. package/build-types/dataviews/actions/rename-post.d.ts.map +1 -0
  314. package/build-types/dataviews/actions/reorder-page.d.ts +8 -0
  315. package/build-types/dataviews/actions/reorder-page.d.ts.map +1 -0
  316. package/build-types/dataviews/actions/reorder-page.native.d.ts +3 -0
  317. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +1 -0
  318. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  319. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
  320. package/build-types/dataviews/actions/utils.d.ts +5 -3
  321. package/build-types/dataviews/actions/utils.d.ts.map +1 -1
  322. package/build-types/dataviews/actions/view-post-revisions.d.ts +8 -0
  323. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +1 -0
  324. package/build-types/dataviews/actions/view-post.d.ts +8 -0
  325. package/build-types/dataviews/actions/view-post.d.ts.map +1 -0
  326. package/build-types/dataviews/fields/index.d.ts +8 -0
  327. package/build-types/dataviews/fields/index.d.ts.map +1 -0
  328. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  329. package/build-types/dataviews/types.d.ts +57 -8
  330. package/build-types/dataviews/types.d.ts.map +1 -1
  331. package/build-types/store/private-actions.d.ts.map +1 -1
  332. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
  333. package/package.json +36 -36
  334. package/src/bindings/post-meta.js +14 -8
  335. package/src/components/block-manager/index.js +2 -0
  336. package/src/components/block-manager/style.scss +2 -2
  337. package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
  338. package/src/components/create-template-part-modal/index.js +1 -0
  339. package/src/components/create-template-part-modal/style.scss +1 -1
  340. package/src/components/document-bar/index.js +4 -4
  341. package/src/components/document-outline/style.scss +1 -1
  342. package/src/components/editor-history/redo.js +2 -0
  343. package/src/components/editor-history/undo.js +2 -0
  344. package/src/components/editor-interface/index.js +2 -4
  345. package/src/components/error-boundary/index.js +6 -1
  346. package/src/components/error-boundary/style.native.scss +1 -1
  347. package/src/components/error-boundary/style.scss +1 -1
  348. package/src/components/global-styles-provider/index.js +16 -3
  349. package/src/components/header/style.scss +6 -3
  350. package/src/components/index.js +1 -0
  351. package/src/components/inserter-sidebar/index.js +12 -5
  352. package/src/components/local-autosave-monitor/index.js +6 -6
  353. package/src/components/page-attributes/parent.js +18 -13
  354. package/src/components/plugin-preview-menu-item/index.js +52 -0
  355. package/src/components/post-actions/actions.js +5 -616
  356. package/src/components/post-actions/index.js +24 -34
  357. package/src/components/post-card-panel/index.js +28 -27
  358. package/src/components/post-card-panel/style.scss +1 -1
  359. package/src/components/post-discussion/style.scss +0 -9
  360. package/src/components/post-excerpt/panel.js +2 -0
  361. package/src/components/post-featured-image/index.js +8 -0
  362. package/src/components/post-featured-image/style.scss +1 -2
  363. package/src/components/post-format/index.js +2 -0
  364. package/src/components/post-format/style.scss +0 -6
  365. package/src/components/post-last-revision/index.js +2 -0
  366. package/src/components/post-locked-modal/index.js +14 -2
  367. package/src/components/post-locked-modal/style.scss +1 -1
  368. package/src/components/post-publish-panel/index.js +2 -0
  369. package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -0
  370. package/src/components/post-publish-panel/maybe-upload-media.js +37 -29
  371. package/src/components/post-publish-panel/postpublish.js +8 -2
  372. package/src/components/post-publish-panel/style.scss +3 -1
  373. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -8
  374. package/src/components/post-slug/index.js +1 -0
  375. package/src/components/post-status/index.js +3 -2
  376. package/src/components/post-status/style.scss +0 -19
  377. package/src/components/post-taxonomies/hierarchical-term-selector.js +5 -1
  378. package/src/components/post-taxonomies/most-used-terms.js +2 -0
  379. package/src/components/post-template/block-theme.js +15 -9
  380. package/src/components/post-template/classic-theme.js +2 -0
  381. package/src/components/post-title/index.js +30 -41
  382. package/src/components/post-url/index.js +17 -9
  383. package/src/components/preview-dropdown/index.js +28 -20
  384. package/src/components/provider/use-block-editor-settings.js +5 -5
  385. package/src/components/resizable-editor/style.scss +2 -2
  386. package/src/components/save-publish-panels/index.js +4 -0
  387. package/src/components/save-publish-panels/style.scss +3 -3
  388. package/src/components/sidebar/post-summary.js +20 -16
  389. package/src/components/site-discussion/style.scss +0 -14
  390. package/src/components/start-template-options/index.js +6 -1
  391. package/src/components/table-of-contents/index.js +2 -0
  392. package/src/components/template-content-panel/index.js +4 -1
  393. package/src/components/text-editor/index.js +2 -0
  394. package/src/components/visual-editor/index.js +2 -9
  395. package/src/dataviews/actions/duplicate-pattern.tsx +40 -0
  396. package/src/dataviews/actions/duplicate-post.native.tsx +3 -0
  397. package/src/dataviews/actions/duplicate-post.tsx +174 -0
  398. package/src/dataviews/actions/duplicate-template-part.tsx +70 -0
  399. package/src/dataviews/actions/export-pattern.tsx +2 -0
  400. package/src/dataviews/actions/permanently-delete-post.tsx +2 -0
  401. package/src/dataviews/actions/rename-post.tsx +146 -0
  402. package/src/dataviews/actions/reorder-page.native.tsx +3 -0
  403. package/src/dataviews/actions/reorder-page.tsx +125 -0
  404. package/src/dataviews/actions/reset-post.tsx +6 -1
  405. package/src/dataviews/actions/trash-post.tsx +4 -0
  406. package/src/dataviews/actions/utils.ts +14 -4
  407. package/src/dataviews/actions/view-post-revisions.tsx +47 -0
  408. package/src/dataviews/actions/view-post.tsx +30 -0
  409. package/src/dataviews/fields/index.ts +26 -0
  410. package/src/dataviews/store/private-actions.ts +42 -1
  411. package/src/dataviews/types.ts +47 -6
  412. package/src/private-apis.js +2 -2
  413. package/src/store/private-actions.js +4 -2
  414. package/src/store/utils/is-template-revertable.js +2 -1
  415. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_interface","_data","_i18n","_preferences","_blockEditor","_keyboardShortcuts","_compose","_element","_store","_editorNotices","_header","_inserterSidebar","_listViewSidebar","_savePublishPanels","_textEditor","_visualEditor","_contentSlotFill","_jsxRuntime","interfaceLabels","header","__","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","icon","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","blockEditorMode","useSelect","select","get","preferencesStore","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","blockEditorStore","__unstableGetEditorMode","isWideViewport","useViewportMatch","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","jsx","InterfaceSkeleton","clsx","labels","secondarySidebar","default","editorNotices","ComplementaryArea","Slot","scope","content","jsxs","Fragment","editorCanvasView","BlockToolbar","hideDragHandle","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\ticon,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tblockEditorMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free':\n\t\t\t\t\tisDistractionFree && isWideViewport && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\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\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tblockEditorMode !== 'zoom-out' &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,gBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,kBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,WAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,aAAA,GAAAjB,sBAAA,CAAAC,OAAA;AACA,IAAAiB,gBAAA,GAAAlB,sBAAA,CAAAC,OAAA;AAAwD,IAAAkB,WAAA,GAAAlB,OAAA;AAhCxD;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;;AAWA,MAAMmB,eAAe,GAAG;EACvB;EACA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N,CAAEsB,aAAa,GACZV,eAAe,iBACf,IAAAlB,WAAA,CAAA6D,GAAA,EAACjE,kBAAA,CAAAsE,OAAiB;MACjBR,wBAAwB,EACvBA,wBACA;MACDqB,yBAAyB,EACxBxB,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDwB,wBAAwB,EAAGnE;IAAc,CACzC,CACA,GACDoE,SACH;IACDC,SAAS,EAAG;MACXC,QAAQ,EAAEtD,gBAAgB;MAC1BuD,IAAI,EAAEtD;IACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_interface","_data","_i18n","_preferences","_blockEditor","_keyboardShortcuts","_compose","_element","_store","_editorNotices","_header","_inserterSidebar","_listViewSidebar","_savePublishPanels","_textEditor","_visualEditor","_contentSlotFill","_jsxRuntime","interfaceLabels","header","__","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","icon","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","blockEditorMode","useSelect","select","get","preferencesStore","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","blockEditorStore","__unstableGetEditorMode","isLargeViewport","useViewportMatch","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","jsx","InterfaceSkeleton","clsx","labels","secondarySidebar","default","editorNotices","ComplementaryArea","Slot","scope","content","jsxs","Fragment","editorCanvasView","BlockToolbar","hideDragHandle","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\ticon,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tblockEditorMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free': isDistractionFree && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\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\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tblockEditorMode !== 'zoom-out' &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,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,IAAI,KAAK,QAAU,kBACpB,IAAAvB,WAAA,CAAA4D,GAAA,EAAC9D,aAAA,CAAAmE,OAAY;YACZtD,MAAM,EAAGA,MAAQ;YACjBG,UAAU,EAAGA,UAAY;YACzBC,aAAa,EAAGA;YAChB;YACA;YAAA;YACAC,SAAS,EAAGA,SAAW;YACvBM,WAAW,EAAGA;UAAa,CAC3B,CACD,EACCV,QAAQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDL,MAAM,EACL,CAAEqB,aAAa,IACf,CAAED,iBAAiB,IACnBwB,eAAe,IACfpB,oBAAoB,IACpBP,oBAAoB,IACpBS,eAAe,KAAK,UAAU,IAC9BV,IAAI,KAAK,QAAQ,iBAChB,IAAAvB,WAAA,CAAA4D,GAAA,EAACzE,YAAA,CAAAyF,eAAe;MAACC,aAAa,EAAG7C;IAAe,CAAE,CAEnD;IACD1B,OAAO,EACN,CAAEsB,aAAa,GACZV,eAAe,iBACf,IAAAlB,WAAA,CAAA4D,GAAA,EAAChE,kBAAA,CAAAqE,OAAiB;MACjBR,wBAAwB,EACvBA,wBACA;MACDqB,yBAAyB,EACxBxB,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDwB,wBAAwB,EAAGlE;IAAc,CACzC,CACA,GACDmE,SACH;IACDC,SAAS,EAAG;MACXC,QAAQ,EAAErD,gBAAgB;MAC1BsD,IAAI,EAAErD;IACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
@@ -37,7 +37,10 @@ function CopyButton({
37
37
  children
38
38
  }) {
39
39
  const ref = (0, _compose.useCopyToClipboard)(text);
40
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
41
+ // TODO: Switch to `true` (40px size) if possible
42
+ , {
43
+ __next40pxDefaultSize: false,
41
44
  variant: "secondary",
42
45
  ref: ref,
43
46
  children: children
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_i18n","_components","_data","_blockEditor","_compose","_hooks","_store","_jsxRuntime","getContent","select","editorStore","getEditedPostContent","error","CopyButton","text","children","ref","useCopyToClipboard","jsx","Button","variant","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","doAction","getDerivedStateFromError","render","props","actions","__","stack","Warning","className","_default","exports","default"],"sources":["@wordpress/editor/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { select } from '@wordpress/data';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst actions = [\n\t\t\t<CopyButton key=\"copy-post\" text={ getContent }>\n\t\t\t\t{ __( 'Copy Post Text' ) }\n\t\t\t</CopyButton>,\n\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t</CopyButton>,\n\t\t];\n\n\t\treturn (\n\t\t\t<Warning className=\"editor-error-boundary\" actions={ actions }>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n\n/**\n * ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.\n *\n * It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.\n *\n * getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.\n *\n * @class ErrorBoundary\n * @augments Component\n */\nexport default ErrorBoundary;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,GAAAR,OAAA;AAdnD;AACA;AACA;;AASA;AACA;AACA;;AAGA,SAASS,UAAUA,CAAA,EAAG;EACrB,IAAI;IACH;IACA;IACA;IACA;IACA;IACA;IACA,OAAO,IAAAC,YAAM,EAAEC,YAAY,CAAC,CAACC,oBAAoB,CAAC,CAAC;EACpD,CAAC,CAAC,OAAQC,KAAK,EAAG,CAAC;AACpB;AAEA,SAASC,UAAUA,CAAE;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EACzC,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEH,IAAK,CAAC;EACtC,oBACC,IAAAP,WAAA,CAAAW,GAAA,EAACjB,WAAA,CAAAkB,MAAM;IAACC,OAAO,EAAC,WAAW;IAACJ,GAAG,EAAGA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_element","require","_i18n","_components","_data","_blockEditor","_compose","_hooks","_store","_jsxRuntime","getContent","select","editorStore","getEditedPostContent","error","CopyButton","text","children","ref","useCopyToClipboard","jsx","Button","__next40pxDefaultSize","variant","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","doAction","getDerivedStateFromError","render","props","actions","__","stack","Warning","className","_default","exports","default"],"sources":["@wordpress/editor/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { select } from '@wordpress/data';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button\n\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t__next40pxDefaultSize={ false }\n\t\t\tvariant=\"secondary\"\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst actions = [\n\t\t\t<CopyButton key=\"copy-post\" text={ getContent }>\n\t\t\t\t{ __( 'Copy Post Text' ) }\n\t\t\t</CopyButton>,\n\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t</CopyButton>,\n\t\t];\n\n\t\treturn (\n\t\t\t<Warning className=\"editor-error-boundary\" actions={ actions }>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n\n/**\n * ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.\n *\n * It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.\n *\n * getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.\n *\n * @class ErrorBoundary\n * @augments Component\n */\nexport default ErrorBoundary;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,GAAAR,OAAA;AAdnD;AACA;AACA;;AASA;AACA;AACA;;AAGA,SAASS,UAAUA,CAAA,EAAG;EACrB,IAAI;IACH;IACA;IACA;IACA;IACA;IACA;IACA,OAAO,IAAAC,YAAM,EAAEC,YAAY,CAAC,CAACC,oBAAoB,CAAC,CAAC;EACpD,CAAC,CAAC,OAAQC,KAAK,EAAG,CAAC;AACpB;AAEA,SAASC,UAAUA,CAAE;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EACzC,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEH,IAAK,CAAC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Z;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAUejB,aAAa","ignoreList":[]}
@@ -33,10 +33,23 @@ const {
33
33
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
34
34
  function mergeBaseAndUserConfigs(base, user) {
35
35
  return (0, _deepmerge.default)(base, user, {
36
- // We only pass as arrays the presets,
37
- // in which case we want the new array of values
38
- // to override the old array (no merging).
39
- isMergeableObject: _isPlainObject.isPlainObject
36
+ /*
37
+ * We only pass as arrays the presets,
38
+ * in which case we want the new array of values
39
+ * to override the old array (no merging).
40
+ */
41
+ isMergeableObject: _isPlainObject.isPlainObject,
42
+ /*
43
+ * Exceptions to the above rule.
44
+ * Background images should be replaced, not merged,
45
+ * as they themselves are specific object definitions for the style.
46
+ */
47
+ customMerge: key => {
48
+ if (key === 'backgroundImage') {
49
+ return (baseConfig, userConfig) => userConfig;
50
+ }
51
+ return undefined;
52
+ }
40
53
  });
41
54
  }
42
55
  function useGlobalStylesUserConfig() {
@@ -1 +1 @@
1
- {"version":3,"names":["_deepmerge","_interopRequireDefault","require","_isPlainObject","_blockEditor","_coreData","_data","_element","_lockUnlock","_jsxRuntime","GlobalStylesContext","cleanEmptyObject","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","base","user","deepmerge","isMergeableObject","isPlainObject","useGlobalStylesUserConfig","globalStylesId","isReady","settings","styles","_links","useSelect","select","getEditedEntityRecord","hasFinishedResolution","canUser","coreStore","_globalStylesId","__experimentalGetCurrentGlobalStylesId","record","kind","name","id","undefined","hasResolved","editEntityRecord","useDispatch","config","useMemo","setConfig","useCallback","callbackOrObject","options","_record$styles","_record$settings","_record$_links","currentConfig","updatedConfig","useGlobalStylesBaseConfig","baseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","userConfig","setUserConfig","isBaseConfigReady","mergedConfig","context","merged","GlobalStylesProvider","children","jsx","Provider","value"],"sources":["@wordpress/editor/src/components/global-styles-provider/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext, cleanEmptyObject } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport function mergeBaseAndUserConfigs( base, user ) {\n\treturn deepmerge( base, user, {\n\t\t// We only pass as arrays the presets,\n\t\t// in which case we want the new array of values\n\t\t// to override the old array (no merging).\n\t\tisMergeableObject: isPlainObject,\n\t} );\n}\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, isReady, settings, styles, _links } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _globalStylesId =\n\t\t\t\tselect( coreStore ).__experimentalGetCurrentGlobalStylesId();\n\n\t\t\tconst record =\n\t\t\t\t_globalStylesId &&\n\t\t\t\tcanUser( 'read', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'globalStyles',\n\t\t\t\t\tid: _globalStylesId,\n\t\t\t\t} )\n\t\t\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t_globalStylesId\n\t\t\t\t\t )\n\t\t\t\t\t: undefined;\n\n\t\t\tlet hasResolved = false;\n\t\t\tif (\n\t\t\t\thasFinishedResolution(\n\t\t\t\t\t'__experimentalGetCurrentGlobalStylesId'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\thasResolved = _globalStylesId\n\t\t\t\t\t? hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t ] )\n\t\t\t\t\t: true;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tglobalStylesId: _globalStylesId,\n\t\t\t\tisReady: hasResolved,\n\t\t\t\tsettings: record?.settings,\n\t\t\t\tstyles: record?.styles,\n\t\t\t\t_links: record?._links,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t\t_links: _links ?? {},\n\t\t};\n\t}, [ settings, styles, _links ] );\n\n\tconst setConfig = useCallback(\n\t\t/**\n\t\t * Set the global styles config.\n\t\t * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.\n\t\t * Otherwise, overwrite the current config with the incoming object.\n\t\t * @param {Object} options Options for editEntityRecord Core selector.\n\t\t */\n\t\t( callbackOrObject, options = {} ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t\t_links: record?._links ?? {},\n\t\t\t};\n\n\t\t\tconst updatedConfig =\n\t\t\t\ttypeof callbackOrObject === 'function'\n\t\t\t\t\t? callbackOrObject( currentConfig )\n\t\t\t\t\t: callbackOrObject;\n\n\t\t\teditEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t{\n\t\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t\t\t_links: cleanEmptyObject( updatedConfig._links ) || {},\n\t\t\t\t},\n\t\t\t\toptions\n\t\t\t);\n\t\t},\n\t\t[ globalStylesId, editEntityRecord, getEditedEntityRecord ]\n\t);\n\n\treturn [ isReady, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect( ( select ) => {\n\t\tconst { __experimentalGetCurrentThemeBaseGlobalStyles, canUser } =\n\t\t\tselect( coreStore );\n\n\t\treturn (\n\t\t\tcanUser( 'read', { kind: 'root', name: 'theme' } ) &&\n\t\t\t__experimentalGetCurrentThemeBaseGlobalStyles()\n\t\t);\n\t}, [] );\n\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nexport function useGlobalStylesContext() {\n\tconst [ isUserConfigReady, userConfig, setUserConfig ] =\n\t\tuseGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],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AEC,UAAU,EAAEC,aAAa,CAAE,GACrDvC,yBAAyB,CAAC,CAAC;EAC5B,MAAM,CAAEwC,iBAAiB,EAAEN,UAAU,CAAE,GAAGD,yBAAyB,CAAC,CAAC;EAErE,MAAMQ,YAAY,GAAG,IAAAlB,gBAAO,EAAE,MAAM;IACnC,IAAK,CAAEW,UAAU,IAAI,CAAEI,UAAU,EAAG;MACnC,OAAO,CAAC,CAAC;IACV;IAEA,OAAO5C,uBAAuB,CAAEwC,UAAU,EAAEI,UAAW,CAAC;EACzD,CAAC,EAAE,CAAEA,UAAU,EAAEJ,UAAU,CAAG,CAAC;EAE/B,MAAMQ,OAAO,GAAG,IAAAnB,gBAAO,EAAE,MAAM;IAC9B,OAAO;MACNrB,OAAO,EAAEmC,iBAAiB,IAAIG,iBAAiB;MAC/C5C,IAAI,EAAE0C,UAAU;MAChB3C,IAAI,EAAEuC,UAAU;MAChBS,MAAM,EAAEF,YAAY;MACpBF;IACD,CAAC;EACF,CAAC,EAAE,CACFE,YAAY,EACZH,UAAU,EACVJ,UAAU,EACVK,aAAa,EACbF,iBAAiB,EACjBG,iBAAiB,CAChB,CAAC;EAEH,OAAOE,OAAO;AACf;AAEO,SAASE,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMH,OAAO,GAAGN,sBAAsB,CAAC,CAAC;EACxC,IAAK,CAAEM,OAAO,CAACxC,OAAO,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAb,WAAA,CAAAyD,GAAA,EAACxD,mBAAmB,CAACyD,QAAQ;IAACC,KAAK,EAAGN,OAAS;IAAAG,QAAA,EAC5CA;EAAQ,CACmB,CAAC;AAEjC","ignoreList":[]}
1
+ {"version":3,"names":["_deepmerge","_interopRequireDefault","require","_isPlainObject","_blockEditor","_coreData","_data","_element","_lockUnlock","_jsxRuntime","GlobalStylesContext","cleanEmptyObject","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","base","user","deepmerge","isMergeableObject","isPlainObject","customMerge","key","baseConfig","userConfig","undefined","useGlobalStylesUserConfig","globalStylesId","isReady","settings","styles","_links","useSelect","select","getEditedEntityRecord","hasFinishedResolution","canUser","coreStore","_globalStylesId","__experimentalGetCurrentGlobalStylesId","record","kind","name","id","hasResolved","editEntityRecord","useDispatch","config","useMemo","setConfig","useCallback","callbackOrObject","options","_record$styles","_record$settings","_record$_links","currentConfig","updatedConfig","useGlobalStylesBaseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","setUserConfig","isBaseConfigReady","mergedConfig","context","merged","GlobalStylesProvider","children","jsx","Provider","value"],"sources":["@wordpress/editor/src/components/global-styles-provider/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext, cleanEmptyObject } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport function mergeBaseAndUserConfigs( base, user ) {\n\treturn deepmerge( base, user, {\n\t\t/*\n\t\t * We only pass as arrays the presets,\n\t\t * in which case we want the new array of values\n\t\t * to override the old array (no merging).\n\t\t */\n\t\tisMergeableObject: isPlainObject,\n\t\t/*\n\t\t * Exceptions to the above rule.\n\t\t * Background images should be replaced, not merged,\n\t\t * as they themselves are specific object definitions for the style.\n\t\t */\n\t\tcustomMerge: ( key ) => {\n\t\t\tif ( key === 'backgroundImage' ) {\n\t\t\t\treturn ( baseConfig, userConfig ) => userConfig;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t} );\n}\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, isReady, settings, styles, _links } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _globalStylesId =\n\t\t\t\tselect( coreStore ).__experimentalGetCurrentGlobalStylesId();\n\n\t\t\tconst record =\n\t\t\t\t_globalStylesId &&\n\t\t\t\tcanUser( 'read', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'globalStyles',\n\t\t\t\t\tid: _globalStylesId,\n\t\t\t\t} )\n\t\t\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t_globalStylesId\n\t\t\t\t\t )\n\t\t\t\t\t: undefined;\n\n\t\t\tlet hasResolved = false;\n\t\t\tif (\n\t\t\t\thasFinishedResolution(\n\t\t\t\t\t'__experimentalGetCurrentGlobalStylesId'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\thasResolved = _globalStylesId\n\t\t\t\t\t? hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t ] )\n\t\t\t\t\t: true;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tglobalStylesId: _globalStylesId,\n\t\t\t\tisReady: hasResolved,\n\t\t\t\tsettings: record?.settings,\n\t\t\t\tstyles: record?.styles,\n\t\t\t\t_links: record?._links,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t\t_links: _links ?? {},\n\t\t};\n\t}, [ settings, styles, _links ] );\n\n\tconst setConfig = useCallback(\n\t\t/**\n\t\t * Set the global styles config.\n\t\t * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.\n\t\t * Otherwise, overwrite the current config with the incoming object.\n\t\t * @param {Object} options Options for editEntityRecord Core selector.\n\t\t */\n\t\t( callbackOrObject, options = {} ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t\t_links: record?._links ?? {},\n\t\t\t};\n\n\t\t\tconst updatedConfig =\n\t\t\t\ttypeof callbackOrObject === 'function'\n\t\t\t\t\t? callbackOrObject( currentConfig )\n\t\t\t\t\t: callbackOrObject;\n\n\t\t\teditEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t{\n\t\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t\t\t_links: cleanEmptyObject( updatedConfig._links ) || {},\n\t\t\t\t},\n\t\t\t\toptions\n\t\t\t);\n\t\t},\n\t\t[ globalStylesId, editEntityRecord, getEditedEntityRecord ]\n\t);\n\n\treturn [ isReady, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect( ( select ) => {\n\t\tconst { __experimentalGetCurrentThemeBaseGlobalStyles, canUser } =\n\t\t\tselect( coreStore );\n\n\t\treturn (\n\t\t\tcanUser( 'read', { kind: 'root', name: 'theme' } ) &&\n\t\t\t__experimentalGetCurrentThemeBaseGlobalStyles()\n\t\t);\n\t}, [] );\n\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nexport function useGlobalStylesContext() {\n\tconst [ isUserConfigReady, userConfig, setUserConfig ] =\n\t\tuseGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAjB3C;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEQ,mBAAmB;EAAEC;AAAiB,CAAC,GAAG,IAAAC,kBAAM,EACvDC,wBACD,CAAC;AAEM,SAASC,uBAAuBA,CAAEC,IAAI,EAAEC,IAAI,EAAG;EACrD,OAAO,IAAAC,kBAAS,EAAEF,IAAI,EAAEC,IAAI,EAAE;IAC7B;AACF;AACA;AACA;AACA;IACEE,iBAAiB,EAAEC,4BAAa;IAChC;AACF;AACA;AACA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O,EAAE,MAAM;IAC9B,OAAO;MACNpB,OAAO,EAAEiC,iBAAiB,IAAIE,iBAAiB;MAC/C9C,IAAI,EAAEO,UAAU;MAChBR,IAAI,EAAEO,UAAU;MAChB2C,MAAM,EAAEF,YAAY;MACpBF;IACD,CAAC;EACF,CAAC,EAAE,CACFE,YAAY,EACZxC,UAAU,EACVD,UAAU,EACVuC,aAAa,EACbD,iBAAiB,EACjBE,iBAAiB,CAChB,CAAC;EAEH,OAAOE,OAAO;AACf;AAEO,SAASE,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMH,OAAO,GAAGL,sBAAsB,CAAC,CAAC;EACxC,IAAK,CAAEK,OAAO,CAACrC,OAAO,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAlB,WAAA,CAAA2D,GAAA,EAAC1D,mBAAmB,CAAC2D,QAAQ;IAACC,KAAK,EAAGN,OAAS;IAAAG,QAAA,EAC5CA;EAAQ,CACmB,CAAC;AAEjC","ignoreList":[]}
@@ -32,6 +32,7 @@ var _exportNames = {
32
32
  PluginPostPublishPanel: true,
33
33
  PluginPostStatusInfo: true,
34
34
  PluginPrePublishPanel: true,
35
+ PluginPreviewMenuItem: true,
35
36
  PluginSidebar: true,
36
37
  PluginSidebarMoreMenuItem: true,
37
38
  PostTemplatePanel: true,
@@ -255,6 +256,12 @@ Object.defineProperty(exports, "PluginPrePublishPanel", {
255
256
  return _pluginPrePublishPanel.default;
256
257
  }
257
258
  });
259
+ Object.defineProperty(exports, "PluginPreviewMenuItem", {
260
+ enumerable: true,
261
+ get: function () {
262
+ return _pluginPreviewMenuItem.default;
263
+ }
264
+ });
258
265
  Object.defineProperty(exports, "PluginSidebar", {
259
266
  enumerable: true,
260
267
  get: function () {
@@ -684,6 +691,7 @@ var _pluginMoreMenuItem = _interopRequireDefault(require("./plugin-more-menu-ite
684
691
  var _pluginPostPublishPanel = _interopRequireDefault(require("./plugin-post-publish-panel"));
685
692
  var _pluginPostStatusInfo = _interopRequireDefault(require("./plugin-post-status-info"));
686
693
  var _pluginPrePublishPanel = _interopRequireDefault(require("./plugin-pre-publish-panel"));
694
+ var _pluginPreviewMenuItem = _interopRequireDefault(require("./plugin-preview-menu-item"));
687
695
  var _pluginSidebar = _interopRequireDefault(require("./plugin-sidebar"));
688
696
  var _pluginSidebarMoreMenuItem = _interopRequireDefault(require("./plugin-sidebar-more-menu-item"));
689
697
  var _panel2 = _interopRequireDefault(require("./post-template/panel"));
@@ -1 +1 @@
1
- {"version":3,"names":["_globalKeyboardShortcuts","_interopRequireDefault","require","_autocompleters","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_autosaveMonitor","_documentBar","_documentOutline","_check","_registerShortcuts","_redo","_undo","_editorNotices","_editorSnackbars","_entitiesSavedStates","_useIsDirty","_errorBoundary","_localAutosaveMonitor","_check2","_order","_panel","_parent","_classicTheme","_pluginDocumentSettingPanel","_pluginBlockSettingsMenuItem","_pluginMoreMenuItem","_pluginPostPublishPanel","_pluginPostStatusInfo","_pluginPrePublishPanel","_pluginSidebar","_pluginSidebarMoreMenuItem","_panel2","_postAuthor","_check3","_panel3","_postComments","_panel4","_postExcerpt","_check4","_panel5","_postFeaturedImage","_check5","_panel6","_postFormat","_check6","_postLastRevision","_check7","_panel7","_postLockedModal","_postPendingStatus","_check8","_postPingbacks","_postPreviewButton","_postPublishButton","_label","_postPublishPanel","_postSavedState","_postSchedule","_check9","_label2","_interopRequireWildcard","_panel8","_postSlug","_check10","_postSticky","_check11","_postSwitchToDraftButton","_postSyncStatus","_postTaxonomies","_flatTermSelector","_hierarchicalTermSelector","_check12","_panel9","_postTextEditor","_postTitle","_postTitleRaw","_postTrash","_check13","_postTypeSupportCheck","_postUrl","_check14","_label3","_panel10","_postVisibility","_label4","_check15","_tableOfContents","_themeSupportCheck","_unsavedChangesWarning","_wordCount","_timeToRead","_characterCount","_provider","_deprecated","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","VisualEditorGlobalKeyboardShortcuts","EditorKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"sources":["@wordpress/editor/src/components/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentBar } from './document-bar';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesPanel } from './page-attributes/panel';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template/classic-theme';\nexport { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel';\nexport { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginMoreMenuItem } from './plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './plugin-sidebar-more-menu-item';\nexport { default as PostTemplatePanel } from './post-template/panel';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostAuthorPanel } from './post-author/panel';\nexport { default as PostComments } from './post-comments';\nexport { default as PostDiscussionPanel } from './post-discussion/panel';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostExcerptPanel } from './post-excerpt/panel';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFeaturedImagePanel } from './post-featured-image/panel';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLastRevisionPanel } from './post-last-revision/panel';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSchedulePanel } from './post-schedule/panel';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport { default as PostSyncStatus } from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTaxonomiesPanel } from './post-taxonomies/panel';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTitleRaw } from './post-title/post-title-raw';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostURLPanel } from './post-url/panel';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\n\n/**\n * Handles the keyboard shortcuts for the editor.\n *\n * It provides functionality for various keyboard shortcuts such as toggling editor mode,\n * toggling distraction-free mode, undo/redo, saving the post, toggling list view,\n * and toggling the sidebar.\n */\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n\n/**\n * Handles the keyboard shortcuts for the editor.\n *\n * It provides functionality for various keyboard shortcuts such as toggling editor mode,\n * toggling distraction-free mode, undo/redo, saving the post, toggling list view,\n * and toggling the sidebar.\n */\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAA9F,GAAA,CAAA2F,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAA/G,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAgH,wBAAA,WAAAC,CAAA,IAAAX,CAAA,oBAAAW,CAAA,OAAA5G,cAAA,CAAAC,IAAA,CAAAgG,CAAA,EAAAW,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAA/G,MAAA,CAAAgH,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAvG,GAAA,IAAAuG,CAAA,CAAAC,GAAA,IAAAnH,MAAA,CAAAS,cAAA,CAAAoG,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA;AA1G7B;AACA;AACA;;AAGA;;AAGA;;AA+FA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,mCAAmC,GAAA5G,OAAA,CAAA4G,mCAAA,GAAGC,gCAAuB;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iCAAiC,GAAA9G,OAAA,CAAA8G,iCAAA,GAAGD,gCAAuB","ignoreList":[]}
1
+ {"version":3,"names":["_globalKeyboardShortcuts","_interopRequireDefault","require","_autocompleters","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_autosaveMonitor","_documentBar","_documentOutline","_check","_registerShortcuts","_redo","_undo","_editorNotices","_editorSnackbars","_entitiesSavedStates","_useIsDirty","_errorBoundary","_localAutosaveMonitor","_check2","_order","_panel","_parent","_classicTheme","_pluginDocumentSettingPanel","_pluginBlockSettingsMenuItem","_pluginMoreMenuItem","_pluginPostPublishPanel","_pluginPostStatusInfo","_pluginPrePublishPanel","_pluginPreviewMenuItem","_pluginSidebar","_pluginSidebarMoreMenuItem","_panel2","_postAuthor","_check3","_panel3","_postComments","_panel4","_postExcerpt","_check4","_panel5","_postFeaturedImage","_check5","_panel6","_postFormat","_check6","_postLastRevision","_check7","_panel7","_postLockedModal","_postPendingStatus","_check8","_postPingbacks","_postPreviewButton","_postPublishButton","_label","_postPublishPanel","_postSavedState","_postSchedule","_check9","_label2","_interopRequireWildcard","_panel8","_postSlug","_check10","_postSticky","_check11","_postSwitchToDraftButton","_postSyncStatus","_postTaxonomies","_flatTermSelector","_hierarchicalTermSelector","_check12","_panel9","_postTextEditor","_postTitle","_postTitleRaw","_postTrash","_check13","_postTypeSupportCheck","_postUrl","_check14","_label3","_panel10","_postVisibility","_label4","_check15","_tableOfContents","_themeSupportCheck","_unsavedChangesWarning","_wordCount","_timeToRead","_characterCount","_provider","_deprecated","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","VisualEditorGlobalKeyboardShortcuts","EditorKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"sources":["@wordpress/editor/src/components/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentBar } from './document-bar';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesPanel } from './page-attributes/panel';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template/classic-theme';\nexport { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel';\nexport { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginMoreMenuItem } from './plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './plugin-pre-publish-panel';\nexport { default as PluginPreviewMenuItem } from './plugin-preview-menu-item';\nexport { default as PluginSidebar } from './plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './plugin-sidebar-more-menu-item';\nexport { default as PostTemplatePanel } from './post-template/panel';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostAuthorPanel } from './post-author/panel';\nexport { default as PostComments } from './post-comments';\nexport { default as PostDiscussionPanel } from './post-discussion/panel';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostExcerptPanel } from './post-excerpt/panel';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFeaturedImagePanel } from './post-featured-image/panel';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLastRevisionPanel } from './post-last-revision/panel';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSchedulePanel } from './post-schedule/panel';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport { default as PostSyncStatus } from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTaxonomiesPanel } from './post-taxonomies/panel';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTitleRaw } from './post-title/post-title-raw';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostURLPanel } from './post-url/panel';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\n\n/**\n * Handles the keyboard shortcuts for the editor.\n *\n * It provides functionality for various keyboard shortcuts such as toggling editor mode,\n * toggling distraction-free mode, undo/redo, saving the post, toggling list view,\n * and toggling the sidebar.\n */\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n\n/**\n * Handles the keyboard shortcuts for the editor.\n *\n * It provides functionality for various keyboard shortcuts such as toggling editor mode,\n * toggling distraction-free mode, undo/redo, saving the post, toggling list view,\n * and toggling the sidebar.\n */\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAiH,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAxG,GAAA,IAAAwG,CAAA,CAAAC,GAAA,IAAApH,MAAA,CAAAS,cAAA,CAAAqG,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA;AA3G7B;AACA;AACA;;AAGA;;AAGA;;AAgGA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,mCAAmC,GAAA7G,OAAA,CAAA6G,mCAAA,GAAGC,gCAAuB;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iCAAiC,GAAA/G,OAAA,CAAA+G,iCAAA,GAAGD,gCAAuB","ignoreList":[]}
@@ -27,6 +27,7 @@ const {
27
27
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
28
28
  function InserterSidebar() {
29
29
  const {
30
+ blockInsertionPoint,
30
31
  blockSectionRootClientId,
31
32
  inserterSidebarToggleRef,
32
33
  insertionPoint,
@@ -39,10 +40,11 @@ function InserterSidebar() {
39
40
  isPublishSidebarOpened
40
41
  } = (0, _lockUnlock.unlock)(select(_store.store));
41
42
  const {
43
+ getBlockInsertionPoint,
42
44
  getBlockRootClientId,
43
45
  __unstableGetEditorMode,
44
- getSettings
45
- } = select(_blockEditor.store);
46
+ getSectionRootClientId
47
+ } = (0, _lockUnlock.unlock)(select(_blockEditor.store));
46
48
  const {
47
49
  get
48
50
  } = select(_preferences.store);
@@ -51,9 +53,7 @@ function InserterSidebar() {
51
53
  } = select(_interface.store);
52
54
  const getBlockSectionRootClientId = () => {
53
55
  if (__unstableGetEditorMode() === 'zoom-out') {
54
- const {
55
- sectionRootClientId
56
- } = (0, _lockUnlock.unlock)(getSettings());
56
+ const sectionRootClientId = getSectionRootClientId();
57
57
  if (sectionRootClientId) {
58
58
  return sectionRootClientId;
59
59
  }
@@ -61,6 +61,7 @@ function InserterSidebar() {
61
61
  return getBlockRootClientId();
62
62
  };
63
63
  return {
64
+ blockInsertionPoint: getBlockInsertionPoint(),
64
65
  inserterSidebarToggleRef: getInserterSidebarToggleRef(),
65
66
  insertionPoint: getInsertionPoint(),
66
67
  showMostUsedBlocks: get('core', 'mostUsedBlocks'),
@@ -94,8 +95,8 @@ function InserterSidebar() {
94
95
  showMostUsedBlocks: showMostUsedBlocks,
95
96
  showInserterHelpPanel: true,
96
97
  shouldFocusBlock: isMobileViewport,
97
- rootClientId: blockSectionRootClientId !== null && blockSectionRootClientId !== void 0 ? blockSectionRootClientId : insertionPoint.rootClientId,
98
- __experimentalInsertionIndex: insertionPoint.insertionIndex,
98
+ rootClientId: blockSectionRootClientId !== null && blockSectionRootClientId !== void 0 ? blockSectionRootClientId : blockInsertionPoint.rootClientId,
99
+ __experimentalInsertionIndex: blockInsertionPoint.index,
99
100
  onSelect: insertionPoint.onSelect,
100
101
  __experimentalInitialTab: insertionPoint.tab,
101
102
  __experimentalInitialCategory: insertionPoint.category,
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blockEditor","_compose","_element","_preferences","_keycodes","_interface","_lockUnlock","_store","_jsxRuntime","PrivateInserterLibrary","unlock","blockEditorPrivateApis","InserterSidebar","blockSectionRootClientId","inserterSidebarToggleRef","insertionPoint","showMostUsedBlocks","sidebarIsOpened","useSelect","select","getInserterSidebarToggleRef","getInsertionPoint","isPublishSidebarOpened","editorStore","getBlockRootClientId","__unstableGetEditorMode","getSettings","blockEditorStore","get","preferencesStore","getActiveComplementaryArea","interfaceStore","getBlockSectionRootClientId","sectionRootClientId","setIsInserterOpened","useDispatch","disableComplementaryArea","isMobileViewport","useViewportMatch","libraryRef","useRef","closeInserterSidebar","useCallback","current","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","inserterContents","jsx","className","children","showInserterHelpPanel","shouldFocusBlock","rootClientId","__experimentalInsertionIndex","insertionIndex","onSelect","__experimentalInitialTab","tab","__experimentalInitialCategory","category","__experimentalFilterValue","filterValue","onPatternCategorySelection","undefined","ref","onClose","onKeyDown"],"sources":["@wordpress/editor/src/components/inserter-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { PrivateInserterLibrary } = unlock( blockEditorPrivateApis );\n\nexport default function InserterSidebar() {\n\tconst {\n\t\tblockSectionRootClientId,\n\t\tinserterSidebarToggleRef,\n\t\tinsertionPoint,\n\t\tshowMostUsedBlocks,\n\t\tsidebarIsOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetInsertionPoint,\n\t\t\tisPublishSidebarOpened,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getBlockRootClientId, __unstableGetEditorMode, getSettings } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst getBlockSectionRootClientId = () => {\n\t\t\tif ( __unstableGetEditorMode() === 'zoom-out' ) {\n\t\t\t\tconst { sectionRootClientId } = unlock( getSettings() );\n\t\t\t\tif ( sectionRootClientId ) {\n\t\t\t\t\treturn sectionRootClientId;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn getBlockRootClientId();\n\t\t};\n\t\treturn {\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tinsertionPoint: getInsertionPoint(),\n\t\t\tshowMostUsedBlocks: get( 'core', 'mostUsedBlocks' ),\n\t\t\tblockSectionRootClientId: getBlockSectionRootClientId(),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tgetActiveComplementaryArea( 'core' ) || isPublishSidebarOpened()\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst { disableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst libraryRef = useRef();\n\n\t// When closing the inserter, focus should return to the toggle button.\n\tconst closeInserterSidebar = useCallback( () => {\n\t\tsetIsInserterOpened( false );\n\t\tinserterSidebarToggleRef.current?.focus();\n\t}, [ inserterSidebarToggleRef, setIsInserterOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseInserterSidebar();\n\t\t\t}\n\t\t},\n\t\t[ closeInserterSidebar ]\n\t);\n\n\tconst inserterContents = (\n\t\t<div className=\"editor-inserter-sidebar__content\">\n\t\t\t<PrivateInserterLibrary\n\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\tshowInserterHelpPanel\n\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\trootClientId={\n\t\t\t\t\tblockSectionRootClientId ?? insertionPoint.rootClientId\n\t\t\t\t}\n\t\t\t\t__experimentalInsertionIndex={ insertionPoint.insertionIndex }\n\t\t\t\tonSelect={ insertionPoint.onSelect }\n\t\t\t\t__experimentalInitialTab={ insertionPoint.tab }\n\t\t\t\t__experimentalInitialCategory={ insertionPoint.category }\n\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\tonPatternCategorySelection={\n\t\t\t\t\tsidebarIsOpened\n\t\t\t\t\t\t? () => disableComplementaryArea( 'core' )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tref={ libraryRef }\n\t\t\t\tonClose={ closeInserterSidebar }\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div onKeyDown={ closeOnEscape } className=\"editor-inserter-sidebar\">\n\t\t\t{ inserterContents }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAlBnD;AACA;AACA;;AAYA;AACA;AACA;;AAIA,MAAM;EAAEU;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEpD,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IACLC,wBAAwB;IACxBC,wBAAwB;IACxBC,cAAc;IACdC,kBAAkB;IAClBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MACLC,2BAA2B;MAC3BC,iBAAiB;MACjBC;IACD,CAAC,GAAG,IAAAZ,kBAAM,EAAES,MAAM,CAAEI,YAAY,CAAE,CAAC;IACnC,MAAM;MAAEC,oBAAoB;MAAEC,uBAAuB;MAAEC;IAAY,CAAC,GACnEP,MAAM,CAAEQ,kBAAiB,CAAC;IAC3B,MAAM;MAAEC;IAAI,CAAC,GAAGT,MAAM,CAAEU,kBAAiB,CAAC;IAC1C,MAAM;MAAEC;IAA2B,CAAC,GAAGX,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AAKC,gBAAM,IAAI,CAAEF,KAAK,CAACG,gBAAgB,EAAG;MAC3DH,KAAK,CAACI,cAAc,CAAC,CAAC;MACtBT,oBAAoB,CAAC,CAAC;IACvB;EACD,CAAC,EACD,CAAEA,oBAAoB,CACvB,CAAC;EAED,MAAMU,gBAAgB,gBACrB,IAAA3C,WAAA,CAAA4C,GAAA;IAAKC,SAAS,EAAC,kCAAkC;IAAAC,QAAA,eAChD,IAAA9C,WAAA,CAAA4C,GAAA,EAAC3C,sBAAsB;MACtBO,kBAAkB,EAAGA,kBAAoB;MACzCuC,qBAAqB;MACrBC,gBAAgB,EAAGnB,gBAAkB;MACrCoB,YAAY,EACX5C,wBAAwB,aAAxBA,wBAAwB,cAAxBA,wBAAwB,GAAIE,cAAc,CAAC0C,YAC3C;MACDC,4BAA4B,EAAG3C,cAAc,CAAC4C,cAAgB;MAC9DC,QAAQ,EAAG7C,cAAc,CAAC6C,QAAU;MACpCC,wBAAwB,EAAG9C,cAAc,CAAC+C,GAAK;MAC/CC,6BAA6B,EAAGhD,cAAc,CAACiD,QAAU;MACzDC,yBAAyB,EAAGlD,cAAc,CAACmD,WAAa;MACxDC,0BAA0B,EACzBlD,eAAe,GACZ,MAAMmB,wBAAwB,CAAE,MAAO,CAAC,GACxCgC,SACH;MACDC,GAAG,EAAG9B,UAAY;MAClB+B,OAAO,EAAG7B;IAAsB,CAChC;EAAC,CACE,CACL;EAED;IAAA;IACC;IACA,IAAAjC,WAAA,CAAA4C,GAAA;MAAKmB,SAAS,EAAG1B,aAAe;MAACQ,SAAS,EAAC,yBAAyB;MAAAC,QAAA,EACjEH;IAAgB,CACd;EAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_blockEditor","_compose","_element","_preferences","_keycodes","_interface","_lockUnlock","_store","_jsxRuntime","PrivateInserterLibrary","unlock","blockEditorPrivateApis","InserterSidebar","blockInsertionPoint","blockSectionRootClientId","inserterSidebarToggleRef","insertionPoint","showMostUsedBlocks","sidebarIsOpened","useSelect","select","getInserterSidebarToggleRef","getInsertionPoint","isPublishSidebarOpened","editorStore","getBlockInsertionPoint","getBlockRootClientId","__unstableGetEditorMode","getSectionRootClientId","blockEditorStore","get","preferencesStore","getActiveComplementaryArea","interfaceStore","getBlockSectionRootClientId","sectionRootClientId","setIsInserterOpened","useDispatch","disableComplementaryArea","isMobileViewport","useViewportMatch","libraryRef","useRef","closeInserterSidebar","useCallback","current","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","inserterContents","jsx","className","children","showInserterHelpPanel","shouldFocusBlock","rootClientId","__experimentalInsertionIndex","index","onSelect","__experimentalInitialTab","tab","__experimentalInitialCategory","category","__experimentalFilterValue","filterValue","onPatternCategorySelection","undefined","ref","onClose","onKeyDown"],"sources":["@wordpress/editor/src/components/inserter-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { PrivateInserterLibrary } = unlock( blockEditorPrivateApis );\n\nexport default function InserterSidebar() {\n\tconst {\n\t\tblockInsertionPoint,\n\t\tblockSectionRootClientId,\n\t\tinserterSidebarToggleRef,\n\t\tinsertionPoint,\n\t\tshowMostUsedBlocks,\n\t\tsidebarIsOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetInsertionPoint,\n\t\t\tisPublishSidebarOpened,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst {\n\t\t\tgetBlockInsertionPoint,\n\t\t\tgetBlockRootClientId,\n\t\t\t__unstableGetEditorMode,\n\t\t\tgetSectionRootClientId,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst getBlockSectionRootClientId = () => {\n\t\t\tif ( __unstableGetEditorMode() === 'zoom-out' ) {\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\tif ( sectionRootClientId ) {\n\t\t\t\t\treturn sectionRootClientId;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn getBlockRootClientId();\n\t\t};\n\t\treturn {\n\t\t\tblockInsertionPoint: getBlockInsertionPoint(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tinsertionPoint: getInsertionPoint(),\n\t\t\tshowMostUsedBlocks: get( 'core', 'mostUsedBlocks' ),\n\t\t\tblockSectionRootClientId: getBlockSectionRootClientId(),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tgetActiveComplementaryArea( 'core' ) || isPublishSidebarOpened()\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst { disableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst libraryRef = useRef();\n\n\t// When closing the inserter, focus should return to the toggle button.\n\tconst closeInserterSidebar = useCallback( () => {\n\t\tsetIsInserterOpened( false );\n\t\tinserterSidebarToggleRef.current?.focus();\n\t}, [ inserterSidebarToggleRef, setIsInserterOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseInserterSidebar();\n\t\t\t}\n\t\t},\n\t\t[ closeInserterSidebar ]\n\t);\n\n\tconst inserterContents = (\n\t\t<div className=\"editor-inserter-sidebar__content\">\n\t\t\t<PrivateInserterLibrary\n\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\tshowInserterHelpPanel\n\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\trootClientId={\n\t\t\t\t\tblockSectionRootClientId ?? blockInsertionPoint.rootClientId\n\t\t\t\t}\n\t\t\t\t__experimentalInsertionIndex={ blockInsertionPoint.index }\n\t\t\t\tonSelect={ insertionPoint.onSelect }\n\t\t\t\t__experimentalInitialTab={ insertionPoint.tab }\n\t\t\t\t__experimentalInitialCategory={ insertionPoint.category }\n\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\tonPatternCategorySelection={\n\t\t\t\t\tsidebarIsOpened\n\t\t\t\t\t\t? () => disableComplementaryArea( 'core' )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tref={ libraryRef }\n\t\t\t\tonClose={ closeInserterSidebar }\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div onKeyDown={ closeOnEscape } className=\"editor-inserter-sidebar\">\n\t\t\t{ inserterContents }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAlBnD;AACA;AACA;;AAYA;AACA;AACA;;AAIA,MAAM;EAAEU;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEpD,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IACLC,mBAAmB;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e,GACZ,MAAMoB,wBAAwB,CAAE,MAAO,CAAC,GACxCgC,SACH;MACDC,GAAG,EAAG9B,UAAY;MAClB+B,OAAO,EAAG7B;IAAsB,CAChC;EAAC,CACE,CACL;EAED;IAAA;IACC;IACA,IAAAnC,WAAA,CAAA8C,GAAA;MAAKmB,SAAS,EAAG1B,aAAe;MAACQ,SAAS,EAAC,yBAAyB;MAAAC,QAAA,EACjEH;IAAgB,CACd;EAAC;AAER","ignoreList":[]}
@@ -145,14 +145,14 @@ function useAutosavePurge() {
145
145
  isAutosaving: select(_store.store).isAutosavingPost(),
146
146
  didError: select(_store.store).didPostSaveRequestFail()
147
147
  }), []);
148
- const lastIsDirty = (0, _element.useRef)(isDirty);
149
- const lastIsAutosaving = (0, _element.useRef)(isAutosaving);
148
+ const lastIsDirtyRef = (0, _element.useRef)(isDirty);
149
+ const lastIsAutosavingRef = (0, _element.useRef)(isAutosaving);
150
150
  (0, _element.useEffect)(() => {
151
- if (!didError && (lastIsAutosaving.current && !isAutosaving || lastIsDirty.current && !isDirty)) {
151
+ if (!didError && (lastIsAutosavingRef.current && !isAutosaving || lastIsDirtyRef.current && !isDirty)) {
152
152
  (0, _localAutosave.localAutosaveClear)(postId, isEditedPostNew);
153
153
  }
154
- lastIsDirty.current = isDirty;
155
- lastIsAutosaving.current = isAutosaving;
154
+ lastIsDirtyRef.current = isDirty;
155
+ lastIsAutosavingRef.current = isAutosaving;
156
156
  }, [isDirty, isAutosaving, didError]);
157
157
 
158
158
  // Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave.
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","_data","_i18n","_blocks","_notices","_autosaveMonitor","_interopRequireDefault","_localAutosave","_store","_jsxRuntime","requestIdleCallback","window","requestAnimationFrame","hasStorageSupport","hasSessionStorageSupport","undefined","sessionStorage","setItem","removeItem","useAutosaveNotice","postId","isEditedPostNew","hasRemoteAutosave","useSelect","select","editorStore","getCurrentPostId","getEditorSettings","autosave","getEditedPostAttribute","createWarningNotice","removeNotice","useDispatch","noticesStore","editPost","resetEditorBlocks","useEffect","localAutosave","localAutosaveGet","JSON","parse","post_title","title","content","excerpt","edits","hasDifference","Object","keys","some","key","localAutosaveClear","id","__","actions","label","onClick","editsContent","editsWithoutContent","useAutosavePurge","isDirty","isAutosaving","didError","isEditedPostDirty","isAutosavingPost","didPostSaveRequestFail","lastIsDirty","useRef","lastIsAutosaving","current","wasEditedPostNew","usePrevious","prevPostId","LocalAutosaveMonitor","deferredAutosave","useCallback","local","localAutosaveInterval","jsx","default","interval","_default","exports","ifCondition"],"sources":["@wordpress/editor/src/components/local-autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { ifCondition, usePrevious } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport AutosaveMonitor from '../autosave-monitor';\nimport {\n\tlocalAutosaveGet,\n\tlocalAutosaveClear,\n} from '../../store/local-autosave';\nimport { store as editorStore } from '../../store';\n\nconst requestIdleCallback = window.requestIdleCallback\n\t? window.requestIdleCallback\n\t: window.requestAnimationFrame;\n\nlet hasStorageSupport;\n\n/**\n * Function which returns true if the current environment supports browser\n * sessionStorage, or false otherwise. The result of this function is cached and\n * reused in subsequent invocations.\n */\nconst hasSessionStorageSupport = () => {\n\tif ( hasStorageSupport !== undefined ) {\n\t\treturn hasStorageSupport;\n\t}\n\n\ttry {\n\t\t// Private Browsing in Safari 10 and earlier will throw an error when\n\t\t// attempting to set into sessionStorage. The test here is intentional in\n\t\t// causing a thrown error as condition bailing from local autosave.\n\t\twindow.sessionStorage.setItem( '__wpEditorTestSessionStorage', '' );\n\t\twindow.sessionStorage.removeItem( '__wpEditorTestSessionStorage' );\n\t\thasStorageSupport = true;\n\t} catch {\n\t\thasStorageSupport = false;\n\t}\n\n\treturn hasStorageSupport;\n};\n\n/**\n * Custom hook which manages the creation of a notice prompting the user to\n * restore a local autosave, if one exists.\n */\nfunction useAutosaveNotice() {\n\tconst { postId, isEditedPostNew, hasRemoteAutosave } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\thasRemoteAutosave:\n\t\t\t\t!! select( editorStore ).getEditorSettings().autosave,\n\t\t} ),\n\t\t[]\n\t);\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticesStore );\n\tconst { editPost, resetEditorBlocks } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tlet localAutosave = localAutosaveGet( postId, isEditedPostNew );\n\t\tif ( ! localAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tlocalAutosave = JSON.parse( localAutosave );\n\t\t} catch {\n\t\t\t// Not usable if it can't be parsed.\n\t\t\treturn;\n\t\t}\n\n\t\tconst { post_title: title, content, excerpt } = localAutosave;\n\t\tconst edits = { title, content, excerpt };\n\n\t\t{\n\t\t\t// Only display a notice if there is a difference between what has been\n\t\t\t// saved and that which is stored in sessionStorage.\n\t\t\tconst hasDifference = Object.keys( edits ).some( ( key ) => {\n\t\t\t\treturn edits[ key ] !== getEditedPostAttribute( key );\n\t\t\t} );\n\n\t\t\tif ( ! hasDifference ) {\n\t\t\t\t// If there is no difference, it can be safely ejected from storage.\n\t\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( hasRemoteAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst id = 'wpEditorAutosaveRestore';\n\n\t\tcreateWarningNotice(\n\t\t\t__(\n\t\t\t\t'The backup of this post in your browser is different from the version below.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Restore the backup' ),\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tcontent: editsContent,\n\t\t\t\t\t\t\t\t...editsWithoutContent\n\t\t\t\t\t\t\t} = edits;\n\t\t\t\t\t\t\teditPost( editsWithoutContent );\n\t\t\t\t\t\t\tresetEditorBlocks( parse( edits.content ) );\n\t\t\t\t\t\t\tremoveNotice( id );\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\t);\n\t}, [ isEditedPostNew, postId ] );\n}\n\n/**\n * Custom hook which ejects a local autosave after a successful save occurs.\n */\nfunction useAutosavePurge() {\n\tconst { postId, isEditedPostNew, isDirty, isAutosaving, didError } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\t\tisDirty: select( editorStore ).isEditedPostDirty(),\n\t\t\t\tisAutosaving: select( editorStore ).isAutosavingPost(),\n\t\t\t\tdidError: select( editorStore ).didPostSaveRequestFail(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\tconst lastIsDirty = useRef( isDirty );\n\tconst lastIsAutosaving = useRef( isAutosaving );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! didError &&\n\t\t\t( ( lastIsAutosaving.current && ! isAutosaving ) ||\n\t\t\t\t( lastIsDirty.current && ! isDirty ) )\n\t\t) {\n\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t}\n\n\t\tlastIsDirty.current = isDirty;\n\t\tlastIsAutosaving.current = isAutosaving;\n\t}, [ isDirty, isAutosaving, didError ] );\n\n\t// Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave.\n\tconst wasEditedPostNew = usePrevious( isEditedPostNew );\n\tconst prevPostId = usePrevious( postId );\n\tuseEffect( () => {\n\t\tif ( prevPostId === postId && wasEditedPostNew && ! isEditedPostNew ) {\n\t\t\tlocalAutosaveClear( postId, true );\n\t\t}\n\t}, [ isEditedPostNew, postId ] );\n}\n\nfunction LocalAutosaveMonitor() {\n\tconst { autosave } = useDispatch( editorStore );\n\tconst deferredAutosave = useCallback( () => {\n\t\trequestIdleCallback( () => autosave( { local: true } ) );\n\t}, [] );\n\tuseAutosaveNotice();\n\tuseAutosavePurge();\n\n\tconst localAutosaveInterval = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().localAutosaveInterval,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<AutosaveMonitor\n\t\t\tinterval={ localAutosaveInterval }\n\t\t\tautosave={ deferredAutosave }\n\t\t/>\n\t);\n}\n\n/**\n * Monitors local autosaves of a post in the editor.\n * It uses several hooks and functions to manage autosave behavior:\n * - `useAutosaveNotice` hook: Manages the creation of a notice prompting the user to restore a local autosave, if one exists.\n * - `useAutosavePurge` hook: Ejects a local autosave after a successful save occurs.\n * - `hasSessionStorageSupport` function: Checks if the current environment supports browser sessionStorage.\n * - `LocalAutosaveMonitor` component: Uses the `AutosaveMonitor` component to perform autosaves at a specified interval.\n *\n * The module also checks for sessionStorage support and conditionally exports the `LocalAutosaveMonitor` component based on that.\n *\n * @module LocalAutosaveMonitor\n */\nexport default ifCondition( hasSessionStorageSupport )( LocalAutosaveMonitor );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAIA,IAAAS,MAAA,GAAAT,OAAA;AAAmD,IAAAU,WAAA,GAAAV,OAA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D,UAAU,GAAG,IAAAD,oBAAW,EAAEnD,MAAO,CAAC;EACxC,IAAAgB,kBAAS,EAAE,MAAM;IAChB,IAAKoC,UAAU,KAAKpD,MAAM,IAAIkD,gBAAgB,IAAI,CAAEjD,eAAe,EAAG;MACrE,IAAA8B,iCAAkB,EAAE/B,MAAM,EAAE,IAAK,CAAC;IACnC;EACD,CAAC,EAAE,CAAEC,eAAe,EAAED,MAAM,CAAG,CAAC;AACjC;AAEA,SAASqD,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAE7C;EAAS,CAAC,GAAG,IAAAI,iBAAW,EAAEP,YAAY,CAAC;EAC/C,MAAMiD,gBAAgB,GAAG,IAAAC,oBAAW,EAAE,MAAM;IAC3CjE,mBAAmB,CAAE,MAAMkB,QAAQ,CAAE;MAAEgD,KAAK,EAAE;IAAK,CAAE,CAAE,CAAC;EACzD,CAAC,EAAE,EAAG,CAAC;EACPzD,iBAAiB,CAAC,CAAC;EACnBwC,gBAAgB,CAAC,CAAC;EAElB,MAAMkB,qBAAqB,GAAG,IAAAtD,eAAS,EACpCC,MAAM,IACPA,MAAM,CAAEC,YAAY,CAAC,CAACE,iBAAiB,CAAC,CAAC,CAACkD,qBAAqB,EAChE,EACD,CAAC;EAED,oBACC,IAAApE,WAAA,CAAAqE,GAAA,EAACzE,gBAAA,CAAA0E,OAAe;IACfC,QAAQ,EAAGH,qBAAuB;IAClCjD,QAAQ,EAAG8C;EAAkB,CAC7B,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,IAAAO,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAYe,IAAAI,oBAAW,EAAErE,wBAAyB,CAAC,CAAE2D,oBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","_data","_i18n","_blocks","_notices","_autosaveMonitor","_interopRequireDefault","_localAutosave","_store","_jsxRuntime","requestIdleCallback","window","requestAnimationFrame","hasStorageSupport","hasSessionStorageSupport","undefined","sessionStorage","setItem","removeItem","useAutosaveNotice","postId","isEditedPostNew","hasRemoteAutosave","useSelect","select","editorStore","getCurrentPostId","getEditorSettings","autosave","getEditedPostAttribute","createWarningNotice","removeNotice","useDispatch","noticesStore","editPost","resetEditorBlocks","useEffect","localAutosave","localAutosaveGet","JSON","parse","post_title","title","content","excerpt","edits","hasDifference","Object","keys","some","key","localAutosaveClear","id","__","actions","label","onClick","editsContent","editsWithoutContent","useAutosavePurge","isDirty","isAutosaving","didError","isEditedPostDirty","isAutosavingPost","didPostSaveRequestFail","lastIsDirtyRef","useRef","lastIsAutosavingRef","current","wasEditedPostNew","usePrevious","prevPostId","LocalAutosaveMonitor","deferredAutosave","useCallback","local","localAutosaveInterval","jsx","default","interval","_default","exports","ifCondition"],"sources":["@wordpress/editor/src/components/local-autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { ifCondition, usePrevious } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport AutosaveMonitor from '../autosave-monitor';\nimport {\n\tlocalAutosaveGet,\n\tlocalAutosaveClear,\n} from '../../store/local-autosave';\nimport { store as editorStore } from '../../store';\n\nconst requestIdleCallback = window.requestIdleCallback\n\t? window.requestIdleCallback\n\t: window.requestAnimationFrame;\n\nlet hasStorageSupport;\n\n/**\n * Function which returns true if the current environment supports browser\n * sessionStorage, or false otherwise. The result of this function is cached and\n * reused in subsequent invocations.\n */\nconst hasSessionStorageSupport = () => {\n\tif ( hasStorageSupport !== undefined ) {\n\t\treturn hasStorageSupport;\n\t}\n\n\ttry {\n\t\t// Private Browsing in Safari 10 and earlier will throw an error when\n\t\t// attempting to set into sessionStorage. The test here is intentional in\n\t\t// causing a thrown error as condition bailing from local autosave.\n\t\twindow.sessionStorage.setItem( '__wpEditorTestSessionStorage', '' );\n\t\twindow.sessionStorage.removeItem( '__wpEditorTestSessionStorage' );\n\t\thasStorageSupport = true;\n\t} catch {\n\t\thasStorageSupport = false;\n\t}\n\n\treturn hasStorageSupport;\n};\n\n/**\n * Custom hook which manages the creation of a notice prompting the user to\n * restore a local autosave, if one exists.\n */\nfunction useAutosaveNotice() {\n\tconst { postId, isEditedPostNew, hasRemoteAutosave } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\thasRemoteAutosave:\n\t\t\t\t!! select( editorStore ).getEditorSettings().autosave,\n\t\t} ),\n\t\t[]\n\t);\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticesStore );\n\tconst { editPost, resetEditorBlocks } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tlet localAutosave = localAutosaveGet( postId, isEditedPostNew );\n\t\tif ( ! localAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tlocalAutosave = JSON.parse( localAutosave );\n\t\t} catch {\n\t\t\t// Not usable if it can't be parsed.\n\t\t\treturn;\n\t\t}\n\n\t\tconst { post_title: title, content, excerpt } = localAutosave;\n\t\tconst edits = { title, content, excerpt };\n\n\t\t{\n\t\t\t// Only display a notice if there is a difference between what has been\n\t\t\t// saved and that which is stored in sessionStorage.\n\t\t\tconst hasDifference = Object.keys( edits ).some( ( key ) => {\n\t\t\t\treturn edits[ key ] !== getEditedPostAttribute( key );\n\t\t\t} );\n\n\t\t\tif ( ! hasDifference ) {\n\t\t\t\t// If there is no difference, it can be safely ejected from storage.\n\t\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( hasRemoteAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst id = 'wpEditorAutosaveRestore';\n\n\t\tcreateWarningNotice(\n\t\t\t__(\n\t\t\t\t'The backup of this post in your browser is different from the version below.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Restore the backup' ),\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tcontent: editsContent,\n\t\t\t\t\t\t\t\t...editsWithoutContent\n\t\t\t\t\t\t\t} = edits;\n\t\t\t\t\t\t\teditPost( editsWithoutContent );\n\t\t\t\t\t\t\tresetEditorBlocks( parse( edits.content ) );\n\t\t\t\t\t\t\tremoveNotice( id );\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\t);\n\t}, [ isEditedPostNew, postId ] );\n}\n\n/**\n * Custom hook which ejects a local autosave after a successful save occurs.\n */\nfunction useAutosavePurge() {\n\tconst { postId, isEditedPostNew, isDirty, isAutosaving, didError } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\t\tisDirty: select( editorStore ).isEditedPostDirty(),\n\t\t\t\tisAutosaving: select( editorStore ).isAutosavingPost(),\n\t\t\t\tdidError: select( editorStore ).didPostSaveRequestFail(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\tconst lastIsDirtyRef = useRef( isDirty );\n\tconst lastIsAutosavingRef = useRef( isAutosaving );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! didError &&\n\t\t\t( ( lastIsAutosavingRef.current && ! isAutosaving ) ||\n\t\t\t\t( lastIsDirtyRef.current && ! isDirty ) )\n\t\t) {\n\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t}\n\n\t\tlastIsDirtyRef.current = isDirty;\n\t\tlastIsAutosavingRef.current = isAutosaving;\n\t}, [ isDirty, isAutosaving, didError ] );\n\n\t// Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave.\n\tconst wasEditedPostNew = usePrevious( isEditedPostNew );\n\tconst prevPostId = usePrevious( postId );\n\tuseEffect( () => {\n\t\tif ( prevPostId === postId && wasEditedPostNew && ! isEditedPostNew ) {\n\t\t\tlocalAutosaveClear( postId, true );\n\t\t}\n\t}, [ isEditedPostNew, postId ] );\n}\n\nfunction LocalAutosaveMonitor() {\n\tconst { autosave } = useDispatch( editorStore );\n\tconst deferredAutosave = useCallback( () => {\n\t\trequestIdleCallback( () => autosave( { local: true } ) );\n\t}, [] );\n\tuseAutosaveNotice();\n\tuseAutosavePurge();\n\n\tconst localAutosaveInterval = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().localAutosaveInterval,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<AutosaveMonitor\n\t\t\tinterval={ localAutosaveInterval }\n\t\t\tautosave={ deferredAutosave }\n\t\t/>\n\t);\n}\n\n/**\n * Monitors local autosaves of a post in the editor.\n * It uses several hooks and functions to manage autosave behavior:\n * - `useAutosaveNotice` hook: Manages the creation of a notice prompting the user to restore a local autosave, if one exists.\n * - `useAutosavePurge` hook: Ejects a local autosave after a successful save occurs.\n * - `hasSessionStorageSupport` function: Checks if the current environment supports browser sessionStorage.\n * - `LocalAutosaveMonitor` component: Uses the `AutosaveMonitor` component to perform autosaves at a specified interval.\n *\n * The module also checks for sessionStorage support and conditionally exports the `LocalAutosaveMonitor` component based on that.\n *\n * @module LocalAutosaveMonitor\n */\nexport default ifCondition( hasSessionStorageSupport )( LocalAutosaveMonitor );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA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C","ignoreList":[]}
@@ -208,7 +208,10 @@ function PostParentToggle({
208
208
  });
209
209
  }
210
210
  function ParentRow() {
211
- const homeUrl = (0, _data.useSelect)(select => select(_coreData.store).getUnstableBase()?.home, []);
211
+ const homeUrl = (0, _data.useSelect)(select => {
212
+ // Site index.
213
+ return select(_coreData.store).getEntityRecord('root', '__unstableBase')?.home;
214
+ }, []);
212
215
  // Use internal state instead of a ref to make sure that the component
213
216
  // re-renders when the popover's anchor updates.
214
217
  const [popoverAnchor, setPopoverAnchor] = (0, _element.useState)(null);
@@ -247,11 +250,12 @@ function ParentRow() {
247
250
  children: [(0, _element.createInterpolateElement)((0, _i18n.sprintf)( /* translators: %1$s The home URL of the WordPress installation without the scheme. */
248
251
  (0, _i18n.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'), (0, _url.filterURLForDisplay)(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
249
252
  wbr: /*#__PURE__*/(0, _jsxRuntime.jsx)("wbr", {})
250
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
251
- children: [(0, _i18n.__)('They also show up as sub-items in the default navigation menu. '), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ExternalLink, {
252
- href: (0, _i18n.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'),
253
- children: (0, _i18n.__)('Learn more')
254
- })]
253
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
254
+ children: (0, _element.createInterpolateElement)((0, _i18n.__)('They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'), {
255
+ a: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ExternalLink, {
256
+ href: (0, _i18n.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes')
257
+ })
258
+ })
255
259
  })]
256
260
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(PageAttributesParent, {})]
257
261
  })