@wordpress/editor 13.32.0 → 13.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +225 -2
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  16. package/build/components/character-count/index.js.map +1 -1
  17. package/build/components/commands/index.js +19 -0
  18. package/build/components/commands/index.js.map +1 -1
  19. package/build/components/commands/index.native.js.map +1 -1
  20. package/build/components/deprecated.js.map +1 -1
  21. package/build/components/deprecated.native.js.map +1 -1
  22. package/build/components/document-bar/index.js.map +1 -1
  23. package/build/components/document-outline/check.js.map +1 -1
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-outline/item.js.map +1 -1
  26. package/build/components/document-tools/index.js +1 -1
  27. package/build/components/document-tools/index.js.map +1 -1
  28. package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  29. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  30. package/build/components/editor-canvas/index.js +2 -2
  31. package/build/components/editor-canvas/index.js.map +1 -1
  32. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  33. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  35. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  36. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  37. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  38. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  39. package/build/components/editor-help/index.native.js.map +1 -1
  40. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  41. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js.map +1 -1
  45. package/build/components/editor-history/undo.js.map +1 -1
  46. package/build/components/editor-notices/index.js.map +1 -1
  47. package/build/components/editor-snackbars/index.js.map +1 -1
  48. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  49. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  50. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  51. package/build/components/entities-saved-states/index.js.map +1 -1
  52. package/build/components/error-boundary/index.js.map +1 -1
  53. package/build/components/error-boundary/index.native.js.map +1 -1
  54. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  55. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  56. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  57. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  58. package/build/components/index.js +33 -1
  59. package/build/components/index.js.map +1 -1
  60. package/build/components/index.native.js.map +1 -1
  61. package/build/components/inserter-sidebar/index.js.map +1 -1
  62. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  63. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  64. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  65. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  66. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  67. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  68. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  69. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  70. package/build/components/list-view-sidebar/index.js.map +1 -1
  71. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  72. package/build/components/local-autosave-monitor/index.js.map +1 -1
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/mode-switcher/index.js.map +1 -1
  75. package/build/components/offline-status/index.native.js.map +1 -1
  76. package/build/components/page-attributes/check.js.map +1 -1
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/panel.js.map +1 -1
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  81. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  82. package/build/components/plugin-more-menu-item/index.js +78 -0
  83. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  84. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  85. package/build/components/plugin-post-status-info/index.js +73 -0
  86. package/build/components/plugin-post-status-info/index.js.map +1 -0
  87. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  88. package/build/components/plugin-sidebar/index.js +108 -0
  89. package/build/components/plugin-sidebar/index.js.map +1 -0
  90. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  91. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  92. package/build/components/post-actions/actions.js +218 -17
  93. package/build/components/post-actions/actions.js.map +1 -1
  94. package/build/components/post-actions/index.js +137 -0
  95. package/build/components/post-actions/index.js.map +1 -0
  96. package/build/components/post-author/check.js.map +1 -1
  97. package/build/components/post-author/combobox.js.map +1 -1
  98. package/build/components/post-author/constants.js.map +1 -1
  99. package/build/components/post-author/hook.js.map +1 -1
  100. package/build/components/post-author/index.js.map +1 -1
  101. package/build/components/post-author/panel.js.map +1 -1
  102. package/build/components/post-author/select.js.map +1 -1
  103. package/build/components/post-card-panel/index.js +40 -6
  104. package/build/components/post-card-panel/index.js.map +1 -1
  105. package/build/components/post-comments/index.js.map +1 -1
  106. package/build/components/post-discussion/panel.js.map +1 -1
  107. package/build/components/post-excerpt/check.js +8 -0
  108. package/build/components/post-excerpt/check.js.map +1 -1
  109. package/build/components/post-excerpt/index.js.map +1 -1
  110. package/build/components/post-excerpt/panel.js.map +1 -1
  111. package/build/components/post-excerpt/plugin.js.map +1 -1
  112. package/build/components/post-featured-image/check.js.map +1 -1
  113. package/build/components/post-featured-image/index.js.map +1 -1
  114. package/build/components/post-featured-image/panel.js.map +1 -1
  115. package/build/components/post-format/check.js.map +1 -1
  116. package/build/components/post-format/index.js.map +1 -1
  117. package/build/components/post-last-revision/check.js.map +1 -1
  118. package/build/components/post-last-revision/index.js.map +1 -1
  119. package/build/components/post-last-revision/panel.js.map +1 -1
  120. package/build/components/post-locked-modal/index.js.map +1 -1
  121. package/build/components/post-panel-row/index.js.map +1 -1
  122. package/build/components/post-pending-status/check.js.map +1 -1
  123. package/build/components/post-pending-status/index.js.map +1 -1
  124. package/build/components/post-pingbacks/index.js.map +1 -1
  125. package/build/components/post-preview-button/index.js.map +1 -1
  126. package/build/components/post-publish-button/index.js +31 -31
  127. package/build/components/post-publish-button/index.js.map +1 -1
  128. package/build/components/post-publish-button/label.js +51 -43
  129. package/build/components/post-publish-button/label.js.map +1 -1
  130. package/build/components/post-publish-panel/index.js.map +1 -1
  131. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  132. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  133. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  134. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  135. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  136. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  137. package/build/components/post-saved-state/index.js +10 -6
  138. package/build/components/post-saved-state/index.js.map +1 -1
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js.map +1 -1
  141. package/build/components/post-schedule/label.js.map +1 -1
  142. package/build/components/post-schedule/panel.js +8 -0
  143. package/build/components/post-schedule/panel.js.map +1 -1
  144. package/build/components/post-slug/check.js.map +1 -1
  145. package/build/components/post-slug/index.js +43 -68
  146. package/build/components/post-slug/index.js.map +1 -1
  147. package/build/components/post-status/index.js +239 -0
  148. package/build/components/post-status/index.js.map +1 -0
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js.map +1 -1
  151. package/build/components/post-switch-to-draft-button/index.js +6 -1
  152. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build/components/post-sync-status/index.js.map +1 -1
  154. package/build/components/post-taxonomies/check.js.map +1 -1
  155. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  156. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  157. package/build/components/post-taxonomies/index.js.map +1 -1
  158. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  159. package/build/components/post-taxonomies/panel.js.map +1 -1
  160. package/build/components/post-template/block-theme.js +6 -2
  161. package/build/components/post-template/block-theme.js.map +1 -1
  162. package/build/components/post-template/classic-theme.js.map +1 -1
  163. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  164. package/build/components/post-template/create-new-template.js.map +1 -1
  165. package/build/components/post-template/hooks.js.map +1 -1
  166. package/build/components/post-template/panel.js.map +1 -1
  167. package/build/components/post-template/reset-default-template.js.map +1 -1
  168. package/build/components/post-template/swap-template-button.js.map +1 -1
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/constants.js.map +1 -1
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js.map +1 -1
  173. package/build/components/post-title/post-title-raw.js.map +1 -1
  174. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  175. package/build/components/post-title/use-post-title.js.map +1 -1
  176. package/build/components/post-trash/check.js +23 -25
  177. package/build/components/post-trash/check.js.map +1 -1
  178. package/build/components/post-trash/index.js +2 -1
  179. package/build/components/post-trash/index.js.map +1 -1
  180. package/build/components/post-type-support-check/index.js.map +1 -1
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +44 -19
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js.map +1 -1
  185. package/build/components/post-url/panel.js +14 -7
  186. package/build/components/post-url/panel.js.map +1 -1
  187. package/build/components/post-view-link/index.js.map +1 -1
  188. package/build/components/post-visibility/check.js.map +1 -1
  189. package/build/components/post-visibility/index.js +2 -1
  190. package/build/components/post-visibility/index.js.map +1 -1
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js.map +1 -1
  193. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  194. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  195. package/build/components/preferences-modal/index.js +19 -17
  196. package/build/components/preferences-modal/index.js.map +1 -1
  197. package/build/components/preview-dropdown/index.js.map +1 -1
  198. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  199. package/build/components/provider/index.js +4 -2
  200. package/build/components/provider/index.js.map +1 -1
  201. package/build/components/provider/index.native.js +6 -1
  202. package/build/components/provider/index.native.js.map +1 -1
  203. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  204. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  205. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  206. package/build/components/provider/use-block-editor-settings.js +64 -43
  207. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  208. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  209. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  210. package/build/components/provider/with-registry-provider.js +1 -0
  211. package/build/components/provider/with-registry-provider.js.map +1 -1
  212. package/build/components/start-page-options/index.js +139 -0
  213. package/build/components/start-page-options/index.js.map +1 -0
  214. package/build/components/table-of-contents/index.js.map +1 -1
  215. package/build/components/table-of-contents/panel.js.map +1 -1
  216. package/build/components/template-areas/index.js.map +1 -1
  217. package/build/components/template-validation-notice/index.js +23 -29
  218. package/build/components/template-validation-notice/index.js.map +1 -1
  219. package/build/components/theme-support-check/index.js +10 -16
  220. package/build/components/theme-support-check/index.js.map +1 -1
  221. package/build/components/time-to-read/index.js.map +1 -1
  222. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  223. package/build/components/word-count/index.js.map +1 -1
  224. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  225. package/build/hooks/default-autocompleters.js.map +1 -1
  226. package/build/hooks/index.js.map +1 -1
  227. package/build/hooks/index.native.js.map +1 -1
  228. package/build/hooks/pattern-overrides.js +22 -10
  229. package/build/hooks/pattern-overrides.js.map +1 -1
  230. package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
  231. package/build/index.js.map +1 -1
  232. package/build/index.native.js.map +1 -1
  233. package/build/lock-unlock.js.map +1 -1
  234. package/build/private-apis.js +20 -1
  235. package/build/private-apis.js.map +1 -1
  236. package/build/store/actions.js.map +1 -1
  237. package/build/store/actions.native.js.map +1 -1
  238. package/build/store/constants.js +8 -1
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +1 -1
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js.map +1 -1
  244. package/build/store/private-actions.js +177 -4
  245. package/build/store/private-actions.js.map +1 -1
  246. package/build/store/private-selectors.js +1 -7
  247. package/build/store/private-selectors.js.map +1 -1
  248. package/build/store/reducer.js.map +1 -1
  249. package/build/store/reducer.native.js.map +1 -1
  250. package/build/store/selectors.js +5 -10
  251. package/build/store/selectors.js.map +1 -1
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/get-filtered-template-parts.js.map +1 -1
  254. package/build/store/utils/is-template-revertable.js +28 -0
  255. package/build/store/utils/is-template-revertable.js.map +1 -0
  256. package/build/store/utils/notice-builder.js.map +1 -1
  257. package/build/utils/get-template-part-icon.js.map +1 -1
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js.map +1 -1
  260. package/build/utils/media-upload/index.js.map +1 -1
  261. package/build/utils/media-upload/index.native.js.map +1 -1
  262. package/build/utils/terms.js.map +1 -1
  263. package/build/utils/url.js.map +1 -1
  264. package/build-module/bindings/index.js.map +1 -1
  265. package/build-module/bindings/pattern-overrides.js.map +1 -1
  266. package/build-module/bindings/post-meta.js +14 -31
  267. package/build-module/bindings/post-meta.js.map +1 -1
  268. package/build-module/components/autocompleters/index.js.map +1 -1
  269. package/build-module/components/autocompleters/user.js.map +1 -1
  270. package/build-module/components/autosave-monitor/index.js +10 -0
  271. package/build-module/components/autosave-monitor/index.js.map +1 -1
  272. package/build-module/components/block-manager/category.js.map +1 -1
  273. package/build-module/components/block-manager/checklist.js.map +1 -1
  274. package/build-module/components/block-manager/index.js.map +1 -1
  275. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  276. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  277. package/build-module/components/character-count/index.js.map +1 -1
  278. package/build-module/components/commands/index.js +20 -1
  279. package/build-module/components/commands/index.js.map +1 -1
  280. package/build-module/components/commands/index.native.js.map +1 -1
  281. package/build-module/components/deprecated.js.map +1 -1
  282. package/build-module/components/deprecated.native.js.map +1 -1
  283. package/build-module/components/document-bar/index.js.map +1 -1
  284. package/build-module/components/document-outline/check.js.map +1 -1
  285. package/build-module/components/document-outline/index.js.map +1 -1
  286. package/build-module/components/document-outline/item.js.map +1 -1
  287. package/build-module/components/document-tools/index.js +1 -1
  288. package/build-module/components/document-tools/index.js.map +1 -1
  289. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  290. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  291. package/build-module/components/editor-canvas/index.js +2 -2
  292. package/build-module/components/editor-canvas/index.js.map +1 -1
  293. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  294. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  295. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  297. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  298. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js.map +1 -1
  301. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  302. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  303. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  305. package/build-module/components/editor-history/redo.js.map +1 -1
  306. package/build-module/components/editor-history/undo.js.map +1 -1
  307. package/build-module/components/editor-notices/index.js.map +1 -1
  308. package/build-module/components/editor-snackbars/index.js.map +1 -1
  309. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  310. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  311. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  312. package/build-module/components/entities-saved-states/index.js.map +1 -1
  313. package/build-module/components/error-boundary/index.js.map +1 -1
  314. package/build-module/components/error-boundary/index.native.js.map +1 -1
  315. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  316. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  317. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  318. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  319. package/build-module/components/index.js +4 -0
  320. package/build-module/components/index.js.map +1 -1
  321. package/build-module/components/index.native.js.map +1 -1
  322. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  323. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  324. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  325. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  326. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  327. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  328. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  329. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  330. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  331. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  332. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  333. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  334. package/build-module/components/media-categories/index.js.map +1 -1
  335. package/build-module/components/mode-switcher/index.js.map +1 -1
  336. package/build-module/components/offline-status/index.native.js.map +1 -1
  337. package/build-module/components/page-attributes/check.js.map +1 -1
  338. package/build-module/components/page-attributes/order.js.map +1 -1
  339. package/build-module/components/page-attributes/panel.js.map +1 -1
  340. package/build-module/components/page-attributes/parent.js.map +1 -1
  341. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  342. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  343. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  344. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  345. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  346. package/build-module/components/plugin-post-status-info/index.js +66 -0
  347. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  348. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  349. package/build-module/components/plugin-sidebar/index.js +102 -0
  350. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  351. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  352. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  353. package/build-module/components/post-actions/actions.js +219 -15
  354. package/build-module/components/post-actions/actions.js.map +1 -1
  355. package/build-module/components/post-actions/index.js +130 -0
  356. package/build-module/components/post-actions/index.js.map +1 -0
  357. package/build-module/components/post-author/check.js.map +1 -1
  358. package/build-module/components/post-author/combobox.js.map +1 -1
  359. package/build-module/components/post-author/constants.js.map +1 -1
  360. package/build-module/components/post-author/hook.js.map +1 -1
  361. package/build-module/components/post-author/index.js.map +1 -1
  362. package/build-module/components/post-author/panel.js.map +1 -1
  363. package/build-module/components/post-author/select.js.map +1 -1
  364. package/build-module/components/post-card-panel/index.js +42 -8
  365. package/build-module/components/post-card-panel/index.js.map +1 -1
  366. package/build-module/components/post-comments/index.js.map +1 -1
  367. package/build-module/components/post-discussion/panel.js.map +1 -1
  368. package/build-module/components/post-excerpt/check.js +9 -0
  369. package/build-module/components/post-excerpt/check.js.map +1 -1
  370. package/build-module/components/post-excerpt/index.js.map +1 -1
  371. package/build-module/components/post-excerpt/panel.js.map +1 -1
  372. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  373. package/build-module/components/post-featured-image/check.js.map +1 -1
  374. package/build-module/components/post-featured-image/index.js.map +1 -1
  375. package/build-module/components/post-featured-image/panel.js.map +1 -1
  376. package/build-module/components/post-format/check.js.map +1 -1
  377. package/build-module/components/post-format/index.js.map +1 -1
  378. package/build-module/components/post-last-revision/check.js.map +1 -1
  379. package/build-module/components/post-last-revision/index.js.map +1 -1
  380. package/build-module/components/post-last-revision/panel.js.map +1 -1
  381. package/build-module/components/post-locked-modal/index.js.map +1 -1
  382. package/build-module/components/post-panel-row/index.js.map +1 -1
  383. package/build-module/components/post-pending-status/check.js.map +1 -1
  384. package/build-module/components/post-pending-status/index.js.map +1 -1
  385. package/build-module/components/post-pingbacks/index.js.map +1 -1
  386. package/build-module/components/post-preview-button/index.js.map +1 -1
  387. package/build-module/components/post-publish-button/index.js +31 -31
  388. package/build-module/components/post-publish-button/index.js.map +1 -1
  389. package/build-module/components/post-publish-button/label.js +51 -42
  390. package/build-module/components/post-publish-button/label.js.map +1 -1
  391. package/build-module/components/post-publish-panel/index.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  395. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  396. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  397. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  398. package/build-module/components/post-saved-state/index.js +10 -6
  399. package/build-module/components/post-saved-state/index.js.map +1 -1
  400. package/build-module/components/post-schedule/check.js.map +1 -1
  401. package/build-module/components/post-schedule/index.js.map +1 -1
  402. package/build-module/components/post-schedule/label.js.map +1 -1
  403. package/build-module/components/post-schedule/panel.js +8 -0
  404. package/build-module/components/post-schedule/panel.js.map +1 -1
  405. package/build-module/components/post-slug/check.js.map +1 -1
  406. package/build-module/components/post-slug/index.js +44 -68
  407. package/build-module/components/post-slug/index.js.map +1 -1
  408. package/build-module/components/post-status/index.js +231 -0
  409. package/build-module/components/post-status/index.js.map +1 -0
  410. package/build-module/components/post-sticky/check.js.map +1 -1
  411. package/build-module/components/post-sticky/index.js.map +1 -1
  412. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  413. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  414. package/build-module/components/post-sync-status/index.js.map +1 -1
  415. package/build-module/components/post-taxonomies/check.js.map +1 -1
  416. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  417. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  418. package/build-module/components/post-taxonomies/index.js.map +1 -1
  419. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  420. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  421. package/build-module/components/post-template/block-theme.js +7 -3
  422. package/build-module/components/post-template/block-theme.js.map +1 -1
  423. package/build-module/components/post-template/classic-theme.js.map +1 -1
  424. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  425. package/build-module/components/post-template/create-new-template.js.map +1 -1
  426. package/build-module/components/post-template/hooks.js.map +1 -1
  427. package/build-module/components/post-template/panel.js.map +1 -1
  428. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  429. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  430. package/build-module/components/post-text-editor/index.js.map +1 -1
  431. package/build-module/components/post-title/constants.js.map +1 -1
  432. package/build-module/components/post-title/index.js.map +1 -1
  433. package/build-module/components/post-title/index.native.js.map +1 -1
  434. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  435. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  436. package/build-module/components/post-title/use-post-title.js.map +1 -1
  437. package/build-module/components/post-trash/check.js +24 -26
  438. package/build-module/components/post-trash/check.js.map +1 -1
  439. package/build-module/components/post-trash/index.js +2 -1
  440. package/build-module/components/post-trash/index.js.map +1 -1
  441. package/build-module/components/post-type-support-check/index.js.map +1 -1
  442. package/build-module/components/post-url/check.js.map +1 -1
  443. package/build-module/components/post-url/index.js +46 -21
  444. package/build-module/components/post-url/index.js.map +1 -1
  445. package/build-module/components/post-url/label.js.map +1 -1
  446. package/build-module/components/post-url/panel.js +14 -7
  447. package/build-module/components/post-url/panel.js.map +1 -1
  448. package/build-module/components/post-view-link/index.js.map +1 -1
  449. package/build-module/components/post-visibility/check.js.map +1 -1
  450. package/build-module/components/post-visibility/index.js +2 -1
  451. package/build-module/components/post-visibility/index.js.map +1 -1
  452. package/build-module/components/post-visibility/label.js.map +1 -1
  453. package/build-module/components/post-visibility/utils.js.map +1 -1
  454. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  455. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  456. package/build-module/components/preferences-modal/index.js +19 -17
  457. package/build-module/components/preferences-modal/index.js.map +1 -1
  458. package/build-module/components/preview-dropdown/index.js.map +1 -1
  459. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  460. package/build-module/components/provider/index.js +5 -3
  461. package/build-module/components/provider/index.js.map +1 -1
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  464. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  465. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  466. package/build-module/components/provider/use-block-editor-settings.js +66 -45
  467. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  468. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  469. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  470. package/build-module/components/provider/with-registry-provider.js +1 -0
  471. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  472. package/build-module/components/start-page-options/index.js +132 -0
  473. package/build-module/components/start-page-options/index.js.map +1 -0
  474. package/build-module/components/table-of-contents/index.js.map +1 -1
  475. package/build-module/components/table-of-contents/panel.js.map +1 -1
  476. package/build-module/components/template-areas/index.js.map +1 -1
  477. package/build-module/components/template-validation-notice/index.js +25 -31
  478. package/build-module/components/template-validation-notice/index.js.map +1 -1
  479. package/build-module/components/theme-support-check/index.js +11 -16
  480. package/build-module/components/theme-support-check/index.js.map +1 -1
  481. package/build-module/components/time-to-read/index.js.map +1 -1
  482. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  483. package/build-module/components/word-count/index.js.map +1 -1
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js.map +1 -1
  486. package/build-module/hooks/index.js.map +1 -1
  487. package/build-module/hooks/index.native.js.map +1 -1
  488. package/build-module/hooks/pattern-overrides.js +22 -10
  489. package/build-module/hooks/pattern-overrides.js.map +1 -1
  490. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
  491. package/build-module/index.js.map +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js +18 -1
  495. package/build-module/private-apis.js.map +1 -1
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js.map +1 -1
  498. package/build-module/store/constants.js +7 -0
  499. package/build-module/store/constants.js.map +1 -1
  500. package/build-module/store/defaults.js.map +1 -1
  501. package/build-module/store/index.js.map +1 -1
  502. package/build-module/store/local-autosave.js.map +1 -1
  503. package/build-module/store/private-actions.js +174 -4
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-selectors.js +1 -6
  506. package/build-module/store/private-selectors.js.map +1 -1
  507. package/build-module/store/reducer.js.map +1 -1
  508. package/build-module/store/reducer.native.js.map +1 -1
  509. package/build-module/store/selectors.js +1 -6
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/store/selectors.native.js.map +1 -1
  512. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
  513. package/build-module/store/utils/is-template-revertable.js +22 -0
  514. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  515. package/build-module/store/utils/notice-builder.js.map +1 -1
  516. package/build-module/utils/get-template-part-icon.js.map +1 -1
  517. package/build-module/utils/index.js.map +1 -1
  518. package/build-module/utils/index.native.js.map +1 -1
  519. package/build-module/utils/media-upload/index.js.map +1 -1
  520. package/build-module/utils/media-upload/index.native.js.map +1 -1
  521. package/build-module/utils/terms.js.map +1 -1
  522. package/build-module/utils/url.js.map +1 -1
  523. package/build-style/style-rtl.css +498 -25
  524. package/build-style/style.css +498 -25
  525. package/package.json +35 -35
  526. package/src/bindings/post-meta.js +11 -27
  527. package/src/components/autosave-monitor/index.js +9 -0
  528. package/src/components/commands/index.js +20 -1
  529. package/src/components/document-tools/index.js +16 -14
  530. package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
  531. package/src/components/editor-canvas/index.js +4 -4
  532. package/src/components/error-boundary/style.native.scss +1 -1
  533. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  534. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  535. package/src/components/index.js +4 -0
  536. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  537. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  538. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  539. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  540. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  541. package/src/components/plugin-more-menu-item/index.js +73 -0
  542. package/src/components/plugin-post-status-info/index.js +63 -0
  543. package/src/components/plugin-sidebar/index.js +98 -0
  544. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  545. package/src/components/post-actions/actions.js +294 -14
  546. package/src/components/post-actions/index.js +156 -0
  547. package/src/components/post-actions/style.scss +3 -0
  548. package/src/components/post-card-panel/index.js +69 -9
  549. package/src/components/post-excerpt/check.js +8 -0
  550. package/src/components/post-publish-button/index.js +23 -36
  551. package/src/components/post-publish-button/label.js +54 -39
  552. package/src/components/post-publish-button/test/index.js +15 -26
  553. package/src/components/post-publish-button/test/label.js +44 -21
  554. package/src/components/post-saved-state/index.js +13 -6
  555. package/src/components/post-saved-state/test/index.js +4 -0
  556. package/src/components/post-schedule/panel.js +22 -0
  557. package/src/components/post-slug/index.js +50 -68
  558. package/src/components/post-slug/test/index.js +29 -6
  559. package/src/components/post-status/index.js +310 -0
  560. package/src/components/post-status/style.scss +75 -0
  561. package/src/components/post-switch-to-draft-button/index.js +5 -0
  562. package/src/components/post-template/block-theme.js +31 -22
  563. package/src/components/post-trash/check.js +19 -19
  564. package/src/components/post-trash/index.js +1 -0
  565. package/src/components/post-url/index.js +131 -101
  566. package/src/components/post-url/panel.js +20 -7
  567. package/src/components/post-url/style.scss +8 -6
  568. package/src/components/post-visibility/index.js +1 -0
  569. package/src/components/preferences-modal/index.js +26 -22
  570. package/src/components/provider/index.js +17 -8
  571. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  572. package/src/components/provider/use-block-editor-settings.js +59 -33
  573. package/src/components/provider/with-registry-provider.js +1 -0
  574. package/src/components/start-page-options/index.js +135 -0
  575. package/src/components/start-page-options/style.scss +26 -0
  576. package/src/components/template-validation-notice/index.js +48 -50
  577. package/src/components/theme-support-check/index.js +9 -16
  578. package/src/components/theme-support-check/test/index.js +44 -43
  579. package/src/hooks/pattern-overrides.js +25 -14
  580. package/src/private-apis.js +15 -0
  581. package/src/store/constants.js +7 -0
  582. package/src/store/private-actions.js +269 -4
  583. package/src/store/private-selectors.js +1 -6
  584. package/src/store/selectors.js +1 -6
  585. package/src/store/utils/is-template-revertable.js +23 -0
  586. package/src/style.scss +6 -2
  587. package/src/components/post-publish-button/style.scss +0 -8
  588. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
  589. package/src/components/template-validation-notice/style.scss +0 -9
