@wordpress/editor 13.32.0 → 13.34.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 (733) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +355 -20
  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 +24 -11
  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 +5 -0
  17. package/build/components/character-count/index.js.map +1 -1
  18. package/build/components/collapsible-block-toolbar/index.js +73 -0
  19. package/build/components/collapsible-block-toolbar/index.js.map +1 -0
  20. package/build/components/commands/index.js +19 -0
  21. package/build/components/commands/index.js.map +1 -1
  22. package/build/components/commands/index.native.js.map +1 -1
  23. package/build/components/deprecated.js.map +1 -1
  24. package/build/components/deprecated.native.js.map +1 -1
  25. package/build/components/document-bar/index.js.map +1 -1
  26. package/build/components/document-outline/check.js +8 -0
  27. package/build/components/document-outline/check.js.map +1 -1
  28. package/build/components/document-outline/index.js +11 -0
  29. package/build/components/document-outline/index.js.map +1 -1
  30. package/build/components/document-outline/item.js.map +1 -1
  31. package/build/components/document-tools/index.js +1 -8
  32. package/build/components/document-tools/index.js.map +1 -1
  33. package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  34. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  35. package/build/components/editor-canvas/index.js +2 -2
  36. package/build/components/editor-canvas/index.js.map +1 -1
  37. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  38. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  39. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  40. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  41. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  42. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  43. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  44. package/build/components/editor-help/index.native.js.map +1 -1
  45. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  46. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  47. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  48. package/build/components/editor-help/view-sections.native.js.map +1 -1
  49. package/build/components/editor-history/redo.js +11 -0
  50. package/build/components/editor-history/redo.js.map +1 -1
  51. package/build/components/editor-history/undo.js +11 -0
  52. package/build/components/editor-history/undo.js.map +1 -1
  53. package/build/components/editor-notices/index.js.map +1 -1
  54. package/build/components/editor-snackbars/index.js +6 -0
  55. package/build/components/editor-snackbars/index.js.map +1 -1
  56. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  57. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  58. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  59. package/build/components/entities-saved-states/index.js.map +1 -1
  60. package/build/components/error-boundary/index.js.map +1 -1
  61. package/build/components/error-boundary/index.native.js.map +1 -1
  62. package/build/components/global-keyboard-shortcuts/index.js +31 -0
  63. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +52 -0
  65. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  66. package/build/components/index.js +33 -1
  67. package/build/components/index.js.map +1 -1
  68. package/build/components/index.native.js.map +1 -1
  69. package/build/components/inserter-sidebar/index.js +1 -4
  70. package/build/components/inserter-sidebar/index.js.map +1 -1
  71. package/build/components/keyboard-shortcut-help-modal/config.js +82 -0
  72. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  73. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  74. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  75. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  76. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  77. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  78. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  79. package/build/components/list-view-sidebar/index.js +1 -1
  80. package/build/components/list-view-sidebar/index.js.map +1 -1
  81. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  82. package/build/components/local-autosave-monitor/index.js.map +1 -1
  83. package/build/components/media-categories/index.js.map +1 -1
  84. package/build/components/mode-switcher/index.js.map +1 -1
  85. package/build/components/more-menu/copy-content-menu-item.js +59 -0
  86. package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
  87. package/build/components/more-menu/index.js +119 -0
  88. package/build/components/more-menu/index.js.map +1 -0
  89. package/build/components/more-menu/tools-more-menu-group.js +23 -0
  90. package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
  91. package/build/components/more-menu/view-more-menu-group.js +24 -0
  92. package/build/components/more-menu/view-more-menu-group.js.map +1 -0
  93. package/build/components/offline-status/index.native.js.map +1 -1
  94. package/build/components/page-attributes/check.js +8 -0
  95. package/build/components/page-attributes/check.js.map +1 -1
  96. package/build/components/page-attributes/order.js +7 -0
  97. package/build/components/page-attributes/order.js.map +1 -1
  98. package/build/components/page-attributes/panel.js +14 -8
  99. package/build/components/page-attributes/panel.js.map +1 -1
  100. package/build/components/page-attributes/parent.js +7 -0
  101. package/build/components/page-attributes/parent.js.map +1 -1
  102. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  103. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  104. package/build/components/plugin-more-menu-item/index.js +78 -0
  105. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  106. package/build/components/plugin-post-publish-panel/index.js +1 -1
  107. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  108. package/build/components/plugin-post-status-info/index.js +73 -0
  109. package/build/components/plugin-post-status-info/index.js.map +1 -0
  110. package/build/components/plugin-pre-publish-panel/index.js +1 -1
  111. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  112. package/build/components/plugin-sidebar/index.js +108 -0
  113. package/build/components/plugin-sidebar/index.js.map +1 -0
  114. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  115. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  116. package/build/components/post-actions/actions.js +316 -20
  117. package/build/components/post-actions/actions.js.map +1 -1
  118. package/build/components/post-actions/index.js +160 -0
  119. package/build/components/post-actions/index.js.map +1 -0
  120. package/build/components/post-author/check.js +9 -0
  121. package/build/components/post-author/check.js.map +1 -1
  122. package/build/components/post-author/combobox.js.map +1 -1
  123. package/build/components/post-author/constants.js.map +1 -1
  124. package/build/components/post-author/hook.js.map +1 -1
  125. package/build/components/post-author/index.js +6 -0
  126. package/build/components/post-author/index.js.map +1 -1
  127. package/build/components/post-author/panel.js +5 -0
  128. package/build/components/post-author/panel.js.map +1 -1
  129. package/build/components/post-author/select.js.map +1 -1
  130. package/build/components/post-card-panel/index.js +14 -15
  131. package/build/components/post-card-panel/index.js.map +1 -1
  132. package/build/components/post-comments/index.js.map +1 -1
  133. package/build/components/post-content-information/index.js +72 -0
  134. package/build/components/post-content-information/index.js.map +1 -0
  135. package/build/components/post-discussion/panel.js +9 -7
  136. package/build/components/post-discussion/panel.js.map +1 -1
  137. package/build/components/post-excerpt/check.js +7 -18
  138. package/build/components/post-excerpt/check.js.map +1 -1
  139. package/build/components/post-excerpt/index.js +52 -12
  140. package/build/components/post-excerpt/index.js.map +1 -1
  141. package/build/components/post-excerpt/panel.js +118 -7
  142. package/build/components/post-excerpt/panel.js.map +1 -1
  143. package/build/components/post-excerpt/plugin.js +2 -2
  144. package/build/components/post-excerpt/plugin.js.map +1 -1
  145. package/build/components/post-featured-image/check.js.map +1 -1
  146. package/build/components/post-featured-image/index.js +1 -1
  147. package/build/components/post-featured-image/index.js.map +1 -1
  148. package/build/components/post-featured-image/panel.js.map +1 -1
  149. package/build/components/post-format/check.js.map +1 -1
  150. package/build/components/post-format/index.js.map +1 -1
  151. package/build/components/post-last-edited-panel/index.js +33 -0
  152. package/build/components/post-last-edited-panel/index.js.map +1 -0
  153. package/build/components/post-last-revision/check.js.map +1 -1
  154. package/build/components/post-last-revision/index.js.map +1 -1
  155. package/build/components/post-last-revision/panel.js.map +1 -1
  156. package/build/components/post-locked-modal/index.js.map +1 -1
  157. package/build/components/post-panel-row/index.js.map +1 -1
  158. package/build/components/post-pending-status/check.js.map +1 -1
  159. package/build/components/post-pending-status/index.js.map +1 -1
  160. package/build/components/post-pingbacks/index.js.map +1 -1
  161. package/build/components/post-preview-button/index.js.map +1 -1
  162. package/build/components/post-publish-button/index.js +31 -31
  163. package/build/components/post-publish-button/index.js.map +1 -1
  164. package/build/components/post-publish-button/label.js +51 -43
  165. package/build/components/post-publish-button/label.js.map +1 -1
  166. package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
  167. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  168. package/build/components/post-publish-panel/index.js.map +1 -1
  169. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  170. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  171. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  172. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  173. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  174. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  175. package/build/components/post-saved-state/index.js +10 -6
  176. package/build/components/post-saved-state/index.js.map +1 -1
  177. package/build/components/post-schedule/check.js.map +1 -1
  178. package/build/components/post-schedule/index.js.map +1 -1
  179. package/build/components/post-schedule/label.js.map +1 -1
  180. package/build/components/post-schedule/panel.js +9 -1
  181. package/build/components/post-schedule/panel.js.map +1 -1
  182. package/build/components/post-slug/check.js.map +1 -1
  183. package/build/components/post-slug/index.js +43 -68
  184. package/build/components/post-slug/index.js.map +1 -1
  185. package/build/components/post-status/index.js +239 -0
  186. package/build/components/post-status/index.js.map +1 -0
  187. package/build/components/post-sticky/check.js.map +1 -1
  188. package/build/components/post-sticky/index.js.map +1 -1
  189. package/build/components/post-switch-to-draft-button/index.js +6 -1
  190. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  191. package/build/components/post-sync-status/index.js.map +1 -1
  192. package/build/components/post-taxonomies/check.js.map +1 -1
  193. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  194. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  195. package/build/components/post-taxonomies/index.js.map +1 -1
  196. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  197. package/build/components/post-taxonomies/panel.js.map +1 -1
  198. package/build/components/post-template/block-theme.js +8 -4
  199. package/build/components/post-template/block-theme.js.map +1 -1
  200. package/build/components/post-template/classic-theme.js +0 -1
  201. package/build/components/post-template/classic-theme.js.map +1 -1
  202. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  203. package/build/components/post-template/create-new-template.js.map +1 -1
  204. package/build/components/post-template/hooks.js.map +1 -1
  205. package/build/components/post-template/panel.js.map +1 -1
  206. package/build/components/post-template/reset-default-template.js.map +1 -1
  207. package/build/components/post-template/swap-template-button.js +2 -5
  208. package/build/components/post-template/swap-template-button.js.map +1 -1
  209. package/build/components/post-text-editor/index.js.map +1 -1
  210. package/build/components/post-title/constants.js.map +1 -1
  211. package/build/components/post-title/index.js.map +1 -1
  212. package/build/components/post-title/index.native.js.map +1 -1
  213. package/build/components/post-title/post-title-raw.js.map +1 -1
  214. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  215. package/build/components/post-title/use-post-title.js.map +1 -1
  216. package/build/components/post-trash/check.js +23 -25
  217. package/build/components/post-trash/check.js.map +1 -1
  218. package/build/components/post-trash/index.js +2 -1
  219. package/build/components/post-trash/index.js.map +1 -1
  220. package/build/components/post-type-support-check/index.js.map +1 -1
  221. package/build/components/post-url/check.js.map +1 -1
  222. package/build/components/post-url/index.js +45 -19
  223. package/build/components/post-url/index.js.map +1 -1
  224. package/build/components/post-url/label.js.map +1 -1
  225. package/build/components/post-url/panel.js +15 -8
  226. package/build/components/post-url/panel.js.map +1 -1
  227. package/build/components/post-view-link/index.js.map +1 -1
  228. package/build/components/post-visibility/check.js.map +1 -1
  229. package/build/components/post-visibility/index.js +2 -1
  230. package/build/components/post-visibility/index.js.map +1 -1
  231. package/build/components/post-visibility/label.js.map +1 -1
  232. package/build/components/post-visibility/utils.js.map +1 -1
  233. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  234. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  235. package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
  236. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  237. package/build/components/preferences-modal/index.js +26 -18
  238. package/build/components/preferences-modal/index.js.map +1 -1
  239. package/build/components/preview-dropdown/index.js +3 -1
  240. package/build/components/preview-dropdown/index.js.map +1 -1
  241. package/build/components/provider/disable-non-page-content-blocks.js +23 -16
  242. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  243. package/build/components/provider/index.js +4 -2
  244. package/build/components/provider/index.js.map +1 -1
  245. package/build/components/provider/index.native.js +6 -1
  246. package/build/components/provider/index.native.js.map +1 -1
  247. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  248. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  249. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  250. package/build/components/provider/use-block-editor-settings.js +64 -43
  251. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  252. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  253. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  254. package/build/components/provider/with-registry-provider.js +1 -0
  255. package/build/components/provider/with-registry-provider.js.map +1 -1
  256. package/build/components/save-publish-panels/index.js +89 -0
  257. package/build/components/save-publish-panels/index.js.map +1 -0
  258. package/build/components/start-page-options/index.js +143 -0
  259. package/build/components/start-page-options/index.js.map +1 -0
  260. package/build/components/table-of-contents/index.js.map +1 -1
  261. package/build/components/table-of-contents/panel.js.map +1 -1
  262. package/build/components/template-areas/index.js.map +1 -1
  263. package/build/components/template-validation-notice/index.js +23 -29
  264. package/build/components/template-validation-notice/index.js.map +1 -1
  265. package/build/components/theme-support-check/index.js +10 -16
  266. package/build/components/theme-support-check/index.js.map +1 -1
  267. package/build/components/time-to-read/index.js.map +1 -1
  268. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  269. package/build/components/word-count/index.js.map +1 -1
  270. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  271. package/build/hooks/default-autocompleters.js.map +1 -1
  272. package/build/hooks/index.js.map +1 -1
  273. package/build/hooks/index.native.js.map +1 -1
  274. package/build/hooks/pattern-overrides.js +22 -10
  275. package/build/hooks/pattern-overrides.js.map +1 -1
  276. package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
  277. package/build/index.js.map +1 -1
  278. package/build/index.native.js.map +1 -1
  279. package/build/lock-unlock.js.map +1 -1
  280. package/build/private-apis.js +38 -3
  281. package/build/private-apis.js.map +1 -1
  282. package/build/store/actions.js.map +1 -1
  283. package/build/store/actions.native.js.map +1 -1
  284. package/build/store/constants.js +8 -1
  285. package/build/store/constants.js.map +1 -1
  286. package/build/store/defaults.js.map +1 -1
  287. package/build/store/index.js +1 -1
  288. package/build/store/index.js.map +1 -1
  289. package/build/store/local-autosave.js.map +1 -1
  290. package/build/store/private-actions.js +177 -4
  291. package/build/store/private-actions.js.map +1 -1
  292. package/build/store/private-selectors.js +1 -7
  293. package/build/store/private-selectors.js.map +1 -1
  294. package/build/store/reducer.js.map +1 -1
  295. package/build/store/reducer.native.js.map +1 -1
  296. package/build/store/selectors.js +8 -11
  297. package/build/store/selectors.js.map +1 -1
  298. package/build/store/selectors.native.js.map +1 -1
  299. package/build/store/utils/get-filtered-template-parts.js.map +1 -1
  300. package/build/store/utils/is-template-revertable.js +28 -0
  301. package/build/store/utils/is-template-revertable.js.map +1 -0
  302. package/build/store/utils/notice-builder.js.map +1 -1
  303. package/build/utils/get-template-part-icon.js.map +1 -1
  304. package/build/utils/index.js.map +1 -1
  305. package/build/utils/index.native.js.map +1 -1
  306. package/build/utils/media-upload/index.js.map +1 -1
  307. package/build/utils/media-upload/index.native.js.map +1 -1
  308. package/build/utils/terms.js.map +1 -1
  309. package/build/utils/url.js.map +1 -1
  310. package/build-module/bindings/index.js.map +1 -1
  311. package/build-module/bindings/pattern-overrides.js.map +1 -1
  312. package/build-module/bindings/post-meta.js +14 -31
  313. package/build-module/bindings/post-meta.js.map +1 -1
  314. package/build-module/components/autocompleters/index.js.map +1 -1
  315. package/build-module/components/autocompleters/user.js.map +1 -1
  316. package/build-module/components/autosave-monitor/index.js +24 -12
  317. package/build-module/components/autosave-monitor/index.js.map +1 -1
  318. package/build-module/components/block-manager/category.js.map +1 -1
  319. package/build-module/components/block-manager/checklist.js.map +1 -1
  320. package/build-module/components/block-manager/index.js.map +1 -1
  321. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  322. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  323. package/build-module/components/character-count/index.js +6 -0
  324. package/build-module/components/character-count/index.js.map +1 -1
  325. package/build-module/components/collapsible-block-toolbar/index.js +65 -0
  326. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
  327. package/build-module/components/commands/index.js +20 -1
  328. package/build-module/components/commands/index.js.map +1 -1
  329. package/build-module/components/commands/index.native.js.map +1 -1
  330. package/build-module/components/deprecated.js.map +1 -1
  331. package/build-module/components/deprecated.native.js.map +1 -1
  332. package/build-module/components/document-bar/index.js.map +1 -1
  333. package/build-module/components/document-outline/check.js +9 -0
  334. package/build-module/components/document-outline/check.js.map +1 -1
  335. package/build-module/components/document-outline/index.js +11 -0
  336. package/build-module/components/document-outline/index.js.map +1 -1
  337. package/build-module/components/document-outline/item.js.map +1 -1
  338. package/build-module/components/document-tools/index.js +2 -9
  339. package/build-module/components/document-tools/index.js.map +1 -1
  340. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  341. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  342. package/build-module/components/editor-canvas/index.js +2 -2
  343. package/build-module/components/editor-canvas/index.js.map +1 -1
  344. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  345. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  346. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  347. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  348. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  349. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  350. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  351. package/build-module/components/editor-help/index.native.js.map +1 -1
  352. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  353. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  354. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  355. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  356. package/build-module/components/editor-history/redo.js +11 -0
  357. package/build-module/components/editor-history/redo.js.map +1 -1
  358. package/build-module/components/editor-history/undo.js +11 -0
  359. package/build-module/components/editor-history/undo.js.map +1 -1
  360. package/build-module/components/editor-notices/index.js.map +1 -1
  361. package/build-module/components/editor-snackbars/index.js +6 -0
  362. package/build-module/components/editor-snackbars/index.js.map +1 -1
  363. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  364. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  365. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  366. package/build-module/components/entities-saved-states/index.js.map +1 -1
  367. package/build-module/components/error-boundary/index.js.map +1 -1
  368. package/build-module/components/error-boundary/index.native.js.map +1 -1
  369. package/build-module/components/global-keyboard-shortcuts/index.js +32 -0
  370. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  371. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +53 -0
  372. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  373. package/build-module/components/index.js +4 -0
  374. package/build-module/components/index.js.map +1 -1
  375. package/build-module/components/index.native.js.map +1 -1
  376. package/build-module/components/inserter-sidebar/index.js +2 -5
  377. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  378. package/build-module/components/keyboard-shortcut-help-modal/config.js +75 -0
  379. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  380. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  381. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  382. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  383. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  384. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  385. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  386. package/build-module/components/list-view-sidebar/index.js +1 -1
  387. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  388. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  389. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  390. package/build-module/components/media-categories/index.js.map +1 -1
  391. package/build-module/components/mode-switcher/index.js.map +1 -1
  392. package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
  393. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
  394. package/build-module/components/more-menu/index.js +111 -0
  395. package/build-module/components/more-menu/index.js.map +1 -0
  396. package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
  397. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
  398. package/build-module/components/more-menu/view-more-menu-group.js +17 -0
  399. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
  400. package/build-module/components/offline-status/index.native.js.map +1 -1
  401. package/build-module/components/page-attributes/check.js +9 -0
  402. package/build-module/components/page-attributes/check.js.map +1 -1
  403. package/build-module/components/page-attributes/order.js +7 -0
  404. package/build-module/components/page-attributes/order.js.map +1 -1
  405. package/build-module/components/page-attributes/panel.js +13 -6
  406. package/build-module/components/page-attributes/panel.js.map +1 -1
  407. package/build-module/components/page-attributes/parent.js +7 -0
  408. package/build-module/components/page-attributes/parent.js.map +1 -1
  409. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  410. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  411. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  412. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  413. package/build-module/components/plugin-post-publish-panel/index.js +1 -1
  414. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  415. package/build-module/components/plugin-post-status-info/index.js +66 -0
  416. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  417. package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
  418. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  419. package/build-module/components/plugin-sidebar/index.js +102 -0
  420. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  421. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  422. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  423. package/build-module/components/post-actions/actions.js +317 -19
  424. package/build-module/components/post-actions/actions.js.map +1 -1
  425. package/build-module/components/post-actions/index.js +153 -0
  426. package/build-module/components/post-actions/index.js.map +1 -0
  427. package/build-module/components/post-author/check.js +10 -0
  428. package/build-module/components/post-author/check.js.map +1 -1
  429. package/build-module/components/post-author/combobox.js.map +1 -1
  430. package/build-module/components/post-author/constants.js.map +1 -1
  431. package/build-module/components/post-author/hook.js.map +1 -1
  432. package/build-module/components/post-author/index.js +6 -0
  433. package/build-module/components/post-author/index.js.map +1 -1
  434. package/build-module/components/post-author/panel.js +6 -0
  435. package/build-module/components/post-author/panel.js.map +1 -1
  436. package/build-module/components/post-author/select.js.map +1 -1
  437. package/build-module/components/post-card-panel/index.js +16 -17
  438. package/build-module/components/post-card-panel/index.js.map +1 -1
  439. package/build-module/components/post-comments/index.js.map +1 -1
  440. package/build-module/components/post-content-information/index.js +66 -0
  441. package/build-module/components/post-content-information/index.js.map +1 -0
  442. package/build-module/components/post-discussion/panel.js +8 -6
  443. package/build-module/components/post-discussion/panel.js.map +1 -1
  444. package/build-module/components/post-excerpt/check.js +8 -18
  445. package/build-module/components/post-excerpt/check.js.map +1 -1
  446. package/build-module/components/post-excerpt/index.js +52 -11
  447. package/build-module/components/post-excerpt/index.js.map +1 -1
  448. package/build-module/components/post-excerpt/panel.js +118 -8
  449. package/build-module/components/post-excerpt/panel.js.map +1 -1
  450. package/build-module/components/post-excerpt/plugin.js +2 -2
  451. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  452. package/build-module/components/post-featured-image/check.js.map +1 -1
  453. package/build-module/components/post-featured-image/index.js +1 -1
  454. package/build-module/components/post-featured-image/index.js.map +1 -1
  455. package/build-module/components/post-featured-image/panel.js.map +1 -1
  456. package/build-module/components/post-format/check.js.map +1 -1
  457. package/build-module/components/post-format/index.js.map +1 -1
  458. package/build-module/components/post-last-edited-panel/index.js +26 -0
  459. package/build-module/components/post-last-edited-panel/index.js.map +1 -0
  460. package/build-module/components/post-last-revision/check.js.map +1 -1
  461. package/build-module/components/post-last-revision/index.js.map +1 -1
  462. package/build-module/components/post-last-revision/panel.js.map +1 -1
  463. package/build-module/components/post-locked-modal/index.js.map +1 -1
  464. package/build-module/components/post-panel-row/index.js.map +1 -1
  465. package/build-module/components/post-pending-status/check.js.map +1 -1
  466. package/build-module/components/post-pending-status/index.js.map +1 -1
  467. package/build-module/components/post-pingbacks/index.js.map +1 -1
  468. package/build-module/components/post-preview-button/index.js.map +1 -1
  469. package/build-module/components/post-publish-button/index.js +31 -31
  470. package/build-module/components/post-publish-button/index.js.map +1 -1
  471. package/build-module/components/post-publish-button/label.js +51 -42
  472. package/build-module/components/post-publish-button/label.js.map +1 -1
  473. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
  474. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  475. package/build-module/components/post-publish-panel/index.js.map +1 -1
  476. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  477. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  478. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  479. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  480. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  481. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  482. package/build-module/components/post-saved-state/index.js +10 -6
  483. package/build-module/components/post-saved-state/index.js.map +1 -1
  484. package/build-module/components/post-schedule/check.js.map +1 -1
  485. package/build-module/components/post-schedule/index.js.map +1 -1
  486. package/build-module/components/post-schedule/label.js.map +1 -1
  487. package/build-module/components/post-schedule/panel.js +9 -1
  488. package/build-module/components/post-schedule/panel.js.map +1 -1
  489. package/build-module/components/post-slug/check.js.map +1 -1
  490. package/build-module/components/post-slug/index.js +44 -68
  491. package/build-module/components/post-slug/index.js.map +1 -1
  492. package/build-module/components/post-status/index.js +231 -0
  493. package/build-module/components/post-status/index.js.map +1 -0
  494. package/build-module/components/post-sticky/check.js.map +1 -1
  495. package/build-module/components/post-sticky/index.js.map +1 -1
  496. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  497. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  498. package/build-module/components/post-sync-status/index.js.map +1 -1
  499. package/build-module/components/post-taxonomies/check.js.map +1 -1
  500. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  501. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  502. package/build-module/components/post-taxonomies/index.js.map +1 -1
  503. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  504. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  505. package/build-module/components/post-template/block-theme.js +9 -5
  506. package/build-module/components/post-template/block-theme.js.map +1 -1
  507. package/build-module/components/post-template/classic-theme.js +0 -1
  508. package/build-module/components/post-template/classic-theme.js.map +1 -1
  509. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  510. package/build-module/components/post-template/create-new-template.js.map +1 -1
  511. package/build-module/components/post-template/hooks.js.map +1 -1
  512. package/build-module/components/post-template/panel.js.map +1 -1
  513. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  514. package/build-module/components/post-template/swap-template-button.js +3 -6
  515. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  516. package/build-module/components/post-text-editor/index.js.map +1 -1
  517. package/build-module/components/post-title/constants.js.map +1 -1
  518. package/build-module/components/post-title/index.js.map +1 -1
  519. package/build-module/components/post-title/index.native.js.map +1 -1
  520. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  521. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  522. package/build-module/components/post-title/use-post-title.js.map +1 -1
  523. package/build-module/components/post-trash/check.js +24 -26
  524. package/build-module/components/post-trash/check.js.map +1 -1
  525. package/build-module/components/post-trash/index.js +2 -1
  526. package/build-module/components/post-trash/index.js.map +1 -1
  527. package/build-module/components/post-type-support-check/index.js.map +1 -1
  528. package/build-module/components/post-url/check.js.map +1 -1
  529. package/build-module/components/post-url/index.js +47 -21
  530. package/build-module/components/post-url/index.js.map +1 -1
  531. package/build-module/components/post-url/label.js.map +1 -1
  532. package/build-module/components/post-url/panel.js +15 -8
  533. package/build-module/components/post-url/panel.js.map +1 -1
  534. package/build-module/components/post-view-link/index.js.map +1 -1
  535. package/build-module/components/post-visibility/check.js.map +1 -1
  536. package/build-module/components/post-visibility/index.js +2 -1
  537. package/build-module/components/post-visibility/index.js.map +1 -1
  538. package/build-module/components/post-visibility/label.js.map +1 -1
  539. package/build-module/components/post-visibility/utils.js.map +1 -1
  540. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  541. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  542. package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
  543. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  544. package/build-module/components/preferences-modal/index.js +26 -18
  545. package/build-module/components/preferences-modal/index.js.map +1 -1
  546. package/build-module/components/preview-dropdown/index.js +3 -1
  547. package/build-module/components/preview-dropdown/index.js.map +1 -1
  548. package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
  549. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  550. package/build-module/components/provider/index.js +5 -3
  551. package/build-module/components/provider/index.js.map +1 -1
  552. package/build-module/components/provider/index.native.js.map +1 -1
  553. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  554. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  555. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  556. package/build-module/components/provider/use-block-editor-settings.js +66 -45
  557. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  558. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  559. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  560. package/build-module/components/provider/with-registry-provider.js +1 -0
  561. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  562. package/build-module/components/save-publish-panels/index.js +80 -0
  563. package/build-module/components/save-publish-panels/index.js.map +1 -0
  564. package/build-module/components/start-page-options/index.js +136 -0
  565. package/build-module/components/start-page-options/index.js.map +1 -0
  566. package/build-module/components/table-of-contents/index.js.map +1 -1
  567. package/build-module/components/table-of-contents/panel.js.map +1 -1
  568. package/build-module/components/template-areas/index.js.map +1 -1
  569. package/build-module/components/template-validation-notice/index.js +25 -31
  570. package/build-module/components/template-validation-notice/index.js.map +1 -1
  571. package/build-module/components/theme-support-check/index.js +11 -16
  572. package/build-module/components/theme-support-check/index.js.map +1 -1
  573. package/build-module/components/time-to-read/index.js.map +1 -1
  574. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  575. package/build-module/components/word-count/index.js.map +1 -1
  576. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  577. package/build-module/hooks/default-autocompleters.js.map +1 -1
  578. package/build-module/hooks/index.js.map +1 -1
  579. package/build-module/hooks/index.native.js.map +1 -1
  580. package/build-module/hooks/pattern-overrides.js +22 -10
  581. package/build-module/hooks/pattern-overrides.js.map +1 -1
  582. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
  583. package/build-module/index.js.map +1 -1
  584. package/build-module/index.native.js.map +1 -1
  585. package/build-module/lock-unlock.js.map +1 -1
  586. package/build-module/private-apis.js +36 -3
  587. package/build-module/private-apis.js.map +1 -1
  588. package/build-module/store/actions.js.map +1 -1
  589. package/build-module/store/actions.native.js.map +1 -1
  590. package/build-module/store/constants.js +7 -0
  591. package/build-module/store/constants.js.map +1 -1
  592. package/build-module/store/defaults.js.map +1 -1
  593. package/build-module/store/index.js.map +1 -1
  594. package/build-module/store/local-autosave.js.map +1 -1
  595. package/build-module/store/private-actions.js +174 -4
  596. package/build-module/store/private-actions.js.map +1 -1
  597. package/build-module/store/private-selectors.js +1 -6
  598. package/build-module/store/private-selectors.js.map +1 -1
  599. package/build-module/store/reducer.js.map +1 -1
  600. package/build-module/store/reducer.native.js.map +1 -1
  601. package/build-module/store/selectors.js +4 -7
  602. package/build-module/store/selectors.js.map +1 -1
  603. package/build-module/store/selectors.native.js.map +1 -1
  604. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
  605. package/build-module/store/utils/is-template-revertable.js +22 -0
  606. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  607. package/build-module/store/utils/notice-builder.js.map +1 -1
  608. package/build-module/utils/get-template-part-icon.js.map +1 -1
  609. package/build-module/utils/index.js.map +1 -1
  610. package/build-module/utils/index.native.js.map +1 -1
  611. package/build-module/utils/media-upload/index.js.map +1 -1
  612. package/build-module/utils/media-upload/index.native.js.map +1 -1
  613. package/build-module/utils/terms.js.map +1 -1
  614. package/build-module/utils/url.js.map +1 -1
  615. package/build-style/style-rtl.css +703 -53
  616. package/build-style/style.css +703 -53
  617. package/package.json +35 -35
  618. package/src/bindings/post-meta.js +11 -27
  619. package/src/components/autosave-monitor/index.js +23 -11
  620. package/src/components/character-count/index.js +5 -0
  621. package/src/components/collapsible-block-toolbar/index.js +77 -0
  622. package/src/components/collapsible-block-toolbar/style.scss +80 -0
  623. package/src/components/commands/index.js +20 -1
  624. package/src/components/document-outline/check.js +8 -0
  625. package/src/components/document-outline/index.js +10 -0
  626. package/src/components/document-tools/index.js +16 -19
  627. package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
  628. package/src/components/editor-canvas/index.js +4 -4
  629. package/src/components/editor-history/redo.js +10 -0
  630. package/src/components/editor-history/undo.js +10 -0
  631. package/src/components/editor-snackbars/index.js +5 -0
  632. package/src/components/entities-saved-states/style.scss +7 -0
  633. package/src/components/error-boundary/style.native.scss +1 -1
  634. package/src/components/global-keyboard-shortcuts/index.js +32 -0
  635. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +61 -0
  636. package/src/components/index.js +4 -0
  637. package/src/components/inserter-sidebar/index.js +2 -5
  638. package/src/components/keyboard-shortcut-help-modal/config.js +62 -0
  639. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  640. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  641. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  642. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  643. package/src/components/list-view-sidebar/index.js +1 -1
  644. package/src/components/list-view-sidebar/style.scss +2 -2
  645. package/src/components/more-menu/copy-content-menu-item.js +51 -0
  646. package/src/components/more-menu/index.js +158 -0
  647. package/src/components/more-menu/tools-more-menu-group.js +11 -0
  648. package/src/components/more-menu/view-more-menu-group.js +13 -0
  649. package/src/components/page-attributes/check.js +8 -0
  650. package/src/components/page-attributes/order.js +6 -0
  651. package/src/components/page-attributes/panel.js +21 -17
  652. package/src/components/page-attributes/parent.js +6 -0
  653. package/src/components/plugin-more-menu-item/index.js +73 -0
  654. package/src/components/plugin-post-publish-panel/index.js +1 -1
  655. package/src/components/plugin-post-status-info/index.js +63 -0
  656. package/src/components/plugin-pre-publish-panel/index.js +1 -1
  657. package/src/components/plugin-sidebar/index.js +98 -0
  658. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  659. package/src/components/post-actions/actions.js +413 -18
  660. package/src/components/post-actions/index.js +190 -0
  661. package/src/components/post-actions/style.scss +3 -0
  662. package/src/components/post-author/check.js +9 -0
  663. package/src/components/post-author/index.js +5 -0
  664. package/src/components/post-author/panel.js +5 -0
  665. package/src/components/post-card-panel/index.js +28 -23
  666. package/src/components/post-card-panel/style.scss +2 -6
  667. package/src/components/post-content-information/index.js +83 -0
  668. package/src/components/post-content-information/style.scss +6 -0
  669. package/src/components/post-discussion/panel.js +24 -20
  670. package/src/components/post-excerpt/check.js +8 -18
  671. package/src/components/post-excerpt/index.js +66 -15
  672. package/src/components/post-excerpt/panel.js +196 -19
  673. package/src/components/post-excerpt/plugin.js +2 -2
  674. package/src/components/post-excerpt/style.scss +24 -0
  675. package/src/components/post-featured-image/index.js +1 -1
  676. package/src/components/post-featured-image/style.scss +2 -8
  677. package/src/components/post-last-edited-panel/index.js +35 -0
  678. package/src/components/post-last-edited-panel/style.scss +6 -0
  679. package/src/components/post-panel-row/style.scss +3 -3
  680. package/src/components/post-publish-button/index.js +23 -36
  681. package/src/components/post-publish-button/label.js +54 -39
  682. package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
  683. package/src/components/post-publish-button/test/index.js +15 -26
  684. package/src/components/post-publish-button/test/label.js +44 -21
  685. package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
  686. package/src/components/post-publish-panel/style.scss +43 -0
  687. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
  688. package/src/components/post-saved-state/index.js +13 -6
  689. package/src/components/post-saved-state/test/index.js +4 -0
  690. package/src/components/post-schedule/panel.js +23 -1
  691. package/src/components/post-schedule/style.scss +2 -4
  692. package/src/components/post-slug/index.js +50 -68
  693. package/src/components/post-slug/test/index.js +29 -6
  694. package/src/components/post-status/index.js +318 -0
  695. package/src/components/post-status/style.scss +74 -0
  696. package/src/components/post-switch-to-draft-button/index.js +5 -0
  697. package/src/components/post-template/block-theme.js +33 -24
  698. package/src/components/post-template/classic-theme.js +0 -1
  699. package/src/components/post-template/swap-template-button.js +3 -6
  700. package/src/components/post-text-editor/style.scss +1 -1
  701. package/src/components/post-title/style.scss +1 -1
  702. package/src/components/post-trash/check.js +19 -19
  703. package/src/components/post-trash/index.js +1 -0
  704. package/src/components/post-url/index.js +132 -101
  705. package/src/components/post-url/panel.js +21 -8
  706. package/src/components/post-url/style.scss +8 -6
  707. package/src/components/post-visibility/index.js +1 -0
  708. package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
  709. package/src/components/preferences-modal/index.js +40 -22
  710. package/src/components/preview-dropdown/index.js +3 -1
  711. package/src/components/provider/disable-non-page-content-blocks.js +23 -21
  712. package/src/components/provider/index.js +17 -8
  713. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  714. package/src/components/provider/use-block-editor-settings.js +59 -33
  715. package/src/components/provider/with-registry-provider.js +1 -0
  716. package/src/components/save-publish-panels/index.js +96 -0
  717. package/src/components/save-publish-panels/style.scss +36 -0
  718. package/src/components/start-page-options/index.js +140 -0
  719. package/src/components/start-page-options/style.scss +26 -0
  720. package/src/components/template-validation-notice/index.js +48 -50
  721. package/src/components/theme-support-check/index.js +9 -16
  722. package/src/components/theme-support-check/test/index.js +44 -43
  723. package/src/hooks/pattern-overrides.js +25 -14
  724. package/src/private-apis.js +33 -2
  725. package/src/store/constants.js +7 -0
  726. package/src/store/private-actions.js +269 -4
  727. package/src/store/private-selectors.js +1 -6
  728. package/src/store/selectors.js +4 -7
  729. package/src/store/utils/is-template-revertable.js +23 -0
  730. package/src/style.scss +10 -2
  731. package/src/components/post-publish-button/style.scss +0 -8
  732. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
  733. package/src/components/template-validation-notice/style.scss +0 -9
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = MoreMenu;
8
+ var _react = require("react");
9
+ var _i18n = require("@wordpress/i18n");
10
+ var _data = require("@wordpress/data");
11
+ var _keycodes = require("@wordpress/keycodes");
12
+ var _icons = require("@wordpress/icons");
13
+ var _components = require("@wordpress/components");
14
+ var _preferences = require("@wordpress/preferences");
15
+ var _interface = require("@wordpress/interface");
16
+ var _copyContentMenuItem = _interopRequireDefault(require("./copy-content-menu-item"));
17
+ var _modeSwitcher = _interopRequireDefault(require("../mode-switcher"));
18
+ var _toolsMoreMenuGroup = _interopRequireDefault(require("./tools-more-menu-group"));
19
+ var _viewMoreMenuGroup = _interopRequireDefault(require("./view-more-menu-group"));
20
+ var _store = require("../../store");
21
+ /**
22
+ * WordPress dependencies
23
+ */
24
+
25
+ /**
26
+ * Internal dependencies
27
+ */
28
+
29
+ function MoreMenu() {
30
+ const {
31
+ openModal
32
+ } = (0, _data.useDispatch)(_interface.store);
33
+ const {
34
+ set: setPreference
35
+ } = (0, _data.useDispatch)(_preferences.store);
36
+ const {
37
+ toggleDistractionFree
38
+ } = (0, _data.useDispatch)(_store.store);
39
+ const showIconLabels = (0, _data.useSelect)(select => select(_preferences.store).get('core', 'showIconLabels'), []);
40
+ const turnOffDistractionFree = () => {
41
+ setPreference('core', 'distractionFree', false);
42
+ };
43
+ return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.DropdownMenu, {
44
+ icon: _icons.moreVertical,
45
+ label: (0, _i18n.__)('Options'),
46
+ popoverProps: {
47
+ placement: 'bottom-end',
48
+ className: 'more-menu-dropdown__content'
49
+ },
50
+ toggleProps: {
51
+ showTooltip: !showIconLabels,
52
+ ...(showIconLabels && {
53
+ variant: 'tertiary'
54
+ }),
55
+ tooltipPosition: 'bottom',
56
+ size: 'compact'
57
+ }
58
+ }, ({
59
+ onClose
60
+ }) => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuGroup, {
61
+ label: (0, _i18n._x)('View', 'noun')
62
+ }, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
63
+ scope: "core",
64
+ name: "fixedToolbar",
65
+ onToggle: turnOffDistractionFree,
66
+ label: (0, _i18n.__)('Top toolbar'),
67
+ info: (0, _i18n.__)('Access all block and document tools in a single place'),
68
+ messageActivated: (0, _i18n.__)('Top toolbar activated'),
69
+ messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
70
+ }), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
71
+ scope: "core",
72
+ name: "distractionFree",
73
+ label: (0, _i18n.__)('Distraction free'),
74
+ info: (0, _i18n.__)('Write with calmness'),
75
+ handleToggling: false,
76
+ onToggle: toggleDistractionFree,
77
+ messageActivated: (0, _i18n.__)('Distraction free mode activated'),
78
+ messageDeactivated: (0, _i18n.__)('Distraction free mode deactivated'),
79
+ shortcut: _keycodes.displayShortcut.primaryShift('\\')
80
+ }), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
81
+ scope: "core",
82
+ name: "focusMode",
83
+ label: (0, _i18n.__)('Spotlight mode'),
84
+ info: (0, _i18n.__)('Focus on one block at a time'),
85
+ messageActivated: (0, _i18n.__)('Spotlight mode activated'),
86
+ messageDeactivated: (0, _i18n.__)('Spotlight mode deactivated')
87
+ }), (0, _react.createElement)(_viewMoreMenuGroup.default.Slot, {
88
+ fillProps: {
89
+ onClose
90
+ }
91
+ })), (0, _react.createElement)(_modeSwitcher.default, null), (0, _react.createElement)(_interface.ActionItem.Slot, {
92
+ name: "core/plugin-more-menu",
93
+ label: (0, _i18n.__)('Plugins'),
94
+ as: _components.MenuGroup,
95
+ fillProps: {
96
+ onClick: onClose
97
+ }
98
+ }), (0, _react.createElement)(_components.MenuGroup, {
99
+ label: (0, _i18n.__)('Tools')
100
+ }, (0, _react.createElement)(_components.MenuItem, {
101
+ onClick: () => openModal('editor/keyboard-shortcut-help'),
102
+ shortcut: _keycodes.displayShortcut.access('h')
103
+ }, (0, _i18n.__)('Keyboard shortcuts')), (0, _react.createElement)(_copyContentMenuItem.default, null), (0, _react.createElement)(_components.MenuItem, {
104
+ icon: _icons.external,
105
+ href: (0, _i18n.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'),
106
+ target: "_blank",
107
+ rel: "noopener noreferrer"
108
+ }, (0, _i18n.__)('Help'), (0, _react.createElement)(_components.VisuallyHidden, {
109
+ as: "span"
110
+ }, /* translators: accessibility text */
111
+ (0, _i18n.__)('(opens in a new tab)'))), (0, _react.createElement)(_toolsMoreMenuGroup.default.Slot, {
112
+ fillProps: {
113
+ onClose
114
+ }
115
+ })), (0, _react.createElement)(_components.MenuGroup, null, (0, _react.createElement)(_components.MenuItem, {
116
+ onClick: () => openModal('editor/preferences')
117
+ }, (0, _i18n.__)('Preferences'))))));
118
+ }
119
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_i18n","require","_data","_keycodes","_icons","_components","_preferences","_interface","_copyContentMenuItem","_interopRequireDefault","_modeSwitcher","_toolsMoreMenuGroup","_viewMoreMenuGroup","_store","MoreMenu","openModal","useDispatch","interfaceStore","set","setPreference","preferencesStore","toggleDistractionFree","editorStore","showIconLabels","useSelect","select","get","turnOffDistractionFree","_react","createElement","Fragment","DropdownMenu","icon","moreVertical","label","__","popoverProps","placement","className","toggleProps","showTooltip","variant","tooltipPosition","size","onClose","MenuGroup","_x","PreferenceToggleMenuItem","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","displayShortcut","primaryShift","default","Slot","fillProps","ActionItem","as","onClick","MenuItem","access","external","href","target","rel","VisuallyHidden"],"sources":["@wordpress/editor/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\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\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\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<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\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<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\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<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\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\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\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\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/preferences' )\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\t{ __( 'Preferences' ) }\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) }\n\t\t\t</DropdownMenu>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAMA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,oBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,aAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,mBAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,kBAAA,GAAA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AC,aAAA,EAAClB,mBAAA,CAAA+C,OAAkB,CAACC,IAAI;IACvBC,SAAS,EAAG;MAAEhB;IAAQ;EAAG,CACzB,CACS,CAAC,EACZ,IAAAhB,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAAwC,SAAS,QACT,IAAAjB,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA2D,QAAQ;IACRD,OAAO,EAAGA,CAAA,KACThD,SAAS,CAAE,oBAAqB;EAChC,GAEC,IAAAoB,QAAE,EAAE,aAAc,CACX,CACA,CACV,CAEU,CACb,CAAC;AAEL","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _components = require("@wordpress/components");
9
+ /**
10
+ * WordPress dependencies
11
+ */
12
+
13
+ const {
14
+ Fill: ToolsMoreMenuGroup,
15
+ Slot
16
+ } = (0, _components.createSlotFill)('ToolsMoreMenuGroup');
17
+ ToolsMoreMenuGroup.Slot = ({
18
+ fillProps
19
+ }) => (0, _react.createElement)(Slot, {
20
+ fillProps: fillProps
21
+ });
22
+ var _default = exports.default = ToolsMoreMenuGroup;
23
+ //# sourceMappingURL=tools-more-menu-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","_react","createElement","_default","exports","default"],"sources":["@wordpress/editor/src/components/more-menu/tools-more-menu-group.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => <Slot fillProps={ fillProps } />;\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvC,IAAAC,0BAAc,EAAE,oBAAqB,CAAC;AAEvCF,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEE;AAAU,CAAC,KAAM,IAAAC,MAAA,CAAAC,aAAA,EAACJ,IAAI;EAACE,SAAS,EAAGA;AAAW,CAAE,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEjER,kBAAkB","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _components = require("@wordpress/components");
9
+ var _element = require("@wordpress/element");
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+
14
+ const {
15
+ Fill: ViewMoreMenuGroup,
16
+ Slot
17
+ } = (0, _components.createSlotFill)(_element.Platform.OS === 'web' ? Symbol('ViewMoreMenuGroup') : 'ViewMoreMenuGroup');
18
+ ViewMoreMenuGroup.Slot = ({
19
+ fillProps
20
+ }) => (0, _react.createElement)(Slot, {
21
+ fillProps: fillProps
22
+ });
23
+ var _default = exports.default = ViewMoreMenuGroup;
24
+ //# sourceMappingURL=view-more-menu-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","_element","Fill","ViewMoreMenuGroup","Slot","createSlotFill","Platform","OS","Symbol","fillProps","_react","createElement","_default","exports","default"],"sources":["@wordpress/editor/src/components/more-menu/view-more-menu-group.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\n\nconst { Fill: ViewMoreMenuGroup, Slot } = createSlotFill(\n\tPlatform.OS === 'web' ? Symbol( 'ViewMoreMenuGroup' ) : 'ViewMoreMenuGroup'\n);\n\nViewMoreMenuGroup.Slot = ( { fillProps } ) => <Slot fillProps={ fillProps } />;\n\nexport default ViewMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAM;EAAEE,IAAI,EAAEC,iBAAiB;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EACvDC,iBAAQ,CAACC,EAAE,KAAK,KAAK,GAAGC,MAAM,CAAE,mBAAoB,CAAC,GAAG,mBACzD,CAAC;AAEDL,iBAAiB,CAACC,IAAI,GAAG,CAAE;EAAEK;AAAU,CAAC,KAAM,IAAAC,MAAA,CAAAC,aAAA,EAACP,IAAI;EAACK,SAAS,EAAGA;AAAW,CAAE,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEhEX,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_compose","_components","_icons","_i18n","_element","_styleNative","_interopRequireDefault","useAccessibilityLiveRegion","message","isActive","inactiveMessage","announceForAccessibility","AccessibilityInfo","prevIsActive","usePrevious","useEffect","unconditionalMessage","initialRender","OfflineStatus","isConnected","useNetworkConnectivity","__","containerStyle","usePreferredColorSchemeStyle","styles","offline","offline__dark","textStyle","iconStyle","_react","createElement","View","accessible","accessibilityRole","accessibilityLabel","style","Icon","fill","icon","offlineIcon","Text","_default","exports","default"],"sources":["@wordpress/editor/src/components/offline-status/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorSchemeStyle,\n\tuseNetworkConnectivity,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { Icon } from '@wordpress/components';\nimport { offline as offlineIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.native.scss';\n\n/**\n * Conditionally announces messages for screen reader users. This Hook provides\n * two benefits over React Native's `accessibilityLiveRegion`:\n *\n * 1. It works on both iOS and Android.\n * 2. It allows announcing a secondary message when the component is inactive.\n *\n * @param {string} message The message to announce.\n * @param {Object} options Options for the Hook.\n * @param {boolean} [options.isActive] Whether the message should be announced.\n * @param {string} [options.inactiveMessage] The message to announce when inactive.\n */\nfunction useAccessibilityLiveRegion( message, { isActive, inactiveMessage } ) {\n\tconst { announceForAccessibility } = AccessibilityInfo;\n\tconst prevIsActive = usePrevious( isActive );\n\n\tuseEffect( () => {\n\t\tconst unconditionalMessage = typeof isActive === 'undefined';\n\t\tconst initialRender = typeof prevIsActive === 'undefined';\n\n\t\tif (\n\t\t\tunconditionalMessage ||\n\t\t\t( isActive && ! prevIsActive && ! initialRender )\n\t\t) {\n\t\t\tannounceForAccessibility( message );\n\t\t} else if ( ! isActive && prevIsActive && inactiveMessage ) {\n\t\t\tannounceForAccessibility( inactiveMessage );\n\t\t}\n\t}, [\n\t\tmessage,\n\t\tisActive,\n\t\tprevIsActive,\n\t\tinactiveMessage,\n\t\tannounceForAccessibility,\n\t] );\n}\n\nconst OfflineStatus = () => {\n\tconst { isConnected } = useNetworkConnectivity();\n\n\tuseAccessibilityLiveRegion( __( 'Network connection re-established' ), {\n\t\tisActive: isConnected,\n\t\tinactiveMessage: __( 'Network connection lost, working offline' ),\n\t} );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.offline,\n\t\tstyles.offline__dark\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--text' ],\n\t\tstyles[ 'offline--text__dark' ]\n\t);\n\n\tconst iconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--icon' ],\n\t\tstyles[ 'offline--icon__dark' ]\n\t);\n\n\treturn ! isConnected ? (\n\t\t<View\n\t\t\taccessible\n\t\t\taccessibilityRole=\"alert\"\n\t\t\taccessibilityLabel={ __(\n\t\t\t\t'Network connection lost, working offline'\n\t\t\t) }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<Icon fill={ iconStyle.fill } icon={ offlineIcon } />\n\t\t\t<Text style={ textStyle }>{ __( 'Working Offline' ) } </Text>\n\t\t</View>\n\t) : null;\n};\n\nexport default OfflineStatus;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,YAAA,GAAAC,sBAAA,CAAAP,OAAA;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASQ,0BAA0BA,CAAEC,OAAO,EAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EAC7E,MAAM;IAAEC;EAAyB,CAAC,GAAGC,8BAAiB;EACtD,MAAMC,YAAY,GAAG,IAAAC,oBAAW,EAAEL,QAAS,CAAC;EAE5C,IAAAM,kBAAS,EAAE,MAAM;IAChB,MAAMC,oBAAoB,GAAG,OAAOP,QAAQ,KAAK,WAAW;IAC5D,MAAMQ,aAAa,GAAG,OAAOJ,YAAY,KAAK,WAAW;IAEzD,IACCG,oBAAoB,IAClBP,QAAQ,IAAI,CAAEI,YAAY,IAAI,CAAEI,aAAe,EAChD;MACDN,wBAAwB,CAAEH,OAAQ,CAAC;IACpC,CAAC,MAAM,IAAK,CAAEC,QAAQ,IAAII,YAAY,IAAIH,eAAe,EAAG;MAC3DC,wBAAwB,CAAED,eAAgB,CAAC;IAC5C;EACD,CAAC,EAAE,CACFF,OAAO,EACPC,QAAQ,EACRI,YAAY,EACZH,eAAe,EACfC,wBAAwB,CACvB,CAAC;AACJ;AAEA,MAAMO,aAAa,GAAGA,CAAA,KAAM;EAC3B,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,+BAAsB,EAAC,CAAC;EAEhDb,0BAA0B,CAAE,IAAAc,QAAE,EAAE,mCAAoC,CAAC,EAAE;IACtEZ,QAAQ,EAAEU,WAAW;IACrBT,eAAe,EAAE,IAAAW,QAAE,EAAE,0CAA2C;EACjE,CAAE,CAAC;EAEH,MAAMC,cAAc,GAAG,IAAAC,qCAA4B,EAClDC,oBAAM,CAACC,OAAO,EACdD,oBAAM,CAACE,aACR,CAAC;EAED,MAAMC,SAAS,GAAG,IAAAJ,qCAA4B,EAC7CC,oBAAM,CAAE,eAAe,CAAE,EACzBA,oBAAM,CAAE,qBAAqB,CAC9B,CAAC;EAED,MAAMI,SAAS,GAAG,IAAAL,qCAA4B,EAC7CC,oBAAM,CAAE,eAAe,CAAE,EACzBA,oBAAM,CAAE,qBAAqB,CAC9B,CAAC;EAED,OAAO,CAAEL,WAAW,GACnB,IAAAU,MAAA,CAAAC,aAAA,EAAChC,YAAA,CAAAiC,IAAI;IACJC,UAAU;IACVC,iBAAiB,EAAC,OAAO;IACzBC,kBAAkB,EAAG,IAAAb,QAAE,EACtB,0CACD,CAAG;IACHc,KAAK,EAAGb;EAAgB,GAExB,IAAAO,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAmC,IAAI;IAACC,IAAI,EAAGT,SAAS,CAACS,IAAM;IAACC,IAAI,EAAGC;EAAa,CAAE,CAAC,EACrD,IAAAV,MAAA,CAAAC,aAAA,EAAChC,YAAA,CAAA0C,IAAI;IAACL,KAAK,EAAGR;EAAW,GAAG,IAAAN,QAAE,EAAE,iBAAkB,CAAC,EAAE,GAAO,CACvD,CAAC,GACJ,IAAI;AACT,CAAC;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEazB,aAAa"}
1
+ {"version":3,"names":["_reactNative","require","_compose","_components","_icons","_i18n","_element","_styleNative","_interopRequireDefault","useAccessibilityLiveRegion","message","isActive","inactiveMessage","announceForAccessibility","AccessibilityInfo","prevIsActive","usePrevious","useEffect","unconditionalMessage","initialRender","OfflineStatus","isConnected","useNetworkConnectivity","__","containerStyle","usePreferredColorSchemeStyle","styles","offline","offline__dark","textStyle","iconStyle","_react","createElement","View","accessible","accessibilityRole","accessibilityLabel","style","Icon","fill","icon","offlineIcon","Text","_default","exports","default"],"sources":["@wordpress/editor/src/components/offline-status/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorSchemeStyle,\n\tuseNetworkConnectivity,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { Icon } from '@wordpress/components';\nimport { offline as offlineIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.native.scss';\n\n/**\n * Conditionally announces messages for screen reader users. This Hook provides\n * two benefits over React Native's `accessibilityLiveRegion`:\n *\n * 1. It works on both iOS and Android.\n * 2. It allows announcing a secondary message when the component is inactive.\n *\n * @param {string} message The message to announce.\n * @param {Object} options Options for the Hook.\n * @param {boolean} [options.isActive] Whether the message should be announced.\n * @param {string} [options.inactiveMessage] The message to announce when inactive.\n */\nfunction useAccessibilityLiveRegion( message, { isActive, inactiveMessage } ) {\n\tconst { announceForAccessibility } = AccessibilityInfo;\n\tconst prevIsActive = usePrevious( isActive );\n\n\tuseEffect( () => {\n\t\tconst unconditionalMessage = typeof isActive === 'undefined';\n\t\tconst initialRender = typeof prevIsActive === 'undefined';\n\n\t\tif (\n\t\t\tunconditionalMessage ||\n\t\t\t( isActive && ! prevIsActive && ! initialRender )\n\t\t) {\n\t\t\tannounceForAccessibility( message );\n\t\t} else if ( ! isActive && prevIsActive && inactiveMessage ) {\n\t\t\tannounceForAccessibility( inactiveMessage );\n\t\t}\n\t}, [\n\t\tmessage,\n\t\tisActive,\n\t\tprevIsActive,\n\t\tinactiveMessage,\n\t\tannounceForAccessibility,\n\t] );\n}\n\nconst OfflineStatus = () => {\n\tconst { isConnected } = useNetworkConnectivity();\n\n\tuseAccessibilityLiveRegion( __( 'Network connection re-established' ), {\n\t\tisActive: isConnected,\n\t\tinactiveMessage: __( 'Network connection lost, working offline' ),\n\t} );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.offline,\n\t\tstyles.offline__dark\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--text' ],\n\t\tstyles[ 'offline--text__dark' ]\n\t);\n\n\tconst iconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--icon' ],\n\t\tstyles[ 'offline--icon__dark' ]\n\t);\n\n\treturn ! isConnected ? (\n\t\t<View\n\t\t\taccessible\n\t\t\taccessibilityRole=\"alert\"\n\t\t\taccessibilityLabel={ __(\n\t\t\t\t'Network connection lost, working offline'\n\t\t\t) }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<Icon fill={ iconStyle.fill } icon={ offlineIcon } />\n\t\t\t<Text style={ textStyle }>{ __( 'Working Offline' ) } </Text>\n\t\t</View>\n\t) : null;\n};\n\nexport default OfflineStatus;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,YAAA,GAAAC,sBAAA,CAAAP,OAAA;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASQ,0BAA0BA,CAAEC,OAAO,EAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EAC7E,MAAM;IAAEC;EAAyB,CAAC,GAAGC,8BAAiB;EACtD,MAAMC,YAAY,GAAG,IAAAC,oBAA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,QAAE,EACtB,0CACD,CAAG;IACHc,KAAK,EAAGb;EAAgB,GAExB,IAAAO,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAmC,IAAI;IAACC,IAAI,EAAGT,SAAS,CAACS,IAAM;IAACC,IAAI,EAAGC;EAAa,CAAE,CAAC,EACrD,IAAAV,MAAA,CAAAC,aAAA,EAAChC,YAAA,CAAA0C,IAAI;IAACL,KAAK,EAAGR;EAAW,GAAG,IAAAN,QAAE,EAAE,iBAAkB,CAAC,EAAE,GAAO,CACvD,CAAC,GACJ,IAAI;AACT,CAAC;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEazB,aAAa","ignoreList":[]}
@@ -16,6 +16,14 @@ var _store = require("../../store");
16
16
  * Internal dependencies
17
17
  */
18
18
 
19
+ /**
20
+ * Wrapper component that renders its children only if the post type supports page attributes.
21
+ *
22
+ * @param {Object} props - The component props.
23
+ * @param {Element} props.children - The child components to render.
24
+ *
25
+ * @return {Component|null} The rendered child components or null if page attributes are not supported.
26
+ */
19
27
  function PageAttributesCheck({
20
28
  children
21
29
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_store","PageAttributesCheck","children","supportsPageAttributes","useSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","_default","exports","default"],"sources":["@wordpress/editor/src/components/page-attributes/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PageAttributesCheck( { children } ) {\n\tconst supportsPageAttributes = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn !! postType?.supports?.[ 'page-attributes' ];\n\t}, [] );\n\n\t// Only render fields if post type supports page attributes or available templates exist.\n\tif ( ! supportsPageAttributes ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PageAttributesCheck;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGO,SAASG,mBAAmBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnD,MAAMC,sBAAsB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACvD,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEE,YAAY,CAAC;IACxD,MAAM;MAAEC;IAAY,CAAC,GAAGH,MAAM,CAAEI,eAAU,CAAC;IAC3C,MAAMC,QAAQ,GAAGF,WAAW,CAAEF,sBAAsB,CAAE,MAAO,CAAE,CAAC;IAEhE,OAAO,CAAC,CAAEI,QAAQ,EAAEC,QAAQ,GAAI,iBAAiB,CAAE;EACpD,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA,IAAK,CAAER,sBAAsB,EAAG;IAC/B,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcb,mBAAmB"}
1
+ {"version":3,"names":["_data","require","_coreData","_store","PageAttributesCheck","children","supportsPageAttributes","useSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","_default","exports","default"],"sources":["@wordpress/editor/src/components/page-attributes/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if the post type supports page attributes.\n *\n * @param {Object} props - The component props.\n * @param {Element} props.children - The child components to render.\n *\n * @return {Component|null} The rendered child components or null if page attributes are not supported.\n */\nexport function PageAttributesCheck( { children } ) {\n\tconst supportsPageAttributes = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn !! postType?.supports?.[ 'page-attributes' ];\n\t}, [] );\n\n\t// Only render fields if post type supports page attributes or available templates exist.\n\tif ( ! supportsPageAttributes ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PageAttributesCheck;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnD,MAAMC,sBAAsB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACvD,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEE,YAAY,CAAC;IACxD,MAAM;MAAEC;IAAY,CAAC,GAAGH,MAAM,CAAEI,eAAU,CAAC;IAC3C,MAAMC,QAAQ,GAAGF,WAAW,CAAEF,sBAAsB,CAAE,MAAO,CAAE,CAAC;IAEhE,OAAO,CAAC,CAAEI,QAAQ,EAAEC,QAAQ,GAAI,iBAAiB,CAAE;EACpD,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA,IAAK,CAAER,sBAAsB,EAAG;IAC/B,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcb,mBAAmB","ignoreList":[]}
@@ -50,6 +50,13 @@ function PageAttributesOrder() {
50
50
  }
51
51
  })));
