@wordpress/editor 14.17.1 → 14.19.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 (410) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +2 -0
  3. package/build/bindings/pattern-overrides.js +0 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +0 -1
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/user.js +0 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/block-removal-warnings/index.js +0 -1
  10. package/build/components/block-removal-warnings/index.js.map +1 -1
  11. package/build/components/block-settings-menu/content-only-settings-menu.js +0 -1
  12. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  13. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
  14. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  15. package/build/components/collab-sidebar/comments.js +0 -1
  16. package/build/components/collab-sidebar/comments.js.map +1 -1
  17. package/build/components/collab-sidebar/index.js +0 -1
  18. package/build/components/collab-sidebar/index.js.map +1 -1
  19. package/build/components/collab-sidebar/utils.js +0 -1
  20. package/build/components/collab-sidebar/utils.js.map +1 -1
  21. package/build/components/deprecated.js +0 -1
  22. package/build/components/deprecated.js.map +1 -1
  23. package/build/components/document-outline/index.js +16 -17
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/editor/index.js +9 -5
  26. package/build/components/editor/index.js.map +1 -1
  27. package/build/components/editor-help/index.native.js +0 -1
  28. package/build/components/editor-help/index.native.js.map +1 -1
  29. package/build/components/editor-notices/index.js +0 -1
  30. package/build/components/editor-notices/index.js.map +1 -1
  31. package/build/components/editor-snackbars/index.js +0 -1
  32. package/build/components/editor-snackbars/index.js.map +1 -1
  33. package/build/components/entities-saved-states/entity-record-item.js +2 -1
  34. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  35. package/build/components/entities-saved-states/entity-type-list.js +2 -2
  36. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  37. package/build/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
  38. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  39. package/build/components/entities-saved-states/index.js +66 -43
  40. package/build/components/entities-saved-states/index.js.map +1 -1
  41. package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
  42. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  43. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
  44. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  45. package/build/components/list-view-sidebar/index.js +0 -1
  46. package/build/components/list-view-sidebar/index.js.map +1 -1
  47. package/build/components/local-autosave-monitor/index.js +0 -1
  48. package/build/components/local-autosave-monitor/index.js.map +1 -1
  49. package/build/components/mode-switcher/index.js +0 -1
  50. package/build/components/mode-switcher/index.js.map +1 -1
  51. package/build/components/page-attributes/parent.js +8 -5
  52. package/build/components/page-attributes/parent.js.map +1 -1
  53. package/build/components/post-actions/actions.js +0 -1
  54. package/build/components/post-actions/actions.js.map +1 -1
  55. package/build/components/post-actions/index.js +19 -29
  56. package/build/components/post-actions/index.js.map +1 -1
  57. package/build/components/post-author/check.js +3 -4
  58. package/build/components/post-author/check.js.map +1 -1
  59. package/build/components/post-author/combobox.js +4 -2
  60. package/build/components/post-author/combobox.js.map +1 -1
  61. package/build/components/post-author/hook.js +8 -5
  62. package/build/components/post-author/hook.js.map +1 -1
  63. package/build/components/post-card-panel/index.js +2 -2
  64. package/build/components/post-card-panel/index.js.map +1 -1
  65. package/build/components/post-featured-image/index.js +4 -2
  66. package/build/components/post-featured-image/index.js.map +1 -1
  67. package/build/components/post-fields/index.js +0 -1
  68. package/build/components/post-fields/index.js.map +1 -1
  69. package/build/components/post-format/index.js +0 -1
  70. package/build/components/post-format/index.js.map +1 -1
  71. package/build/components/post-format/panel.js +0 -1
  72. package/build/components/post-format/panel.js.map +1 -1
  73. package/build/components/post-publish-button/index.js +0 -1
  74. package/build/components/post-publish-button/index.js.map +1 -1
  75. package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
  76. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  77. package/build/components/post-publish-panel/maybe-post-format-panel.js +0 -1
  78. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  79. package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
  80. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  81. package/build/components/post-publish-panel/maybe-upload-media.js +0 -1
  82. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  83. package/build/components/post-publish-panel/media-util.js +0 -1
  84. package/build/components/post-publish-panel/media-util.js.map +1 -1
  85. package/build/components/post-saved-state/index.js +0 -1
  86. package/build/components/post-saved-state/index.js.map +1 -1
  87. package/build/components/post-schedule/index.js +0 -1
  88. package/build/components/post-schedule/index.js.map +1 -1
  89. package/build/components/post-taxonomies/check.js +1 -1
  90. package/build/components/post-taxonomies/check.js.map +1 -1
  91. package/build/components/post-taxonomies/flat-term-selector.js +2 -3
  92. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  93. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -3
  94. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  95. package/build/components/post-taxonomies/index.js +1 -2
  96. package/build/components/post-taxonomies/index.js.map +1 -1
  97. package/build/components/post-taxonomies/most-used-terms.js +0 -1
  98. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  99. package/build/components/post-template/block-theme.js +68 -48
  100. package/build/components/post-template/block-theme.js.map +1 -1
  101. package/build/components/post-template/classic-theme.js +30 -19
  102. package/build/components/post-template/classic-theme.js.map +1 -1
  103. package/build/components/post-template/create-new-template-modal.js +3 -1
  104. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  105. package/build/components/post-template/panel.js +3 -11
  106. package/build/components/post-template/panel.js.map +1 -1
  107. package/build/components/post-template/swap-template-button.js +0 -1
  108. package/build/components/post-template/swap-template-button.js.map +1 -1
  109. package/build/components/post-transform-panel/hooks.js +0 -1
  110. package/build/components/post-transform-panel/hooks.js.map +1 -1
  111. package/build/components/post-type-support-check/index.js +0 -1
  112. package/build/components/post-type-support-check/index.js.map +1 -1
  113. package/build/components/preferences-modal/block-visibility.js +2 -2
  114. package/build/components/preferences-modal/block-visibility.js.map +1 -1
  115. package/build/components/preferences-modal/index.js +1 -2
  116. package/build/components/preferences-modal/index.js.map +1 -1
  117. package/build/components/preview-dropdown/index.js +6 -3
  118. package/build/components/preview-dropdown/index.js.map +1 -1
  119. package/build/components/provider/disable-non-page-content-blocks.js +0 -1
  120. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  121. package/build/components/provider/index.js +19 -19
  122. package/build/components/provider/index.js.map +1 -1
  123. package/build/components/provider/index.native.js +0 -1
  124. package/build/components/provider/index.native.js.map +1 -1
  125. package/build/components/provider/use-block-editor-settings.js +0 -1
  126. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  127. package/build/components/sidebar/header.js +1 -1
  128. package/build/components/sidebar/header.js.map +1 -1
  129. package/build/components/sidebar/index.js +1 -2
  130. package/build/components/sidebar/index.js.map +1 -1
  131. package/build/components/start-page-options/index.js +148 -23
  132. package/build/components/start-page-options/index.js.map +1 -1
  133. package/build/components/start-template-options/index.js +0 -1
  134. package/build/components/start-template-options/index.js.map +1 -1
  135. package/build/components/template-part-content-panel/index.js +0 -1
  136. package/build/components/template-part-content-panel/index.js.map +1 -1
  137. package/build/components/theme-support-check/index.js +0 -1
  138. package/build/components/theme-support-check/index.js.map +1 -1
  139. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
  140. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  141. package/build/components/visual-editor/use-select-nearest-editable-block.js +0 -1
  142. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  143. package/build/dataviews/store/private-actions.js +0 -1
  144. package/build/dataviews/store/private-actions.js.map +1 -1
  145. package/build/dataviews/store/reducer.js +0 -1
  146. package/build/dataviews/store/reducer.js.map +1 -1
  147. package/build/hooks/custom-sources-backwards-compatibility.js +0 -1
  148. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  149. package/build/hooks/pattern-overrides.js +0 -1
  150. package/build/hooks/pattern-overrides.js.map +1 -1
  151. package/build/store/actions.js +0 -1
  152. package/build/store/actions.js.map +1 -1
  153. package/build/store/private-actions.js +29 -3
  154. package/build/store/private-actions.js.map +1 -1
  155. package/build/store/private-selectors.js +44 -1
  156. package/build/store/private-selectors.js.map +1 -1
  157. package/build/store/reducer.js +0 -1
  158. package/build/store/reducer.js.map +1 -1
  159. package/build/store/reducer.native.js +0 -1
  160. package/build/store/reducer.native.js.map +1 -1
  161. package/build/store/selectors.js +0 -1
  162. package/build/store/selectors.js.map +1 -1
  163. package/build/utils/get-template-info.js +0 -1
  164. package/build/utils/get-template-info.js.map +1 -1
  165. package/build/utils/media-upload/index.js +5 -2
  166. package/build/utils/media-upload/index.js.map +1 -1
  167. package/build/utils/terms.js +0 -1
  168. package/build/utils/terms.js.map +1 -1
  169. package/build-module/bindings/pattern-overrides.js +0 -1
  170. package/build-module/bindings/pattern-overrides.js.map +1 -1
  171. package/build-module/bindings/post-meta.js +0 -1
  172. package/build-module/bindings/post-meta.js.map +1 -1
  173. package/build-module/components/autocompleters/user.js +0 -1
  174. package/build-module/components/autocompleters/user.js.map +1 -1
  175. package/build-module/components/block-removal-warnings/index.js +0 -1
  176. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  177. package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -1
  178. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  179. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
  180. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  181. package/build-module/components/collab-sidebar/comments.js +0 -1
  182. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  183. package/build-module/components/collab-sidebar/index.js +0 -1
  184. package/build-module/components/collab-sidebar/index.js.map +1 -1
  185. package/build-module/components/collab-sidebar/utils.js +0 -1
  186. package/build-module/components/collab-sidebar/utils.js.map +1 -1
  187. package/build-module/components/deprecated.js +0 -1
  188. package/build-module/components/deprecated.js.map +1 -1
  189. package/build-module/components/document-outline/index.js +17 -18
  190. package/build-module/components/document-outline/index.js.map +1 -1
  191. package/build-module/components/editor/index.js +9 -5
  192. package/build-module/components/editor/index.js.map +1 -1
  193. package/build-module/components/editor-help/index.native.js +0 -1
  194. package/build-module/components/editor-help/index.native.js.map +1 -1
  195. package/build-module/components/editor-notices/index.js +0 -1
  196. package/build-module/components/editor-notices/index.js.map +1 -1
  197. package/build-module/components/editor-snackbars/index.js +0 -1
  198. package/build-module/components/editor-snackbars/index.js.map +1 -1
  199. package/build-module/components/entities-saved-states/entity-record-item.js +2 -1
  200. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  201. package/build-module/components/entities-saved-states/entity-type-list.js +2 -2
  202. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  203. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
  204. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  205. package/build-module/components/entities-saved-states/index.js +67 -44
  206. package/build-module/components/entities-saved-states/index.js.map +1 -1
  207. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  208. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  209. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
  210. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  211. package/build-module/components/list-view-sidebar/index.js +0 -1
  212. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  213. package/build-module/components/local-autosave-monitor/index.js +0 -1
  214. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  215. package/build-module/components/mode-switcher/index.js +0 -1
  216. package/build-module/components/mode-switcher/index.js.map +1 -1
  217. package/build-module/components/page-attributes/parent.js +8 -5
  218. package/build-module/components/page-attributes/parent.js.map +1 -1
  219. package/build-module/components/post-actions/actions.js +0 -1
  220. package/build-module/components/post-actions/actions.js.map +1 -1
  221. package/build-module/components/post-actions/index.js +19 -29
  222. package/build-module/components/post-actions/index.js.map +1 -1
  223. package/build-module/components/post-author/check.js +3 -4
  224. package/build-module/components/post-author/check.js.map +1 -1
  225. package/build-module/components/post-author/combobox.js +4 -2
  226. package/build-module/components/post-author/combobox.js.map +1 -1
  227. package/build-module/components/post-author/hook.js +8 -5
  228. package/build-module/components/post-author/hook.js.map +1 -1
  229. package/build-module/components/post-card-panel/index.js +2 -2
  230. package/build-module/components/post-card-panel/index.js.map +1 -1
  231. package/build-module/components/post-featured-image/index.js +4 -2
  232. package/build-module/components/post-featured-image/index.js.map +1 -1
  233. package/build-module/components/post-fields/index.js +0 -1
  234. package/build-module/components/post-fields/index.js.map +1 -1
  235. package/build-module/components/post-format/index.js +0 -1
  236. package/build-module/components/post-format/index.js.map +1 -1
  237. package/build-module/components/post-format/panel.js +0 -1
  238. package/build-module/components/post-format/panel.js.map +1 -1
  239. package/build-module/components/post-publish-button/index.js +0 -1
  240. package/build-module/components/post-publish-button/index.js.map +1 -1
  241. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
  242. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  243. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +0 -1
  244. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  245. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
  246. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  247. package/build-module/components/post-publish-panel/maybe-upload-media.js +0 -1
  248. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  249. package/build-module/components/post-publish-panel/media-util.js +0 -1
  250. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  251. package/build-module/components/post-saved-state/index.js +0 -1
  252. package/build-module/components/post-saved-state/index.js.map +1 -1
  253. package/build-module/components/post-schedule/index.js +0 -1
  254. package/build-module/components/post-schedule/index.js.map +1 -1
  255. package/build-module/components/post-taxonomies/check.js +1 -1
  256. package/build-module/components/post-taxonomies/check.js.map +1 -1
  257. package/build-module/components/post-taxonomies/flat-term-selector.js +2 -3
  258. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  259. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -3
  260. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  261. package/build-module/components/post-taxonomies/index.js +1 -2
  262. package/build-module/components/post-taxonomies/index.js.map +1 -1
  263. package/build-module/components/post-taxonomies/most-used-terms.js +0 -1
  264. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  265. package/build-module/components/post-template/block-theme.js +68 -48
  266. package/build-module/components/post-template/block-theme.js.map +1 -1
  267. package/build-module/components/post-template/classic-theme.js +30 -19
  268. package/build-module/components/post-template/classic-theme.js.map +1 -1
  269. package/build-module/components/post-template/create-new-template-modal.js +3 -1
  270. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  271. package/build-module/components/post-template/panel.js +3 -11
  272. package/build-module/components/post-template/panel.js.map +1 -1
  273. package/build-module/components/post-template/swap-template-button.js +0 -1
  274. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  275. package/build-module/components/post-transform-panel/hooks.js +0 -1
  276. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  277. package/build-module/components/post-type-support-check/index.js +0 -1
  278. package/build-module/components/post-type-support-check/index.js.map +1 -1
  279. package/build-module/components/preferences-modal/block-visibility.js +2 -2
  280. package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
  281. package/build-module/components/preferences-modal/index.js +1 -2
  282. package/build-module/components/preferences-modal/index.js.map +1 -1
  283. package/build-module/components/preview-dropdown/index.js +6 -3
  284. package/build-module/components/preview-dropdown/index.js.map +1 -1
  285. package/build-module/components/provider/disable-non-page-content-blocks.js +0 -1
  286. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  287. package/build-module/components/provider/index.js +19 -19
  288. package/build-module/components/provider/index.js.map +1 -1
  289. package/build-module/components/provider/index.native.js +0 -1
  290. package/build-module/components/provider/index.native.js.map +1 -1
  291. package/build-module/components/provider/use-block-editor-settings.js +0 -1
  292. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  293. package/build-module/components/sidebar/header.js +1 -1
  294. package/build-module/components/sidebar/header.js.map +1 -1
  295. package/build-module/components/sidebar/index.js +1 -2
  296. package/build-module/components/sidebar/index.js.map +1 -1
  297. package/build-module/components/start-page-options/index.js +148 -24
  298. package/build-module/components/start-page-options/index.js.map +1 -1
  299. package/build-module/components/start-template-options/index.js +0 -1
  300. package/build-module/components/start-template-options/index.js.map +1 -1
  301. package/build-module/components/template-part-content-panel/index.js +0 -1
  302. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  303. package/build-module/components/theme-support-check/index.js +0 -1
  304. package/build-module/components/theme-support-check/index.js.map +1 -1
  305. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
  306. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  307. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +0 -1
  308. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  309. package/build-module/dataviews/store/private-actions.js +0 -1
  310. package/build-module/dataviews/store/private-actions.js.map +1 -1
  311. package/build-module/dataviews/store/reducer.js +0 -1
  312. package/build-module/dataviews/store/reducer.js.map +1 -1
  313. package/build-module/hooks/custom-sources-backwards-compatibility.js +0 -1
  314. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  315. package/build-module/hooks/pattern-overrides.js +0 -1
  316. package/build-module/hooks/pattern-overrides.js.map +1 -1
  317. package/build-module/store/actions.js +0 -1
  318. package/build-module/store/actions.js.map +1 -1
  319. package/build-module/store/private-actions.js +25 -1
  320. package/build-module/store/private-actions.js.map +1 -1
  321. package/build-module/store/private-selectors.js +43 -1
  322. package/build-module/store/private-selectors.js.map +1 -1
  323. package/build-module/store/reducer.js +0 -1
  324. package/build-module/store/reducer.js.map +1 -1
  325. package/build-module/store/reducer.native.js +0 -1
  326. package/build-module/store/reducer.native.js.map +1 -1
  327. package/build-module/store/selectors.js +0 -1
  328. package/build-module/store/selectors.js.map +1 -1
  329. package/build-module/utils/get-template-info.js +0 -1
  330. package/build-module/utils/get-template-info.js.map +1 -1
  331. package/build-module/utils/media-upload/index.js +5 -2
  332. package/build-module/utils/media-upload/index.js.map +1 -1
  333. package/build-module/utils/terms.js +0 -1
  334. package/build-module/utils/terms.js.map +1 -1
  335. package/build-style/style-rtl.css +49 -8
  336. package/build-style/style.css +49 -8
  337. package/build-types/components/document-outline/index.d.ts.map +1 -1
  338. package/build-types/components/editor/index.d.ts.map +1 -1
  339. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  340. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  341. package/build-types/components/entities-saved-states/index.d.ts +6 -2
  342. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  343. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  344. package/build-types/components/post-actions/index.d.ts.map +1 -1
  345. package/build-types/components/post-author/check.d.ts.map +1 -1
  346. package/build-types/components/post-author/combobox.d.ts.map +1 -1
  347. package/build-types/components/post-author/hook.d.ts +1 -0
  348. package/build-types/components/post-author/hook.d.ts.map +1 -1
  349. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  350. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  351. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
  352. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  353. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  354. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  355. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  356. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  357. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  358. package/build-types/components/post-template/hooks.d.ts +1 -1
  359. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  360. package/build-types/components/post-template/panel.d.ts.map +1 -1
  361. package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -1
  362. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  363. package/build-types/components/provider/index.d.ts.map +1 -1
  364. package/build-types/components/start-page-options/index.d.ts +2 -1
  365. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  366. package/build-types/store/private-actions.d.ts +4 -0
  367. package/build-types/store/private-actions.d.ts.map +1 -1
  368. package/build-types/store/private-selectors.d.ts +13 -0
  369. package/build-types/store/private-selectors.d.ts.map +1 -1
  370. package/build-types/utils/media-upload/index.d.ts +3 -1
  371. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  372. package/package.json +37 -37
  373. package/src/components/document-outline/index.js +22 -16
  374. package/src/components/editor/index.js +24 -13
  375. package/src/components/entities-saved-states/entity-record-item.js +1 -0
  376. package/src/components/entities-saved-states/entity-type-list.js +6 -2
  377. package/src/components/entities-saved-states/index.js +98 -58
  378. package/src/components/entities-saved-states/style.scss +40 -5
  379. package/src/components/page-attributes/parent.js +55 -38
  380. package/src/components/post-actions/index.js +19 -37
  381. package/src/components/post-author/check.js +7 -4
  382. package/src/components/post-author/combobox.js +3 -1
  383. package/src/components/post-author/hook.js +4 -3
  384. package/src/components/post-card-panel/index.js +7 -5
  385. package/src/components/post-featured-image/index.js +2 -0
  386. package/src/components/post-publish-panel/maybe-category-panel.js +6 -2
  387. package/src/components/post-publish-panel/maybe-tags-panel.js +5 -1
  388. package/src/components/post-taxonomies/check.js +5 -3
  389. package/src/components/post-taxonomies/flat-term-selector.js +2 -2
  390. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  391. package/src/components/post-taxonomies/index.js +5 -1
  392. package/src/components/post-taxonomies/test/index.js +32 -18
  393. package/src/components/post-template/block-theme.js +76 -56
  394. package/src/components/post-template/classic-theme.js +31 -15
  395. package/src/components/post-template/create-new-template-modal.js +1 -0
  396. package/src/components/post-template/panel.js +2 -12
  397. package/src/components/post-text-editor/style.scss +0 -2
  398. package/src/components/preferences-modal/block-visibility.js +2 -1
  399. package/src/components/preferences-modal/index.js +1 -1
  400. package/src/components/preview-dropdown/index.js +8 -6
  401. package/src/components/provider/index.js +21 -30
  402. package/src/components/sidebar/header.js +1 -1
  403. package/src/components/sidebar/index.js +1 -1
  404. package/src/components/start-page-options/index.js +149 -23
  405. package/src/components/start-page-options/style.scss +27 -0
  406. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -1
  407. package/src/store/private-actions.js +33 -0
  408. package/src/store/private-selectors.js +57 -0
  409. package/src/utils/media-upload/index.js +3 -0
  410. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","useMemo","useState","useIsDirty","editedEntities","siteEdits","siteEntityConfig","select","__experimentalGetDirtyEntityRecords","getEntityRecordEdits","getEntityConfig","dirtyEntityRecords","_siteEntityConfig$met","editedEntitiesWithoutSite","filter","record","kind","name","siteEntityLabels","meta","labels","editedSiteEntities","property","push","title","unselectedEntities","_setUnselectedEntities","setUnselectedEntities","key","checked","elt","isDirty","length"],"sources":["@wordpress/editor/src/components/entities-saved-states/hooks/use-is-dirty.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.\n *\n * @return {Object} An object containing the following properties:\n * - dirtyEntityRecords: An array of dirty entity records.\n * - isDirty: A boolean indicating if there are any dirty entity records.\n * - setUnselectedEntities: A function to set the unselected entities.\n * - unselectedEntities: An array of unselected entities.\n */\nexport const useIsDirty = () => {\n\tconst { editedEntities, siteEdits, siteEntityConfig } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetEntityRecordEdits,\n\t\t\t\tgetEntityConfig,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditedEntities: __experimentalGetDirtyEntityRecords(),\n\t\t\t\tsiteEdits: getEntityRecordEdits( 'root', 'site' ),\n\t\t\t\tsiteEntityConfig: getEntityConfig( 'root', 'site' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst dirtyEntityRecords = useMemo( () => {\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst editedEntitiesWithoutSite = editedEntities.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};\n\t\tconst editedSiteEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\teditedSiteEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: siteEntityLabels[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\n\t\treturn [ ...editedEntitiesWithoutSite, ...editedSiteEntities ];\n\t}, [ editedEntities, siteEdits, siteEntityConfig ] );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;\n\n\treturn {\n\t\tdirtyEntityRecords,\n\t\tisDirty,\n\t\tsetUnselectedEntities,\n\t\tunselectedEntities,\n\t};\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC,cAAc;IAAEC,SAAS;IAAEC;EAAiB,CAAC,GAAGR,SAAS,CAC9DS,MAAM,IAAM;IACb,MAAM;MACLC,mCAAmC;MACnCC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEP,SAAU,CAAC;IAEvB,OAAO;MACNI,cAAc,EAAEI,mCAAmC,CAAC,CAAC;MACrDH,SAAS,EAAEI,oBAAoB,CAAE,MAAM,EAAE,MAAO,CAAC;MACjDH,gBAAgB,EAAEI,eAAe,CAAE,MAAM,EAAE,MAAO;IACnD,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,MAAMC,kBAAkB,GAAGV,OAAO,CAAE,MAAM;IAAA,IAAAW,qBAAA;IACzC;IACA,MAAMC,yBAAyB,GAAGT,cAAc,CAACU,MAAM,CACpDC,MAAM,IAAM,EAAIA,MAAM,CAACC,IAAI,KAAK,MAAM,IAAID,MAAM,CAACE,IAAI,KAAK,MAAM,CACnE,CAAC;IAED,MAAMC,gBAAgB,IAAAN,qBAAA,GAAGN,gBAAgB,EAAEa,IAAI,EAAEC,MAAM,cAAAR,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;IAC7D,MAAMS,kBAAkB,GAAG,EAAE;IAC7B,KAAM,MAAMC,QAAQ,IAAIjB,SAAS,EAAG;MACnCgB,kBAAkB,CAACE,IAAI,CAAE;QACxBP,IAAI,EAAE,MAAM;QACZC,IAAI,EAAE,MAAM;QACZO,KAAK,EAAEN,gBAAgB,CAAEI,QAAQ,CAAE,IAAIA,QAAQ;QAC/CA;MACD,CAAE,CAAC;IACJ;IAEA,OAAO,CAAE,GAAGT,yBAAyB,EAAE,GAAGQ,kBAAkB,CAAE;EAC/D,CAAC,EAAE,CAAEjB,cAAc,EAAEC,SAAS,EAAEC,gBAAgB,CAAG,CAAC;;EAEpD;EACA,MAAM,CAAEmB,kBAAkB,EAAEC,sBAAsB,CAAE,GAAGxB,QAAQ,CAAE,EAAG,CAAC;EAErE,MAAMyB,qBAAqB,GAAGA,CAC7B;IAAEX,IAAI;IAAEC,IAAI;IAAEW,GAAG;IAAEN;EAAS,CAAC,EAC7BO,OAAO,KACH;IACJ,IAAKA,OAAO,EAAG;MACdH,sBAAsB,CACrBD,kBAAkB,CAACX,MAAM,CACtBgB,GAAG,IACJA,GAAG,CAACd,IAAI,KAAKA,IAAI,IACjBc,GAAG,CAACb,IAAI,KAAKA,IAAI,IACjBa,GAAG,CAACF,GAAG,KAAKA,GAAG,IACfE,GAAG,CAACR,QAAQ,KAAKA,QACnB,CACD,CAAC;IACF,CAAC,MAAM;MACNI,sBAAsB,CAAE,CACvB,GAAGD,kBAAkB,EACrB;QAAET,IAAI;QAAEC,IAAI;QAAEW,GAAG;QAAEN;MAAS,CAAC,CAC5B,CAAC;IACJ;EACD,CAAC;EAED,MAAMS,OAAO,GAAGpB,kBAAkB,CAACqB,MAAM,GAAGP,kBAAkB,CAACO,MAAM,GAAG,CAAC;EAEzE,OAAO;IACNrB,kBAAkB;IAClBoB,OAAO;IACPJ,qBAAqB;IACrBF;EACD,CAAC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","coreStore","useMemo","useState","useIsDirty","editedEntities","siteEdits","siteEntityConfig","select","__experimentalGetDirtyEntityRecords","getEntityRecordEdits","getEntityConfig","dirtyEntityRecords","_siteEntityConfig$met","editedEntitiesWithoutSite","filter","record","kind","name","siteEntityLabels","meta","labels","editedSiteEntities","property","push","title","unselectedEntities","_setUnselectedEntities","setUnselectedEntities","key","checked","elt","isDirty","length"],"sources":["@wordpress/editor/src/components/entities-saved-states/hooks/use-is-dirty.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.\n *\n * @return {Object} An object containing the following properties:\n * - dirtyEntityRecords: An array of dirty entity records.\n * - isDirty: A boolean indicating if there are any dirty entity records.\n * - setUnselectedEntities: A function to set the unselected entities.\n * - unselectedEntities: An array of unselected entities.\n */\nexport const useIsDirty = () => {\n\tconst { editedEntities, siteEdits, siteEntityConfig } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetEntityRecordEdits,\n\t\t\t\tgetEntityConfig,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditedEntities: __experimentalGetDirtyEntityRecords(),\n\t\t\t\tsiteEdits: getEntityRecordEdits( 'root', 'site' ),\n\t\t\t\tsiteEntityConfig: getEntityConfig( 'root', 'site' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst dirtyEntityRecords = useMemo( () => {\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst editedEntitiesWithoutSite = editedEntities.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};\n\t\tconst editedSiteEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\teditedSiteEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: siteEntityLabels[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\n\t\treturn [ ...editedEntitiesWithoutSite, ...editedSiteEntities ];\n\t}, [ editedEntities, siteEdits, siteEntityConfig ] );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;\n\n\treturn {\n\t\tdirtyEntityRecords,\n\t\tisDirty,\n\t\tsetUnselectedEntities,\n\t\tunselectedEntities,\n\t};\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC,cAAc;IAAEC,SAAS;IAAEC;EAAiB,CAAC,GAAGR,SAAS,CAC9DS,MAAM,IAAM;IACb,MAAM;MACLC,mCAAmC;MACnCC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEP,SAAU,CAAC;IAEvB,OAAO;MACNI,cAAc,EAAEI,mCAAmC,CAAC,CAAC;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G,CAACb,IAAI,KAAKA,IAAI,IACjBa,GAAG,CAACF,GAAG,KAAKA,GAAG,IACfE,GAAG,CAACR,QAAQ,KAAKA,QACnB,CACD,CAAC;IACF,CAAC,MAAM;MACNI,sBAAsB,CAAE,CACvB,GAAGD,kBAAkB,EACrB;QAAET,IAAI;QAAEC,IAAI;QAAEW,GAAG;QAAEN;MAAS,CAAC,CAC5B,CAAC;IACJ;EACD,CAAC;EAED,MAAMS,OAAO,GAAGpB,kBAAkB,CAACqB,MAAM,GAAGP,kBAAkB,CAACO,MAAM,GAAG,CAAC;EAEzE,OAAO;IACNrB,kBAAkB;IAClBoB,OAAO;IACPJ,qBAAqB;IACrBF;EACD,CAAC;AACF,CAAC","ignoreList":[]}
@@ -1,4 +1,8 @@
1
- /* wp:polyfill */
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
2
6
  /**
3
7
  * WordPress dependencies
4
8
  */
@@ -15,7 +19,7 @@ import EntityTypeList from './entity-type-list';
15
19
  import { useIsDirty } from './hooks/use-is-dirty';
16
20
  import { store as editorStore } from '../../store';
17
21
  import { unlock } from '../../lock-unlock';
18
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
23
  function identity(values) {
20
24
  return values;
21
25
  }
@@ -26,17 +30,20 @@ function identity(values) {
26
30
  * @param {Object} props The component props.
27
31
  * @param {Function} props.close The function to close the dialog.
28
32
  * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.
33
+ * @param {string} props.variant Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.
29
34
  *
30
35
  * @return {React.ReactNode} The rendered component.
31
36
  */
32
37
  export default function EntitiesSavedStates({
33
38
  close,
34
- renderDialog
39
+ renderDialog,
40
+ variant
35
41
  }) {
36
42
  const isDirtyProps = useIsDirty();
37
43
  return /*#__PURE__*/_jsx(EntitiesSavedStatesExtensible, {
38
44
  close: close,
39
45
  renderDialog: renderDialog,
46
+ variant: variant,
40
47
  ...isDirtyProps
41
48
  });
42
49
  }
@@ -55,6 +62,7 @@ export default function EntitiesSavedStates({
55
62
  * @param {boolean} props.isDirty Flag indicating if there are dirty entities.
56
63
  * @param {Function} props.setUnselectedEntities Function to set unselected entities.
57
64
  * @param {Array} props.unselectedEntities Array of unselected entities.
65
+ * @param {string} props.variant Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.
58
66
  *
59
67
  * @return {React.ReactNode} The rendered component.
60
68
  */
@@ -68,7 +76,8 @@ export function EntitiesSavedStatesExtensible({
68
76
  dirtyEntityRecords,
69
77
  isDirty,
70
78
  setUnselectedEntities,
71
- unselectedEntities
79
+ unselectedEntities,
80
+ variant = 'default'
72
81
  }) {
73
82
  const saveButtonRef = useRef();
74
83
  const {
@@ -101,58 +110,67 @@ export function EntitiesSavedStatesExtensible({
101
110
  const [saveDialogRef, saveDialogProps] = useDialog({
102
111
  onClose: () => dismissPanel()
103
112
  });
104
- const dialogLabel = useInstanceId(EntitiesSavedStatesExtensible, 'label');
105
- const dialogDescription = useInstanceId(EntitiesSavedStatesExtensible, 'description');
113
+ const dialogLabelId = useInstanceId(EntitiesSavedStatesExtensible, 'entities-saved-states__panel-label');
114
+ const dialogDescriptionId = useInstanceId(EntitiesSavedStatesExtensible, 'entities-saved-states__panel-description');
106
115
  const selectItemsToSaveDescription = !!dirtyEntityRecords.length ? __('Select the items you want to save.') : undefined;
116
+ const isInline = variant === 'inline';
117
+ const actionButtons = /*#__PURE__*/_jsxs(_Fragment, {
118
+ children: [/*#__PURE__*/_jsx(FlexItem, {
119
+ isBlock: isInline ? false : true,
120
+ as: Button,
121
+ variant: isInline ? 'tertiary' : 'secondary',
122
+ size: isInline ? undefined : 'compact',
123
+ onClick: dismissPanel,
124
+ children: __('Cancel')
125
+ }), /*#__PURE__*/_jsx(FlexItem, {
126
+ isBlock: isInline ? false : true,
127
+ as: Button,
128
+ ref: saveButtonRef,
129
+ variant: "primary",
130
+ size: isInline ? undefined : 'compact',
131
+ disabled: !saveEnabled,
132
+ accessibleWhenDisabled: true,
133
+ onClick: () => saveDirtyEntities({
134
+ onSave,
135
+ dirtyEntityRecords,
136
+ entitiesToSkip: unselectedEntities,
137
+ close
138
+ }),
139
+ className: "editor-entities-saved-states__save-button",
140
+ children: saveLabel
141
+ })]
142
+ });
107
143
  return /*#__PURE__*/_jsxs("div", {
108
144
  ref: renderDialog ? saveDialogRef : undefined,
109
145
  ...(renderDialog && saveDialogProps),
110
- className: "entities-saved-states__panel",
146
+ className: clsx('entities-saved-states__panel', {
147
+ 'is-inline': isInline
148
+ }),
111
149
  role: renderDialog ? 'dialog' : undefined,
112
- "aria-labelledby": renderDialog ? dialogLabel : undefined,
113
- "aria-describedby": renderDialog ? dialogDescription : undefined,
114
- children: [/*#__PURE__*/_jsxs(Flex, {
150
+ "aria-labelledby": renderDialog ? dialogLabelId : undefined,
151
+ "aria-describedby": renderDialog ? dialogDescriptionId : undefined,
152
+ children: [!isInline && /*#__PURE__*/_jsx(Flex, {
115
153
  className: "entities-saved-states__panel-header",
116
154
  gap: 2,
117
- children: [/*#__PURE__*/_jsx(FlexItem, {
118
- isBlock: true,
119
- as: Button,
120
- variant: "secondary",
121
- size: "compact",
122
- onClick: dismissPanel,
123
- children: __('Cancel')
124
- }), /*#__PURE__*/_jsx(FlexItem, {
125
- isBlock: true,
126
- as: Button,
127
- ref: saveButtonRef,
128
- variant: "primary",
129
- size: "compact",
130
- disabled: !saveEnabled,
131
- accessibleWhenDisabled: true,
132
- onClick: () => saveDirtyEntities({
133
- onSave,
134
- dirtyEntityRecords,
135
- entitiesToSkip: unselectedEntities,
136
- close
137
- }),
138
- className: "editor-entities-saved-states__save-button",
139
- children: saveLabel
140
- })]
155
+ children: actionButtons
141
156
  }), /*#__PURE__*/_jsxs("div", {
142
157
  className: "entities-saved-states__text-prompt",
143
- children: [/*#__PURE__*/_jsxs("div", {
158
+ children: [/*#__PURE__*/_jsx("div", {
144
159
  className: "entities-saved-states__text-prompt--header-wrapper",
145
- id: renderDialog ? dialogLabel : undefined,
146
- children: [/*#__PURE__*/_jsx("strong", {
160
+ children: /*#__PURE__*/_jsx("strong", {
161
+ id: renderDialog ? dialogLabelId : undefined,
147
162
  className: "entities-saved-states__text-prompt--header",
148
163
  children: __('Are you ready to save?')
149
- }), additionalPrompt]
150
- }), /*#__PURE__*/_jsx("p", {
151
- id: renderDialog ? dialogDescription : undefined,
152
- children: isDirty ? createInterpolateElement(sprintf(/* translators: %d: number of site changes waiting to be saved. */
153
- _n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), {
154
- strong: /*#__PURE__*/_jsx("strong", {})
155
- }) : selectItemsToSaveDescription
164
+ })
165
+ }), /*#__PURE__*/_jsxs("div", {
166
+ id: renderDialog ? dialogDescriptionId : undefined,
167
+ children: [additionalPrompt, /*#__PURE__*/_jsx("p", {
168
+ className: "entities-saved-states__text-prompt--changes-count",
169
+ children: isDirty ? createInterpolateElement(sprintf(/* translators: %d: number of site changes waiting to be saved. */
170
+ _n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), {
171
+ strong: /*#__PURE__*/_jsx("strong", {})
172
+ }) : selectItemsToSaveDescription
173
+ })]
156
174
  })]
157
175
  }), sortedPartitionedSavables.map(list => {
158
176
  return /*#__PURE__*/_jsx(EntityTypeList, {
@@ -160,6 +178,11 @@ export function EntitiesSavedStatesExtensible({
160
178
  unselectedEntities: unselectedEntities,
161
179
  setUnselectedEntities: setUnselectedEntities
162
180
  }, list[0].name);
181
+ }), isInline && /*#__PURE__*/_jsx(Flex, {
182
+ direction: "row",
183
+ justify: "flex-end",
184
+ className: "entities-saved-states__panel-footer",
185
+ children: actionButtons
163
186
  })]
164
187
  });
165
188
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useCallback","useRef","createInterpolateElement","__experimentalUseDialog","useDialog","useInstanceId","useDispatch","EntityTypeList","useIsDirty","store","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","identity","values","EntitiesSavedStates","close","renderDialog","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","saveDirtyEntities","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabel","dialogDescription","selectItemsToSaveDescription","length","ref","className","role","children","gap","isBlock","as","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function EntitiesSavedStates( { close, renderDialog } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\tconst selectItemsToSaveDescription = !! dirtyEntityRecords.length\n\t\t? __( 'Select the items you want to save.' )\n\t\t: undefined;\n\n\treturn (\n\t\t<div\n\t\t\tref={ renderDialog ? saveDialogRef : undefined }\n\t\t\t{ ...( renderDialog && saveDialogProps ) }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: selectItemsToSaveDescription }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnsel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ACF,CAAC;IAAA,CACN,CAAC,eAEPb,KAAA;MAAK+C,SAAS,EAAC,oCAAoC;MAAAE,QAAA,gBAClDjD,KAAA;QACC+C,SAAS,EAAC,oDAAoD;QAC9DY,EAAE,EAAGtD,YAAY,GAAGqC,WAAW,GAAGjC,SAAW;QAAAwC,QAAA,gBAE7CnD,IAAA;UAAQiD,SAAS,EAAC,4CAA4C;UAAAE,QAAA,EAC3DnE,EAAE,CAAE,wBAAyB;QAAC,CACzB,CAAC,EACP0B,gBAAgB;MAAA,CACd,CAAC,eACNV,IAAA;QAAG6D,EAAE,EAAGtD,YAAY,GAAGsC,iBAAiB,GAAGlC,SAAW;QAAAwC,QAAA,EACnDlC,OAAO,GACN5B,wBAAwB,CACxBH,OAAO,CACN;QACAD,EAAE,CACD,+DAA+D,EAC/D,iEAAiE,EACjE+B,kBAAkB,CAAC+B,MACpB,CAAC,EACD/B,kBAAkB,CAAC+B,MACpB,CAAC,EACD;UAAEe,MAAM,eAAE9D,IAAA,aAAS;QAAE,CACrB,CAAC,GACD8C;MAA4B,CAC7B,CAAC;IAAA,CACA,CAAC,EAEJX,yBAAyB,CAAC4B,GAAG,CAAIC,IAAI,IAAM;MAC5C,oBACChE,IAAA,CAACN,cAAc;QAEdsE,IAAI,EAAGA,IAAM;QACb7C,kBAAkB,EAAGA,kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC8C,IAAI,CAAE,CAAC,CAAE,CAACtC,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Button","Flex","FlexItem","__","_n","sprintf","useCallback","useRef","createInterpolateElement","__experimentalUseDialog","useDialog","useInstanceId","useDispatch","EntityTypeList","useIsDirty","store","editorStore","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","identity","values","EntitiesSavedStates","close","renderDialog","variant","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","saveDirtyEntities","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabelId","dialogDescriptionId","selectItemsToSaveDescription","length","isInline","actionButtons","children","isBlock","as","size","onClick","ref","disabled","accessibleWhenDisabled","entitiesToSkip","className","role","gap","id","strong","map","list","direction","justify"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n * @param {string} props.variant Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function EntitiesSavedStates( {\n\tclose,\n\trenderDialog,\n\tvariant,\n} ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\tvariant={ variant }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n * @param {string} props.variant Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n\tvariant = 'default',\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabelId = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'entities-saved-states__panel-label'\n\t);\n\tconst dialogDescriptionId = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'entities-saved-states__panel-description'\n\t);\n\n\tconst selectItemsToSaveDescription = !! dirtyEntityRecords.length\n\t\t? __( 'Select the items you want to save.' )\n\t\t: undefined;\n\n\tconst isInline = variant === 'inline';\n\n\tconst actionButtons = (\n\t\t<>\n\t\t\t<FlexItem\n\t\t\t\tisBlock={ isInline ? false : true }\n\t\t\t\tas={ Button }\n\t\t\t\tvariant={ isInline ? 'tertiary' : 'secondary' }\n\t\t\t\tsize={ isInline ? undefined : 'compact' }\n\t\t\t\tonClick={ dismissPanel }\n\t\t\t>\n\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t</FlexItem>\n\t\t\t<FlexItem\n\t\t\t\tisBlock={ isInline ? false : true }\n\t\t\t\tas={ Button }\n\t\t\t\tref={ saveButtonRef }\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tsize={ isInline ? undefined : 'compact' }\n\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tonClick={ () =>\n\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\tonSave,\n\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\tclose,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t>\n\t\t\t\t{ saveLabel }\n\t\t\t</FlexItem>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ renderDialog ? saveDialogRef : undefined }\n\t\t\t{ ...( renderDialog && saveDialogProps ) }\n\t\t\tclassName={ clsx( 'entities-saved-states__panel', {\n\t\t\t\t'is-inline': isInline,\n\t\t\t} ) }\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabelId : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescriptionId : undefined }\n\t\t>\n\t\t\t{ ! isInline && (\n\t\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t\t{ actionButtons }\n\t\t\t\t</Flex>\n\t\t\t) }\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div className=\"entities-saved-states__text-prompt--header-wrapper\">\n\t\t\t\t\t<strong\n\t\t\t\t\t\tid={ renderDialog ? dialogLabelId : undefined }\n\t\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t</div>\n\t\t\t\t<div id={ renderDialog ? dialogDescriptionId : undefined }>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t\t<p className=\"entities-saved-states__text-prompt--changes-count\">\n\t\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: selectItemsToSaveDescription }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\n\t\t\t{ isInline && (\n\t\t\t\t<Flex\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\tclassName=\"entities-saved-states__panel-footer\"\n\t\t\t\t>\n\t\t\t\t\t{ actionButtons }\n\t\t\t\t</Flex>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,WAAW,EACXC,MAAM,EACNC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,SAASC,QAAQA,CAAEC,MAAM,EAAG;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C,aAAa,GAAGjC,SAAW;UAC/CgD,SAAS,EAAC,4CAA4C;UAAAT,QAAA,EAEpDrE,EAAE,CAAE,wBAAyB;QAAC,CACzB;MAAC,CACL,CAAC,eACNoB,KAAA;QAAK6D,EAAE,EAAGxD,YAAY,GAAGuC,mBAAmB,GAAGlC,SAAW;QAAAuC,QAAA,GACvDxC,gBAAgB,eAClBb,IAAA;UAAG8D,SAAS,EAAC,mDAAmD;UAAAT,QAAA,EAC7DjC,OAAO,GACN/B,wBAAwB,CACxBH,OAAO,CACN;UACAD,EAAE,CACD,+DAA+D,EAC/D,iEAAiE,EACjEkC,kBAAkB,CAAC+B,MACpB,CAAC,EACD/B,kBAAkB,CAAC+B,MACpB,CAAC,EACD;YAAEgB,MAAM,eAAElE,IAAA,aAAS;UAAE,CACrB,CAAC,GACDiD;QAA4B,CAC7B,CAAC;MAAA,CACA,CAAC;IAAA,CACF,CAAC,EAEJX,yBAAyB,CAAC6B,GAAG,CAAIC,IAAI,IAAM;MAC5C,oBACCpE,IAAA,CAACN,cAAc;QAEd0E,IAAI,EAAGA,IAAM;QACb9C,kBAAkB,EAAGA,kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC+C,IAAI,CAAE,CAAC,CAAE,CAACvC,IAIhB,CAAC;IAEJ,CAAE,CAAC,EAEDsB,QAAQ,iBACTnD,IAAA,CAAClB,IAAI;MACJuF,SAAS,EAAC,KAAK;MACfC,OAAO,EAAC,UAAU;MAClBR,SAAS,EAAC,qCAAqC;MAAAT,QAAA,EAE7CD;IAAa,CACV,CACN;EAAA,CACG,CAAC;AAER","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Modal","__","useShortcut","store","keyboardShortcutsStore","useDispatch","useSelect","interfaceStore","textFormattingShortcuts","Shortcut","DynamicShortcut","jsx","_jsx","jsxs","_jsxs","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","ShortcutList","shortcuts","className","role","children","map","shortcut","index","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","openModal","closeModal","toggleModal","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'editor-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"editor-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nfunction KeyboardShortcutHelpModal() {\n\tconst isModalActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isModalActive(\n\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t),\n\t\t[]\n\t);\n\tconst { openModal, closeModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () => {\n\t\tif ( isModalActive ) {\n\t\t\tcloseModal();\n\t\t} else {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t}\n\t};\n\tuseShortcut( 'core/editor/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/editor/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default KeyboardShortcutHelpModal;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASH,KAAK,IAAII,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ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AK,EAAGzB,EAAE,CAAE,iBAAkB,CAAG;MACjC2B,YAAY,EAAC,OAAO;MACpBC,mBAAmB,EAAG,CACrB;QACCY,cAAc,EAAE;UAAEC,SAAS,EAAE;QAAI,CAAC;QAClCC,WAAW,EAAE1C,EAAE,CACd,qDACD,CAAC;QACD;QACA2C,SAAS,EAAE3C,EAAE,CAAE,eAAgB;MAChC,CAAC;IACC,CACH,CAAC,eACFW,IAAA,CAACa,eAAe;MACfC,KAAK,EAAGzB,EAAE,CAAE,iBAAkB,CAAG;MACjCgB,SAAS,EAAGT;IAAyB,CACrC,CAAC,eACFI,IAAA,CAACe,uBAAuB;MACvBD,KAAK,EAAGzB,EAAE,CAAE,qBAAsB,CAAG;MACrC2B,YAAY,EAAC;IAAW,CACxB,CAAC;EAAA,CACI,CAAC;AAEV;AAEA,eAAeM,yBAAyB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Modal","__","useShortcut","store","keyboardShortcutsStore","useDispatch","useSelect","interfaceStore","textFormattingShortcuts","Shortcut","DynamicShortcut","jsx","_jsx","jsxs","_jsxs","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","ShortcutList","shortcuts","className","role","children","map","shortcut","index","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","openModal","closeModal","toggleModal","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'editor-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"editor-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nfunction KeyboardShortcutHelpModal() {\n\tconst isModalActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isModalActive(\n\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t),\n\t\t[]\n\t);\n\tconst { openModal, closeModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () => {\n\t\tif ( isModalActive ) {\n\t\t\tcloseModal();\n\t\t} else {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t}\n\t};\n\tuseShortcut( 'core/editor/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/editor/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default KeyboardShortcutHelpModal;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASH,KAAK,IAAII,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjD,MAAMC,iCAAiC,GAAG,+BAA+B;AAEzE,MAAMC,YAAY,GAAGA,CAAE;EAAEC;AAAU,CAAC;AAAA;AACnC;AACD;AACA;AACA;AACC;AACAL,IAAA;EACCM,SAAS,EAAC,oDAAoD;EAC9DC,IAAI,EAAC,MAAM;EAAAC,QAAA,EAETH,SAAS,CAACI,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,kBACjCX,IAAA;IACCM,SAAS,EAAC,+CAA+C;IAAAE,QAAA,EAGvD,OAAOE,QAAQ,KAAK,QAAQ,gBAC7BV,IAAA,CAACF,eAAe;MAACc,IAAI,EAAGF;IAAU,CAAE,CAAC,gBAErCV,IAAA,CAACH,QAAQ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 -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","jsx","_jsx","jsxs","_jsxs","_Fragment","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","className","children","Array","isArray","map","index","Shortcut","description","aliases","alias"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAN,QAAA,IAAAO,SAAA;AAE7E,SAASC,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7D,MAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAQ,GACrCX,mBAAmB,CAAEQ,cAAc,CAACG,QAAQ,CAAE,CAC9CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAC3B,MAAMC,SAAS,GAAGL,cAAc,CAACG,QAAQ,GACtCV,iBAAiB,CAAEO,cAAc,CAACG,QAAQ,CAAE,CAC5CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAE3B,oBACCT,IAAA;IACCW,SAAS,EAAC,+DAA+D;IACzE,cAAaL,cAAc,IAAII,SAAW;IAAAE,QAAA,EAExC,CAAEC,KAAK,CAACC,OAAO,CAAEP,QAAS,CAAC,GAAGA,QAAQ,GAAG,CAAEA,QAAQ,CAAE,EAAGQ,GAAG,CAC5D,CAAEN,SAAS,EAAEO,KAAK,KAAM;MACvB,IAAKP,SAAS,KAAK,GAAG,EAAG;QACxB,oBAAOT,IAAA,CAACJ,QAAQ;UAAAgB,QAAA,EAAiBH;QAAS,GAAnBO,KAA+B,CAAC;MACxD;MAEA,oBACChB,IAAA;QAECW,SAAS,EAAC,mDAAmD;QAAAC,QAAA,EAE3DH;MAAS,GAHLO,KAIF,CAAC;IAER,CACD;EAAC,CACG,CAAC;AAER;AAEA,SAASC,QAAQA,CAAE;EAAEC,WAAW;EAAEb,cAAc;EAAEc,OAAO,GAAG,EAAE;EAAET;AAAU,CAAC,EAAG;EAC7E,oBACCR,KAAA,CAAAC,SAAA;IAAAS,QAAA,gBACCZ,IAAA;MAAKW,SAAS,EAAC,2DAA2D;MAAAC,QAAA,EACvEM;IAAW,CACT,CAAC,eACNhB,KAAA;MAAKS,SAAS,EAAC,oDAAoD;MAAAC,QAAA,gBAClEZ,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGA,cAAgB;QACjCC,cAAc,EAAGI;MAAW,CAC5B,CAAC,EACAS,OAAO,CAACJ,GAAG,CAAE,CAAEK,KAAK,EAAEJ,KAAK,kBAC5BhB,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGe,KAAO;QACxBd,cAAc,EAAGI;MAAW,GACtBM,KACN,CACA,CAAC;IAAA,CACC,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeC,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","jsx","_jsx","jsxs","_jsxs","_Fragment","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","className","children","Array","isArray","map","index","Shortcut","description","aliases","alias"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\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EAC7E,oBACCR,KAAA,CAAAC,SAAA;IAAAS,QAAA,gBACCZ,IAAA;MAAKW,SAAS,EAAC,2DAA2D;MAAAC,QAAA,EACvEM;IAAW,CACT,CAAC,eACNhB,KAAA;MAAKS,SAAS,EAAC,oDAAoD;MAAAC,QAAA,gBAClEZ,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGA,cAAgB;QACjCC,cAAc,EAAGI;MAAW,CAC5B,CAAC,EACAS,OAAO,CAACJ,GAAG,CAAE,CAAEK,KAAK,EAAEJ,KAAK,kBAC5BhB,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGe,KAAO;QACxBd,cAAc,EAAGI;MAAW,GACtBM,KACN,CACA,CAAC;IAAA,CACC,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeC,QAAQ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalListView","ListView","privateApis","blockEditorPrivateApis","useFocusOnMount","useMergeRefs","useDispatch","useSelect","focus","useCallback","useRef","useState","__","_x","useShortcut","ESCAPE","ListViewOutline","unlock","store","editorStore","jsx","_jsx","TabbedSidebar","ListViewSidebar","setIsListViewOpened","getListViewToggleRef","focusOnMountRef","closeListView","current","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabsRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","listViewApplicationFocus","listViewFocusArea","contains","handleToggleListViewShortcut","ownerDocument","activeElement","className","onKeyDown","ref","children","tabs","name","title","panel","panelRef","onClose","onSelect","tabName","defaultTabId","closeButtonLabel"],"sources":["@wordpress/editor/src/components/list-view-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalListView as ListView,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewOutline from './list-view-outline';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { TabbedSidebar } = unlock( blockEditorPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editorStore ) );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\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\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabsRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabsRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\tconst handleToggleListViewShortcut = useCallback( () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tcloseListView();\n\t\t} else {\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t}, [ closeListView, tab ] );\n\n\t// This only fires when the sidebar is open because of the conditional rendering.\n\t// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/editor/toggle-list-view', handleToggleListViewShortcut );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"editor-list-view-sidebar\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<TabbedSidebar\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-container\">\n\t\t\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-panel-content\">\n\t\t\t\t\t\t\t\t\t<ListView\n\t\t\t\t\t\t\t\t\t\tdropZoneElement={ dropZoneElement }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpanelRef: listViewContainerRef,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-container\">\n\t\t\t\t\t\t\t\t<ListViewOutline />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t\tonClose={ closeListView }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tdefaultTabId=\"list-view\"\n\t\t\t\tref={ tabsRef }\n\t\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,sBAAsB,IAAIC,QAAQ,EAClCC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,eAAe,EAAEC,YAAY,QAAQ,oBAAoB;AAClE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAClE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;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AACC,aAAa;QACbmC,IAAI,EAAG,CACN;UACCC,IAAI,EAAE,WAAW;UACjBC,KAAK,EAAE9C,EAAE,CAAE,WAAW,EAAE,eAAgB,CAAC;UACzC+C,KAAK,eACJvC,IAAA;YAAKgC,SAAS,EAAC,+CAA+C;YAAAG,QAAA,eAC7DnC,IAAA;cAAKgC,SAAS,EAAC,mDAAmD;cAAAG,QAAA,eACjEnC,IAAA,CAACpB,QAAQ;gBACRiC,eAAe,EAAGA;cAAiB,CACnC;YAAC,CACE;UAAC,CACF,CACL;UACD2B,QAAQ,EAAEpB;QACX,CAAC,EACD;UACCiB,IAAI,EAAE,SAAS;UACfC,KAAK,EAAE9C,EAAE,CAAE,SAAS,EAAE,eAAgB,CAAC;UACvC+C,KAAK,eACJvC,IAAA;YAAKgC,SAAS,EAAC,+CAA+C;YAAAG,QAAA,eAC7DnC,IAAA,CAACL,eAAe,IAAE;UAAC,CACf;QAEP,CAAC,CACC;QACH8C,OAAO,EAAGnC,aAAe;QACzBoC,QAAQ,EAAKC,OAAO,IAAM3B,MAAM,CAAE2B,OAAQ,CAAG;QAC7CC,YAAY,EAAC,WAAW;QACxBV,GAAG,EAAGhB,OAAS;QACf2B,gBAAgB,EAAGtD,EAAE,CAAE,OAAQ;MAAG,CAClC;IAAC,CACE;EAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalListView","ListView","privateApis","blockEditorPrivateApis","useFocusOnMount","useMergeRefs","useDispatch","useSelect","focus","useCallback","useRef","useState","__","_x","useShortcut","ESCAPE","ListViewOutline","unlock","store","editorStore","jsx","_jsx","TabbedSidebar","ListViewSidebar","setIsListViewOpened","getListViewToggleRef","focusOnMountRef","closeListView","current","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabsRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","listViewApplicationFocus","listViewFocusArea","contains","handleToggleListViewShortcut","ownerDocument","activeElement","className","onKeyDown","ref","children","tabs","name","title","panel","panelRef","onClose","onSelect","tabName","defaultTabId","closeButtonLabel"],"sources":["@wordpress/editor/src/components/list-view-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalListView as ListView,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewOutline from './list-view-outline';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { TabbedSidebar } = unlock( blockEditorPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editorStore ) );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\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\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabsRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabsRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\tconst handleToggleListViewShortcut = useCallback( () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tcloseListView();\n\t\t} else {\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t}, [ closeListView, tab ] );\n\n\t// This only fires when the sidebar is open because of the conditional rendering.\n\t// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/editor/toggle-list-view', handleToggleListViewShortcut );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"editor-list-view-sidebar\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<TabbedSidebar\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-container\">\n\t\t\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-panel-content\">\n\t\t\t\t\t\t\t\t\t<ListView\n\t\t\t\t\t\t\t\t\t\tdropZoneElement={ dropZoneElement }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpanelRef: listViewContainerRef,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-container\">\n\t\t\t\t\t\t\t\t<ListViewOutline />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t\tonClose={ closeListView }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tdefaultTabId=\"list-view\"\n\t\t\t\tref={ tabsRef }\n\t\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,sBAAsB,IAAIC,QAAQ,EAClCC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,eAAe,EAAEC,YAAY,QAAQ,oBAAoB;AAClE,SAASC,WAAW,EAAEC,SAAS,QAAQ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,GAAG,CAAG,CAAC;;EAE3B;EACA;EACAtB,WAAW,CAAE,8BAA8B,EAAEoC,4BAA6B,CAAC;EAE3E;IAAA;IACC;IACA7B,IAAA;MACCgC,SAAS,EAAC,0BAA0B;MACpCC,SAAS,EAAGzB,aAAe;MAC3B0B,GAAG,EAAGjB,UAAY;MAAAkB,QAAA,eAElBnC,IAAA,CAACC,aAAa;QACbmC,IAAI,EAAG,CACN;UACCC,IAAI,EAAE,WAAW;UACjBC,KAAK,EAAE9C,EAAE,CAAE,WAAW,EAAE,eAAgB,CAAC;UACzC+C,KAAK,eACJvC,IAAA;YAAKgC,SAAS,EAAC,+CAA+C;YAAAG,QAAA,eAC7DnC,IAAA;cAAKgC,SAAS,EAAC,mDAAmD;cAAAG,QAAA,eACjEnC,IAAA,CAACpB,QAAQ;gBACRiC,eAAe,EAAGA;cAAiB,CACnC;YAAC,CACE;UAAC,CACF,CACL;UACD2B,QAAQ,EAAEpB;QACX,CAAC,EACD;UACCiB,IAAI,EAAE,SAAS;UACfC,KAAK,EAAE9C,EAAE,CAAE,SAAS,EAAE,eAAgB,CAAC;UACvC+C,KAAK,eACJvC,IAAA;YAAKgC,SAAS,EAAC,+CAA+C;YAAAG,QAAA,eAC7DnC,IAAA,CAACL,eAAe,IAAE;UAAC,CACf;QAEP,CAAC,CACC;QACH8C,OAAO,EAAGnC,aAAe;QACzBoC,QAAQ,EAAKC,OAAO,IAAM3B,MAAM,CAAE2B,OAAQ,CAAG;QAC7CC,YAAY,EAAC,WAAW;QACxBV,GAAG,EAAGhB,OAAS;QACf2B,gBAAgB,EAAGtD,EAAE,CAAE,OAAQ;MAAG,CAClC;IAAC,CACE;EAAC;AAER","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useEffect","useRef","ifCondition","usePrevious","useSelect","useDispatch","__","parse","store","noticesStore","AutosaveMonitor","localAutosaveGet","localAutosaveClear","editorStore","jsx","_jsx","requestIdleCallback","window","requestAnimationFrame","hasStorageSupport","hasSessionStorageSupport","undefined","sessionStorage","setItem","removeItem","useAutosaveNotice","postId","isEditedPostNew","hasRemoteAutosave","select","getCurrentPostId","getEditorSettings","autosave","getEditedPostAttribute","createWarningNotice","removeNotice","editPost","resetEditorBlocks","localAutosave","JSON","post_title","title","content","excerpt","edits","hasDifference","Object","keys","some","key","id","actions","label","onClick","editsContent","editsWithoutContent","useAutosavePurge","isDirty","isAutosaving","didError","isEditedPostDirty","isAutosavingPost","didPostSaveRequestFail","lastIsDirtyRef","lastIsAutosavingRef","current","wasEditedPostNew","prevPostId","LocalAutosaveMonitor","deferredAutosave","local","localAutosaveInterval","interval"],"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":";AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACnE,SAASC,WAAW,EAAEC,WAAW,QAAQ,oBAAoB;AAC7D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ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CAAED,OAAO,EAAEC,YAAY,EAAEC,QAAQ,CAAG,CAAC;;EAExC;EACA,MAAMO,gBAAgB,GAAG/D,WAAW,CAAEwB,eAAgB,CAAC;EACvD,MAAMwC,UAAU,GAAGhE,WAAW,CAAEuB,MAAO,CAAC;EACxC1B,SAAS,CAAE,MAAM;IAChB,IAAKmE,UAAU,KAAKzC,MAAM,IAAIwC,gBAAgB,IAAI,CAAEvC,eAAe,EAAG;MACrEf,kBAAkB,CAAEc,MAAM,EAAE,IAAK,CAAC;IACnC;EACD,CAAC,EAAE,CAAEC,eAAe,EAAED,MAAM,CAAG,CAAC;AACjC;AAEA,SAAS0C,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAEpC;EAAS,CAAC,GAAG3B,WAAW,CAAEQ,WAAY,CAAC;EAC/C,MAAMwD,gBAAgB,GAAGtE,WAAW,CAAE,MAAM;IAC3CiB,mBAAmB,CAAE,MAAMgB,QAAQ,CAAE;MAAEsC,KAAK,EAAE;IAAK,CAAE,CAAE,CAAC;EACzD,CAAC,EAAE,EAAG,CAAC;EACP7C,iBAAiB,CAAC,CAAC;EACnB+B,gBAAgB,CAAC,CAAC;EAElB,MAAMe,qBAAqB,GAAGnE,SAAS,CACpCyB,MAAM,IACPA,MAAM,CAAEhB,WAAY,CAAC,CAACkB,iBAAiB,CAAC,CAAC,CAACwC,qBAAqB,EAChE,EACD,CAAC;EAED,oBACCxD,IAAA,CAACL,eAAe;IACf8D,QAAQ,EAAGD,qBAAuB;IAClCvC,QAAQ,EAAGqC;EAAkB,CAC7B,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAenE,WAAW,CAAEkB,wBAAyB,CAAC,CAAEgD,oBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useEffect","useRef","ifCondition","usePrevious","useSelect","useDispatch","__","parse","store","noticesStore","AutosaveMonitor","localAutosaveGet","localAutosaveClear","editorStore","jsx","_jsx","requestIdleCallback","window","requestAnimationFrame","hasStorageSupport","hasSessionStorageSupport","undefined","sessionStorage","setItem","removeItem","useAutosaveNotice","postId","isEditedPostNew","hasRemoteAutosave","select","getCurrentPostId","getEditorSettings","autosave","getEditedPostAttribute","createWarningNotice","removeNotice","editPost","resetEditorBlocks","localAutosave","JSON","post_title","title","content","excerpt","edits","hasDifference","Object","keys","some","key","id","actions","label","onClick","editsContent","editsWithoutContent","useAutosavePurge","isDirty","isAutosaving","didError","isEditedPostDirty","isAutosavingPost","didPostSaveRequestFail","lastIsDirtyRef","lastIsAutosavingRef","current","wasEditedPostNew","prevPostId","LocalAutosaveMonitor","deferredAutosave","local","localAutosaveInterval","interval"],"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":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACnE,SAASC,WAAW,EAAEC,WAAW,QAAQ,oBAAoB;AAC7D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,KAA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AAEC,QAAQ,CAAG,CAAC;;EAExC;EACA,MAAMO,gBAAgB,GAAG/D,WAAW,CAAEwB,eAAgB,CAAC;EACvD,MAAMwC,UAAU,GAAGhE,WAAW,CAAEuB,MAAO,CAAC;EACxC1B,SAAS,CAAE,MAAM;IAChB,IAAKmE,UAAU,KAAKzC,MAAM,IAAIwC,gBAAgB,IAAI,CAAEvC,eAAe,EAAG;MACrEf,kBAAkB,CAAEc,MAAM,EAAE,IAAK,CAAC;IACnC;EACD,CAAC,EAAE,CAAEC,eAAe,EAAED,MAAM,CAAG,CAAC;AACjC;AAEA,SAAS0C,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAEpC;EAAS,CAAC,GAAG3B,WAAW,CAAEQ,WAAY,CAAC;EAC/C,MAAMwD,gBAAgB,GAAGtE,WAAW,CAAE,MAAM;IAC3CiB,mBAAmB,CAAE,MAAMgB,QAAQ,CAAE;MAAEsC,KAAK,EAAE;IAAK,CAAE,CAAE,CAAC;EACzD,CAAC,EAAE,EAAG,CAAC;EACP7C,iBAAiB,CAAC,CAAC;EACnB+B,gBAAgB,CAAC,CAAC;EAElB,MAAMe,qBAAqB,GAAGnE,SAAS,CACpCyB,MAAM,IACPA,MAAM,CAAEhB,WAAY,CAAC,CAACkB,iBAAiB,CAAC,CAAC,CAACwC,qBAAqB,EAChE,EACD,CAAC;EAED,oBACCxD,IAAA,CAACL,eAAe;IACf8D,QAAQ,EAAGD,qBAAuB;IAClCvC,QAAQ,EAAGqC;EAAkB,CAC7B,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAenE,WAAW,CAAEkB,wBAAyB,CAAC,CAAEgD,oBAAqB,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["__","MenuItemsChoice","MenuGroup","useSelect","useDispatch","store","keyboardShortcutsStore","editorStore","jsx","_jsx","MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","mode","select","getShortcutRepresentation","getEditorSettings","richEditingEnabled","codeEditingEnabled","getEditorMode","switchEditorMode","selectedMode","choices","map","choice","disabled","info","children","onSelect"],"sources":["@wordpress/editor/src/components/mode-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst { shortcut, isRichEditingEnabled, isCodeEditingEnabled, mode } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tshortcut: select(\n\t\t\t\t\tkeyboardShortcutsStore\n\t\t\t\t).getShortcutRepresentation( 'core/editor/toggle-mode' ),\n\t\t\t\tisRichEditingEnabled:\n\t\t\t\t\tselect( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.richEditingEnabled,\n\t\t\t\tisCodeEditingEnabled:\n\t\t\t\t\tselect( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.codeEditingEnabled,\n\t\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\tconst { switchEditorMode } = useDispatch( editorStore );\n\n\tlet selectedMode = mode;\n\tif ( ! isRichEditingEnabled && mode === 'visual' ) {\n\t\tselectedMode = 'text';\n\t}\n\tif ( ! isCodeEditingEnabled && mode === 'text' ) {\n\t\tselectedMode = 'visual';\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( ! isCodeEditingEnabled && choice.value === 'text' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t}\n\t\tif ( ! isRichEditingEnabled && choice.value === 'visual' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t\tinfo: __(\n\t\t\t\t\t'You can enable the visual editor in your profile settings.'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\tif ( choice.value !== selectedMode && ! choice.disabled ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ selectedMode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,QAAQ,uBAAuB;AAClE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;;AAE/E;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,MAAMC,KAAK,GAAG,CACb;EACCC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAEZ,EAAE,CAAE,eAAgB;AAC5B,CAAC,EACD;EACCW,KAAK,EAAE,MAAM;EACbC,KAAK,EAAEZ,EAAE,CAAE,aAAc;AAC1B,CAAC,CACD;AAED,SAASa,YAAYA,CAAA,EAAG;EACvB,MAAM;IAAEC,QAAQ;IAAEC,oBAAoB;IAAEC,oBAAoB;IAAEC;EAAK,CAA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AAOc,MAAM;EACd,CAAE,CAAC;EAEH,oBACCnB,IAAA,CAACP,SAAS;IAACU,KAAK,EAAGZ,EAAE,CAAE,QAAS,CAAG;IAAA+B,QAAA,eAClCtB,IAAA,CAACR,eAAe;MACfyB,OAAO,EAAGA,OAAS;MACnBf,KAAK,EAAGc,YAAc;MACtBO,QAAQ,EAAGR;IAAkB,CAC7B;EAAC,CACQ,CAAC;AAEd;AAEA,eAAeX,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["__","MenuItemsChoice","MenuGroup","useSelect","useDispatch","store","keyboardShortcutsStore","editorStore","jsx","_jsx","MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","mode","select","getShortcutRepresentation","getEditorSettings","richEditingEnabled","codeEditingEnabled","getEditorMode","switchEditorMode","selectedMode","choices","map","choice","disabled","info","children","onSelect"],"sources":["@wordpress/editor/src/components/mode-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst { shortcut, isRichEditingEnabled, isCodeEditingEnabled, mode } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tshortcut: select(\n\t\t\t\t\tkeyboardShortcutsStore\n\t\t\t\t).getShortcutRepresentation( 'core/editor/toggle-mode' ),\n\t\t\t\tisRichEditingEnabled:\n\t\t\t\t\tselect( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.richEditingEnabled,\n\t\t\t\tisCodeEditingEnabled:\n\t\t\t\t\tselect( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.codeEditingEnabled,\n\t\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\tconst { switchEditorMode } = useDispatch( editorStore );\n\n\tlet selectedMode = mode;\n\tif ( ! isRichEditingEnabled && mode === 'visual' ) {\n\t\tselectedMode = 'text';\n\t}\n\tif ( ! isCodeEditingEnabled && mode === 'text' ) {\n\t\tselectedMode = 'visual';\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( ! isCodeEditingEnabled && choice.value === 'text' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t}\n\t\tif ( ! isRichEditingEnabled && choice.value === 'visual' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t\tinfo: __(\n\t\t\t\t\t'You can enable the visual editor in your profile settings.'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\tif ( choice.value !== selectedMode && ! choice.disabled ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ selectedMode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,QAAQ,uBAAuB;AAClE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;;AAE/E;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD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X,CAAC;IACF;IACA,IAAK,CAAEd,oBAAoB,IAAIa,MAAM,CAACjB,KAAK,KAAK,QAAQ,EAAG;MAC1DiB,MAAM,GAAG;QACR,GAAGA,MAAM;QACTC,QAAQ,EAAE,IAAI;QACdC,IAAI,EAAE9B,EAAE,CACP,4DACD;MACD,CAAC;IACF;IACA,IAAK4B,MAAM,CAACjB,KAAK,KAAKc,YAAY,IAAI,CAAEG,MAAM,CAACC,QAAQ,EAAG;MACzD,OAAO;QAAE,GAAGD,MAAM;QAAEd;MAAS,CAAC;IAC/B;IACA,OAAOc,MAAM;EACd,CAAE,CAAC;EAEH,oBACCnB,IAAA,CAACP,SAAS;IAACU,KAAK,EAAGZ,EAAE,CAAE,QAAS,CAAG;IAAA+B,QAAA,eAClCtB,IAAA,CAACR,eAAe;MACfyB,OAAO,EAAGA,OAAS;MACnBf,KAAK,EAAGc,YAAc;MACtBO,QAAQ,EAAGR;IAAkB,CAC7B;EAAC,CACQ,CAAC;AAEd;AAEA,eAAeX,YAAY","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -54,13 +53,15 @@ export function PageAttributesParent() {
54
53
  isHierarchical,
55
54
  parentPostId,
56
55
  parentPostTitle,
57
- pageItems
56
+ pageItems,
57
+ isLoading
58
58
  } = useSelect(select => {
59
59
  var _pType$hierarchical;
60
60
  const {
61
61
  getPostType,
62
62
  getEntityRecords,
63
- getEntityRecord
63
+ getEntityRecord,
64
+ isResolving
64
65
  } = select(coreStore);
65
66
  const {
66
67
  getCurrentPostId,
@@ -89,7 +90,8 @@ export function PageAttributesParent() {
89
90
  isHierarchical: postIsHierarchical,
90
91
  parentPostId: pageId,
91
92
  parentPostTitle: parentPost ? getTitle(parentPost) : '',
92
- pageItems: postIsHierarchical ? getEntityRecords('postType', postTypeSlug, query) : null
93
+ pageItems: postIsHierarchical ? getEntityRecords('postType', postTypeSlug, query) : null,
94
+ isLoading: postIsHierarchical ? isResolving('getEntityRecords', ['postType', postTypeSlug, query]) : false
93
95
  };
94
96
  }, [fieldValue]);
95
97
  const parentOptions = useMemo(() => {
@@ -163,7 +165,8 @@ export function PageAttributesParent() {
163
165
  options: parentOptions,
164
166
  onFilterValueChange: debounce(handleKeydown, 300),
165
167
  onChange: handleChange,
166
- hideLabelFromVision: true
168
+ hideLabelFromVision: true,
169
+ isLoading: isLoading
167
170
  });
168
171
  }
169
172
  function PostParentToggle({