@@ -0,0 +1,132 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { Modal } from '@wordpress/components';
6
+ import { __ } from '@wordpress/i18n';
7
+ import { useState, useMemo, useEffect } from '@wordpress/element';
8
+ import { store as blockEditorStore, __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
9
+ import { useSelect, useDispatch } from '@wordpress/data';
10
+ import { useAsyncList } from '@wordpress/compose';
11
+ import { store as coreStore } from '@wordpress/core-data';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import { store as editorStore } from '../../store';
17
+ function useStartPatterns() {
18
+ // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
19
+ // and it has no postTypes declared and the current post type is page or if
20
+ // the current post type is part of the postTypes declared.
21
+ const {
22
+ blockPatternsWithPostContentBlockType,
23
+ postType
24
+ } = useSelect(select => {
25
+ const {
26
+ getPatternsByBlockTypes,
27
+ getBlocksByName
28
+ } = select(blockEditorStore);
29
+ const {
30
+ getCurrentPostType,
31
+ getRenderingMode
32
+ } = select(editorStore);
33
+ const rootClientId = getRenderingMode() === 'post-only' ? '' : getBlocksByName('core/post-content')?.[0];
34
+ return {
35
+ blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content', rootClientId),
36
+ postType: getCurrentPostType()
37
+ };
38
+ }, []);
39
+ return useMemo(() => {
40
+ // filter patterns without postTypes declared if the current postType is page
41
+ // or patterns that declare the current postType in its post type array.
42
+ return blockPatternsWithPostContentBlockType.filter(pattern => {
43
+ return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType);
44
+ });
45
+ }, [postType, blockPatternsWithPostContentBlockType]);
46
+ }
47
+ function PatternSelection({
48
+ blockPatterns,
49
+ onChoosePattern
50
+ }) {
51
+ const shownBlockPatterns = useAsyncList(blockPatterns);
52
+ const {
53
+ editEntityRecord
54
+ } = useDispatch(coreStore);
55
+ const {
56
+ postType,
57
+ postId
58
+ } = useSelect(select => {
59
+ const {
60
+ getCurrentPostType,
61
+ getCurrentPostId
62
+ } = select(editorStore);
63
+ return {
64
+ postType: getCurrentPostType(),
65
+ postId: getCurrentPostId()
66
+ };
67
+ }, []);
68
+ return createElement(BlockPatternsList, {
69
+ blockPatterns: blockPatterns,
70
+ shownPatterns: shownBlockPatterns,
71
+ onClickPattern: (_pattern, blocks) => {
72
+ editEntityRecord('postType', postType, postId, {
73
+ blocks
74
+ });
75
+ onChoosePattern();
76
+ }
77
+ });
78
+ }
79
+ function StartPageOptionsModal({
80
+ onClose
81
+ }) {
82
+ const startPatterns = useStartPatterns();
83
+ const hasStartPattern = startPatterns.length > 0;
84
+ if (!hasStartPattern) {
85
+ return null;
86
+ }
87
+ return createElement(Modal, {
88
+ title: __('Choose a pattern'),
89
+ isFullScreen: true,
90
+ onRequestClose: onClose
91
+ }, createElement("div", {
92
+ className: "editor-start-page-options__modal-content"
93
+ }, createElement(PatternSelection, {
94
+ blockPatterns: startPatterns,
95
+ onChoosePattern: onClose
96
+ })));
97
+ }
98
+ export default function StartPageOptions() {
99
+ const [isClosed, setIsClosed] = useState(false);
100
+ const {
101
+ shouldEnableModal,
102
+ postType,
103
+ postId
104
+ } = useSelect(select => {
105
+ const {
106
+ isEditedPostDirty,
107
+ isEditedPostEmpty,
108
+ getCurrentPostType,
109
+ getCurrentPostId,
110
+ getEditorSettings
111
+ } = select(editorStore);
112
+ const {
113
+ __unstableIsPreviewMode: isPreviewMode
114
+ } = getEditorSettings();
115
+ return {
116
+ shouldEnableModal: !isPreviewMode && !isEditedPostDirty() && isEditedPostEmpty(),
117
+ postType: getCurrentPostType(),
118
+ postId: getCurrentPostId()
119
+ };
120
+ }, []);
121
+ useEffect(() => {
122
+ // Should reset the modal state when navigating to a new page/post.
123
+ setIsClosed(false);
124
+ }, [postType, postId]);
125
+ if (!shouldEnableModal || isClosed) {
126
+ return null;
127
+ }
128
+ return createElement(StartPageOptionsModal, {
129
+ onClose: () => setIsClosed(true)
130
+ });
131
+ }
132
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Modal","__","useState","useMemo","useEffect","store","blockEditorStore","__experimentalBlockPatternsList","BlockPatternsList","useSelect","useDispatch","useAsyncList","coreStore","editorStore","useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","getBlocksByName","getCurrentPostType","getRenderingMode","rootClientId","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","editEntityRecord","postId","getCurrentPostId","createElement","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","title","isFullScreen","onRequestClose","className","StartPageOptions","isClosed","setIsClosed","shouldEnableModal","isEditedPostDirty","isEditedPostEmpty","getEditorSettings","__unstableIsPreviewMode","isPreviewMode"],"sources":["@wordpress/editor/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes, getBlocksByName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getCurrentPostType, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst rootClientId =\n\t\t\t\tgetRenderingMode() === 'post-only'\n\t\t\t\t\t? ''\n\t\t\t\t\t: getBlocksByName( 'core/post-content' )?.[ 0 ];\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType: getPatternsByBlockTypes(\n\t\t\t\t\t'core/post-content',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\teditEntityRecord( 'postType', postType, postId, { blocks } );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ onClose }\n\t\t>\n\t\t\t<div className=\"editor-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ onClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { shouldEnableModal, postType, postId } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostEmpty,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { __unstableIsPreviewMode: isPreviewMode } = getEditorSettings();\n\n\t\treturn {\n\t\t\tshouldEnableModal:\n\t\t\t\t! isPreviewMode && ! isEditedPostDirty() && isEditedPostEmpty(),\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Should reset the modal state when navigating to a new page/post.\n\t\tsetIsClosed( false );\n\t}, [ postType, postId ] );\n\n\tif ( ! shouldEnableModal || isClosed ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsClosed( true ) } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,uBAAuB;AAC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,CAACP,gBAAgB;IAChBC,aAAa,EAAGa,aAAe;IAC/BZ,eAAe,EAAGW;EAAS,CAC3B,CACG,CACC,CAAC;AAEV;AAEA,eAAe,SAASQ,gBAAgBA,CAAA,EAAG;EAC1C,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAGlD,QAAQ,CAAE,KAAM,CAAC;EACnD,MAAM;IAAEmD,iBAAiB;IAAErC,QAAQ;IAAEkB;EAAO,CAAC,GAAGzB,SAAS,CAAIQ,MAAM,IAAM;IACxE,MAAM;MACLqC,iBAAiB;MACjBC,iBAAiB;MACjBnC,kBAAkB;MAClBe,gBAAgB;MAChBqB;IACD,CAAC,GAAGvC,MAAM,CAAEJ,WAAY,CAAC;IACzB,MAAM;MAAE4C,uBAAuB,EAAEC;IAAc,CAAC,GAAGF,iBAAiB,CAAC,CAAC;IAEtE,OAAO;MACNH,iBAAiB,EAChB,CAAEK,aAAa,IAAI,CAAEJ,iBAAiB,CAAC,CAAC,IAAIC,iBAAiB,CAAC,CAAC;MAChEvC,QAAQ,EAAEI,kBAAkB,CAAC,CAAC;MAC9Bc,MAAM,EAAEC,gBAAgB,CAAC;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP/B,SAAS,CAAE,MAAM;IAChB;IACAgD,WAAW,CAAE,KAAM,CAAC;EACrB,CAAC,EAAE,CAAEpC,QAAQ,EAAEkB,MAAM,CAAG,CAAC;EAEzB,IAAK,CAAEmB,iBAAiB,IAAIF,QAAQ,EAAG;IACtC,OAAO,IAAI;EACZ;EAEA,OAAOf,aAAA,CAACK,qBAAqB;IAACC,OAAO,EAAGA,CAAA,KAAMU,WAAW,CAAE,IAAK;EAAG,CAAE,CAAC;AACvE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","createElement","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfCont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AC;AAEJ;AAEA,eAAeL,UAAU,CAAEI,eAAgB,CAAC"}
1
+ {"version":3,"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","createElement","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,SAAS;AAE1C,SAASC,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAGX,SAAS,CACxBY,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAER,gBAAiB,CAAC,CAACS,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,OACCC,aAAA,CAAChB,QAAQ;IACRiB,YAAY,EAAG;MACdC,SAAS,EAAER,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHS,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCP,aAAA,CAACf,MAAM;MAAA,GACDU,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXY,OAAO,EAAGX,SAAS,GAAGU,QAAQ,GAAGE,SAAW;MAC5CC,IAAI,EAAGvB,IAAM;MACb,iBAAgBmB,MAAQ;MACxB,iBAAc;MACd;MACAK,KAAK,EAAG5B,EAAE,CAAE,SAAU,CAAG;MACzB6B,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAEf;IAAW,CAC7B,CACC;IACHgB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5Bd,aAAA,CAACT,oBAAoB;MACpBwB,cAAc,EAAGD,OAAS;MAC1BrB,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;AAEA,eAAeL,UAAU,CAAEI,eAAgB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","useSelect","store","blockEditorStore","WordCount","TimeToRead","DocumentOutline","CharacterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount","createElement","Fragment","className","role","tabIndex","onSelect"],"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport TimeToRead from '../time-to-read';\nimport DocumentOutline from '../document-outline';\nimport CharacterCount from '../character-count';\n\nfunction TableOfContentsPanel( { hasOutlineItemsDisabled, onRequestClose } ) {\n\tconst { headingCount, paragraphCount, numberOfBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t\t\tnumberOfBlocks: getGlobalBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t/*\n\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t */\n\t\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"table-of-contents__wrapper\"\n\t\t\t\trole=\"note\"\n\t\t\t\taria-label={ __( 'Document Statistics' ) }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<ul role=\"list\" className=\"table-of-contents__counts\">\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Words' ) }\n\t\t\t\t\t\t<WordCount />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Characters' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Time to read' ) }\n\t\t\t\t\t\t<TimeToRead />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Headings' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ headingCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Paragraphs' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ paragraphCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ numberOfBlocks }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<hr />\n\t\t\t\t\t<h2 className=\"table-of-contents__title\">\n\t\t\t\t\t\t{ __( 'Document Outline' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<DocumentOutline\n\t\t\t\t\t\tonSelect={ onRequestClose }\n\t\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default TableOfContentsPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,UAAU,MAAM,iBAAiB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,SAASC,oBAAoBA,CAAE;EAAEC,uBAAuB;EAAEC;AAAe,CAAC,EAAG;EAC5E,MAAM;IAAEC,YAAY;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGZ,SAAS,CAC/Da,MAAM,IAAM;IACb,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEX,gBAAiB,CAAC;IAC1D,OAAO;MACNQ,YAAY,EAAEI,mBAAmB,CAAE,cAAe,CAAC;MACnDH,cAAc,EAAEG,mBAAmB,CAAE,gBAAiB,CAAC;MACvDF,cAAc,EAAEE,mBAAmB,CAAC;IACrC,CAAC;EACF,CAAC,EACD,EACD,CAAC;EACD;IACC;AACF;AACA;AACA;IACE;IACAC,aAAA,CAAAC,QAAA,QACCD,aAAA;MACCE,SAAS,EAAC,4BAA4B;MACtCC,IAAI,EAAC,MAAM;MACX,cAAanB,EAAE,CAAE,qBAAsB,CAAG;MAC1CoB,QAAQ,EAAC;IAAG,GAEZJ,aAAA;MAAIG,IAAI,EAAC,MAAM;MAACD,SAAS,EAAC;IAA2B,GACpDF,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,OAAQ,CAAC,EACfgB,aAAA,CAACZ,SAAS,MAAE,CACT,CAAC,EACLY,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,YAAa,CAAC,EACpBgB,aAAA;MAAME,SAAS,EAAC;IAA2B,GAC1CF,aAAA,CAACT,cAAc,MAAE,CACZ,CACH,CAAC,EACLS,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,cAAe,CAAC,EACtBgB,aAAA,CAACX,UAAU,MAAE,CACV,CAAC,EACLW,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,UAAW,CAAC,EAClBgB,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCP,YACG,CACH,CAAC,EACLK,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,YAAa,CAAC,EACpBgB,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCN,cACG,CACH,CAAC,EACLI,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,QAAS,CAAC,EAChBgB,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCL,cACG,CACH,CACD,CACA,CAAC,EACJF,YAAY,GAAG,CAAC,IACjBK,aAAA,CAAAC,QAAA,QACCD,aAAA,WAAK,CAAC,EACNA,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,kBAAmB,CACtB,CAAC,EACLgB,aAAA,CAACV,eAAe;MACfe,QAAQ,EAAGX,cAAgB;MAC3BD,uBAAuB,EAAGA;IAAyB,CACnD,CACA,CAEF;IACF;EAAA;AAEF;AAEA,eAAeD,oBAAoB"}
1
+ {"version":3,"names":["__","useSelect","store","blockEditorStore","WordCount","TimeToRead","DocumentOutline","CharacterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount","createElement","Fragment","className","role","tabIndex","onSelect"],"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport TimeToRead from '../time-to-read';\nimport DocumentOutline from '../document-outline';\nimport CharacterCount from '../character-count';\n\nfunction TableOfContentsPanel( { hasOutlineItemsDisabled, onRequestClose } ) {\n\tconst { headingCount, paragraphCount, numberOfBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t\t\tnumberOfBlocks: getGlobalBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t/*\n\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t */\n\t\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"table-of-contents__wrapper\"\n\t\t\t\trole=\"note\"\n\t\t\t\taria-label={ __( 'Document Statistics' ) }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<ul role=\"list\" className=\"table-of-contents__counts\">\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Words' ) }\n\t\t\t\t\t\t<WordCount />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Characters' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Time to read' ) }\n\t\t\t\t\t\t<TimeToRead />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Headings' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ headingCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Paragraphs' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ paragraphCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ numberOfBlocks }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<hr />\n\t\t\t\t\t<h2 className=\"table-of-contents__title\">\n\t\t\t\t\t\t{ __( 'Document Outline' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<DocumentOutline\n\t\t\t\t\t\tonSelect={ onRequestClose }\n\t\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default TableOfContentsPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,UAAU,MAAM,iBAAiB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,cAAc,MAAM,oBAAoB;A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,CAAE,YAAa,CAAC,EACpBgB,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCN,cACG,CACH,CAAC,EACLI,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,QAAS,CAAC,EAChBgB,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCL,cACG,CACH,CACD,CACA,CAAC,EACJF,YAAY,GAAG,CAAC,IACjBK,aAAA,CAAAC,QAAA,QACCD,aAAA,WAAK,CAAC,EACNA,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrClB,EAAE,CAAE,kBAAmB,CACtB,CAAC,EACLgB,aAAA,CAACV,eAAe;MACfe,QAAQ,EAAGX,cAAgB;MAC3BD,uBAAuB,EAAGA;IAAyB,CACnD,CACA,CAEF;IACF;EAAA;AAEF;AAEA,eAAeD,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","Button","__experimentalHeading","Heading","store","blockEditorStore","__","editorStore","unlock","TemplateAreaItem","area","clientId","selectBlock","toggleBlockHighlight","templatePartArea","select","defaultAreas","__experimentalGetDefaultTemplatePartAreas","find","defaultArea","highlightBlock","cancelHighlightBlock","createElement","className","icon","onMouseOver","onMouseLeave","onFocus","onBlur","onClick","label","TemplateAreas","templateParts","getCurrentTemplateTemplateParts","length","level","map","templatePart","block","key"],"sources":["@wordpress/editor/src/components/template-areas/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\n\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction TemplateAreaItem( { area, clientId } ) {\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\tconst templatePartArea = useSelect(\n\t\t( select ) => {\n\t\t\tconst defaultAreas =\n\t\t\t\tselect(\n\t\t\t\t\teditorStore\n\t\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\treturn defaultAreas.find(\n\t\t\t\t( defaultArea ) => defaultArea.area === area\n\t\t\t);\n\t\t},\n\t\t[ area ]\n\t);\n\n\tconst highlightBlock = () => toggleBlockHighlight( clientId, true );\n\tconst cancelHighlightBlock = () => toggleBlockHighlight( clientId, false );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"editor-template-areas__item\"\n\t\t\ticon={ templatePartArea?.icon }\n\t\t\tonMouseOver={ highlightBlock }\n\t\t\tonMouseLeave={ cancelHighlightBlock }\n\t\t\tonFocus={ highlightBlock }\n\t\t\tonBlur={ cancelHighlightBlock }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t>\n\t\t\t{ templatePartArea?.label }\n\t\t</Button>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst templateParts = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editorStore ) ).getCurrentTemplateTemplateParts(),\n\t\t[]\n\t);\n\n\tif ( ! templateParts.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<section className=\"editor-template-areas\">\n\t\t\t<Heading level={ 3 } className=\"editor-template-areas__title\">\n\t\t\t\t{ __( 'Areas' ) }\n\t\t\t</Heading>\n\n\t\t\t<ul className=\"editor-template-areas__list\">\n\t\t\t\t{ templateParts.map( ( { templatePart, block } ) => (\n\t\t\t\t\t<li key={ block.clientId }>\n\t\t\t\t\t\t<TemplateAreaItem\n\t\t\t\t\t\t\tarea={ templatePart.area }\n\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</section>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,M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P,MAAM,CAAEO,MAAM,CAAER,WAAY,CAAE,CAAC,CAAC0B,+BAA+B,CAAC,CAAC,EAClE,EACD,CAAC;EAED,IAAK,CAAED,aAAa,CAACE,MAAM,EAAG;IAC7B,OAAO,IAAI;EACZ;EAEA,OACCZ,aAAA;IAASC,SAAS,EAAC;EAAuB,GACzCD,aAAA,CAACnB,OAAO;IAACgC,KAAK,EAAG,CAAG;IAACZ,SAAS,EAAC;EAA8B,GAC1DjB,EAAE,CAAE,OAAQ,CACN,CAAC,EAEVgB,aAAA;IAAIC,SAAS,EAAC;EAA6B,GACxCS,aAAa,CAACI,GAAG,CAAE,CAAE;IAAEC,YAAY;IAAEC;EAAM,CAAC,KAC7ChB,aAAA;IAAIiB,GAAG,EAAGD,KAAK,CAAC3B;EAAU,GACzBW,aAAA,CAACb,gBAAgB;IAChBC,IAAI,EAAG2B,YAAY,CAAC3B,IAAM;IAC1BC,QAAQ,EAAG2B,KAAK,CAAC3B;EAAU,CAC3B,CACE,CACH,CACC,CACI,CAAC;AAEZ"}
1
+ {"version":3,"names":["useSelect","useDispatch","Button","__experimentalHeading","Heading","store","blockEditorStore","__","editorStore","unlock","TemplateAreaItem","area","clientId","selectBlock","toggleBlockHighlight","templatePartArea","select","defaultAreas","__experimentalGetDefaultTemplatePartAreas","find","defaultArea","highlightBlock","cancelHighlightBlock","createElement","className","icon","onMouseOver","onMouseLeave","onFocus","onBlur","onClick","label","TemplateAreas","templateParts","getCurrentTemplateTemplateParts","length","level","map","templatePart","block","key"],"sources":["@wordpress/editor/src/components/template-areas/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\n\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction TemplateAreaItem( { area, clientId } ) {\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\tconst templatePartArea = useSelect(\n\t\t( select ) => {\n\t\t\tconst defaultAreas =\n\t\t\t\tselect(\n\t\t\t\t\teditorStore\n\t\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\treturn defaultAreas.find(\n\t\t\t\t( defaultArea ) => defaultArea.area === area\n\t\t\t);\n\t\t},\n\t\t[ area ]\n\t);\n\n\tconst highlightBlock = () => toggleBlockHighlight( clientId, true );\n\tconst cancelHighlightBlock = () => toggleBlockHighlight( clientId, false );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"editor-template-areas__item\"\n\t\t\ticon={ templatePartArea?.icon }\n\t\t\tonMouseOver={ highlightBlock }\n\t\t\tonMouseLeave={ cancelHighlightBlock }\n\t\t\tonFocus={ highlightBlock }\n\t\t\tonBlur={ cancelHighlightBlock }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t>\n\t\t\t{ templatePartArea?.label }\n\t\t</Button>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst templateParts = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editorStore ) ).getCurrentTemplateTemplateParts(),\n\t\t[]\n\t);\n\n\tif ( ! templateParts.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<section className=\"editor-template-areas\">\n\t\t\t<Heading level={ 3 } className=\"editor-template-areas__title\">\n\t\t\t\t{ __( 'Areas' ) }\n\t\t\t</Heading>\n\n\t\t\t<ul className=\"editor-template-areas__list\">\n\t\t\t\t{ templateParts.map( ( { templatePart, block } ) => (\n\t\t\t\t\t<li key={ block.clientId }>\n\t\t\t\t\t\t<TemplateAreaItem\n\t\t\t\t\t\t\tarea={ templatePart.area }\n\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\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,CAAC;AAEX;AAEA,eAAe,SAASC,aAAaA,CAAA,EAAG;EACvC,MAAMC,aAAa,GAAGjC,SAAS,CAC5BgB,MAAM,IACPP,MAAM,CAAEO,MAAM,CAAER,WAAY,CAAE,CAAC,CAAC0B,+BAA+B,CAAC,CAAC,EAClE,EACD,CAAC;EAED,IAAK,CAAED,aAAa,CAACE,MAAM,EAAG;IAC7B,OAAO,IAAI;EACZ;EAEA,OACCZ,aAAA;IAASC,SAAS,EAAC;EAAuB,GACzCD,aAAA,CAACnB,OAAO;IAACgC,KAAK,EAAG,CAAG;IAACZ,SAAS,EAAC;EAA8B,GAC1DjB,EAAE,CAAE,OAAQ,CACN,CAAC,EAEVgB,aAAA;IAAIC,SAAS,EAAC;EAA6B,GACxCS,aAAa,CAACI,GAAG,CAAE,CAAE;IAAEC,YAAY;IAAEC;EAAM,CAAC,KAC7ChB,aAAA;IAAIiB,GAAG,EAAGD,KAAK,CAAC3B;EAAU,GACzBW,aAAA,CAACb,gBAAgB;IAChBC,IAAI,EAAG2B,YAAY,CAAC3B,IAAM;IAC1BC,QAAQ,EAAG2B,KAAK,CAAC3B;EAAU,CAC3B,CACE,CACH,CACC,CACI,CAAC;AAEZ","ignoreList":[]}
@@ -1,49 +1,43 @@
1
- import { createElement } from "react";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { Notice } from '@wordpress/components';
5
+ import { Notice, __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
- import { withSelect, withDispatch } from '@wordpress/data';
8
- import { compose } from '@wordpress/compose';
7
+ import { useDispatch, useSelect } from '@wordpress/data';
8
+ import { useState } from '@wordpress/element';
9
9
  import { store as blockEditorStore } from '@wordpress/block-editor';
10
- function TemplateValidationNotice({
11
- isValid,
12
- ...props
13
- }) {
10
+ export default function TemplateValidationNotice() {
11
+ const [showConfirmDialog, setShowConfirmDialog] = useState(false);
12
+ const isValid = useSelect(select => {
13
+ return select(blockEditorStore).isValidTemplate();
14
+ }, []);
15
+ const {
16
+ setTemplateValidity,
17
+ synchronizeTemplate
18
+ } = useDispatch(blockEditorStore);
14
19
  if (isValid) {
15
20
  return null;
16
21
  }
17
- const confirmSynchronization = () => {
18
- if (
19
- // eslint-disable-next-line no-alert
20
- window.confirm(__('Resetting the template may result in loss of content, do you want to continue?'))) {
21
- props.synchronizeTemplate();
22
- }
23
- };
24
- return createElement(Notice, {
22
+ return createElement(Fragment, null, createElement(Notice, {
25
23
  className: "editor-template-validation-notice",
26
24
  isDismissible: false,
27
25
  status: "warning",
28
26
  actions: [{
29
27
  label: __('Keep it as is'),
30
- onClick: props.resetTemplateValidity
28
+ onClick: () => setTemplateValidity(true)
31
29
  }, {
32
30
  label: __('Reset the template'),
33
- onClick: confirmSynchronization
31
+ onClick: () => setShowConfirmDialog(true)
34
32
  }]
35
- }, __('The content of your post doesn’t match the template assigned to your post type.'));
33
+ }, __('The content of your post doesn’t match the template assigned to your post type.')), createElement(ConfirmDialog, {
34
+ isOpen: showConfirmDialog,
35
+ confirmButtonText: __('Reset'),
36
+ onConfirm: () => {
37
+ setShowConfirmDialog(false);
38
+ synchronizeTemplate();
39
+ },
40
+ onCancel: () => setShowConfirmDialog(false)
41
+ }, __('Resetting the template may result in loss of content, do you want to continue?')));
36
42
  }
37
- export default compose([withSelect(select => ({
38
- isValid: select(blockEditorStore).isValidTemplate()
39
- })), withDispatch(dispatch => {
40
- const {
41
- setTemplateValidity,
42
- synchronizeTemplate
43
- } = dispatch(blockEditorStore);
44
- return {
45
- resetTemplateValidity: () => setTemplateValidity(true),
46
- synchronizeTemplate
47
- };
48
- })])(TemplateValidationNotice);
49
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Notice","__","withSelect","withDispatch","compose","store","blockEditorStore","TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","createElement","className","isDismissible","status","actions","label","onClick","resetTemplateValidity","select","isValidTemplate","dispatch","setTemplateValidity"],"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction TemplateValidationNotice( { isValid, ...props } ) {\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\tconst confirmSynchronization = () => {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\twindow.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tprops.synchronizeTemplate();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Notice\n\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\tisDismissible={ false }\n\t\t\tstatus=\"warning\"\n\t\t\tactions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\tonClick: props.resetTemplateValidity,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\tonClick: confirmSynchronization,\n\t\t\t\t},\n\t\t\t] }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisValid: select( blockEditorStore ).isValidTemplate(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { setTemplateValidity, synchronizeTemplate } =\n\t\t\tdispatch( blockEditorStore );\n\t\treturn {\n\t\t\tresetTemplateValidity: () => setTemplateValidity( true ),\n\t\t\tsynchronizeTemplate,\n\t\t};\n\t} ),\n] )( TemplateValidationNotice );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAAS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C,CAAEN,wBAAyB,CAAC"}
1
+ {"version":3,"names":["Notice","__experimentalConfirmDialog","ConfirmDialog","__","useDispatch","useSelect","useState","store","blockEditorStore","TemplateValidationNotice","showConfirmDialog","setShowConfirmDialog","isValid","select","isValidTemplate","setTemplateValidity","synchronizeTemplate","createElement","Fragment","className","isDismissible","status","actions","label","onClick","isOpen","confirmButtonText","onConfirm","onCancel"],"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tNotice,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function TemplateValidationNotice() {\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\tconst isValid = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).isValidTemplate();\n\t}, [] );\n\tconst { setTemplateValidity, synchronizeTemplate } =\n\t\tuseDispatch( blockEditorStore );\n\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Notice\n\t\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\t\tisDismissible={ false }\n\t\t\t\tstatus=\"warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\t\tonClick: () => setTemplateValidity( true ),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\t\tonClick: () => setShowConfirmDialog( true ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t\t) }\n\t\t\t</Notice>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tconfirmButtonText={ __( 'Reset' ) }\n\t\t\t\tonConfirm={ () => {\n\t\t\t\t\tsetShowConfirmDialog( false );\n\t\t\t\t\tsynchronizeTemplate();\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEnE,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAGL,QAAQ,CAAE,KAAM,CAAC;EACrE,MAAMM,OAAO,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACxC,OAAOA,MAAM,CAAEL,gBAAiB,CAAC,CAACM,eAAe,CAAC,CAAC;EACpD,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACjDZ,WAAW,CAAEI,gBAAiB,CAAC;EAEhC,IAAKI,OAAO,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,OACCK,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACjB,MAAM;IACNmB,SAAS,EAAC,mCAAmC;IAC7CC,aAAa,EAAG,KAAO;IACvBC,MAAM,EAAC,SAAS;IAChBC,OAAO,EAAG,CACT;MACCC,KAAK,EAAEpB,EAAE,CAAE,eAAgB,CAAC;MAC5BqB,OAAO,EAAEA,CAAA,KAAMT,mBAAmB,CAAE,IAAK;IAC1C,CAAC,EACD;MACCQ,KAAK,EAAEpB,EAAE,CAAE,oBAAqB,CAAC;MACjCqB,OAAO,EAAEA,CAAA,KAAMb,oBAAoB,CAAE,IAAK;IAC3C,CAAC;EACC,GAEDR,EAAE,CACH,iFACD,CACO,CAAC,EACTc,aAAA,CAACf,aAAa;IACbuB,MAAM,EAAGf,iBAAmB;IAC5BgB,iBAAiB,EAAGvB,EAAE,CAAE,OAAQ,CAAG;IACnCwB,SAAS,EAAGA,CAAA,KAAM;MACjBhB,oBAAoB,CAAE,KAAM,CAAC;MAC7BK,mBAAmB,CAAC,CAAC;IACtB,CAAG;IACHY,QAAQ,EAAGA,CAAA,KAAMjB,oBAAoB,CAAE,KAAM;EAAG,GAE9CR,EAAE,CACH,gFACD,CACc,CACd,CAAC;AAEL","ignoreList":[]}
@@ -1,19 +1,26 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { withSelect } from '@wordpress/data';
4
+ import { useSelect } from '@wordpress/data';
5
5
  import { store as coreStore } from '@wordpress/core-data';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
10
  import { store as editorStore } from '../../store';
11
- export function ThemeSupportCheck({
12
- themeSupports,
11
+ export default function ThemeSupportCheck({
13
12
  children,
14
- postType,
15
13
  supportKeys
16
14
  }) {
15
+ const {
16
+ postType,
17
+ themeSupports
18
+ } = useSelect(select => {
19
+ return {
20
+ postType: select(editorStore).getEditedPostAttribute('type'),
21
+ themeSupports: select(coreStore).getThemeSupports()
22
+ };
23
+ }, []);
17
24
  const isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => {
18
25
  var _themeSupports$key;
19
26
  const supported = (_themeSupports$key = themeSupports?.[key]) !== null && _themeSupports$key !== void 0 ? _themeSupports$key : false;
@@ -31,16 +38,4 @@ export function ThemeSupportCheck({
31
38
  }
32
39
  return children;
33
40
  }
34
- export default withSelect(select => {
35
- const {
36
- getThemeSupports
37
- } = select(coreStore);
38
- const {
39
- getEditedPostAttribute
40
- } = select(editorStore);
41
- return {
42
- postType: getEditedPostAttribute('type'),
43
- themeSupports: getThemeSupports()
44
- };
45
- })(ThemeSupportCheck);
46
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["withSelect","store","coreStore","editorStore","ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes","select","getThemeSupports","getEditedPostAttribute"],"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } 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 ThemeSupportCheck( {\n\tthemeSupports,\n\tchildren,\n\tpostType,\n\tsupportKeys,\n} ) {\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getThemeSupports } = select( coreStore );\n\tconst { getEditedPostAttribute } = select( editorStore );\n\treturn {\n\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\tthemeSupports: getThemeSupports(),\n\t};\n} )( ThemeSupportCheck );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,iBAAiBA,CAAE;EAClCC,aAAa;EACbC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAEH,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DI,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAET,QAAS,CAAC;IACtC;IACA,OAAOQ,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOH,QAAQ;AAChB;AAEA,eAAeN,UAAU,CAAIiB,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAiB,CAAC,GAAGD,MAAM,CAAEf,SAAU,CAAC;EAChD,MAAM;IAAEiB;EAAuB,CAAC,GAAGF,MAAM,CAAEd,WAAY,CAAC;EACxD,OAAO;IACNI,QAAQ,EAAEY,sBAAsB,CAAE,MAAO,CAAC;IAC1Cd,aAAa,EAAEa,gBAAgB,CAAC;EACjC,CAAC;AACF,CAAE,CAAC,CAAEd,iBAAkB,CAAC"}
1
+ {"version":3,"names":["useSelect","store","coreStore","editorStore","ThemeSupportCheck","children","supportKeys","postType","themeSupports","select","getEditedPostAttribute","getThemeSupports","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes"],"sources":["@wordpress/editor/src/components/theme-support-check/index.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 default function ThemeSupportCheck( { children, supportKeys } ) {\n\tconst { postType, themeSupports } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t\t\tthemeSupports: select( coreStore ).getThemeSupports(),\n\t\t};\n\t}, [] );\n\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EACtE,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC5D,OAAO;MACNF,QAAQ,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,MAAO,CAAC;MAChEF,aAAa,EAAEC,MAAM,CAAEP,SAAU,CAAC,CAACS,gBAAgB,CAAC;IACrD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAER,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DS,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAEZ,QAAS,CAAC;IACtC;IACA,OAAOW,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOP,QAAQ;AAChB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","createElement","className"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s is the number of minutes the post will take to read. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%d</span> minute',\n\t\t\t\t\t\t\t'<span>%d</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,GAAG;AAEhC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGZ,SAAS,CACtBa,MAAM,IAAMA,MAAM,CAAEJ,WAAY,CAAC,CAACK,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGd,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMe,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/BZ,SAAS,CAAEM,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBT,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DiB,IAAI,EAAEC,aAAA,aAAO;EACb,CAAE,CAAC,GACHd,wBAAwB,CACxBH,OAAO,EACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBc,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,EAAEC,aAAA,aAAO;EACd,CACA,CAAC;EAEL,OAAOA,aAAA;IAAMC,SAAS,EAAC;EAAc,GAAGH,mBAA2B,CAAC;AACrE"}
1
+ {"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","createElement","className"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s is the number of minutes the post will take to read. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%d</span> minute',\n\t\t\t\t\t\t\t'<span>%d</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,GAAG;AAEhC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGZ,SAAS,CACtBa,MAAM,IAAMA,MAAM,CAAEJ,WAAY,CAAC,CAACK,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGd,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMe,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/BZ,SAAS,CAAEM,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBT,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DiB,IAAI,EAAEC,aAAA,aAAO;EACb,CAAE,CAAC,GACHd,wBAAwB,CACxBH,OAAO,EACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBc,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,EAAEC,aAAA,aAAO;EACd,CACA,CAAC;EAEL,OAAOA,aAAA;IAAMC,SAAS,EAAC;EAAc,GAAGH,mBAA2B,CAAC;AACrE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","useEffect","useSelect","store","coreStore","UnsavedChangesWarning","__experimentalGetDirtyEntityRecords","warnIfUnsavedChanges","event","dirtyEntityRecords","length","returnValue","window","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {Component} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\t// We need to call the selector directly in the listener to avoid race\n\t\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tif ( dirtyEntityRecords.length > 0 ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ __experimentalGetDirtyEntityRecords ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAM;IAAEC;EAAoC,CAAC,GAAGJ,SAAS,CAAEE,SAAU,CAAC;EAEtEH,SAAS,CAAE,MAAM;IAChB;AACF;AACA;AACA;AACA;AACA;AACA;IACE,MAAMM,oBAAoB,GAAKC,KAAK,IAAM;MACzC;MACA;MACA;MACA;MACA,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;MAChE,IAAKG,kBAAkB,CAACC,MAAM,GAAG,CAAC,EAAG;QACpCF,KAAK,CAACG,WAAW,GAAGX,EAAE,CACrB,8DACD,CAAC;QACD,OAAOQ,KAAK,CAACG,WAAW;MACzB;IACD,CAAC;IAEDC,MAAM,CAACC,gBAAgB,CAAE,cAAc,EAAEN,oBAAqB,CAAC;IAE/D,OAAO,MAAM;MACZK,MAAM,CAACE,mBAAmB,CAAE,cAAc,EAAEP,oBAAqB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,CAAED,mCAAmC,CAAG,CAAC;EAE5C,OAAO,IAAI;AACZ"}
1
+ {"version":3,"names":["__","useEffect","useSelect","store","coreStore","UnsavedChangesWarning","__experimentalGetDirtyEntityRecords","warnIfUnsavedChanges","event","dirtyEntityRecords","length","returnValue","window","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {Component} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\t// We need to call the selector directly in the listener to avoid race\n\t\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tif ( dirtyEntityRecords.length > 0 ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ __experimentalGetDirtyEntityRecords ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAM;IAAEC;EAAoC,CAAC,GAAGJ,SAAS,CAAEE,SAAU,CAAC;EAEtEH,SAAS,CAAE,MAAM;IAChB;AACF;AACA;AACA;AACA;AACA;AACA;IACE,MAAMM,oBAAoB,GAAKC,KAAK,IAAM;MACzC;MACA;MACA;MACA;MACA,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;MAChE,IAAKG,kBAAkB,CAACC,MAAM,GAAG,CAAC,EAAG;QACpCF,KAAK,CAACG,WAAW,GAAGX,EAAE,CACrB,8DACD,CAAC;QACD,OAAOQ,KAAK,CAACG,WAAW;MACzB;IACD,CAAC;IAEDC,MAAM,CAACC,gBAAgB,CAAE,cAAc,EAAEN,oBAAqB,CAAC;IAE/D,OAAO,MAAM;MACZK,MAAM,CAACE,mBAAmB,CAAE,cAAc,EAAEP,oBAAqB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,CAAED,mCAAmC,CAAG,CAAC;EAE5C,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","_x","count","wordCount","store","editorStore","WordCount","content","select","getEditedPostAttribute","wordCountType","createElement","className"],"sources":["@wordpress/editor/src/components/word-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGP,SAAS,CACtBQ,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGT,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EAEzE,OACCU,aAAA;IAAMC,SAAS,EAAC;EAAY,GACzBT,SAAS,CAAEI,OAAO,EAAEG,aAAc,CAC/B,CAAC;AAET"}
1
+ {"version":3,"names":["useSelect","_x","count","wordCount","store","editorStore","WordCount","content","select","getEditedPostAttribute","wordCountType","createElement","className"],"sources":["@wordpress/editor/src/components/word-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGP,SAAS,CACtBQ,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGT,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EAEzE,OACCU,aAAA;IAAMC,SAAS,EAAC;EAAY,GACzBT,SAAS,CAAEI,OAAO,EAAEG,aAAc,CAC/B,CAAC;AAET","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","store","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","select","getCurrentPostType","meta","setMeta","mergedAttributes","Object","fromEntries","entries","map","attributeKey","metaKey","createElement","nextAttributes","nextMeta","filter","key","value","length","shimAttributeSource","settings","_settings$attributes","source","edit"],"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) =>\n\t\t\t( { attributes, setAttributes, ...props } ) => {\n\t\t\t\tconst postType = useSelect(\n\t\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\t'meta'\n\t\t\t\t);\n\n\t\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t\t() => ( {\n\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries( metaAttributes ).map(\n\t\t\t\t\t\t\t\t( [ attributeKey, metaKey ] ) => [\n\t\t\t\t\t\t\t\t\tattributeKey,\n\t\t\t\t\t\t\t\t\tmeta[ metaKey ],\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t} ),\n\t\t\t\t\t[ attributes, meta ]\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\t\tconst nextMeta = Object.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries( nextAttributes ?? {} )\n\t\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\t\t\t\t( [ key ] ) => key in metaAttributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.map( ( [ attributeKey, value ] ) => [\n\t\t\t\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ],\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( Object.entries( nextMeta ).length ) {\n\t\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = Object.fromEntries(\n\t\tObject.entries( settings.attributes ?? {} )\n\t\t\t.filter( ( [ , { source } ] ) => source === 'meta' )\n\t\t\t.map( ( [ attributeKey, { meta } ] ) => [ attributeKey, meta ] )\n\t);\n\tif ( Object.entries( metaAttributes ).length ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-back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AC1E4B,mBACD,CAAC"}
1
+ {"version":3,"names":["useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","store","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","select","getCurrentPostType","meta","setMeta","mergedAttributes","Object","fromEntries","entries","map","attributeKey","metaKey","createElement","nextAttributes","nextMeta","filter","key","value","length","shimAttributeSource","settings","_settings$attributes","source","edit"],"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) =>\n\t\t\t( { attributes, setAttributes, ...props } ) => {\n\t\t\t\tconst postType = useSelect(\n\t\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\t'meta'\n\t\t\t\t);\n\n\t\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t\t() => ( {\n\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries( metaAttributes ).map(\n\t\t\t\t\t\t\t\t( [ attributeKey, metaKey ] ) => [\n\t\t\t\t\t\t\t\t\tattributeKey,\n\t\t\t\t\t\t\t\t\tmeta[ metaKey ],\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t} ),\n\t\t\t\t\t[ attributes, meta ]\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\t\tconst nextMeta = Object.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries( nextAttributes ?? {} )\n\t\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\t\t\t\t( [ key ] ) => key in metaAttributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.map( ( [ attributeKey, value ] ) => [\n\t\t\t\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ],\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( Object.entries( nextMeta ).length ) {\n\t\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = Object.fromEntries(\n\t\tObject.entries( settings.attributes ?? {} )\n\t\t\t.filter( ( [ , { source } ] ) => source === 'meta' )\n\t\t\t.map( ( [ attributeKey, { meta } ] ) => [ attributeKey, meta ] )\n\t);\n\tif ( Object.entries( metaAttributes ).length ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,UAAU;;AAE/C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,6BAA6B,GAAKC,cAAc,IACrDL,0BAA0B,CACvBM,SAAS,IACV,CAAE;EAAEC,UAAU;EAAEC,aAAa;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC9C,MAAMC,QAAQ,GAAGb,SAAS,CACvBc,MAAM,IAAMA,MAAM,CAAER,WAAY,CAAC,CAACS,kBAAkB,CAAC,CAAC,EACxD,EACD,CAAC;EACD,MAAM,CAAEC,IAAI,EAAEC,O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a,oBAAA,GAAED,QAAQ,CAACvB,UAAU,cAAAwB,oBAAA,cAAAA,oBAAA,GAAI,CAAC,CAAE,CAAC,CACzCN,MAAM,CAAE,CAAE,GAAI;IAAEO;EAAO,CAAC,CAAE,KAAMA,MAAM,KAAK,MAAO,CAAC,CACnDb,GAAG,CAAE,CAAE,CAAEC,YAAY,EAAE;IAAEP;EAAK,CAAC,CAAE,KAAM,CAAEO,YAAY,EAAEP,IAAI,CAAG,CACjE,CAAC;EACD,IAAKG,MAAM,CAACE,OAAO,CAAEb,cAAe,CAAC,CAACuB,MAAM,EAAG;IAC9CE,QAAQ,CAACG,IAAI,GAAG7B,6BAA6B,CAAEC,cAAe,CAAC,CAC9DyB,QAAQ,CAACG,IACV,CAAC;EACF;EAEA,OAAOH,QAAQ;AAChB;AAEA7B,SAAS,CACR,0BAA0B,EAC1B,0EAA0E,EAC1E4B,mBACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","userAutocompleter","setDefaultCompleters","completers","push"],"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( { ...userAutocompleter } );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,eAAe;AAEjD,SAASC,oBAAoBA,CAAEC,UAAU,GAAG,EAAE,EAAG;EAChD;EACAA,UAAU,CAACC,IAAI,CAAE;IAAE,GAAGH;EAAkB,CAAE,CAAC;EAE3C,OAAOE,UAAU;AAClB;AAEAH,SAAS,CACR,gCAAgC,EAChC,8CAA8C,EAC9CE,oBACD,CAAC"}
1
+ {"version":3,"names":["addFilter","userAutocompleter","setDefaultCompleters","completers","push"],"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( { ...userAutocompleter } );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,eAAe;AAEjD,SAASC,oBAAoBA,CAAEC,UAAU,GAAG,EAAE,EAAG;EAChD;EACAA,UAAU,CAACC,IAAI,CAAE;IAAE,GAAGH;EAAkB,CAAE,CAAC;EAE3C,OAAOE,UAAU;AAClB;AAEAH,SAAS,CACR,gCAAgC,EAChC,8CAA8C,EAC9CE,oBACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './custom-sources-backwards-compatibility';\nimport './default-autocompleters';\nimport './pattern-overrides';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,0CAA0C;AACjD,OAAO,0BAA0B;AACjC,OAAO,qBAAqB"}
1
+ {"version":3,"names":[],"sources":["@wordpress/editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './custom-sources-backwards-compatibility';\nimport './default-autocompleters';\nimport './pattern-overrides';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,0CAA0C;AACjD,OAAO,0BAA0B;AACjC,OAAO,qBAAqB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/editor/src/hooks/index.native.js"],"sourcesContent":[""],"mappings":""}
1
+ {"version":3,"names":[],"sources":["@wordpress/editor/src/hooks/index.native.js"],"sourcesContent":[""],"mappings":"","ignoreList":[]}
@@ -7,6 +7,7 @@ import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
7
7
  import { createHigherOrderComponent } from '@wordpress/compose';
8
8
  import { useBlockEditingMode } from '@wordpress/block-editor';
9
9
  import { useSelect } from '@wordpress/data';
10
+ import { store as blocksStore } from '@wordpress/blocks';
10
11
 
11
12
  /**
12
13
  * Internal dependencies
@@ -14,7 +15,7 @@ import { useSelect } from '@wordpress/data';
14
15
  import { store as editorStore } from '../store';
15
16
  import { unlock } from '../lock-unlock';
16
17
  const {
17
- useSetPatternBindings,
18
+ PatternOverridesControls,
18
19
  ResetOverridesControl,
19
20
  PATTERN_TYPES,
20
21
  PARTIAL_SYNCING_SUPPORTED_BLOCKS
@@ -33,27 +34,38 @@ const withPatternOverrideControls = createHigherOrderComponent(BlockEdit => prop
33
34
  const isSupportedBlock = Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(props.name);
34
35
  return createElement(Fragment, null, createElement(BlockEdit, {
35
36
  ...props
36
- }), isSupportedBlock && createElement(BindingUpdater, {
37
- ...props
38
37
  }), props.isSelected && isSupportedBlock && createElement(ControlsWithStoreSubscription, {
39
38
  ...props
40
39
  }));
41
40
  });
42
- function BindingUpdater(props) {
43
- const postType = useSelect(select => select(editorStore).getCurrentPostType(), []);
44
- useSetPatternBindings(props, postType);
45
- return null;
46
- }
47
41
 
48
42
  // Split into a separate component to avoid a store subscription
49
43
  // on every block.
50
44
  function ControlsWithStoreSubscription(props) {
51
45
  const blockEditingMode = useBlockEditingMode();
52
- const isEditingPattern = useSelect(select => select(editorStore).getCurrentPostType() === PATTERN_TYPES.user, []);
46
+ const {
47
+ hasPatternOverridesSource,
48
+ isEditingPattern
49
+ } = useSelect(select => {
50
+ const {
51
+ getBlockBindingsSource
52
+ } = unlock(select(blocksStore));
53
+ return {
54
+ // For editing link to the site editor if the theme and user permissions support it.
55
+ hasPatternOverridesSource: !!getBlockBindingsSource('core/pattern-overrides'),
56
+ isEditingPattern: select(editorStore).getCurrentPostType() === PATTERN_TYPES.user
57
+ };
58
+ }, []);
53
59
  const bindings = props.attributes.metadata?.bindings;
54
60
  const hasPatternBindings = !!bindings && Object.values(bindings).some(binding => binding.source === 'core/pattern-overrides');
61
+ const shouldShowPatternOverridesControls = isEditingPattern && blockEditingMode === 'default';
55
62
  const shouldShowResetOverridesControl = !isEditingPattern && !!props.attributes.metadata?.name && blockEditingMode !== 'disabled' && hasPatternBindings;
56
- return createElement(Fragment, null, shouldShowResetOverridesControl && createElement(ResetOverridesControl, {
63
+ if (!hasPatternOverridesSource) {
64
+ return null;
65
+ }
66
+ return createElement(Fragment, null, shouldShowPatternOverridesControls && createElement(PatternOverridesControls, {
67
+ ...props
68
+ }), shouldShowResetOverridesControl && createElement(ResetOverridesControl, {
57
69
  ...props
58
70
  }));
59
71
  }
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","useSelect","store","editorStore","unlock","useSetPatternBindings","ResetOverridesControl","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","withPatternOverrideControls","BlockEdit","props","isSupportedBlock","Object","keys","includes","name","createElement","Fragment","BindingUpdater","isSelected","ControlsWithStoreSubscription","postType","select","getCurrentPostType","blockEditingMode","isEditingPattern","user","bindings","attributes","metadata","hasPatternBindings","values","some","binding","source","shouldShowResetOverridesControl"],"sources":["@wordpress/editor/src/hooks/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst {\n\tuseSetPatternBindings,\n\tResetOverridesControl,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPatternOverrideControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock = Object.keys(\n\t\t\tPARTIAL_SYNCING_SUPPORTED_BLOCKS\n\t\t).includes( props.name );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isSupportedBlock && <BindingUpdater { ...props } /> }\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\nfunction BindingUpdater( props ) {\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\tuseSetPatternBindings( props, postType );\n\treturn null;\n}\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isEditingPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === PATTERN_TYPES.user,\n\t\t[]\n\t);\n\n\tconst bindings = props.attributes.metadata?.bindings;\n\tconst hasPatternBindings =\n\t\t!! bindings &&\n\t\tObject.values( bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t);\n\n\tconst shouldShowResetOverridesControl =\n\t\t! isEditingPattern &&\n\t\t!! props.attributes.metadata?.name &&\n\t\tblockEditingMode !== 'disabled' &&\n\t\thasPatternBindings;\n\n\treturn (\n\t\t<>\n\t\t\t{ shouldShowResetOverridesControl && (\n\t\t\t\t<ResetOverridesControl { ...props } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-pattern-override-controls',\n\twithPatternOverrideControls\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;AACxE,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,UAAU;AAC/C,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAM;EACLC,qBAAqB;EACrBC,qBAAqB;EACrBC,aAAa;EACbC;AACD,CAAC,GAAGJ,MAAM,CAAEN,mBAAoB,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,2BAA2B,GAAGV,0BAA0B,CAC3DW,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CACnCN,gCACD,CAAC,CAACO,QAAQ,CAAEJ,KAAK,CAACK,IAAK,CAAC;EAExB,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBC,gBAAgB,IAAIK,aAAA,CAACE,cAAc;IAAA,GAAMR;EAAK,CAAI,CAAC,EACnDA,KAAK,CAACS,UAAU,IAAIR,gBAAgB,IACrCK,aAAA,CAACI,6BAA6B;IAAA,GAAMV;EAAK,CAAI,CAE7C,CAAC;AAEL,CACD,CAAC;AAED,SAASQ,cAAcA,CAAER,KAAK,EAAG;EAChC,MAAMW,QAAQ,GAAGrB,SAAS,CACvBsB,MAAM,IAAMA,MAAM,CAAEpB,WAAY,CAAC,CAACqB,kBAAkB,CAAC,CAAC,EACxD,EACD,CAAC;EACDnB,qBAAqB,CAAEM,KAAK,EAAEW,QAAS,CAAC;EACxC,OAAO,IAAI;AACZ;;AAEA;AACA;AACA,SAASD,6BAA6BA,CAAEV,KAAK,EAAG;EAC/C,MAAMc,gBAAgB,GAAGzB,mBAAmB,CAAC,CAAC;EAC9C,MAAM0B,gBAAgB,GAAGzB,SAAS,CAC/BsB,MAAM,IACPA,MAAM,CAAEpB,WAAY,CAAC,CAACqB,kBAAkB,CAAC,CAAC,KAAKjB,aAAa,CAACoB,IAAI,EAClE,EACD,CAAC;EAED,MAAMC,QAAQ,GAAGjB,KAAK,CAACkB,UAAU,CAACC,QAAQ,EAAEF,QAAQ;EACpD,MAAMG,kBAAkB,GACvB,CAAC,CAAEH,QAAQ,IACXf,MAAM,CAACmB,MAAM,CAAEJ,QAAS,CAAC,CAACK,IAAI,CAC3BC,OAAO,IAAMA,OAAO,CAACC,MAAM,KAAK,wBACnC,CAAC;EAEF,MAAMC,+BAA+B,GACpC,CAAEV,gBAAgB,IAClB,CAAC,CAAEf,KAAK,CAACkB,UAAU,CAACC,QAAQ,EAAEd,IAAI,IAClCS,gBAAgB,KAAK,UAAU,IAC/BM,kBAAkB;EAEnB,OACCd,aAAA,CAAAC,QAAA,QACGkB,+BAA+B,IAChCnB,aAAA,CAACX,qBAAqB;IAAA,GAAMK;EAAK,CAAI,CAErC,CAAC;AAEL;AAEAf,SAAS,CACR,kBAAkB,EAClB,4CAA4C,EAC5Ca,2BACD,CAAC"}
1
+ {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","useSelect","store","blocksStore","editorStore","unlock","PatternOverridesControls","ResetOverridesControl","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","withPatternOverrideControls","BlockEdit","props","isSupportedBlock","Object","keys","includes","name","createElement","Fragment","isSelected","ControlsWithStoreSubscription","blockEditingMode","hasPatternOverridesSource","isEditingPattern","select","getBlockBindingsSource","getCurrentPostType","user","bindings","attributes","metadata","hasPatternBindings","values","some","binding","source","shouldShowPatternOverridesControls","shouldShowResetOverridesControl"],"sources":["@wordpress/editor/src/hooks/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst {\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPatternOverrideControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock = Object.keys(\n\t\t\tPARTIAL_SYNCING_SUPPORTED_BLOCKS\n\t\t).includes( props.name );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { hasPatternOverridesSource, isEditingPattern } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\n\t\t\treturn {\n\t\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t\tisEditingPattern:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\tPATTERN_TYPES.user,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst bindings = props.attributes.metadata?.bindings;\n\tconst hasPatternBindings =\n\t\t!! bindings &&\n\t\tObject.values( bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t);\n\n\tconst shouldShowPatternOverridesControls =\n\t\tisEditingPattern && blockEditingMode === 'default';\n\tconst shouldShowResetOverridesControl =\n\t\t! isEditingPattern &&\n\t\t!! props.attributes.metadata?.name &&\n\t\tblockEditingMode !== 'disabled' &&\n\t\thasPatternBindings;\n\n\tif ( ! hasPatternOverridesSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ shouldShowPatternOverridesControls && (\n\t\t\t\t<PatternOverridesControls { ...props } />\n\t\t\t) }\n\t\t\t{ shouldShowResetOverridesControl && (\n\t\t\t\t<ResetOverridesControl { ...props } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-pattern-override-controls',\n\twithPatternOverrideControls\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;AACxE,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,UAAU;AAC/C,SAASC,MAAM,QAAQ,g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