@wordpress/editor 13.32.0 → 13.33.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 (589) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +225 -2
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  16. package/build/components/character-count/index.js.map +1 -1
  17. package/build/components/commands/index.js +19 -0
  18. package/build/components/commands/index.js.map +1 -1
  19. package/build/components/commands/index.native.js.map +1 -1
  20. package/build/components/deprecated.js.map +1 -1
  21. package/build/components/deprecated.native.js.map +1 -1
  22. package/build/components/document-bar/index.js.map +1 -1
  23. package/build/components/document-outline/check.js.map +1 -1
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-outline/item.js.map +1 -1
  26. package/build/components/document-tools/index.js +1 -1
  27. package/build/components/document-tools/index.js.map +1 -1
  28. package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  29. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  30. package/build/components/editor-canvas/index.js +2 -2
  31. package/build/components/editor-canvas/index.js.map +1 -1
  32. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  33. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  35. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  36. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  37. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  38. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  39. package/build/components/editor-help/index.native.js.map +1 -1
  40. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  41. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js.map +1 -1
  45. package/build/components/editor-history/undo.js.map +1 -1
  46. package/build/components/editor-notices/index.js.map +1 -1
  47. package/build/components/editor-snackbars/index.js.map +1 -1
  48. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  49. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  50. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  51. package/build/components/entities-saved-states/index.js.map +1 -1
  52. package/build/components/error-boundary/index.js.map +1 -1
  53. package/build/components/error-boundary/index.native.js.map +1 -1
  54. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  55. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  56. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  57. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  58. package/build/components/index.js +33 -1
  59. package/build/components/index.js.map +1 -1
  60. package/build/components/index.native.js.map +1 -1
  61. package/build/components/inserter-sidebar/index.js.map +1 -1
  62. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  63. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  64. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  65. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  66. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  67. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  68. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  69. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  70. package/build/components/list-view-sidebar/index.js.map +1 -1
  71. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  72. package/build/components/local-autosave-monitor/index.js.map +1 -1
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/mode-switcher/index.js.map +1 -1
  75. package/build/components/offline-status/index.native.js.map +1 -1
  76. package/build/components/page-attributes/check.js.map +1 -1
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/panel.js.map +1 -1
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  81. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  82. package/build/components/plugin-more-menu-item/index.js +78 -0
  83. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  84. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  85. package/build/components/plugin-post-status-info/index.js +73 -0
  86. package/build/components/plugin-post-status-info/index.js.map +1 -0
  87. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  88. package/build/components/plugin-sidebar/index.js +108 -0
  89. package/build/components/plugin-sidebar/index.js.map +1 -0
  90. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  91. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  92. package/build/components/post-actions/actions.js +218 -17
  93. package/build/components/post-actions/actions.js.map +1 -1
  94. package/build/components/post-actions/index.js +137 -0
  95. package/build/components/post-actions/index.js.map +1 -0
  96. package/build/components/post-author/check.js.map +1 -1
  97. package/build/components/post-author/combobox.js.map +1 -1
  98. package/build/components/post-author/constants.js.map +1 -1
  99. package/build/components/post-author/hook.js.map +1 -1
  100. package/build/components/post-author/index.js.map +1 -1
  101. package/build/components/post-author/panel.js.map +1 -1
  102. package/build/components/post-author/select.js.map +1 -1
  103. package/build/components/post-card-panel/index.js +40 -6
  104. package/build/components/post-card-panel/index.js.map +1 -1
  105. package/build/components/post-comments/index.js.map +1 -1
  106. package/build/components/post-discussion/panel.js.map +1 -1
  107. package/build/components/post-excerpt/check.js +8 -0
  108. package/build/components/post-excerpt/check.js.map +1 -1
  109. package/build/components/post-excerpt/index.js.map +1 -1
  110. package/build/components/post-excerpt/panel.js.map +1 -1
  111. package/build/components/post-excerpt/plugin.js.map +1 -1
  112. package/build/components/post-featured-image/check.js.map +1 -1
  113. package/build/components/post-featured-image/index.js.map +1 -1
  114. package/build/components/post-featured-image/panel.js.map +1 -1
  115. package/build/components/post-format/check.js.map +1 -1
  116. package/build/components/post-format/index.js.map +1 -1
  117. package/build/components/post-last-revision/check.js.map +1 -1
  118. package/build/components/post-last-revision/index.js.map +1 -1
  119. package/build/components/post-last-revision/panel.js.map +1 -1
  120. package/build/components/post-locked-modal/index.js.map +1 -1
  121. package/build/components/post-panel-row/index.js.map +1 -1
  122. package/build/components/post-pending-status/check.js.map +1 -1
  123. package/build/components/post-pending-status/index.js.map +1 -1
  124. package/build/components/post-pingbacks/index.js.map +1 -1
  125. package/build/components/post-preview-button/index.js.map +1 -1
  126. package/build/components/post-publish-button/index.js +31 -31
  127. package/build/components/post-publish-button/index.js.map +1 -1
  128. package/build/components/post-publish-button/label.js +51 -43
  129. package/build/components/post-publish-button/label.js.map +1 -1
  130. package/build/components/post-publish-panel/index.js.map +1 -1
  131. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  132. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  133. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  134. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  135. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  136. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  137. package/build/components/post-saved-state/index.js +10 -6
  138. package/build/components/post-saved-state/index.js.map +1 -1
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js.map +1 -1
  141. package/build/components/post-schedule/label.js.map +1 -1
  142. package/build/components/post-schedule/panel.js +8 -0
  143. package/build/components/post-schedule/panel.js.map +1 -1
  144. package/build/components/post-slug/check.js.map +1 -1
  145. package/build/components/post-slug/index.js +43 -68
  146. package/build/components/post-slug/index.js.map +1 -1
  147. package/build/components/post-status/index.js +239 -0
  148. package/build/components/post-status/index.js.map +1 -0
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js.map +1 -1
  151. package/build/components/post-switch-to-draft-button/index.js +6 -1
  152. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build/components/post-sync-status/index.js.map +1 -1
  154. package/build/components/post-taxonomies/check.js.map +1 -1
  155. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  156. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  157. package/build/components/post-taxonomies/index.js.map +1 -1
  158. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  159. package/build/components/post-taxonomies/panel.js.map +1 -1
  160. package/build/components/post-template/block-theme.js +6 -2
  161. package/build/components/post-template/block-theme.js.map +1 -1
  162. package/build/components/post-template/classic-theme.js.map +1 -1
  163. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  164. package/build/components/post-template/create-new-template.js.map +1 -1
  165. package/build/components/post-template/hooks.js.map +1 -1
  166. package/build/components/post-template/panel.js.map +1 -1
  167. package/build/components/post-template/reset-default-template.js.map +1 -1
  168. package/build/components/post-template/swap-template-button.js.map +1 -1
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/constants.js.map +1 -1
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js.map +1 -1
  173. package/build/components/post-title/post-title-raw.js.map +1 -1
  174. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  175. package/build/components/post-title/use-post-title.js.map +1 -1
  176. package/build/components/post-trash/check.js +23 -25
  177. package/build/components/post-trash/check.js.map +1 -1
  178. package/build/components/post-trash/index.js +2 -1
  179. package/build/components/post-trash/index.js.map +1 -1
  180. package/build/components/post-type-support-check/index.js.map +1 -1
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +44 -19
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js.map +1 -1
  185. package/build/components/post-url/panel.js +14 -7
  186. package/build/components/post-url/panel.js.map +1 -1
  187. package/build/components/post-view-link/index.js.map +1 -1
  188. package/build/components/post-visibility/check.js.map +1 -1
  189. package/build/components/post-visibility/index.js +2 -1
  190. package/build/components/post-visibility/index.js.map +1 -1
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js.map +1 -1
  193. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  194. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  195. package/build/components/preferences-modal/index.js +19 -17
  196. package/build/components/preferences-modal/index.js.map +1 -1
  197. package/build/components/preview-dropdown/index.js.map +1 -1
  198. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  199. package/build/components/provider/index.js +4 -2
  200. package/build/components/provider/index.js.map +1 -1
  201. package/build/components/provider/index.native.js +6 -1
  202. package/build/components/provider/index.native.js.map +1 -1
  203. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  204. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  205. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  206. package/build/components/provider/use-block-editor-settings.js +64 -43
  207. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  208. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  209. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  210. package/build/components/provider/with-registry-provider.js +1 -0
  211. package/build/components/provider/with-registry-provider.js.map +1 -1
  212. package/build/components/start-page-options/index.js +139 -0
  213. package/build/components/start-page-options/index.js.map +1 -0
  214. package/build/components/table-of-contents/index.js.map +1 -1
  215. package/build/components/table-of-contents/panel.js.map +1 -1
  216. package/build/components/template-areas/index.js.map +1 -1
  217. package/build/components/template-validation-notice/index.js +23 -29
  218. package/build/components/template-validation-notice/index.js.map +1 -1
  219. package/build/components/theme-support-check/index.js +10 -16
  220. package/build/components/theme-support-check/index.js.map +1 -1
  221. package/build/components/time-to-read/index.js.map +1 -1
  222. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  223. package/build/components/word-count/index.js.map +1 -1
  224. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  225. package/build/hooks/default-autocompleters.js.map +1 -1
  226. package/build/hooks/index.js.map +1 -1
  227. package/build/hooks/index.native.js.map +1 -1
  228. package/build/hooks/pattern-overrides.js +22 -10
  229. package/build/hooks/pattern-overrides.js.map +1 -1
  230. package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
  231. package/build/index.js.map +1 -1
  232. package/build/index.native.js.map +1 -1
  233. package/build/lock-unlock.js.map +1 -1
  234. package/build/private-apis.js +20 -1
  235. package/build/private-apis.js.map +1 -1
  236. package/build/store/actions.js.map +1 -1
  237. package/build/store/actions.native.js.map +1 -1
  238. package/build/store/constants.js +8 -1
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +1 -1
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js.map +1 -1
  244. package/build/store/private-actions.js +177 -4
  245. package/build/store/private-actions.js.map +1 -1
  246. package/build/store/private-selectors.js +1 -7
  247. package/build/store/private-selectors.js.map +1 -1
  248. package/build/store/reducer.js.map +1 -1
  249. package/build/store/reducer.native.js.map +1 -1
  250. package/build/store/selectors.js +5 -10
  251. package/build/store/selectors.js.map +1 -1
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/get-filtered-template-parts.js.map +1 -1
  254. package/build/store/utils/is-template-revertable.js +28 -0
  255. package/build/store/utils/is-template-revertable.js.map +1 -0
  256. package/build/store/utils/notice-builder.js.map +1 -1
  257. package/build/utils/get-template-part-icon.js.map +1 -1
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js.map +1 -1
  260. package/build/utils/media-upload/index.js.map +1 -1
  261. package/build/utils/media-upload/index.native.js.map +1 -1
  262. package/build/utils/terms.js.map +1 -1
  263. package/build/utils/url.js.map +1 -1
  264. package/build-module/bindings/index.js.map +1 -1
  265. package/build-module/bindings/pattern-overrides.js.map +1 -1
  266. package/build-module/bindings/post-meta.js +14 -31
  267. package/build-module/bindings/post-meta.js.map +1 -1
  268. package/build-module/components/autocompleters/index.js.map +1 -1
  269. package/build-module/components/autocompleters/user.js.map +1 -1
  270. package/build-module/components/autosave-monitor/index.js +10 -0
  271. package/build-module/components/autosave-monitor/index.js.map +1 -1
  272. package/build-module/components/block-manager/category.js.map +1 -1
  273. package/build-module/components/block-manager/checklist.js.map +1 -1
  274. package/build-module/components/block-manager/index.js.map +1 -1
  275. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  276. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  277. package/build-module/components/character-count/index.js.map +1 -1
  278. package/build-module/components/commands/index.js +20 -1
  279. package/build-module/components/commands/index.js.map +1 -1
  280. package/build-module/components/commands/index.native.js.map +1 -1
  281. package/build-module/components/deprecated.js.map +1 -1
  282. package/build-module/components/deprecated.native.js.map +1 -1
  283. package/build-module/components/document-bar/index.js.map +1 -1
  284. package/build-module/components/document-outline/check.js.map +1 -1
  285. package/build-module/components/document-outline/index.js.map +1 -1
  286. package/build-module/components/document-outline/item.js.map +1 -1
  287. package/build-module/components/document-tools/index.js +1 -1
  288. package/build-module/components/document-tools/index.js.map +1 -1
  289. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  290. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  291. package/build-module/components/editor-canvas/index.js +2 -2
  292. package/build-module/components/editor-canvas/index.js.map +1 -1
  293. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  294. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  295. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  297. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  298. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js.map +1 -1
  301. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  302. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  303. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  305. package/build-module/components/editor-history/redo.js.map +1 -1
  306. package/build-module/components/editor-history/undo.js.map +1 -1
  307. package/build-module/components/editor-notices/index.js.map +1 -1
  308. package/build-module/components/editor-snackbars/index.js.map +1 -1
  309. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  310. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  311. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  312. package/build-module/components/entities-saved-states/index.js.map +1 -1
  313. package/build-module/components/error-boundary/index.js.map +1 -1
  314. package/build-module/components/error-boundary/index.native.js.map +1 -1
  315. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  316. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  317. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  318. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  319. package/build-module/components/index.js +4 -0
  320. package/build-module/components/index.js.map +1 -1
  321. package/build-module/components/index.native.js.map +1 -1
  322. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  323. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  324. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  325. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  326. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  327. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  328. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  329. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  330. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  331. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  332. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  333. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  334. package/build-module/components/media-categories/index.js.map +1 -1
  335. package/build-module/components/mode-switcher/index.js.map +1 -1
  336. package/build-module/components/offline-status/index.native.js.map +1 -1
  337. package/build-module/components/page-attributes/check.js.map +1 -1
  338. package/build-module/components/page-attributes/order.js.map +1 -1
  339. package/build-module/components/page-attributes/panel.js.map +1 -1
  340. package/build-module/components/page-attributes/parent.js.map +1 -1
  341. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  342. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  343. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  344. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  345. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  346. package/build-module/components/plugin-post-status-info/index.js +66 -0
  347. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  348. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  349. package/build-module/components/plugin-sidebar/index.js +102 -0
  350. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  351. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  352. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  353. package/build-module/components/post-actions/actions.js +219 -15
  354. package/build-module/components/post-actions/actions.js.map +1 -1
  355. package/build-module/components/post-actions/index.js +130 -0
  356. package/build-module/components/post-actions/index.js.map +1 -0
  357. package/build-module/components/post-author/check.js.map +1 -1
  358. package/build-module/components/post-author/combobox.js.map +1 -1
  359. package/build-module/components/post-author/constants.js.map +1 -1
  360. package/build-module/components/post-author/hook.js.map +1 -1
  361. package/build-module/components/post-author/index.js.map +1 -1
  362. package/build-module/components/post-author/panel.js.map +1 -1
  363. package/build-module/components/post-author/select.js.map +1 -1
  364. package/build-module/components/post-card-panel/index.js +42 -8
  365. package/build-module/components/post-card-panel/index.js.map +1 -1
  366. package/build-module/components/post-comments/index.js.map +1 -1
  367. package/build-module/components/post-discussion/panel.js.map +1 -1
  368. package/build-module/components/post-excerpt/check.js +9 -0
  369. package/build-module/components/post-excerpt/check.js.map +1 -1
  370. package/build-module/components/post-excerpt/index.js.map +1 -1
  371. package/build-module/components/post-excerpt/panel.js.map +1 -1
  372. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  373. package/build-module/components/post-featured-image/check.js.map +1 -1
  374. package/build-module/components/post-featured-image/index.js.map +1 -1
  375. package/build-module/components/post-featured-image/panel.js.map +1 -1
  376. package/build-module/components/post-format/check.js.map +1 -1
  377. package/build-module/components/post-format/index.js.map +1 -1
  378. package/build-module/components/post-last-revision/check.js.map +1 -1
  379. package/build-module/components/post-last-revision/index.js.map +1 -1
  380. package/build-module/components/post-last-revision/panel.js.map +1 -1
  381. package/build-module/components/post-locked-modal/index.js.map +1 -1
  382. package/build-module/components/post-panel-row/index.js.map +1 -1
  383. package/build-module/components/post-pending-status/check.js.map +1 -1
  384. package/build-module/components/post-pending-status/index.js.map +1 -1
  385. package/build-module/components/post-pingbacks/index.js.map +1 -1
  386. package/build-module/components/post-preview-button/index.js.map +1 -1
  387. package/build-module/components/post-publish-button/index.js +31 -31
  388. package/build-module/components/post-publish-button/index.js.map +1 -1
  389. package/build-module/components/post-publish-button/label.js +51 -42
  390. package/build-module/components/post-publish-button/label.js.map +1 -1
  391. package/build-module/components/post-publish-panel/index.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  395. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  396. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  397. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  398. package/build-module/components/post-saved-state/index.js +10 -6
  399. package/build-module/components/post-saved-state/index.js.map +1 -1
  400. package/build-module/components/post-schedule/check.js.map +1 -1
  401. package/build-module/components/post-schedule/index.js.map +1 -1
  402. package/build-module/components/post-schedule/label.js.map +1 -1
  403. package/build-module/components/post-schedule/panel.js +8 -0
  404. package/build-module/components/post-schedule/panel.js.map +1 -1
  405. package/build-module/components/post-slug/check.js.map +1 -1
  406. package/build-module/components/post-slug/index.js +44 -68
  407. package/build-module/components/post-slug/index.js.map +1 -1
  408. package/build-module/components/post-status/index.js +231 -0
  409. package/build-module/components/post-status/index.js.map +1 -0
  410. package/build-module/components/post-sticky/check.js.map +1 -1
  411. package/build-module/components/post-sticky/index.js.map +1 -1
  412. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  413. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  414. package/build-module/components/post-sync-status/index.js.map +1 -1
  415. package/build-module/components/post-taxonomies/check.js.map +1 -1
  416. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  417. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  418. package/build-module/components/post-taxonomies/index.js.map +1 -1
  419. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  420. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  421. package/build-module/components/post-template/block-theme.js +7 -3
  422. package/build-module/components/post-template/block-theme.js.map +1 -1
  423. package/build-module/components/post-template/classic-theme.js.map +1 -1
  424. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  425. package/build-module/components/post-template/create-new-template.js.map +1 -1
  426. package/build-module/components/post-template/hooks.js.map +1 -1
  427. package/build-module/components/post-template/panel.js.map +1 -1
  428. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  429. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  430. package/build-module/components/post-text-editor/index.js.map +1 -1
  431. package/build-module/components/post-title/constants.js.map +1 -1
  432. package/build-module/components/post-title/index.js.map +1 -1
  433. package/build-module/components/post-title/index.native.js.map +1 -1
  434. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  435. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  436. package/build-module/components/post-title/use-post-title.js.map +1 -1
  437. package/build-module/components/post-trash/check.js +24 -26
  438. package/build-module/components/post-trash/check.js.map +1 -1
  439. package/build-module/components/post-trash/index.js +2 -1
  440. package/build-module/components/post-trash/index.js.map +1 -1
  441. package/build-module/components/post-type-support-check/index.js.map +1 -1
  442. package/build-module/components/post-url/check.js.map +1 -1
  443. package/build-module/components/post-url/index.js +46 -21
  444. package/build-module/components/post-url/index.js.map +1 -1
  445. package/build-module/components/post-url/label.js.map +1 -1
  446. package/build-module/components/post-url/panel.js +14 -7
  447. package/build-module/components/post-url/panel.js.map +1 -1
  448. package/build-module/components/post-view-link/index.js.map +1 -1
  449. package/build-module/components/post-visibility/check.js.map +1 -1
  450. package/build-module/components/post-visibility/index.js +2 -1
  451. package/build-module/components/post-visibility/index.js.map +1 -1
  452. package/build-module/components/post-visibility/label.js.map +1 -1
  453. package/build-module/components/post-visibility/utils.js.map +1 -1
  454. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  455. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  456. package/build-module/components/preferences-modal/index.js +19 -17
  457. package/build-module/components/preferences-modal/index.js.map +1 -1
  458. package/build-module/components/preview-dropdown/index.js.map +1 -1
  459. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  460. package/build-module/components/provider/index.js +5 -3
  461. package/build-module/components/provider/index.js.map +1 -1
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  464. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  465. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  466. package/build-module/components/provider/use-block-editor-settings.js +66 -45
  467. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  468. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  469. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  470. package/build-module/components/provider/with-registry-provider.js +1 -0
  471. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  472. package/build-module/components/start-page-options/index.js +132 -0
  473. package/build-module/components/start-page-options/index.js.map +1 -0
  474. package/build-module/components/table-of-contents/index.js.map +1 -1
  475. package/build-module/components/table-of-contents/panel.js.map +1 -1
  476. package/build-module/components/template-areas/index.js.map +1 -1
  477. package/build-module/components/template-validation-notice/index.js +25 -31
  478. package/build-module/components/template-validation-notice/index.js.map +1 -1
  479. package/build-module/components/theme-support-check/index.js +11 -16
  480. package/build-module/components/theme-support-check/index.js.map +1 -1
  481. package/build-module/components/time-to-read/index.js.map +1 -1
  482. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  483. package/build-module/components/word-count/index.js.map +1 -1
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js.map +1 -1
  486. package/build-module/hooks/index.js.map +1 -1
  487. package/build-module/hooks/index.native.js.map +1 -1
  488. package/build-module/hooks/pattern-overrides.js +22 -10
  489. package/build-module/hooks/pattern-overrides.js.map +1 -1
  490. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
  491. package/build-module/index.js.map +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js +18 -1
  495. package/build-module/private-apis.js.map +1 -1
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js.map +1 -1
  498. package/build-module/store/constants.js +7 -0
  499. package/build-module/store/constants.js.map +1 -1
  500. package/build-module/store/defaults.js.map +1 -1
  501. package/build-module/store/index.js.map +1 -1
  502. package/build-module/store/local-autosave.js.map +1 -1
  503. package/build-module/store/private-actions.js +174 -4
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-selectors.js +1 -6
  506. package/build-module/store/private-selectors.js.map +1 -1
  507. package/build-module/store/reducer.js.map +1 -1
  508. package/build-module/store/reducer.native.js.map +1 -1
  509. package/build-module/store/selectors.js +1 -6
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/store/selectors.native.js.map +1 -1
  512. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
  513. package/build-module/store/utils/is-template-revertable.js +22 -0
  514. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  515. package/build-module/store/utils/notice-builder.js.map +1 -1
  516. package/build-module/utils/get-template-part-icon.js.map +1 -1
  517. package/build-module/utils/index.js.map +1 -1
  518. package/build-module/utils/index.native.js.map +1 -1
  519. package/build-module/utils/media-upload/index.js.map +1 -1
  520. package/build-module/utils/media-upload/index.native.js.map +1 -1
  521. package/build-module/utils/terms.js.map +1 -1
  522. package/build-module/utils/url.js.map +1 -1
  523. package/build-style/style-rtl.css +498 -25
  524. package/build-style/style.css +498 -25
  525. package/package.json +35 -35
  526. package/src/bindings/post-meta.js +11 -27
  527. package/src/components/autosave-monitor/index.js +9 -0
  528. package/src/components/commands/index.js +20 -1
  529. package/src/components/document-tools/index.js +16 -14
  530. package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
  531. package/src/components/editor-canvas/index.js +4 -4
  532. package/src/components/error-boundary/style.native.scss +1 -1
  533. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  534. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  535. package/src/components/index.js +4 -0
  536. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  537. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  538. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  539. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  540. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  541. package/src/components/plugin-more-menu-item/index.js +73 -0
  542. package/src/components/plugin-post-status-info/index.js +63 -0
  543. package/src/components/plugin-sidebar/index.js +98 -0
  544. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  545. package/src/components/post-actions/actions.js +294 -14
  546. package/src/components/post-actions/index.js +156 -0
  547. package/src/components/post-actions/style.scss +3 -0
  548. package/src/components/post-card-panel/index.js +69 -9
  549. package/src/components/post-excerpt/check.js +8 -0
  550. package/src/components/post-publish-button/index.js +23 -36
  551. package/src/components/post-publish-button/label.js +54 -39
  552. package/src/components/post-publish-button/test/index.js +15 -26
  553. package/src/components/post-publish-button/test/label.js +44 -21
  554. package/src/components/post-saved-state/index.js +13 -6
  555. package/src/components/post-saved-state/test/index.js +4 -0
  556. package/src/components/post-schedule/panel.js +22 -0
  557. package/src/components/post-slug/index.js +50 -68
  558. package/src/components/post-slug/test/index.js +29 -6
  559. package/src/components/post-status/index.js +310 -0
  560. package/src/components/post-status/style.scss +75 -0
  561. package/src/components/post-switch-to-draft-button/index.js +5 -0
  562. package/src/components/post-template/block-theme.js +31 -22
  563. package/src/components/post-trash/check.js +19 -19
  564. package/src/components/post-trash/index.js +1 -0
  565. package/src/components/post-url/index.js +131 -101
  566. package/src/components/post-url/panel.js +20 -7
  567. package/src/components/post-url/style.scss +8 -6
  568. package/src/components/post-visibility/index.js +1 -0
  569. package/src/components/preferences-modal/index.js +26 -22
  570. package/src/components/provider/index.js +17 -8
  571. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  572. package/src/components/provider/use-block-editor-settings.js +59 -33
  573. package/src/components/provider/with-registry-provider.js +1 -0
  574. package/src/components/start-page-options/index.js +135 -0
  575. package/src/components/start-page-options/style.scss +26 -0
  576. package/src/components/template-validation-notice/index.js +48 -50
  577. package/src/components/theme-support-check/index.js +9 -16
  578. package/src/components/theme-support-check/test/index.js +44 -43
  579. package/src/hooks/pattern-overrides.js +25 -14
  580. package/src/private-apis.js +15 -0
  581. package/src/store/constants.js +7 -0
  582. package/src/store/private-actions.js +269 -4
  583. package/src/store/private-selectors.js +1 -6
  584. package/src/store/selectors.js +1 -6
  585. package/src/store/utils/is-template-revertable.js +23 -0
  586. package/src/style.scss +6 -2
  587. package/src/components/post-publish-button/style.scss +0 -8
  588. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
  589. package/src/components/template-validation-notice/style.scss +0 -9
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useState","Dropdown","Button","__","sprintf","PostURLCheck","PostURL","usePostURLLabel","PostPanelRow","PostURLPanel","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","createElement","label","ref","className","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostURLToggle","onClick","renderContent","onClose","__next40pxDefaultSize","variant"],"sources":["@wordpress/editor/src/components/post-url/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PostURLCheck from './check';\nimport PostURL from './index';\nimport { usePostURLLabel } from './label';\nimport PostPanelRow from '../post-panel-row';\n\nexport default function PostURLPanel() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PostPanelRow label={ __( 'URL' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-url__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-url__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURL onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst label = usePostURLLabel();\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-post-url__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post URL.\n\t\t\taria-label={ sprintf( __( 'Change URL: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,YAAY,MAAM,SAAS;AAClC,OAAOC,OAAO,MAAM,SAAS;AAC7B,SAASC,eAAe,QAAQ,SAAS;AACzC,OAAOC,YAAY,MAAM,mBAAmB;AAE5C,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAGX,QAAQ,CAAE,IAAK,CAAC;EAC5D;EACA,MAAMY,YAAY,GAAGb,OAAO,CAC3B,OAAQ;IAAEc,MAAM,EAAEH,aAAa;IAAEI,SAAS,EAAE;EAAa,CAAC,CAAE,EAC5D,CAAEJ,aAAa,CAChB,CAAC;EAED,OACCK,aAAA,CAACV,YAAY,QACZU,aAAA,CAACP,YAAY;IAACQ,KAAK,EAAGb,EAAE,CAAE,KAAM,CAAG;IAACc,GAAG,EAAGN;EAAkB,GAC3DI,aAAA,CAACd,QAAQ;IACRW,YAAY,EAAGA,YAAc;IAC7BM,SAAS,EAAC,iCAAiC;IAC3CC,gBAAgB,EAAC,+BAA+B;IAChDC,YAAY;IACZC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCR,aAAA,CAACS,aAAa;MAACF,MAAM,EAAGA,MAAQ;MAACG,OAAO,EAAGF;IAAU,CAAE,CACrD;IACHG,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5BZ,aAAA,CAACT,OAAO;MAACqB,OAAO,EAAGA;IAAS,CAAE;EAC5B,CACH,CACY,CACD,CAAC;AAEjB;AAEA,SAASH,aAAaA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EAC7C,MAAMT,KAAK,GAAGT,eAAe,CAAC,CAAC;EAC/B,OACCQ,aAAA,CAACb,MAAM;IACN0B,qBAAqB;IACrBV,SAAS,EAAC,+BAA+B;IACzCW,OAAO,EAAC,UAAU;IAClB,iBAAgBP;IAChB;IAAA;IACA,cAAalB,OAAO,CAAED,EAAE,CAAE,gBAAiB,CAAC,EAAEa,KAAM,CAAG;IACvDS,OAAO,EAAGA;EAAS,GAEjBT,KACK,CAAC;AAEX"}
1
+ {"version":3,"names":["useMemo","useState","useSelect","Dropdown","Button","__","sprintf","safeDecodeURIComponent","PostURLCheck","PostURL","PostPanelRow","store","editorStore","PostURLPanel","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","createElement","label","ref","className","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostURLToggle","onClick","renderContent","onClose","slug","select","getEditedPostSlug","decodedSlug","__next40pxDefaultSize","variant"],"sources":["@wordpress/editor/src/components/post-url/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostURLCheck from './check';\nimport PostURL from './index';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nexport default function PostURLPanel() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PostPanelRow label={ __( 'Link' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-url__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-url__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURL onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst slug = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostSlug(),\n\t\t[]\n\t);\n\tconst decodedSlug = safeDecodeURIComponent( slug );\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-post-url__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post link.\n\t\t\taria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ decodedSlug }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,sBAAsB,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,SAAS;AAClC,OAAOC,OAAO,MAAM,SAAS;AAC7B,OAAOC,YAAY,MAAM,mBAAmB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAGd,QAAQ,CAAE,IAAK,CAAC;EAC5D;EACA,MAAMe,YAAY,GAAGhB,OAAO,CAC3B,OAAQ;IACP;IACA;IACAiB,MAAM,EAAEH,aAAa;IACrBI,SAAS,EAAE,YAAY;IACvBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE;EACR,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EAED,OACCO,aAAA,CAACb,YAAY,QACZa,aAAA,CAACX,YAAY;IAACY,KAAK,EAAGjB,EAAE,CAAE,MAAO,CAAG;IAACkB,GAAG,EAAGR;EAAkB,GAC5DM,aAAA,CAAClB,QAAQ;IACRa,YAAY,EAAGA,YAAc;IAC7BQ,SAAS,EAAC,iCAAiC;IAC3CC,gBAAgB,EAAC,+BAA+B;IAChDC,YAAY;IACZC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCR,aAAA,CAACS,aAAa;MAACF,MAAM,EAAGA,MAAQ;MAACG,OAAO,EAAGF;IAAU,CAAE,CACrD;IACHG,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5BZ,aAAA,CAACZ,OAAO;MAACwB,OAAO,EAAGA;IAAS,CAAE;EAC5B,CACH,CACY,CACD,CAAC;AAEjB;AAEA,SAASH,aAAaA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EAC7C,MAAMG,IAAI,GAAGhC,SAAS,CACnBiC,MAAM,IAAMA,MAAM,CAAEvB,WAAY,CAAC,CAACwB,iBAAiB,CAAC,CAAC,EACvD,EACD,CAAC;EACD,MAAMC,WAAW,GAAG9B,sBAAsB,CAAE2B,IAAK,CAAC;EAClD,OACCb,aAAA,CAACjB,MAAM;IACNkC,qBAAqB;IACrBd,SAAS,EAAC,+BAA+B;IACzCe,OAAO,EAAC,UAAU;IAClB,iBAAgBX;IAChB;IAAA;IACA,cAAatB,OAAO,CAAED,EAAE,CAAE,iBAAkB,CAAC,EAAEgC,WAAY,CAAG;IAC9DN,OAAO,EAAGA;EAAS,GAEjBM,WACK,CAAC;AAEX","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","Button","external","store","coreStore","useSelect","preferencesStore","editorStore","PostViewLink","hasLoaded","permalink","isPublished","label","showIconLabels","select","postTypeSlug","getCurrentPostType","postType","getPostType","get","getPermalink","isCurrentPostPublished","labels","view_item","createElement","icon","href","target","showTooltip","size"],"sources":["@wordpress/editor/src/components/post-view-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostViewLink() {\n\tconst { hasLoaded, permalink, isPublished, label, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\t// Grab post type to retrieve the view_item label.\n\t\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\treturn {\n\t\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\t\tlabel: postType?.labels.view_item,\n\t\t\t\thasLoaded: !! postType,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink || ! hasLoaded ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\tsize=\"compact\"\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,SAAS;IAAEC,SAAS;IAAEC,WAAW;IAAEC,KAAK;IAAEC;EAAe,CAAC,GACjER,SAAS,CAAIS,MAAM,IAAM;IACxB;IACA,MAAMC,YAAY,GAAGD,MAAM,CAAEP,WAAY,CAAC,CAACS,kBAAkB,CAAC,CAAC;IAC/D,MAAMC,QAAQ,GAAGH,MAAM,CAAEV,SAAU,CAAC,CAACc,WAAW,CAAEH,YAAa,CAAC;IAChE,MAAM;MAAEI;IAAI,CAAC,GAAGL,MAAM,CAAER,gBAAiB,CAAC;IAE1C,OAAO;MACNI,SAAS,EAAEI,MAAM,CAAEP,WAAY,CAAC,CAACa,YAAY,CAAC,CAAC;MAC/CT,WAAW,EAAEG,MAAM,CAAEP,WAAY,CAAC,CAACc,sBAAsB,CAAC,CAAC;MAC3DT,KAAK,EAAEK,QAAQ,EAAEK,MAAM,CAACC,SAAS;MACjCd,SAAS,EAAE,CAAC,CAAEQ,QAAQ;MACtBJ,cAAc,EAAEM,GAAG,CAAE,MAAM,EAAE,gBAAiB;IAC/C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;;EAER;EACA,IAAK,CAAER,WAAW,IAAI,CAAED,SAAS,IAAI,CAAED,SAAS,EAAG;IAClD,OAAO,IAAI;EACZ;EAEA,OACCe,aAAA,CAACvB,MAAM;IACNwB,IAAI,EAAGvB,QAAU;IACjBU,KAAK,EAAGA,KAAK,IAAIZ,EAAE,CAAE,WAAY,CAAG;IACpC0B,IAAI,EAAGhB,SAAW;IAClBiB,MAAM,EAAC,QAAQ;IACfC,WAAW,EAAG,CAAEf,cAAgB;IAChCgB,IAAI,EAAC;EAAS,CACd,CAAC;AAEJ"}
1
+ {"version":3,"names":["__","Button","external","store","coreStore","useSelect","preferencesStore","editorStore","PostViewLink","hasLoaded","permalink","isPublished","label","showIconLabels","select","postTypeSlug","getCurrentPostType","postType","getPostType","get","getPermalink","isCurrentPostPublished","labels","view_item","createElement","icon","href","target","showTooltip","size"],"sources":["@wordpress/editor/src/components/post-view-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostViewLink() {\n\tconst { hasLoaded, permalink, isPublished, label, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\t// Grab post type to retrieve the view_item label.\n\t\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\treturn {\n\t\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\t\tlabel: postType?.labels.view_item,\n\t\t\t\thasLoaded: !! postType,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink || ! hasLoaded ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\tsize=\"compact\"\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,SAAS;IAAEC,SAAS;IAAEC,WAAW;IAAEC,KAAK;IAAEC;EAAe,CAAC,GACjER,SAAS,CAAIS,MAAM,IAAM;IACxB;IACA,MAAMC,YAAY,GAAGD,MAAM,CAAEP,WAAY,CAAC,CAACS,kBAAkB,CAAC,CAAC;IAC/D,MAAMC,QAAQ,GAAGH,MAAM,CAAEV,SAAU,CAAC,CAACc,WAAW,CAAEH,YAAa,CAAC;IAChE,MAAM;MAAEI;IAAI,CAAC,GAAGL,MAAM,CAAER,gBAAiB,CAAC;IAE1C,OAAO;MACNI,SAAS,EAAEI,MAAM,CAAEP,WAAY,CAAC,CAACa,YAAY,CAAC,CAAC;MAC/CT,WAAW,EAAEG,MAAM,CAAEP,WAAY,CAAC,CAACc,sBAAsB,CAAC,CAAC;MAC3DT,KAAK,EAAEK,QAAQ,EAAEK,MAAM,CAACC,SAAS;MACjCd,SAAS,EAAE,CAAC,CAAEQ,QAAQ;MACtBJ,cAAc,EAAEM,GAAG,CAAE,MAAM,EAAE,gBAAiB;IAC/C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;;EAER;EACA,IAAK,CAAER,WAAW,IAAI,CAAED,SAAS,IAAI,CAAED,SAAS,EAAG;IAClD,OAAO,IAAI;EACZ;EAEA,OACCe,aAAA,CAACvB,MAAM;IACNwB,IAAI,EAAGvB,QAAU;IACjBU,KAAK,EAAGA,KAAK,IAAIZ,EAAE,CAAE,WAAY,CAAG;IACpC0B,IAAI,EAAGhB,SAAW;IAClBiB,MAAM,EAAC,QAAQ;IACfC,WAAW,EAAG,CAAEf,cAAgB;IAChCgB,IAAI,EAAC;EAAS,CACd,CAAC;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","editorStore","PostVisibilityCheck","render","canEdit","select","_select$getCurrentPos","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityCheck( { render } ) {\n\tconst canEdit = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t} );\n\n\treturn render( { canEdit } );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,mBAAmBA,CAAE;EAAEC;AAAO,CAAC,EAAG;EACzD,MAAMC,OAAO,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACxC,QAAAA,qBAAA,GACCD,MAAM,CAAEJ,WAAY,CAAC,CAACM,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAF,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAE,CAAC;EAEH,OAAOH,MAAM,CAAE;IAAEC;EAAQ,CAAE,CAAC;AAC7B"}
1
+ {"version":3,"names":["useSelect","store","editorStore","PostVisibilityCheck","render","canEdit","select","_select$getCurrentPos","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityCheck( { render } ) {\n\tconst canEdit = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t} );\n\n\treturn render( { canEdit } );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,mBAAmBA,CAAE;EAAEC;AAAO,CAAC,EAAG;EACzD,MAAMC,OAAO,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACxC,QAAAA,qBAAA,GACCD,MAAM,CAAEJ,WAAY,CAAC,CAACM,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAF,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAE,CAAC;EAEH,OAAOH,MAAM,CAAE;IAAEC;EAAQ,CAAE,CAAC;AAC7B","ignoreList":[]}
@@ -113,7 +113,8 @@ export default function PostVisibility({
113
113
  }))), createElement(ConfirmDialog, {
114
114
  isOpen: showPrivateConfirmDialog,
115
115
  onConfirm: confirmPrivate,
116
- onCancel: handleDialogCancel
116
+ onCancel: handleDialogCancel,
117
+ confirmButtonText: __('Publish')
117
118
  }, __('Would you like to privately publish this post now?')));
118
119
  }
119
120
  function PostVisibilityChoice({
@@ -1 +1 @@
1
- {"version":3,"names":["__","useState","VisuallyHidden","__experimentalConfirmDialog","ConfirmDialog","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","visibilityOptions","store","editorStore","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","createElement","className","title","help","as","PostVisibilityChoice","label","public","info","checked","onChange","private","htmlFor","id","type","placeholder","isOpen","onConfirm","onCancel","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,cAAc,EACdC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,SAAS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Cc,IAAI,EAAC,OAAO;IACZM,IAAI,EAAI,mCAAmC1C,UAAY,EAAG;IAC1DqB,KAAK,EAAGA,KAAO;IACfc,EAAE,EAAI,eAAed,KAAO,IAAIrB,UAAY,EAAG;IAC/C,oBAAoB,eAAeqB,KAAO,IAAIrB,UAAY,cAAe;IACzEuB,SAAS,EAAC,+BAA+B;IAAA,GACpCkB;EAAK,CACV,CAAC,EACFnB,aAAA;IACCY,OAAO,EAAI,eAAeb,KAAO,IAAIrB,UAAY,EAAG;IACpDuB,SAAS,EAAC;EAA+B,GAEvCK,KACI,CAAC,EACRN,aAAA;IACCa,EAAE,EAAI,eAAed,KAAO,IAAIrB,UAAY,cAAe;IAC3DuB,SAAS,EAAC;EAA8B,GAEtCO,IACA,CACC,CAAC;AAER"}
1
+ {"version":3,"names":["__","useState","VisuallyHidden","__experimentalConfirmDialog","ConfirmDialog","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","visibilityOptions","store","editorStore","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","createElement","className","title","help","as","PostVisibilityChoice","label","public","info","checked","onChange","private","htmlFor","id","type","placeholder","isOpen","onConfirm","onCancel","confirmButtonText","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t\tconfirmButtonText={ __( 'Publish' ) }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,cAAc,EACdC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,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C,OAAO;IACZO,IAAI,EAAI,mCAAmC3C,UAAY,EAAG;IAC1DqB,KAAK,EAAGA,KAAO;IACfc,EAAE,EAAI,eAAed,KAAO,IAAIrB,UAAY,EAAG;IAC/C,oBAAoB,eAAeqB,KAAO,IAAIrB,UAAY,cAAe;IACzEuB,SAAS,EAAC,+BAA+B;IAAA,GACpCmB;EAAK,CACV,CAAC,EACFpB,aAAA;IACCY,OAAO,EAAI,eAAeb,KAAO,IAAIrB,UAAY,EAAG;IACpDuB,SAAS,EAAC;EAA+B,GAEvCK,KACI,CAAC,EACRN,aAAA;IACCa,EAAE,EAAI,eAAed,KAAO,IAAIrB,UAAY,cAAe;IAC3DuB,SAAS,EAAC;EAA8B,GAEtCO,IACA,CACC,CAAC;AAER","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","label"],"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostVisibility()\n\t);\n\treturn visibilityOptions[ visibility ]?.label;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,OAAOC,sBAAsB,CAAC,CAAC;AAChC;AAEA,OAAO,SAASA,sBAAsBA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAGN,SAAS,CAAIO,MAAM,IACrCA,MAAM,CAAEJ,WAAY,CAAC,CAACK,uBAAuB,CAAC,CAC/C,CAAC;EACD,OAAOP,iBAAiB,CAAEK,UAAU,CAAE,EAAEG,KAAK;AAC9C"}
1
+ {"version":3,"names":["useSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","label"],"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostVisibility()\n\t);\n\treturn visibilityOptions[ visibility ]?.label;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,OAAOC,sBAAsB,CAAC,CAAC;AAChC;AAEA,OAAO,SAASA,sBAAsBA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAGN,SAAS,CAAIO,MAAM,IACrCA,MAAM,CAAEJ,WAAY,CAAC,CAACK,uBAAuB,CAAC,CAC/C,CAAC;EACD,OAAOP,iBAAiB,CAAEK,UAAU,CAAE,EAAEG,KAAK;AAC9C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","visibilityOptions","public","label","info","private","password"],"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const visibilityOptions = {\n\tpublic: {\n\t\tlabel: __( 'Public' ),\n\t\tinfo: __( 'Visible to everyone.' ),\n\t},\n\tprivate: {\n\t\tlabel: __( 'Private' ),\n\t\tinfo: __( 'Only visible to site admins and editors.' ),\n\t},\n\tpassword: {\n\t\tlabel: __( 'Password protected' ),\n\t\tinfo: __( 'Only those with the password can view this post.' ),\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,MAAM,EAAE;IACPC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;IACrBI,IAAI,EAAEJ,EAAE,CAAE,sBAAuB;EAClC,CAAC;EACDK,OAAO,EAAE;IACRF,KAAK,EAAEH,EAAE,CAAE,SAAU,CAAC;IACtBI,IAAI,EAAEJ,EAAE,CAAE,0CAA2C;EACtD,CAAC;EACDM,QAAQ,EAAE;IACTH,KAAK,EAAEH,EAAE,CAAE,oBAAqB,CAAC;IACjCI,IAAI,EAAEJ,EAAE,CAAE,kDAAmD;EAC9D;AACD,CAAC"}
1
+ {"version":3,"names":["__","visibilityOptions","public","label","info","private","password"],"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const visibilityOptions = {\n\tpublic: {\n\t\tlabel: __( 'Public' ),\n\t\tinfo: __( 'Visible to everyone.' ),\n\t},\n\tprivate: {\n\t\tlabel: __( 'Private' ),\n\t\tinfo: __( 'Only visible to site admins and editors.' ),\n\t},\n\tpassword: {\n\t\tlabel: __( 'Password protected' ),\n\t\tinfo: __( 'Only those with the password can view this post.' ),\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,MAAM,EAAE;IACPC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;IACrBI,IAAI,EAAEJ,EAAE,CAAE,sBAAuB;EAClC,CAAC;EACDK,OAAO,EAAE;IACRF,KAAK,EAAEH,EAAE,CAAE,SAAU,CAAC;IACtBI,IAAI,EAAEJ,EAAE,CAAE,0CAA2C;EACtD,CAAC;EACDM,QAAQ,EAAE;IACTH,KAAK,EAAEH,EAAE,CAAE,oBAAqB,CAAC;IACjCI,IAAI,EAAEJ,EAAE,CAAE,kDAAmD;EAC9D;AACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["compose","ifCondition","withSelect","withDispatch","privateApis","preferencesPrivateApis","unlock","store","editorStore","PreferenceBaseOption","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/editor/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,MAAM;EAAEC;AAAqB,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeL,OAAO,CACrBE,UAAU,CAAE,CAAEQ,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEF,WAAY,CAAC;EACtB,OAAO;IACNM,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHV,WAAW,CAAE,CAAE;EAAEa;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CX,YAAY,CAAE,CAAEa,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAER,WAAY,CAAC,CAACU,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEF,oBAAqB,CAAC"}
1
+ {"version":3,"names":["compose","ifCondition","withSelect","withDispatch","privateApis","preferencesPrivateApis","unlock","store","editorStore","PreferenceBaseOption","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/editor/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,MAAM;EAAEC;AAAqB,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeL,OAAO,CACrBE,UAAU,CAAE,CAAEQ,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEF,WAAY,CAAC;EACtB,OAAO;IACNM,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHV,WAAW,CAAE,CAAE;EAAEa;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CX,YAAY,CAAE,CAAEa,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAER,WAAY,CAAC,CAACU,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEF,oBAAqB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["createSlotFill","EnablePanelOption","Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName","createElement"],"sources":["@wordpress/editor/src/components/preferences-modal/enable-plugin-document-setting-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,uBAAuB;;AAEtD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAE9C,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CACpC,wCACD,CAAC;AAED,MAAMI,sCAAsC,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAU,CAAC,KACpEC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,iBAAiB;EAACI,KAAK,EAAGA,KAAO;EAACC,SAAS,EAAGA;AAAW,CAAE,CACvD,CACN;AAEDF,sCAAsC,CAACD,IAAI,GAAGA,IAAI;AAElD,eAAeC,sCAAsC"}
1
+ {"version":3,"names":["createSlotFill","EnablePanelOption","Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName","createElement"],"sources":["@wordpress/editor/src/components/preferences-modal/enable-plugin-document-setting-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,uBAAuB;;AAEtD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAE9C,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CACpC,wCACD,CAAC;AAED,MAAMI,sCAAsC,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAU,CAAC,KACpEC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,iBAAiB;EAACI,KAAK,EAAGA,KAAO;EAACC,SAAS,EAAGA;AAAW,CAAE,CACvD,CACN;AAEDF,sCAAsC,CAACD,IAAI,GAAGA,IAAI;AAElD,eAAeC,sCAAsC","ignoreList":[]}
@@ -8,6 +8,7 @@ import { useViewportMatch } from '@wordpress/compose';
8
8
  import { useSelect, useDispatch } from '@wordpress/data';
9
9
  import { useMemo } from '@wordpress/element';
10
10
  import { store as preferencesStore, privateApis as preferencesPrivateApis } from '@wordpress/preferences';
11
+ import { store as interfaceStore } from '@wordpress/interface';
11
12
 
12
13
  /**
13
14
  * Internal dependencies
@@ -29,12 +30,11 @@ const {
29
30
  PreferenceToggleControl
30
31
  } = unlock(preferencesPrivateApis);
31
32
  export default function EditorPreferencesModal({
32
- extraSections = {},
33
- isActive,
34
- onClose
33
+ extraSections = {}
35
34
  }) {
36
35
  const isLargeViewport = useViewportMatch('medium');
37
36
  const {
37
+ isActive,
38
38
  showBlockBreadcrumbsOption
39
39
  } = useSelect(select => {
40
40
  const {
@@ -43,12 +43,19 @@ export default function EditorPreferencesModal({
43
43
  const {
44
44
  get
45
45
  } = select(preferencesStore);
46
+ const {
47
+ isModalActive
48
+ } = select(interfaceStore);
46
49
  const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
47
50
  const isDistractionFreeEnabled = get('core', 'distractionFree');
48
51
  return {
49
- showBlockBreadcrumbsOption: !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled
52
+ showBlockBreadcrumbsOption: !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled,
53
+ isActive: isModalActive('editor/preferences')
50
54
  };
51
55
  }, [isLargeViewport]);
56
+ const {
57
+ closeModal
58
+ } = useDispatch(interfaceStore);
52
59
  const {
53
60
  setIsListViewOpened,
54
61
  setIsInserterOpened
@@ -56,15 +63,6 @@ export default function EditorPreferencesModal({
56
63
  const {
57
64
  set: setPreference
58
65
  } = useDispatch(preferencesStore);
59
- const toggleDistractionFree = () => {
60
- setPreference('core', 'fixedToolbar', true);
61
- setIsInserterOpened(false);
62
- setIsListViewOpened(false);
63
- // Todo: Check sidebar when closing/opening distraction free.
64
- };
65
- const turnOffDistractionFree = () => {
66
- setPreference('core', 'distractionFree', false);
67
- };
68
66
  const sections = useMemo(() => [{
69
67
  name: 'general',
70
68
  tabLabel: __('General'),
@@ -117,13 +115,17 @@ export default function EditorPreferencesModal({
117
115
  }, createElement(PreferenceToggleControl, {
118
116
  scope: "core",
119
117
  featureName: "fixedToolbar",
120
- onToggle: turnOffDistractionFree,
118
+ onToggle: () => setPreference('core', 'distractionFree', false),
121
119
  help: __('Access all block and document tools in a single place.'),
122
120
  label: __('Top toolbar')
123
121
  }), createElement(PreferenceToggleControl, {
124
122
  scope: "core",
125
123
  featureName: "distractionFree",
126
- onToggle: toggleDistractionFree,
124
+ onToggle: () => {
125
+ setPreference('core', 'fixedToolbar', true);
126
+ setIsInserterOpened(false);
127
+ setIsListViewOpened(false);
128
+ },
127
129
  help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
128
130
  label: __('Distraction free')
129
131
  }), createElement(PreferenceToggleControl, {
@@ -165,12 +167,12 @@ export default function EditorPreferencesModal({
165
167
  title: __('Manage block visibility'),
166
168
  description: __("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
167
169
  }, createElement(BlockManager, null)))
168
- }], [isLargeViewport, showBlockBreadcrumbsOption, extraSections]);
170
+ }], [showBlockBreadcrumbsOption, extraSections, setIsInserterOpened, setIsListViewOpened, setPreference]);
169
171
  if (!isActive) {
170
172
  return null;
171
173
  }
172
174
  return createElement(PreferencesModal, {
173
- closeModal: onClose
175
+ closeModal: closeModal
174
176
  }, createElement(PreferencesModalTabs, {
175
177
  sections: sections
176
178
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","EnablePanelOption","EnablePluginDocumentSettingPanelOption","BlockManager","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isActive","onClose","isLargeViewport","showBlockBreadcrumbsOption","select","getEditorSettings","get","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance","closeModal"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport BlockManager from '../block-manager';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( {\n\textraSections = {},\n\tisActive,\n\tonClose,\n} ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { showBlockBreadcrumbsOption } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn {\n\t\t\t\tshowBlockBreadcrumbsOption:\n\t\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled,\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\t// Todo: Check sidebar when closing/opening distraction free.\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption, extraSections ]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ onClose }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,wBAAwB;;AAE/B;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,OAAOC,sCAAsC,MAAM,wCAAwC;AAC3F,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,OAAOC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AAQ;IACdC,QAAQ,EAAE3C,EAAE,CAAE,QAAS,CAAC;IACxB4C,OAAO,EACNC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACxB,uBAAuB;MAAC0B,KAAK,EAAG/C,EAAE,CAAE,UAAW;IAAG,GAClD6C,aAAA,CAACvB,uBAAuB;MACvB0B,KAAK,EAAC,MAAM;MACZC,WAAW,EAAC,gBAAgB;MAC5BC,IAAI,EAAGlD,EAAE,CACR,uEACD,CAAG;MACHmD,KAAK,EAAGnD,EAAE,CAAE,uBAAwB;IAAG,CACvC,CACuB,CAAC,EAC1B6C,aAAA,CAACxB,uBAAuB;MACvB0B,KAAK,EAAG/C,EAAE,CAAE,yBAA0B,CAAG;MACzCoD,WAAW,EAAGpD,EAAE,CACf,yGACD;IAAG,GAEH6C,aAAA,CAAClC,YAAY,MAAE,CACS,CACxB;EAEJ,CAAC,CACD,EACD,CAAEgB,eAAe,EAAEC,0BAA0B,EAAEJ,aAAa,CAC7D,CAAC;EAED,IAAK,CAAEC,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACCoB,aAAA,CAAC1B,gBAAgB;IAAC6C,UAAU,EAAGtC;EAAS,GACvCmB,aAAA,CAACzB,oBAAoB;IAACqB,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
1
+ {"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","interfaceStore","EnablePanelOption","EnablePluginDocumentSettingPanelOption","BlockManager","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isLargeViewport","isActive","showBlockBreadcrumbsOption","select","getEditorSettings","get","isModalActive","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeModal","setIsListViewOpened","setIsInserterOpened","set","setPreference","sections","name","tabLabel","content","createElement","Fragment","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport BlockManager from '../block-manager';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isActive, showBlockBreadcrumbsOption } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isModalActive } = select( interfaceStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn {\n\t\t\t\tshowBlockBreadcrumbsOption:\n\t\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled,\n\t\t\t\tisActive: isModalActive( 'editor/preferences' ),\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,wBAAwB;AAC/B,SAASH,KAAK,IAAII,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,OAAOC,sCAAsC,MAAM,wCAAwC;AAC3F,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASZ,KAAK,IAAIa,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EACLC,gBAAgB;EAChBC,oBAAoB;EACpBC,uBAAuB;EACvBC;AACD,CAAC,GAAGJ,MAAM,CAAEX,sBAAuB,CAAC;AAEpC,eAAe,SAASgB,sBAAsBA,CAAE;EAAEC,aAAa,GAAG,CAAC;AAAE,CAAC,EAAG;EACxE,MAAMC,eAAe,GAAGzB,gBAAgB,CAAE,QAAS,CAAC;EACp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ACvB,uBAAuB;MACvByB,KAAK,EAAG/C,EAAE,CAAE,yBAA0B,CAAG;MACzCoD,WAAW,EAAGpD,EAAE,CACf,yGACD;IAAG,GAEH6C,aAAA,CAACjC,YAAY,MAAE,CACS,CACxB;EAEJ,CAAC,CACD,EACD,CACCgB,0BAA0B,EAC1BH,aAAa,EACba,mBAAmB,EACnBD,mBAAmB,EACnBG,aAAa,CAEf,CAAC;EAED,IAAK,CAAEb,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACCkB,aAAA,CAACzB,gBAAgB;IAACgB,UAAU,EAAGA;EAAY,GAC1CS,aAAA,CAACxB,oBAAoB;IAACoB,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","DropdownMenu","MenuGroup","MenuItem","VisuallyHidden","Icon","__","check","desktop","mobile","tablet","external","useSelect","useDispatch","store","coreStore","preferencesStore","editorStore","PostPreviewButton","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","select","_getPostType$viewable","getDeviceType","getCurrentPostType","getUnstableBase","getPostType","get","_currentPostType","home","viewable","setDeviceType","isMobile","popoverProps","placement","toggleProps","className","size","showTooltip","__experimentalIsFocusable","menuProps","deviceIcons","createElement","icon","toLowerCase","label","disableOpenOnArrowDown","onClose","Fragment","onClick","href","target","as","role","textContent","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\t__experimentalIsFocusable: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,kBAAkB;AAC3E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,wBAAwB;AAEtD,eAAe,SAASC,eAAeA,CAAE;EAAEC,mBAAmB;EAAEC;AAAS,CAAC,EAAG;EAC5E,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAe,CAAC,GACpEd,SAAS,CAAIe,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACxB,MAAM;MAAEC,aAAa;MAAEC;IAAmB,CAAC,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0CAA0C;IACpDiB,IAAI,EAAC,UAAU;IACfvC,mBAAmB,EAAGA,mBAAqB;IAC3CwC,WAAW,EACVZ,aAAA,CAAAM,QAAA,QACGhD,EAAE,CAAE,oBAAqB,CAAC,EAC5B0C,aAAA,CAAC3C,IAAI;MAAC4C,IAAI,EAAGtC;IAAU,CAAE,CACxB,CACF;IACDkD,SAAS,EAAGR;EAAS,CACrB,CACS,CAEX,CAEU,CAAC;AAEjB"}
1
+ {"version":3,"names":["useViewportMatch","DropdownMenu","MenuGroup","MenuItem","VisuallyHidden","Icon","__","check","desktop","mobile","tablet","external","useSelect","useDispatch","store","coreStore","preferencesStore","editorStore","PostPreviewButton","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","select","_getPostType$viewable","getDeviceType","getCurrentPostType","getUnstableBase","getPostType","get","_currentPostType","home","viewable","setDeviceType","isMobile","popoverProps","placement","toggleProps","className","size","showTooltip","__experimentalIsFocusable","menuProps","deviceIcons","createElement","icon","toLowerCase","label","disableOpenOnArrowDown","onClose","Fragment","onClick","href","target","as","role","textContent","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\t__experimentalIsFocusable: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t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CAAE,CACxB,CACF;IACDkD,SAAS,EAAGR;EAAS,CACrB,CACS,CAEX,CAEU,CAAC;AAEjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","store","blockEditorStore","useEffect","applyFilters","CONTENT_ONLY_BLOCKS","DisableNonPageContentBlocks","contentOnlyIds","select","getBlocksByName","getBlockParents","getBlockName","filter","clientId","every","parentClientId","parentBlockName","includes","disabledIds","getBlockOrder","flatMap","setBlockEditingMode","unsetBlockEditingMode"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\nconst CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n\t'core/template-part',\n] );\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\treturn getBlocksByName( CONTENT_ONLY_BLOCKS ).filter( ( clientId ) =>\n\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\treturn (\n\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t! CONTENT_ONLY_BLOCKS.includes( parentBlockName )\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}, [] );\n\n\tconst disabledIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockOrder } = select( blockEditorStore );\n\t\treturn getBlocksByName( [ 'core/template-part' ] ).flatMap(\n\t\t\t( clientId ) => getBlockOrder( clientId )\n\t\t);\n\t}, [] );\n\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tsetBlockEditingMode( '', 'disabled' );\n\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t}\n\t\tfor ( const clientId of disabledIds ) {\n\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t}\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tcontentOnlyIds,\n\t\tdisabledIds,\n\t\tsetBlockEditingMode,\n\t\tunsetBlockEditingMode,\n\t] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,QAAQ,kBAAkB;AAE/C,MAAMC,mBAAmB,GAAGD,YAAY,CAAE,8BAA8B,EAAE,CACzE,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,CACnB,CAAC;;AAEH;AACA;AACA;AACA;AACA,eAAe,SAASE,2BAA2BA,CAAA,EAAG;EACrD,MAAMC,cAAc,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC/C,MAAM;MAAEC,eAAe;MAAEC,eAAe;MAAEC;IAAa,CAAC,GACvDH,MAAM,CAAEN,gBAAiB,CAAC;IAC3B,OAAOO,eAAe,CAAEJ,mBAAoB,CAAC,CAACO,MAAM,CAAIC,QAAQ,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AACZ"}
1
+ {"version":3,"names":["useSelect","useDispatch","store","blockEditorStore","useEffect","applyFilters","CONTENT_ONLY_BLOCKS","DisableNonPageContentBlocks","contentOnlyIds","select","getBlocksByName","getBlockParents","getBlockName","filter","clientId","every","parentClientId","parentBlockName","includes","disabledIds","getBlockOrder","flatMap","setBlockEditingMode","unsetBlockEditingMode"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\nconst CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n\t'core/template-part',\n] );\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\treturn getBlocksByName( CONTENT_ONLY_BLOCKS ).filter( ( clientId ) =>\n\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\treturn (\n\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t! CONTENT_ONLY_BLOCKS.includes( parentBlockName )\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}, [] );\n\n\tconst disabledIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockOrder } = select( blockEditorStore );\n\t\treturn getBlocksByName( [ 'core/template-part' ] ).flatMap(\n\t\t\t( clientId ) => getBlockOrder( clientId )\n\t\t);\n\t}, [] );\n\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tsetBlockEditingMode( '', 'disabled' );\n\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t}\n\t\tfor ( const clientId of disabledIds ) {\n\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t}\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tcontentOnlyIds,\n\t\tdisabledIds,\n\t\tsetBlockEditingMode,\n\t\tunsetBlockEditingMode,\n\t] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,QAAQ,kBAAkB;AAE/C,MAAMC,mBAAmB,GAAGD,YAAY,CAAE,8BAA8B,EAAE,CACzE,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,CACnB,CAAC;;AAEH;AACA;AACA;AACA;AACA,eAAe,SAASE,2BAA2BA,CAAA,EAAG;EACrD,MAAMC,cAAc,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC/C,MAAM;MAAEC,eAAe;MAAEC,eAAe;MAAEC;IAAa,CAAC,GACvDH,MAAM,CAAEN,gBAAiB,CAAC;IAC3B,OAAOO,eAAe,CAAEJ,mBAAoB,CAAC,CAACO,MAAM,CAAIC,QAAQ,IAC/DH,eAAe,CAAEG,QAAS,CAAC,CAACC,KAAK,CAAIC,cAAc,IAAM;MACxD,MAAMC,eAAe,GAAGL,YAAY,CAAEI,cAAe,CAAC;MACtD;QACC;QACAC,eAAe,KAAK,YAAY;QAChC;QACA,CAAEX,mBAAmB,CAACY,QAAQ,CAAED,eAAgB;MAAC;IAEnD,CAAE,CACH,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAME,WAAW,GAAGnB,SAAS,CAAIS,MAAM,IAAM;IAC5C,MAAM;MAAEC,eAAe;MAAEU;IAAc,CAAC,GAAGX,MAAM,CAAEN,gBAAiB,CAAC;IACrE,OAAOO,eAAe,CAAE,CAAE,oBAAoB,CAAG,CAAC,CAACW,OAAO,CACvDP,QAAQ,IAAMM,aAAa,CAAEN,QAAS,CACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEQ,mBAAmB;IAAEC;EAAsB,CAAC,GACnDtB,WAAW,CAAEE,gBAAiB,CAAC;EAEhCC,SAAS,CAAE,MAAM;IAChBkB,mBAAmB,CAAE,EAAE,EAAE,UAAW,CAAC;IACrC,KAAM,MAAMR,QAAQ,IAAIN,cAAc,EAAG;MACxCc,mBAAmB,CAAER,QAAQ,EAAE,aAAc,CAAC;IAC/C;IACA,KAAM,MAAMA,QAAQ,IAAIK,WAAW,EAAG;MACrCG,mBAAmB,CAAER,QAAQ,EAAE,UAAW,CAAC;IAC5C;IAEA,OAAO,MAAM;MACZS,qBAAqB,CAAE,EAAG,CAAC;MAC3B,KAAM,MAAMT,QAAQ,IAAIN,cAAc,EAAG;QACxCe,qBAAqB,CAAET,QAAS,CAAC;MAClC;MACA,KAAM,MAAMA,QAAQ,IAAIK,WAAW,EAAG;QACrCI,qBAAqB,CAAET,QAAS,CAAC;MAClC;IACD,CAAC;EACF,CAAC,EAAE,CACFN,cAAc,EACdW,WAAW,EACXG,mBAAmB,EACnBC,qBAAqB,CACpB,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { createElement } from "react";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -23,6 +23,8 @@ import NavigationBlockEditingMode from './navigation-block-editing-mode';
23
23
  import { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';
24
24
  import useCommands from '../commands';
25
25
  import BlockRemovalWarnings from '../block-removal-warnings';
26
+ import StartPageOptions from '../start-page-options';
27
+ import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
26
28
  const {
27
29
  ExperimentalBlockEditorProvider
28
30
  } = unlock(blockEditorPrivateApis);
@@ -131,7 +133,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
131
133
  id,
132
134
  type
133
135
  } = rootLevelPost;
134
- const blockEditorSettings = useBlockEditorSettings(editorSettings, type, id);
136
+ const blockEditorSettings = useBlockEditorSettings(editorSettings, type, id, mode);
135
137
  const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode);
136
138
  const {
137
139
  updatePostLock,
@@ -207,7 +209,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
207
209
  selection: selection,
208
210
  settings: blockEditorSettings,
209
211
  useSubRegistry: false
210
- }, children, createElement(PatternsMenuItems, null), mode === 'template-locked' && createElement(DisableNonPageContentBlocks, null), type === 'wp_navigation' && createElement(NavigationBlockEditingMode, null), createElement(BlockRemovalWarnings, null)))));
212
+ }, children, !settings.__unstableIsPreviewMode && createElement(Fragment, null, createElement(PatternsMenuItems, null), mode === 'template-locked' && createElement(DisableNonPageContentBlocks, null), type === 'wp_navigation' && createElement(NavigationBlockEditingMode, null), createElement(KeyboardShortcutHelpModal, null), createElement(BlockRemovalWarnings, null), createElement(StartPageOptions, null))))));
211
213
  });
212
214
  export function EditorProvider(props) {
213
215
  return createElement(ExperimentalEditorProvider, {
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","select","getRenderingMode","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","editorSettings","selection","isReady","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","createElement","kind","value","useSubRegistry","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst mode = useSelect(\n\t\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,WAAW,IAAII,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,0BAA0B,MAAM,iCAAiC;AACxE,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,OAAOC,WAAW,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EAAET,gBAAgB,CAAG,CAAC;EAExDvD,yBAAyB,CAAEQ,IAAI,CAACO,IAAI,EAAEL,IAAK,CAAC;;EAE5C;EACAT,WAAW,CAAC,CAAC;EAEb,IAAK,CAAE4C,OAAO,EAAG;IAChB,OAAO,IAAI;EACZ;EAEA,OACCoB,aAAA,CAACjF,cAAc;IAACkF,IAAI,EAAC,MAAM;IAACnD,IAAI,EAAC;EAAM,GACtCkD,aAAA,CAACjF,cAAc;IACdkF,IAAI,EAAC,UAAU;IACfnD,IAAI,EAAGP,IAAI,CAACO,IAAM;IAClBC,EAAE,EAAGR,IAAI,CAACQ;EAAI,GAEdiD,aAAA,CAAC9E,oBAAoB;IAACgF,KAAK,EAAGhC;EAAqB,GAClD8B,aAAA,CAACnC,4BAA4B;IAC5BqC,KAAK,EAAG5C,MAAQ;IAChBT,QAAQ,EAAGA,QAAU;IACrBD,OAAO,EAAGA,OAAS;IACnB+B,SAAS,EAAGA,SAAW;IACvBlB,QAAQ,EAAGuB,mBAAqB;IAChCmB,cAAc,EAAG;EAAO,GAEtBvC,QAAQ,EACVoC,aAAA,CAAC7D,iBAAiB,MAAE,CAAC,EACnBM,IAAI,KAAK,iBAAiB,IAC3BuD,aAAA,CAACnE,2BAA2B,MAAE,CAC9B,EACCiB,IAAI,KAAK,eAAe,IACzBkD,aAAA,CAAClE,0BAA0B,MAAE,CAC7B,EACDkE,aAAA,CAAC/D,oBAAoB,MAAE,CACM,CACT,CACP,CACD,CAAC;AAEnB,CACD,CAAC;AAED,OAAO,SAASmE,cAAcA,CAAEC,KAAK,EAAG;EACvC,OACCL,aAAA,CAACxC,0BAA0B;IAAA,GACrB6C,KAAK;IACVxC,4BAA4B,EAAG5C;EAAqB,GAElDoF,KAAK,CAACzC,QACmB,CAAC;AAE/B;AAEA,eAAewC,cAAc"}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","select","getRenderingMode","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","editorSettings","selection","isReady","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","createElement","kind","value","useSubRegistry","__unstableIsPreviewMode","Fragment","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst mode = useSelect(\n\t\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,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