52
52
  }
53
+
54
+ /**
55
+ * Renders the Page Attributes Order component. A number input in an editor interface
56
+ * for setting the order of a given page.
57
+ *
58
+ * @return {Component} The component to be rendered.
59
+ */
53
60
  function PageAttributesOrderWithChecks() {
54
61
  return (0, _react.createElement)(_postTypeSupportCheck.default, {
55
62
  supportKeys: "page-attributes"
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_element","_postTypeSupportCheck","_interopRequireDefault","_store","PageAttributesOrder","order","useSelect","select","_select$getEditedPost","editorStore","getEditedPostAttribute","editPost","useDispatch","orderInput","setOrderInput","useState","setUpdatedOrder","value","newOrder","Number","isInteger","trim","menu_order","_react","createElement","Flex","FlexBlock","__experimentalNumberControl","__next40pxDefaultSize","label","__","onChange","labelPosition","onBlur","PageAttributesOrderWithChecks","default","supportKeys"],"sources":["@wordpress/editor/src/components/page-attributes/order.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tFlex,\n\tFlexBlock,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PageAttributesOrder() {\n\tconst order = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'menu_order' ) ?? 0,\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ orderInput, setOrderInput ] = useState( null );\n\n\tconst setUpdatedOrder = ( value ) => {\n\t\tsetOrderInput( value );\n\t\tconst newOrder = Number( value );\n\t\tif ( Number.isInteger( newOrder ) && value.trim?.() !== '' ) {\n\t\t\teditPost( { menu_order: newOrder } );\n\t\t}\n\t};\n\n\tconst value = orderInput ?? order;\n\n\treturn (\n\t\t<Flex>\n\t\t\t<FlexBlock>\n\t\t\t\t<NumberControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Order' ) }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ setUpdatedOrder }\n\t\t\t\t\tlabelPosition=\"side\"\n\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\tsetOrderInput( null );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</FlexBlock>\n\t\t</Flex>\n\t);\n}\n\nexport default function PageAttributesOrderWithChecks() {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"page-attributes\">\n\t\t\t<PageAttributesOrder />\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,SAASO,mBAAmBA,CAAA,EAAG;EAC9B,MAAMC,KAAK,GAAG,IAAAC,eAAS,EACpBC,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEE,YAAY,CAAC,CAACC,sBAAsB,CAAE,YAAa,CAAC,cAAAF,qBAAA,cAAAA,qBAAA,GAAI,CAAC;EAAA,GAClE,EACD,CAAC;EACD,MAAM;IAAEG;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC/C,MAAM,CAAEI,UAAU,EAAEC,aAAa,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAEtD,MAAMC,eAAe,GAAKC,KAAK,IAAM;IACpCH,aAAa,CAAEG,KAAM,CAAC;IACtB,MAAMC,QAAQ,GAAGC,MAAM,CAAEF,KAAM,CAAC;IAChC,IAAKE,MAAM,CAACC,SAAS,CAAEF,QAAS,CAAC,IAAID,KAAK,CAACI,IAAI,GAAG,CAAC,KAAK,EAAE,EAAG;MAC5DV,QAAQ,CAAE;QAAEW,UAAU,EAAEJ;MAAS,CAAE,CAAC;IACrC;EACD,CAAC;EAED,MAAMD,KAAK,GAAGJ,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAIR,KAAK;EAEjC,OACC,IAAAkB,MAAA,CAAAC,aAAA,EAAC1B,WAAA,CAAA2B,IAAI,QACJ,IAAAF,MAAA,CAAAC,aAAA,EAAC1B,WAAA,CAAA4B,SAAS,QACT,IAAAH,MAAA,CAAAC,aAAA,EAAC1B,WAAA,CAAA6B,2BAAa;IACbC,qBAAqB;IACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAQ,CAAG;IACvBb,KAAK,EAAGA,KAAO;IACfc,QAAQ,EAAGf,eAAiB;IAC5BgB,aAAa,EAAC,MAAM;IACpBC,MAAM,EAAGA,CAAA,KAAM;MACdnB,aAAa,CAAE,IAAK,CAAC;IACtB;EAAG,CACH,CACS,CACN,CAAC;AAET;AAEe,SAASoB,6BAA6BA,CAAA,EAAG;EACvD,OACC,IAAAX,MAAA,CAAAC,aAAA,EAACvB,qBAAA,CAAAkC,OAAoB;IAACC,WAAW,EAAC;EAAiB,GAClD,IAAAb,MAAA,CAAAC,aAAA,EAACpB,mBAAmB,MAAE,CACD,CAAC;AAEzB"}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_element","_postTypeSupportCheck","_interopRequireDefault","_store","PageAttributesOrder","order","useSelect","select","_select$getEditedPost","editorStore","getEditedPostAttribute","editPost","useDispatch","orderInput","setOrderInput","useState","setUpdatedOrder","value","newOrder","Number","isInteger","trim","menu_order","_react","createElement","Flex","FlexBlock","__experimentalNumberControl","__next40pxDefaultSize","label","__","onChange","labelPosition","onBlur","PageAttributesOrderWithChecks","default","supportKeys"],"sources":["@wordpress/editor/src/components/page-attributes/order.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tFlex,\n\tFlexBlock,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PageAttributesOrder() {\n\tconst order = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'menu_order' ) ?? 0,\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ orderInput, setOrderInput ] = useState( null );\n\n\tconst setUpdatedOrder = ( value ) => {\n\t\tsetOrderInput( value );\n\t\tconst newOrder = Number( value );\n\t\tif ( Number.isInteger( newOrder ) && value.trim?.() !== '' ) {\n\t\t\teditPost( { menu_order: newOrder } );\n\t\t}\n\t};\n\n\tconst value = orderInput ?? order;\n\n\treturn (\n\t\t<Flex>\n\t\t\t<FlexBlock>\n\t\t\t\t<NumberControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Order' ) }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ setUpdatedOrder }\n\t\t\t\t\tlabelPosition=\"side\"\n\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\tsetOrderInput( null );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</FlexBlock>\n\t\t</Flex>\n\t);\n}\n\n/**\n * Renders the Page Attributes Order component. A number input in an editor interface\n * for setting the order of a given page.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PageAttributesOrderWithChecks() {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"page-attributes\">\n\t\t\t<PageAttributesOrder />\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAhBA;AACA;AACA;;AAU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,CAAC;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACe,SAASoB,6BAA6BA,CAAA,EAAG;EACvD,OACC,IAAAX,MAAA,CAAAC,aAAA,EAACvB,qBAAA,CAAAkC,OAAoB;IAACC,WAAW,EAAC;EAAiB,GAClD,IAAAb,MAAA,CAAAC,aAAA,EAACpB,mBAAmB,MAAE,CACD,CAAC;AAEzB","ignoreList":[]}
@@ -4,8 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.PageAttributesPanel = PageAttributesPanel;
8
- exports.default = void 0;
7
+ exports.default = PageAttributesPanel;
9
8
  var _react = require("react");
10
9
  var _i18n = require("@wordpress/i18n");
11
10
  var _components = require("@wordpress/components");
@@ -24,7 +23,7 @@ var _parent = _interopRequireDefault(require("./parent"));
24
23
  */
25
24
 
26
25
  const PANEL_NAME = 'page-attributes';
27
- function PageAttributesPanel() {
26
+ function AttributesPanel() {
28
27
  var _postType$labels$attr;
29
28
  const {
30
29
  isEnabled,
@@ -51,12 +50,19 @@ function PageAttributesPanel() {
51
50
  if (!isEnabled || !postType) {
52
51
  return null;
53
52
  }
54
- const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
55
- return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(_components.PanelBody, {
53
+ return (0, _react.createElement)(_components.PanelBody, {
56
54
  title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : (0, _i18n.__)('Page attributes'),
57
55
  opened: isOpened,
58
- onToggle: onTogglePanel
59
- }, (0, _react.createElement)(_parent.default, null), (0, _react.createElement)(_components.PanelRow, null, (0, _react.createElement)(_order.default, null))));
56
+ onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
57
+ }, (0, _react.createElement)(_parent.default, null), (0, _react.createElement)(_components.PanelRow, null, (0, _react.createElement)(_order.default, null)));
58
+ }
59
+
60
+ /**
61
+ * Renders the Page Attributes Panel component.
62
+ *
63
+ * @return {Component} The component to be rendered.
64
+ */
65
+ function PageAttributesPanel() {
66
+ return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(AttributesPanel, null));
60
67
  }
61
- var _default = exports.default = PageAttributesPanel;
62
68
  //# sourceMappingURL=panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_coreData","_store","_check","_interopRequireDefault","_order","_parent","PANEL_NAME","PageAttributesPanel","_postType$labels$attr","isEnabled","isOpened","postType","useSelect","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","editorStore","getPostType","coreStore","toggleEditorPanelOpened","useDispatch","onTogglePanel","args","_react","createElement","default","PanelBody","title","labels","attributes","__","opened","onToggle","PanelRow","_default","exports"],"sources":["@wordpress/editor/src/components/page-attributes/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\n\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PageAttributesCheck from './check';\nimport PageAttributesOrder from './order';\nimport PageAttributesParent from './parent';\n\nconst PANEL_NAME = 'page-attributes';\n\nexport function PageAttributesPanel() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst onTogglePanel = ( ...args ) =>\n\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args );\n\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.attributes ?? __( 'Page attributes' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PageAttributesParent />\n\t\t\t\t<PanelRow>\n\t\t\t\t\t<PageAttributesOrder />\n\t\t\t\t</PanelRow>\n\t\t\t</PanelBody>\n\t\t</PageAttributesCheck>\n\t);\n}\n\nexport default PageAttributesPanel;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,OAAA,GAAAF,sBAAA,CAAAN,OAAA;AAfA;AACA;AACA;;AAOA;AACA;AACA;;AAMA,MAAMS,UAAU,GAAG,iBAAiB;AAE7B,SAASC,mBAAmBA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EACrC,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAClE,MAAM;MACLC,sBAAsB;MACtBC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEI,YAAY,CAAC;IACzB,MAAM;MAAEC;IAAY,CAAC,GAAGL,MAAM,CAAEM,eAAU,CAAC;IAC3C,OAAO;MACNV,SAAS,EAAEM,oBAAoB,CAAET,UAAW,CAAC;MAC7CI,QAAQ,EAAEM,mBAAmB,CAAEV,UAAW,CAAC;MAC3CK,QAAQ,EAAEO,WAAW,CAAEJ,sBAAsB,CAAE,MAAO,CAAE;IACzD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEM;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,YAAY,CAAC;EAE9D,IAAK,CAAER,SAAS,IAAI,CAAEE,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMW,aAAa,GAAGA,CAAE,GAAGC,IAAI,KAC9BH,uBAAuB,CAAEd,UAAU,EAAE,GAAGiB,IAAK,CAAC;EAE/C,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACvB,MAAA,CAAAwB,OAAmB,QACnB,IAAAF,MAAA,CAAAC,aAAA,EAAC3B,WAAA,CAAA6B,SAAS;IACTC,KAAK,GAAApB,qBAAA,GACJG,QAAQ,EAAEkB,MAAM,EAAEC,UAAU,cAAAtB,qBAAA,cAAAA,qBAAA,GAAI,IAAAuB,QAAE,EAAE,iBAAkB,CACtD;IACDC,MAAM,EAAGtB,QAAU;IACnBuB,QAAQ,EAAGX;EAAe,GAE1B,IAAAE,MAAA,CAAAC,aAAA,EAACpB,OAAA,CAAAqB,OAAoB,MAAE,CAAC,EACxB,IAAAF,MAAA,CAAAC,aAAA,EAAC3B,WAAA,CAAAoC,QAAQ,QACR,IAAAV,MAAA,CAAAC,aAAA,EAACrB,MAAA,CAAAsB,OAAmB,MAAE,CACb,CACA,CACS,CAAC;AAExB;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcnB,mBAAmB"}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_coreData","_store","_check","_interopRequireDefault","_order","_parent","PANEL_NAME","AttributesPanel","_postType$labels$attr","isEnabled","isOpened","postType","useSelect","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","editorStore","getPostType","coreStore","toggleEditorPanelOpened","useDispatch","_react","createElement","PanelBody","title","labels","attributes","__","opened","onToggle","default","PanelRow","PageAttributesPanel"],"sources":["@wordpress/editor/src/components/page-attributes/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\n\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PageAttributesCheck from './check';\nimport PageAttributesOrder from './order';\nimport PageAttributesParent from './parent';\n\nconst PANEL_NAME = 'page-attributes';\n\nfunction AttributesPanel() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ postType?.labels?.attributes ?? __( 'Page attributes' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PageAttributesParent />\n\t\t\t<PanelRow>\n\t\t\t\t<PageAttributesOrder />\n\t\t\t</PanelRow>\n\t\t</PanelBody>\n\t);\n}\n\n/**\n * Renders the Page Attributes Panel component.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PageAttributesPanel() {\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<AttributesPanel />\n\t\t</PageAttributesCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAA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,MAAM,EAAGnB,QAAU;IACnBoB,QAAQ,EAAGA,CAAA,KAAMV,uBAAuB,CAAEd,UAAW;EAAG,GAExD,IAAAgB,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAA0B,OAAoB,MAAE,CAAC,EACxB,IAAAT,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAAkC,QAAQ,QACR,IAAAV,MAAA,CAAAC,aAAA,EAACnB,MAAA,CAAA2B,OAAmB,MAAE,CACb,CACA,CAAC;AAEd;;AAEA;AACA;AACA;AACA;AACA;AACe,SAASE,mBAAmBA,CAAA,EAAG;EAC7C,OACC,IAAAX,MAAA,CAAAC,aAAA,EAACrB,MAAA,CAAA6B,OAAmB,QACnB,IAAAT,MAAA,CAAAC,aAAA,EAAChB,eAAe,MAAE,CACE,CAAC;AAExB","ignoreList":[]}
@@ -43,6 +43,13 @@ const getItemPriority = (name, searchValue) => {
43
43
  }
44
44
  return Infinity;
45
45
  };
46
+
47
+ /**
48
+ * Renders the Page Attributes Parent component. A dropdown menu in an editor interface
49
+ * for selecting the parent page of a given page.
50
+ *
51
+ * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.
52
+ */
46
53
  exports.getItemPriority = getItemPriority;
47
54
  function PageAttributesParent() {
48
55
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_removeAccents","_interopRequireDefault","require","_i18n","_components","_compose","_element","_data","_htmlEntities","_coreData","_terms","_store","getTitle","post","title","rendered","decodeEntities","id","__","getItemPriority","name","searchValue","normalizedName","removeAccents","toLowerCase","normalizedSearch","startsWith","length","Infinity","exports","PageAttributesParent","editPost","useDispatch","editorStore","fieldValue","setFieldValue","useState","isHierarchical","parentPostId","parentPostTitle","pageItems","useSelect","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","coreStore","getCurrentPostId","getEditedPostAttribute","postTypeSlug","pageId","pType","postId","postIsHierarchical","hierarchical","query","per_page","exclude","parent_exclude","orderby","order","_fields","search","parentPost","parentOptions","useMemo","getOptionsFromTree","tree","level","mappedNodes","map","treeNode","value","label","repeat","rawName","children","sortedNodes","sort","a","b","priorityA","priorityB","flat","item","parent","buildTermsTree","opts","optsHasParent","find","unshift","handleKeydown","inputValue","handleChange","selectedPostId","_react","createElement","ComboboxControl","__nextHasNoMarginBottom","__next40pxDefaultSize","className","options","onFilterValueChange","debounce","onChange","_default","default"],"sources":["@wordpress/editor/src/components/page-attributes/parent.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\nimport { debounce } from '@wordpress/compose';\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\nfunction getTitle( post ) {\n\treturn post?.title?.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post.id } (${ __( 'no title' ) })`;\n}\n\nexport const getItemPriority = ( name, searchValue ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\nexport function PageAttributesParent() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ fieldValue, setFieldValue ] = useState( false );\n\tconst { isHierarchical, parentPostId, parentPostTitle, pageItems } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getPostType, getEntityRecords, getEntityRecord } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\t\tconst query = {\n\t\t\t\t\tper_page: 100,\n\t\t\t\t\texclude: postId,\n\t\t\t\t\tparent_exclude: postId,\n\t\t\t\t\torderby: 'menu_order',\n\t\t\t\t\torder: 'asc',\n\t\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t};\n\n\t\t\t\t// Perform a search when the field is changed.\n\t\t\t\tif ( !! fieldValue ) {\n\t\t\t\t\tquery.search = fieldValue;\n\t\t\t\t}\n\n\t\t\t\tconst parentPost = pageId\n\t\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t\t: null;\n\n\t\t\t\treturn {\n\t\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\t\tparentPostId: pageId,\n\t\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ fieldValue ]\n\t\t);\n\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = ( tree, level = 0 ) => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id,\n\t\t\tparent: item.parent,\n\t\t\tname: getTitle( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find(\n\t\t\t( item ) => item.value === parentPostId\n\t\t);\n\t\tif ( parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: parentPostId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t} );\n\t\t}\n\t\treturn opts;\n\t}, [ pageItems, fieldValue, parentPostTitle, parentPostId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId ) => {\n\t\teditPost( { parent: selectedPostId } );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\tvalue={ parentPostId }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleChange }\n\t\t/>\n\t);\n}\n\nexport default PageAttributesParent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;EAAc,CACzB,CAAC;AAEJ;AAAC,IAAAY,QAAA,GAAA7E,OAAA,CAAA8E,OAAA,GAEc7E,oBAAoB"}
1
+ {"version":3,"names":["_removeAccents","_interopRequireDefault","require","_i18n","_components","_compose","_element","_data","_htmlEntities","_coreData","_terms","_store","getTitle","post","title","rendered","decodeEntities","id","__","getItemPriority","name","searchValue","normalizedName","removeAccents","toLowerCase","normalizedSearch","startsWith","length","Infinity","exports","PageAttributesParent","editPost","useDispatch","editorStore","fieldValue","setFieldValue","useState","isHierarchical","parentPostId","parentPostTitle","pageItems","useSelect","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","coreStore","getCurrentPostId","getEditedPostAttribute","postTypeSlug","pageId","pType","postId","postIsHierarchical","hierarchical","query","per_page","exclude","parent_exclude","orderby","order","_fields","search","parentPost","parentOptions","useMemo","getOptionsFromTree","tree","level","mappedNodes","map","treeNode","value","label","repeat","rawName","children","sortedNodes","sort","a","b","priorityA","priorityB","flat","item","parent","buildTermsTree","opts","optsHasParent","find","unshift","handleKeydown","inputValue","handleChange","selectedPostId","_react","createElement","ComboboxControl","__nextHasNoMarginBottom","__next40pxDefaultSize","className","options","onFilterValueChange","debounce","onChange","_default","default"],"sources":["@wordpress/editor/src/components/page-attributes/parent.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\nimport { debounce } from '@wordpress/compose';\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\nfunction getTitle( post ) {\n\treturn post?.title?.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post.id } (${ __( 'no title' ) })`;\n}\n\nexport const getItemPriority = ( name, searchValue ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\n/**\n * Renders the Page Attributes Parent component. A dropdown menu in an editor interface\n * for selecting the parent page of a given page.\n *\n * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.\n */\nexport function PageAttributesParent() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ fieldValue, setFieldValue ] = useState( false );\n\tconst { isHierarchical, parentPostId, parentPostTitle, pageItems } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getPostType, getEntityRecords, getEntityRecord } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\t\tconst query = {\n\t\t\t\t\tper_page: 100,\n\t\t\t\t\texclude: postId,\n\t\t\t\t\tparent_exclude: postId,\n\t\t\t\t\torderby: 'menu_order',\n\t\t\t\t\torder: 'asc',\n\t\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t};\n\n\t\t\t\t// Perform a search when the field is changed.\n\t\t\t\tif ( !! fieldValue ) {\n\t\t\t\t\tquery.search = fieldValue;\n\t\t\t\t}\n\n\t\t\t\tconst parentPost = pageId\n\t\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t\t: null;\n\n\t\t\t\treturn {\n\t\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\t\tparentPostId: pageId,\n\t\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ fieldValue ]\n\t\t);\n\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = ( tree, level = 0 ) => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id,\n\t\t\tparent: item.parent,\n\t\t\tname: getTitle( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find(\n\t\t\t( item ) => item.value === parentPostId\n\t\t);\n\t\tif ( parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: parentPostId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t} );\n\t\t}\n\t\treturn opts;\n\t}, [ pageItems, fieldValue, parentPostTitle, parentPostId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId ) => {\n\t\teditPost( { parent: selectedPostId } );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\tvalue={ parentPostId }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleChange }\n\t\t/>\n\t);\n}\n\nexport default PageAttributesParent;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAIA,SAASU,QAAQA,CAAEC,IAAI,EAAG;EACzB,OAAOA,IAAI,EAAEC,KAAK,EAAEC,QAAQ,GACzB,IAAAC,4BAAc,EAAEH,IAAI,CAACC,KAAK,CAACC,QAAS,CAAC,GACpC,IAAIF,IAAI,CAACI,EAAI,KAAK,I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AU,EAAEK,eAAe,EAAED,YAAY,CAAG,CAAC;EAE7D,IAAK,CAAED,cAAc,EAAG;IACvB,OAAO,IAAI;EACZ;EACA;AACD;AACA;AACA;AACA;EACC,MAAMuD,aAAa,GAAKC,UAAU,IAAM;IACvC1D,aAAa,CAAE0D,UAAW,CAAC;EAC5B,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,YAAY,GAAKC,cAAc,IAAM;IAC1ChE,QAAQ,CAAE;MAAEuD,MAAM,EAAES;IAAe,CAAE,CAAC;EACvC,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC7F,WAAA,CAAA8F,eAAe;IACfC,uBAAuB;IACvBC,qBAAqB;IACrBC,SAAS,EAAC,gCAAgC;IAC1C3B,KAAK,EAAG,IAAAxD,QAAE,EAAE,QAAS,CAAG;IACxBuD,KAAK,EAAGnC,YAAc;IACtBgE,OAAO,EAAGrC,aAAe;IACzBsC,mBAAmB,EAAG,IAAAC,iBAAQ,EAAEZ,aAAa,EAAE,GAAI,CAAG;IACtDa,QAAQ,EAAGX;EAAc,CACzB,CAAC;AAEJ;AAAC,IAAAY,QAAA,GAAA7E,OAAA,CAAA8E,OAAA,GAEc7E,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_patterns","_store","_lockUnlock","OverridesPanel","unlock","patternsPrivateApis","PatternOverridesPanel","supportsPatternOverridesPanel","useSelect","select","editorStore","getCurrentPostType","_react","createElement"],"sources":["@wordpress/editor/src/components/pattern-overrides-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { OverridesPanel } = unlock( patternsPrivateApis );\n\nexport default function PatternOverridesPanel() {\n\tconst supportsPatternOverridesPanel = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType() === 'wp_block',\n\t\t[]\n\t);\n\n\tif ( ! supportsPatternOverridesPanel ) {\n\t\treturn null;\n\t}\n\n\treturn <OverridesPanel />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAM;EAAEI;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAoB,CAAC;AAEzC,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAMC,6BAA6B,GAAG,IAAAC,eAAS,EAC5CC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,UAAU,EACvE,EACD,CAAC;EAED,IAAK,CAAEJ,6BAA6B,EAAG;IACtC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAK,MAAA,CAAAC,aAAA,EAACV,cAAc,MAAE,CAAC;AAC1B"}
1
+ {"version":3,"names":["_data","require","_patterns","_store","_lockUnlock","OverridesPanel","unlock","patternsPrivateApis","PatternOverridesPanel","supportsPatternOverridesPanel","useSelect","select","editorStore","getCurrentPostType","_react","createElement"],"sources":["@wordpress/editor/src/components/pattern-overrides-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { OverridesPanel } = unlock( patternsPrivateApis );\n\nexport default function PatternOverridesPanel() {\n\tconst supportsPatternOverridesPanel = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType() === 'wp_block',\n\t\t[]\n\t);\n\n\tif ( ! supportsPatternOverridesPanel ) {\n\t\treturn null;\n\t}\n\n\treturn <OverridesPanel />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAM;EAAEI;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAoB,CAAC;AAEzC,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAMC,6BAA6B,GAAG,IAAAC,eAAS,EAC5CC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,UAAU,EACvE,EACD,CAAC;EAED,IAAK,CAAEJ,6BAA6B,EAAG;IACtC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAK,MAAA,CAAAC,aAAA,EAACV,cAAc,MAAE,CAAC;AAC1B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_plugins","_data","_warning","_interopRequireDefault","_enablePluginDocumentSettingPanel","_store","Fill","Slot","createSlotFill","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","usePluginContext","panelName","opened","isEnabled","useSelect","select","isEditorPanelOpened","isEditorPanelEnabled","editorStore","toggleEditorPanelOpened","useDispatch","undefined","SCRIPT_DEBUG","warning","_react","createElement","Fragment","default","label","PanelBody","onToggle","_default","exports"],"sources":["@wordpress/editor/src/components/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/editor';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAKA,IAAAK,iCAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA,MAAM;EAAEO,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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;IACfC,IAAI,EAAGA,IAAM;IACbK,MAAM,EAAGA,MAAQ;IACjBkB,QAAQ,EAAGA,CAAA,KAAMX,uBAAuB,CAAER,SAAU;EAAG,GAErDH,QACQ,CAEP,CACL,CAAC;AAEL,CAAC;AAEDL,0BAA0B,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAExBxB,0BAA0B"}
1
+ {"version":3,"names":["_components","require","_plugins","_data","_warning","_interopRequireDefault","_enablePluginDocumentSettingPanel","_store","Fill","Slot","createSlotFill","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","usePluginContext","panelName","opened","isEnabled","useSelect","select","isEditorPanelOpened","isEditorPanelEnabled","editorStore","toggleEditorPanelOpened","useDispatch","undefined","SCRIPT_DEBUG","warning","_react","createElement","Fragment","default","label","PanelBody","onToggle","_default","exports"],"sources":["@wordpress/editor/src/components/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/editor';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAKA,IAAAK,iCAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA,MAAM;EAAEO,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAG,IAAAC,yBAAgB,EAAC,CAAC;EAC/C,MAAMC,SAAS,GAA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ports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _compose = require("@wordpress/compose");
8
+ var _components = require("@wordpress/components");
9
+ var _plugins = require("@wordpress/plugins");
10
+ var _interface = require("@wordpress/interface");
11
+ /**
12
+ * WordPress dependencies
13
+ */
14
+ /**
15
+ * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
16
+ * The text within the component appears as the menu item label.
17
+ *
18
+ * @param {Object} props Component properties.
19
+ * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
20
+ * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
21
+ * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
22
+ * @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
23
+ *
24
+ * @example
25
+ * ```js
26
+ * // Using ES5 syntax
27
+ * var __ = wp.i18n.__;
28
+ * var PluginMoreMenuItem = wp.editor.PluginMoreMenuItem;
29
+ * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
30
+ *
31
+ * function onButtonClick() {
32
+ * alert( 'Button clicked.' );
33
+ * }
34
+ *
35
+ * function MyButtonMoreMenuItem() {
36
+ * return wp.element.createElement(
37
+ * PluginMoreMenuItem,
38
+ * {
39
+ * icon: moreIcon,
40
+ * onClick: onButtonClick,
41
+ * },
42
+ * __( 'My button title' )
43
+ * );
44
+ * }
45
+ * ```
46
+ *
47
+ * @example
48
+ * ```jsx
49
+ * // Using ESNext syntax
50
+ * import { __ } from '@wordpress/i18n';
51
+ * import { PluginMoreMenuItem } from '@wordpress/editor';
52
+ * import { more } from '@wordpress/icons';
53
+ *
54
+ * function onButtonClick() {
55
+ * alert( 'Button clicked.' );
56
+ * }
57
+ *
58
+ * const MyButtonMoreMenuItem = () => (
59
+ * <PluginMoreMenuItem
60
+ * icon={ more }
61
+ * onClick={ onButtonClick }
62
+ * >
63
+ * { __( 'My button title' ) }
64
+ * </PluginMoreMenuItem>
65
+ * );
66
+ * ```
67
+ *
68
+ * @return {Component} The component to be rendered.
69
+ */
70
+ var _default = exports.default = (0, _compose.compose)((0, _plugins.withPluginContext)((context, ownProps) => {
71
+ var _ownProps$as;
72
+ return {
73
+ as: (_ownProps$as = ownProps.as) !== null && _ownProps$as !== void 0 ? _ownProps$as : _components.MenuItem,
74
+ icon: ownProps.icon || context.icon,
75
+ name: 'core/plugin-more-menu'
76
+ };
77
+ }))(_interface.ActionItem);
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_compose","require","_components","_plugins","_interface","_default","exports","default","compose","withPluginContext","context","ownProps","_ownProps$as","as","MenuItem","icon","name","ActionItem"],"sources":["@wordpress/editor/src/components/plugin-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { MenuItem } from '@wordpress/components';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { ActionItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginMoreMenuItem = wp.editor.PluginMoreMenuItem;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * function MyButtonMoreMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginMoreMenuItem,\n * \t\t{\n * \t\t\ticon: moreIcon,\n * \t\t\tonClick: onButtonClick,\n * \t\t},\n * \t\t__( 'My button title' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginMoreMenuItem } from '@wordpress/editor';\n * import { more } from '@wordpress/icons';\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * const MyButtonMoreMenuItem = () => (\n * \t<PluginMoreMenuItem\n * \t\ticon={ more }\n * \t\tonClick={ onButtonClick }\n * \t>\n * \t\t{ __( 'My button title' ) }\n * \t</PluginMoreMenuItem>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nexport default compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\tas: ownProps.as ?? MenuItem,\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t\tname: 'core/plugin-more-menu',\n\t\t};\n\t} )\n)( ActionItem );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AANA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvDA,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAwDe,IAAAC,gBAAO,EACrB,IAAAC,0BAAiB,EAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAAA,IAAAC,YAAA;EAC3C,OAAO;IACNC,EAAE,GAAAD,YAAA,GAAED,QAAQ,CAACE,EAAE,cAAAD,YAAA,cAAAA,YAAA,GAAIE,oBAAQ;IAC3BC,IAAI,EAAEJ,QAAQ,CAACI,IAAI,IAAIL,OAAO,CAACK,IAAI;IACnCC,IAAI,EAAE;EACP,CAAC;AACF,CAAE,CACH,CAAC,CAAEC,qBAAW,CAAC","ignoreList":[]}
@@ -31,7 +31,7 @@ const {
31
31
  * ```jsx
32
32
  * // Using ESNext syntax
33
33
  * import { __ } from '@wordpress/i18n';
34
- * import { PluginPostPublishPanel } from '@wordpress/edit-post';
34
+ * import { PluginPostPublishPanel } from '@wordpress/editor';
35
35
  *
36
36
  * const MyPluginPostPublishPanel = () => (
37
37
  * <PluginPostPublishPanel