@wordpress/editor 14.1.0 → 14.3.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 (772) hide show
  1. package/CHANGELOG.md +16 -12
  2. package/README.md +28 -7
  3. package/build/bindings/pattern-overrides.js +8 -5
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +4 -0
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/create-template-part-modal/index.js +2 -0
  8. package/build/components/create-template-part-modal/index.js.map +1 -1
  9. package/build/components/document-bar/index.js +11 -4
  10. package/build/components/document-bar/index.js.map +1 -1
  11. package/build/components/editor-interface/index.js +6 -3
  12. package/build/components/editor-interface/index.js.map +1 -1
  13. package/build/components/entities-saved-states/entity-record-item.js +4 -12
  14. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  15. package/build/components/entities-saved-states/index.js +1 -1
  16. package/build/components/entities-saved-states/index.js.map +1 -1
  17. package/build/components/global-keyboard-shortcuts/index.js +1 -1
  18. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  19. package/build/components/global-styles-provider/index.js +6 -65
  20. package/build/components/global-styles-provider/index.js.map +1 -1
  21. package/build/components/header/index.js +6 -2
  22. package/build/components/header/index.js.map +1 -1
  23. package/build/components/index.js +10 -2
  24. package/build/components/index.js.map +1 -1
  25. package/build/components/inserter-sidebar/index.js +10 -21
  26. package/build/components/inserter-sidebar/index.js.map +1 -1
  27. package/build/components/list-view-sidebar/index.js +19 -47
  28. package/build/components/list-view-sidebar/index.js.map +1 -1
  29. package/build/components/page-attributes/parent.js +2 -1
  30. package/build/components/page-attributes/parent.js.map +1 -1
  31. package/build/components/post-actions/actions.js +371 -452
  32. package/build/components/post-actions/actions.js.map +1 -1
  33. package/build/components/post-actions/index.js +7 -2
  34. package/build/components/post-actions/index.js.map +1 -1
  35. package/build/components/post-excerpt/index.js +2 -1
  36. package/build/components/post-excerpt/index.js.map +1 -1
  37. package/build/components/post-excerpt/panel.js +3 -2
  38. package/build/components/post-excerpt/panel.js.map +1 -1
  39. package/build/components/post-preview-button/index.js +1 -1
  40. package/build/components/post-preview-button/index.js.map +1 -1
  41. package/build/components/post-publish-panel/index.js +1 -1
  42. package/build/components/post-publish-panel/index.js.map +1 -1
  43. package/build/components/post-saved-state/index.js +11 -1
  44. package/build/components/post-saved-state/index.js.map +1 -1
  45. package/build/components/post-schedule/index.js +3 -0
  46. package/build/components/post-schedule/index.js.map +1 -1
  47. package/build/components/post-slug/check.js +8 -1
  48. package/build/components/post-slug/check.js.map +1 -1
  49. package/build/components/post-slug/index.js +6 -0
  50. package/build/components/post-slug/index.js.map +1 -1
  51. package/build/components/post-status/index.js +4 -2
  52. package/build/components/post-status/index.js.map +1 -1
  53. package/build/components/post-sticky/index.js +9 -13
  54. package/build/components/post-sticky/index.js.map +1 -1
  55. package/build/components/post-template/create-new-template-modal.js +2 -0
  56. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  57. package/build/components/post-title/index.js +5 -13
  58. package/build/components/post-title/index.js.map +1 -1
  59. package/build/components/preview-dropdown/index.js +1 -1
  60. package/build/components/preview-dropdown/index.js.map +1 -1
  61. package/build/components/provider/index.native.js +0 -4
  62. package/build/components/provider/index.native.js.map +1 -1
  63. package/build/components/provider/use-block-editor-settings.js +7 -4
  64. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  65. package/build/components/save-publish-panels/index.js +30 -16
  66. package/build/components/save-publish-panels/index.js.map +1 -1
  67. package/build/components/sidebar/index.js +4 -1
  68. package/build/components/sidebar/index.js.map +1 -1
  69. package/build/components/sidebar/post-summary.js +2 -4
  70. package/build/components/sidebar/post-summary.js.map +1 -1
  71. package/build/components/template-content-panel/index.js +29 -4
  72. package/build/components/template-content-panel/index.js.map +1 -1
  73. package/build/components/template-part-content-panel/index.js +70 -0
  74. package/build/components/template-part-content-panel/index.js.map +1 -0
  75. package/build/components/visual-editor/index.js +1 -1
  76. package/build/components/visual-editor/index.js.map +1 -1
  77. package/build/dataviews/actions/delete-post.js +96 -0
  78. package/build/dataviews/actions/delete-post.js.map +1 -0
  79. package/build/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +11 -20
  80. package/build/dataviews/actions/export-pattern.js.map +1 -0
  81. package/build/dataviews/actions/index.js +32 -0
  82. package/build/dataviews/actions/index.js.map +1 -0
  83. package/build/dataviews/actions/reset-post.js +111 -0
  84. package/build/dataviews/actions/reset-post.js.map +1 -0
  85. package/build/dataviews/actions/utils.js +50 -0
  86. package/build/dataviews/actions/utils.js.map +1 -0
  87. package/build/dataviews/store/private-actions.js.map +1 -1
  88. package/build/dataviews/store/private-selectors.js +6 -6
  89. package/build/dataviews/store/private-selectors.js.map +1 -1
  90. package/build/dataviews/store/reducer.js +6 -2
  91. package/build/dataviews/store/reducer.js.map +1 -1
  92. package/build/dataviews/types.js +6 -0
  93. package/build/dataviews/types.js.map +1 -0
  94. package/build/hooks/pattern-overrides.js +3 -3
  95. package/build/hooks/pattern-overrides.js.map +1 -1
  96. package/build/lock-unlock.js +1 -1
  97. package/build/lock-unlock.js.map +1 -1
  98. package/build/private-apis.js +2 -0
  99. package/build/private-apis.js.map +1 -1
  100. package/build/private-apis.native.js +0 -2
  101. package/build/private-apis.native.js.map +1 -1
  102. package/build/store/constants.js.map +1 -1
  103. package/build/store/private-actions.js +9 -5
  104. package/build/store/private-actions.js.map +1 -1
  105. package/build/store/private-selectors.js +0 -18
  106. package/build/store/private-selectors.js.map +1 -1
  107. package/build/store/utils/is-template-revertable.js +6 -8
  108. package/build/store/utils/is-template-revertable.js.map +1 -1
  109. package/build-module/bindings/pattern-overrides.js +8 -5
  110. package/build-module/bindings/pattern-overrides.js.map +1 -1
  111. package/build-module/bindings/post-meta.js +4 -0
  112. package/build-module/bindings/post-meta.js.map +1 -1
  113. package/build-module/components/create-template-part-modal/index.js +2 -0
  114. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  115. package/build-module/components/document-bar/index.js +11 -4
  116. package/build-module/components/document-bar/index.js.map +1 -1
  117. package/build-module/components/editor-interface/index.js +6 -3
  118. package/build-module/components/editor-interface/index.js.map +1 -1
  119. package/build-module/components/entities-saved-states/entity-record-item.js +6 -14
  120. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  121. package/build-module/components/entities-saved-states/index.js +1 -1
  122. package/build-module/components/entities-saved-states/index.js.map +1 -1
  123. package/build-module/components/global-keyboard-shortcuts/index.js +1 -1
  124. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +7 -66
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/index.js +6 -2
  128. package/build-module/components/header/index.js.map +1 -1
  129. package/build-module/components/index.js +11 -2
  130. package/build-module/components/index.js.map +1 -1
  131. package/build-module/components/inserter-sidebar/index.js +11 -22
  132. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  133. package/build-module/components/list-view-sidebar/index.js +20 -49
  134. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  135. package/build-module/components/page-attributes/parent.js +2 -1
  136. package/build-module/components/page-attributes/parent.js.map +1 -1
  137. package/build-module/components/post-actions/actions.js +370 -450
  138. package/build-module/components/post-actions/actions.js.map +1 -1
  139. package/build-module/components/post-actions/index.js +7 -2
  140. package/build-module/components/post-actions/index.js.map +1 -1
  141. package/build-module/components/post-excerpt/index.js +2 -1
  142. package/build-module/components/post-excerpt/index.js.map +1 -1
  143. package/build-module/components/post-excerpt/panel.js +3 -2
  144. package/build-module/components/post-excerpt/panel.js.map +1 -1
  145. package/build-module/components/post-preview-button/index.js +1 -1
  146. package/build-module/components/post-preview-button/index.js.map +1 -1
  147. package/build-module/components/post-publish-panel/index.js +1 -1
  148. package/build-module/components/post-publish-panel/index.js.map +1 -1
  149. package/build-module/components/post-saved-state/index.js +11 -1
  150. package/build-module/components/post-saved-state/index.js.map +1 -1
  151. package/build-module/components/post-schedule/index.js +3 -0
  152. package/build-module/components/post-schedule/index.js.map +1 -1
  153. package/build-module/components/post-slug/check.js +9 -0
  154. package/build-module/components/post-slug/check.js.map +1 -1
  155. package/build-module/components/post-slug/index.js +6 -0
  156. package/build-module/components/post-slug/index.js.map +1 -1
  157. package/build-module/components/post-status/index.js +3 -2
  158. package/build-module/components/post-status/index.js.map +1 -1
  159. package/build-module/components/post-sticky/index.js +10 -14
  160. package/build-module/components/post-sticky/index.js.map +1 -1
  161. package/build-module/components/post-template/create-new-template-modal.js +2 -0
  162. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  163. package/build-module/components/post-title/index.js +5 -13
  164. package/build-module/components/post-title/index.js.map +1 -1
  165. package/build-module/components/preview-dropdown/index.js +1 -1
  166. package/build-module/components/preview-dropdown/index.js.map +1 -1
  167. package/build-module/components/provider/index.native.js +0 -4
  168. package/build-module/components/provider/index.native.js.map +1 -1
  169. package/build-module/components/provider/use-block-editor-settings.js +7 -4
  170. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  171. package/build-module/components/save-publish-panels/index.js +30 -16
  172. package/build-module/components/save-publish-panels/index.js.map +1 -1
  173. package/build-module/components/sidebar/index.js +4 -1
  174. package/build-module/components/sidebar/index.js.map +1 -1
  175. package/build-module/components/sidebar/post-summary.js +2 -4
  176. package/build-module/components/sidebar/post-summary.js.map +1 -1
  177. package/build-module/components/template-content-panel/index.js +30 -5
  178. package/build-module/components/template-content-panel/index.js.map +1 -1
  179. package/build-module/components/template-part-content-panel/index.js +63 -0
  180. package/build-module/components/template-part-content-panel/index.js.map +1 -0
  181. package/build-module/components/visual-editor/index.js +1 -1
  182. package/build-module/components/visual-editor/index.js.map +1 -1
  183. package/build-module/dataviews/actions/delete-post.js +87 -0
  184. package/build-module/dataviews/actions/delete-post.js.map +1 -0
  185. package/build-module/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +10 -19
  186. package/build-module/dataviews/actions/export-pattern.js.map +1 -0
  187. package/build-module/dataviews/actions/index.js +24 -0
  188. package/build-module/dataviews/actions/index.js.map +1 -0
  189. package/build-module/dataviews/actions/reset-post.js +104 -0
  190. package/build-module/dataviews/actions/reset-post.js.map +1 -0
  191. package/build-module/dataviews/actions/utils.js +41 -0
  192. package/build-module/dataviews/actions/utils.js.map +1 -0
  193. package/build-module/dataviews/store/private-actions.js.map +1 -1
  194. package/build-module/dataviews/store/private-selectors.js +5 -5
  195. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  196. package/build-module/dataviews/store/reducer.js +6 -2
  197. package/build-module/dataviews/store/reducer.js.map +1 -1
  198. package/build-module/dataviews/types.js +2 -0
  199. package/build-module/dataviews/types.js.map +1 -0
  200. package/build-module/hooks/pattern-overrides.js +4 -2
  201. package/build-module/hooks/pattern-overrides.js.map +1 -1
  202. package/build-module/lock-unlock.js +1 -1
  203. package/build-module/lock-unlock.js.map +1 -1
  204. package/build-module/private-apis.js +2 -0
  205. package/build-module/private-apis.js.map +1 -1
  206. package/build-module/private-apis.native.js +0 -2
  207. package/build-module/private-apis.native.js.map +1 -1
  208. package/build-module/store/constants.js.map +1 -1
  209. package/build-module/store/private-actions.js +9 -5
  210. package/build-module/store/private-actions.js.map +1 -1
  211. package/build-module/store/private-selectors.js +0 -17
  212. package/build-module/store/private-selectors.js.map +1 -1
  213. package/build-module/store/utils/is-template-revertable.js +6 -8
  214. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  215. package/build-style/style-rtl.css +26 -76
  216. package/build-style/style.css +26 -76
  217. package/build-types/bindings/index.d.ts +2 -0
  218. package/build-types/bindings/index.d.ts.map +1 -0
  219. package/build-types/bindings/pattern-overrides.d.ts +18 -0
  220. package/build-types/bindings/pattern-overrides.d.ts.map +1 -0
  221. package/build-types/bindings/post-meta.d.ts +25 -0
  222. package/build-types/bindings/post-meta.d.ts.map +1 -0
  223. package/build-types/components/autocompleters/index.d.ts +2 -0
  224. package/build-types/components/autocompleters/index.d.ts.map +1 -0
  225. package/build-types/components/autocompleters/user.d.ts +6 -0
  226. package/build-types/components/autocompleters/user.d.ts.map +1 -0
  227. package/build-types/components/autosave-monitor/index.d.ts +15 -0
  228. package/build-types/components/autosave-monitor/index.d.ts.map +1 -0
  229. package/build-types/components/block-manager/category.d.ts +6 -0
  230. package/build-types/components/block-manager/category.d.ts.map +1 -0
  231. package/build-types/components/block-manager/checklist.d.ts +7 -0
  232. package/build-types/components/block-manager/checklist.d.ts.map +1 -0
  233. package/build-types/components/block-manager/index.d.ts +3 -0
  234. package/build-types/components/block-manager/index.d.ts.map +1 -0
  235. package/build-types/components/block-removal-warnings/index.d.ts +2 -0
  236. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -0
  237. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +2 -0
  238. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -0
  239. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +65 -0
  240. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -0
  241. package/build-types/components/blog-title/index.d.ts +2 -0
  242. package/build-types/components/blog-title/index.d.ts.map +1 -0
  243. package/build-types/components/character-count/index.d.ts +7 -0
  244. package/build-types/components/character-count/index.d.ts.map +1 -0
  245. package/build-types/components/collapsible-block-toolbar/index.d.ts +6 -0
  246. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -0
  247. package/build-types/components/commands/index.d.ts +2 -0
  248. package/build-types/components/commands/index.d.ts.map +1 -0
  249. package/build-types/components/create-template-part-modal/index.d.ts +14 -0
  250. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -0
  251. package/build-types/components/create-template-part-modal/utils.d.ts +4 -0
  252. package/build-types/components/create-template-part-modal/utils.d.ts.map +1 -0
  253. package/build-types/components/deprecated.d.ts +182 -0
  254. package/build-types/components/deprecated.d.ts.map +1 -0
  255. package/build-types/components/document-bar/index.d.ts +22 -0
  256. package/build-types/components/document-bar/index.d.ts.map +1 -0
  257. package/build-types/components/document-outline/check.d.ts +12 -0
  258. package/build-types/components/document-outline/check.d.ts.map +1 -0
  259. package/build-types/components/document-outline/index.d.ts +16 -0
  260. package/build-types/components/document-outline/index.d.ts.map +1 -0
  261. package/build-types/components/document-outline/item.d.ts +9 -0
  262. package/build-types/components/document-outline/item.d.ts.map +1 -0
  263. package/build-types/components/document-tools/index.d.ts +6 -0
  264. package/build-types/components/document-tools/index.d.ts.map +1 -0
  265. package/build-types/components/editor/index.d.ts +14 -0
  266. package/build-types/components/editor/index.d.ts.map +1 -0
  267. package/build-types/components/editor-history/redo.d.ts +4 -0
  268. package/build-types/components/editor-history/redo.d.ts.map +1 -0
  269. package/build-types/components/editor-history/undo.d.ts +4 -0
  270. package/build-types/components/editor-history/undo.d.ts.map +1 -0
  271. package/build-types/components/editor-interface/content-slot-fill.d.ts +3 -0
  272. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -0
  273. package/build-types/components/editor-interface/index.d.ts +17 -0
  274. package/build-types/components/editor-interface/index.d.ts.map +1 -0
  275. package/build-types/components/editor-notices/index.d.ts +13 -0
  276. package/build-types/components/editor-notices/index.d.ts.map +1 -0
  277. package/build-types/components/editor-snackbars/index.d.ts +7 -0
  278. package/build-types/components/editor-snackbars/index.d.ts.map +1 -0
  279. package/build-types/components/entities-saved-states/entity-record-item.d.ts +6 -0
  280. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -0
  281. package/build-types/components/entities-saved-states/entity-type-list.d.ts +6 -0
  282. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -0
  283. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +2 -0
  284. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -0
  285. package/build-types/components/entities-saved-states/index.d.ts +43 -0
  286. package/build-types/components/entities-saved-states/index.d.ts.map +1 -0
  287. package/build-types/components/error-boundary/index.d.ts +14 -0
  288. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  289. package/build-types/components/global-keyboard-shortcuts/index.d.ts +9 -0
  290. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -0
  291. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +8 -0
  292. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -0
  293. package/build-types/components/global-styles-provider/index.d.ts +20 -0
  294. package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
  295. package/build-types/components/header/back-button.d.ts +6 -0
  296. package/build-types/components/header/back-button.d.ts.map +1 -0
  297. package/build-types/components/header/index.d.ts +10 -0
  298. package/build-types/components/header/index.d.ts.map +1 -0
  299. package/build-types/components/index.d.ts +108 -0
  300. package/build-types/components/index.d.ts.map +1 -0
  301. package/build-types/components/inserter-sidebar/index.d.ts +2 -0
  302. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -0
  303. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +26 -0
  304. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
  305. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
  306. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
  307. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +3 -0
  308. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
  309. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +8 -0
  310. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
  311. package/build-types/components/list-view-sidebar/index.d.ts +2 -0
  312. package/build-types/components/list-view-sidebar/index.d.ts.map +1 -0
  313. package/build-types/components/list-view-sidebar/list-view-outline.d.ts +2 -0
  314. package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -0
  315. package/build-types/components/local-autosave-monitor/index.d.ts +3 -0
  316. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -0
  317. package/build-types/components/media-categories/index.d.ts +7 -0
  318. package/build-types/components/media-categories/index.d.ts.map +1 -0
  319. package/build-types/components/mode-switcher/index.d.ts +3 -0
  320. package/build-types/components/mode-switcher/index.d.ts.map +1 -0
  321. package/build-types/components/more-menu/copy-content-menu-item.d.ts +2 -0
  322. package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -0
  323. package/build-types/components/more-menu/index.d.ts +2 -0
  324. package/build-types/components/more-menu/index.d.ts.map +1 -0
  325. package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
  326. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
  327. package/build-types/components/more-menu/view-more-menu-group.d.ts +6 -0
  328. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -0
  329. package/build-types/components/page-attributes/check.d.ts +13 -0
  330. package/build-types/components/page-attributes/check.d.ts.map +1 -0
  331. package/build-types/components/page-attributes/order.d.ts +9 -0
  332. package/build-types/components/page-attributes/order.d.ts.map +1 -0
  333. package/build-types/components/page-attributes/panel.d.ts +7 -0
  334. package/build-types/components/page-attributes/panel.d.ts.map +1 -0
  335. package/build-types/components/page-attributes/parent.d.ts +11 -0
  336. package/build-types/components/page-attributes/parent.d.ts.map +1 -0
  337. package/build-types/components/pattern-duplicate-modal/index.d.ts +3 -0
  338. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -0
  339. package/build-types/components/pattern-overrides-panel/index.d.ts +2 -0
  340. package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -0
  341. package/build-types/components/pattern-rename-modal/index.d.ts +3 -0
  342. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -0
  343. package/build-types/components/plugin-document-setting-panel/index.d.ts +69 -0
  344. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -0
  345. package/build-types/components/plugin-more-menu-item/index.d.ts +3 -0
  346. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -0
  347. package/build-types/components/plugin-post-publish-panel/index.d.ts +47 -0
  348. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -0
  349. package/build-types/components/plugin-post-status-info/index.d.ts +57 -0
  350. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -0
  351. package/build-types/components/plugin-pre-publish-panel/index.d.ts +50 -0
  352. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -0
  353. package/build-types/components/plugin-sidebar/index.d.ts +73 -0
  354. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -0
  355. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +52 -0
  356. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -0
  357. package/build-types/components/post-actions/actions.d.ts +31 -0
  358. package/build-types/components/post-actions/actions.d.ts.map +1 -0
  359. package/build-types/components/post-actions/index.d.ts +5 -0
  360. package/build-types/components/post-actions/index.d.ts.map +1 -0
  361. package/build-types/components/post-author/check.d.ts +13 -0
  362. package/build-types/components/post-author/check.d.ts.map +1 -0
  363. package/build-types/components/post-author/combobox.d.ts +2 -0
  364. package/build-types/components/post-author/combobox.d.ts.map +1 -0
  365. package/build-types/components/post-author/constants.d.ts +9 -0
  366. package/build-types/components/post-author/constants.d.ts.map +1 -0
  367. package/build-types/components/post-author/hook.d.ts +6 -0
  368. package/build-types/components/post-author/hook.d.ts.map +1 -0
  369. package/build-types/components/post-author/index.d.ts +8 -0
  370. package/build-types/components/post-author/index.d.ts.map +1 -0
  371. package/build-types/components/post-author/panel.d.ts +8 -0
  372. package/build-types/components/post-author/panel.d.ts.map +1 -0
  373. package/build-types/components/post-author/select.d.ts +2 -0
  374. package/build-types/components/post-author/select.d.ts.map +1 -0
  375. package/build-types/components/post-card-panel/index.d.ts +4 -0
  376. package/build-types/components/post-card-panel/index.d.ts.map +1 -0
  377. package/build-types/components/post-comments/index.d.ts +3 -0
  378. package/build-types/components/post-comments/index.d.ts.map +1 -0
  379. package/build-types/components/post-content-information/index.d.ts +2 -0
  380. package/build-types/components/post-content-information/index.d.ts.map +1 -0
  381. package/build-types/components/post-discussion/panel.d.ts +10 -0
  382. package/build-types/components/post-discussion/panel.d.ts.map +1 -0
  383. package/build-types/components/post-excerpt/check.d.ts +13 -0
  384. package/build-types/components/post-excerpt/check.d.ts.map +1 -0
  385. package/build-types/components/post-excerpt/index.d.ts +15 -0
  386. package/build-types/components/post-excerpt/index.d.ts.map +1 -0
  387. package/build-types/components/post-excerpt/panel.d.ts +8 -0
  388. package/build-types/components/post-excerpt/panel.d.ts.map +1 -0
  389. package/build-types/components/post-excerpt/plugin.d.ts +53 -0
  390. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -0
  391. package/build-types/components/post-featured-image/check.d.ts +14 -0
  392. package/build-types/components/post-featured-image/check.d.ts.map +1 -0
  393. package/build-types/components/post-featured-image/index.d.ts +3 -0
  394. package/build-types/components/post-featured-image/index.d.ts.map +1 -0
  395. package/build-types/components/post-featured-image/panel.d.ts +13 -0
  396. package/build-types/components/post-featured-image/panel.d.ts.map +1 -0
  397. package/build-types/components/post-format/check.d.ts +5 -0
  398. package/build-types/components/post-format/check.d.ts.map +1 -0
  399. package/build-types/components/post-format/index.d.ts +16 -0
  400. package/build-types/components/post-format/index.d.ts.map +1 -0
  401. package/build-types/components/post-format/panel.d.ts +8 -0
  402. package/build-types/components/post-format/panel.d.ts.map +1 -0
  403. package/build-types/components/post-last-edited-panel/index.d.ts +2 -0
  404. package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -0
  405. package/build-types/components/post-last-revision/check.d.ts +13 -0
  406. package/build-types/components/post-last-revision/check.d.ts.map +1 -0
  407. package/build-types/components/post-last-revision/index.d.ts +9 -0
  408. package/build-types/components/post-last-revision/index.d.ts.map +1 -0
  409. package/build-types/components/post-last-revision/panel.d.ts +8 -0
  410. package/build-types/components/post-last-revision/panel.d.ts.map +1 -0
  411. package/build-types/components/post-locked-modal/index.d.ts +8 -0
  412. package/build-types/components/post-locked-modal/index.d.ts.map +1 -0
  413. package/build-types/components/post-panel-row/index.d.ts +3 -0
  414. package/build-types/components/post-panel-row/index.d.ts.map +1 -0
  415. package/build-types/components/post-panel-section/index.d.ts +6 -0
  416. package/build-types/components/post-panel-section/index.d.ts.map +1 -0
  417. package/build-types/components/post-pending-status/check.d.ts +15 -0
  418. package/build-types/components/post-pending-status/check.d.ts.map +1 -0
  419. package/build-types/components/post-pending-status/index.d.ts +8 -0
  420. package/build-types/components/post-pending-status/index.d.ts.map +1 -0
  421. package/build-types/components/post-pingbacks/index.d.ts +3 -0
  422. package/build-types/components/post-pingbacks/index.d.ts.map +1 -0
  423. package/build-types/components/post-preview-button/index.d.ts +23 -0
  424. package/build-types/components/post-preview-button/index.d.ts.map +1 -0
  425. package/build-types/components/post-publish-button/index.d.ts +17 -0
  426. package/build-types/components/post-publish-button/index.d.ts.map +1 -0
  427. package/build-types/components/post-publish-button/label.d.ts +7 -0
  428. package/build-types/components/post-publish-button/label.d.ts.map +1 -0
  429. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +17 -0
  430. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -0
  431. package/build-types/components/post-publish-panel/index.d.ts +10 -0
  432. package/build-types/components/post-publish-panel/index.d.ts.map +1 -0
  433. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +3 -0
  434. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -0
  435. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts +2 -0
  436. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -0
  437. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +3 -0
  438. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -0
  439. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +2 -0
  440. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -0
  441. package/build-types/components/post-publish-panel/postpublish.d.ts +3 -0
  442. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -0
  443. package/build-types/components/post-publish-panel/prepublish.d.ts +5 -0
  444. package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -0
  445. package/build-types/components/post-saved-state/index.d.ts +13 -0
  446. package/build-types/components/post-saved-state/index.d.ts.map +1 -0
  447. package/build-types/components/post-schedule/check.d.ts +12 -0
  448. package/build-types/components/post-schedule/check.d.ts.map +1 -0
  449. package/build-types/components/post-schedule/index.d.ts +17 -0
  450. package/build-types/components/post-schedule/index.d.ts.map +1 -0
  451. package/build-types/components/post-schedule/label.d.ts +25 -0
  452. package/build-types/components/post-schedule/label.d.ts.map +1 -0
  453. package/build-types/components/post-schedule/panel.d.ts +7 -0
  454. package/build-types/components/post-schedule/panel.d.ts.map +1 -0
  455. package/build-types/components/post-slug/check.d.ts +12 -0
  456. package/build-types/components/post-slug/check.d.ts.map +1 -0
  457. package/build-types/components/post-slug/index.d.ts +7 -0
  458. package/build-types/components/post-slug/index.d.ts.map +1 -0
  459. package/build-types/components/post-slug/panel.d.ts +3 -0
  460. package/build-types/components/post-slug/panel.d.ts.map +1 -0
  461. package/build-types/components/post-status/index.d.ts +6 -0
  462. package/build-types/components/post-status/index.d.ts.map +1 -0
  463. package/build-types/components/post-sticky/check.d.ts +12 -0
  464. package/build-types/components/post-sticky/check.d.ts.map +1 -0
  465. package/build-types/components/post-sticky/index.d.ts +7 -0
  466. package/build-types/components/post-sticky/index.d.ts.map +1 -0
  467. package/build-types/components/post-sticky/panel.d.ts +3 -0
  468. package/build-types/components/post-sticky/panel.d.ts.map +1 -0
  469. package/build-types/components/post-switch-to-draft-button/index.d.ts +7 -0
  470. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -0
  471. package/build-types/components/post-sync-status/index.d.ts +7 -0
  472. package/build-types/components/post-sync-status/index.d.ts.map +1 -0
  473. package/build-types/components/post-taxonomies/check.d.ts +12 -0
  474. package/build-types/components/post-taxonomies/check.d.ts.map +1 -0
  475. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +64 -0
  476. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -0
  477. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +102 -0
  478. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -0
  479. package/build-types/components/post-taxonomies/index.d.ts +5 -0
  480. package/build-types/components/post-taxonomies/index.d.ts.map +1 -0
  481. package/build-types/components/post-taxonomies/most-used-terms.d.ts +5 -0
  482. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -0
  483. package/build-types/components/post-taxonomies/panel.d.ts +3 -0
  484. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -0
  485. package/build-types/components/post-template/block-theme.d.ts +4 -0
  486. package/build-types/components/post-template/block-theme.d.ts.map +1 -0
  487. package/build-types/components/post-template/classic-theme.d.ts +3 -0
  488. package/build-types/components/post-template/classic-theme.d.ts.map +1 -0
  489. package/build-types/components/post-template/create-new-template-modal.d.ts +4 -0
  490. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -0
  491. package/build-types/components/post-template/create-new-template.d.ts +4 -0
  492. package/build-types/components/post-template/create-new-template.d.ts.map +1 -0
  493. package/build-types/components/post-template/hooks.d.ts +8 -0
  494. package/build-types/components/post-template/hooks.d.ts.map +1 -0
  495. package/build-types/components/post-template/panel.d.ts +7 -0
  496. package/build-types/components/post-template/panel.d.ts.map +1 -0
  497. package/build-types/components/post-template/reset-default-template.d.ts +4 -0
  498. package/build-types/components/post-template/reset-default-template.d.ts.map +1 -0
  499. package/build-types/components/post-template/swap-template-button.d.ts +4 -0
  500. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -0
  501. package/build-types/components/post-text-editor/index.d.ts +7 -0
  502. package/build-types/components/post-text-editor/index.d.ts.map +1 -0
  503. package/build-types/components/post-title/constants.d.ts +3 -0
  504. package/build-types/components/post-title/constants.d.ts.map +1 -0
  505. package/build-types/components/post-title/index.d.ts +3 -0
  506. package/build-types/components/post-title/index.d.ts.map +1 -0
  507. package/build-types/components/post-title/post-title-raw.d.ts +3 -0
  508. package/build-types/components/post-title/post-title-raw.d.ts.map +1 -0
  509. package/build-types/components/post-title/use-post-title-focus.d.ts +9 -0
  510. package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -0
  511. package/build-types/components/post-title/use-post-title.d.ts +7 -0
  512. package/build-types/components/post-title/use-post-title.d.ts.map +1 -0
  513. package/build-types/components/post-transform-panel/hooks.d.ts +2 -0
  514. package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -0
  515. package/build-types/components/post-transform-panel/index.d.ts +2 -0
  516. package/build-types/components/post-transform-panel/index.d.ts.map +1 -0
  517. package/build-types/components/post-trash/check.d.ts +12 -0
  518. package/build-types/components/post-trash/check.d.ts.map +1 -0
  519. package/build-types/components/post-trash/index.d.ts +7 -0
  520. package/build-types/components/post-trash/index.d.ts.map +1 -0
  521. package/build-types/components/post-type-support-check/index.d.ts +18 -0
  522. package/build-types/components/post-type-support-check/index.d.ts.map +1 -0
  523. package/build-types/components/post-url/check.d.ts +12 -0
  524. package/build-types/components/post-url/check.d.ts.map +1 -0
  525. package/build-types/components/post-url/index.d.ts +14 -0
  526. package/build-types/components/post-url/index.d.ts.map +1 -0
  527. package/build-types/components/post-url/label.d.ts +13 -0
  528. package/build-types/components/post-url/label.d.ts.map +1 -0
  529. package/build-types/components/post-url/panel.d.ts +7 -0
  530. package/build-types/components/post-url/panel.d.ts.map +1 -0
  531. package/build-types/components/post-view-link/index.d.ts +2 -0
  532. package/build-types/components/post-view-link/index.d.ts.map +1 -0
  533. package/build-types/components/post-visibility/check.d.ts +13 -0
  534. package/build-types/components/post-visibility/check.d.ts.map +1 -0
  535. package/build-types/components/post-visibility/index.d.ts +11 -0
  536. package/build-types/components/post-visibility/index.d.ts.map +1 -0
  537. package/build-types/components/post-visibility/label.d.ts +13 -0
  538. package/build-types/components/post-visibility/label.d.ts.map +1 -0
  539. package/build-types/components/post-visibility/utils.d.ts +21 -0
  540. package/build-types/components/post-visibility/utils.d.ts.map +1 -0
  541. package/build-types/components/posts-per-page/index.d.ts +2 -0
  542. package/build-types/components/posts-per-page/index.d.ts.map +1 -0
  543. package/build-types/components/preferences-modal/enable-panel.d.ts +3 -0
  544. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -0
  545. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +14 -0
  546. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -0
  547. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +3 -0
  548. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -0
  549. package/build-types/components/preferences-modal/index.d.ts +4 -0
  550. package/build-types/components/preferences-modal/index.d.ts.map +1 -0
  551. package/build-types/components/preview-dropdown/index.d.ts +5 -0
  552. package/build-types/components/preview-dropdown/index.d.ts.map +1 -0
  553. package/build-types/components/provider/disable-non-page-content-blocks.d.ts +6 -0
  554. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -0
  555. package/build-types/components/provider/index.d.ts +65 -0
  556. package/build-types/components/provider/index.d.ts.map +1 -0
  557. package/build-types/components/provider/navigation-block-editing-mode.d.ts +9 -0
  558. package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -0
  559. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +7 -0
  560. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -0
  561. package/build-types/components/provider/use-block-editor-settings.d.ts +13 -0
  562. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -0
  563. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +9 -0
  564. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -0
  565. package/build-types/components/provider/with-registry-provider.d.ts +3 -0
  566. package/build-types/components/provider/with-registry-provider.d.ts.map +1 -0
  567. package/build-types/components/resizable-editor/index.d.ts +8 -0
  568. package/build-types/components/resizable-editor/index.d.ts.map +1 -0
  569. package/build-types/components/resizable-editor/resize-handle.d.ts +5 -0
  570. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -0
  571. package/build-types/components/save-publish-panels/index.d.ts +11 -0
  572. package/build-types/components/save-publish-panels/index.d.ts.map +1 -0
  573. package/build-types/components/sidebar/constants.d.ts +5 -0
  574. package/build-types/components/sidebar/constants.d.ts.map +1 -0
  575. package/build-types/components/sidebar/header.d.ts +3 -0
  576. package/build-types/components/sidebar/header.d.ts.map +1 -0
  577. package/build-types/components/sidebar/index.d.ts +6 -0
  578. package/build-types/components/sidebar/index.d.ts.map +1 -0
  579. package/build-types/components/sidebar/post-summary.d.ts +4 -0
  580. package/build-types/components/sidebar/post-summary.d.ts.map +1 -0
  581. package/build-types/components/site-discussion/index.d.ts +2 -0
  582. package/build-types/components/site-discussion/index.d.ts.map +1 -0
  583. package/build-types/components/start-page-options/index.d.ts +2 -0
  584. package/build-types/components/start-page-options/index.d.ts.map +1 -0
  585. package/build-types/components/start-template-options/index.d.ts +2 -0
  586. package/build-types/components/start-template-options/index.d.ts.map +1 -0
  587. package/build-types/components/table-of-contents/index.d.ts +7 -0
  588. package/build-types/components/table-of-contents/index.d.ts.map +1 -0
  589. package/build-types/components/table-of-contents/panel.d.ts +6 -0
  590. package/build-types/components/table-of-contents/panel.d.ts.map +1 -0
  591. package/build-types/components/template-content-panel/index.d.ts +4 -0
  592. package/build-types/components/template-content-panel/index.d.ts.map +1 -0
  593. package/build-types/components/template-part-content-panel/index.d.ts +2 -0
  594. package/build-types/components/template-part-content-panel/index.d.ts.map +1 -0
  595. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts +5 -0
  596. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -0
  597. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +5 -0
  598. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -0
  599. package/build-types/components/template-part-menu-items/index.d.ts +2 -0
  600. package/build-types/components/template-part-menu-items/index.d.ts.map +1 -0
  601. package/build-types/components/template-validation-notice/index.d.ts +2 -0
  602. package/build-types/components/template-validation-notice/index.d.ts.map +1 -0
  603. package/build-types/components/text-editor/index.d.ts +4 -0
  604. package/build-types/components/text-editor/index.d.ts.map +1 -0
  605. package/build-types/components/theme-support-check/index.d.ts +14 -0
  606. package/build-types/components/theme-support-check/index.d.ts.map +1 -0
  607. package/build-types/components/time-to-read/index.d.ts +7 -0
  608. package/build-types/components/time-to-read/index.d.ts.map +1 -0
  609. package/build-types/components/unsaved-changes-warning/index.d.ts +8 -0
  610. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -0
  611. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +18 -0
  612. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -0
  613. package/build-types/components/visual-editor/index.d.ts +10 -0
  614. package/build-types/components/visual-editor/index.d.ts.map +1 -0
  615. package/build-types/components/word-count/index.d.ts +7 -0
  616. package/build-types/components/word-count/index.d.ts.map +1 -0
  617. package/build-types/dataviews/actions/delete-post.d.ts +5 -0
  618. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -0
  619. package/build-types/dataviews/actions/export-pattern.d.ts +8 -0
  620. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -0
  621. package/build-types/dataviews/actions/index.d.ts +2 -0
  622. package/build-types/dataviews/actions/index.d.ts.map +1 -0
  623. package/build-types/dataviews/actions/reset-post.d.ts +5 -0
  624. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -0
  625. package/build-types/dataviews/actions/utils.d.ts +11 -0
  626. package/build-types/dataviews/actions/utils.d.ts.map +1 -0
  627. package/build-types/dataviews/api.d.ts +27 -0
  628. package/build-types/dataviews/api.d.ts.map +1 -0
  629. package/build-types/dataviews/store/private-actions.d.ts +2 -2
  630. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  631. package/build-types/dataviews/store/private-selectors.d.ts +2 -5
  632. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  633. package/build-types/dataviews/store/reducer.d.ts +5 -1
  634. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  635. package/build-types/dataviews/types.d.ts +34 -0
  636. package/build-types/dataviews/types.d.ts.map +1 -0
  637. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +10 -0
  638. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -0
  639. package/build-types/hooks/default-autocompleters.d.ts +2 -0
  640. package/build-types/hooks/default-autocompleters.d.ts.map +1 -0
  641. package/build-types/hooks/index.d.ts +2 -0
  642. package/build-types/hooks/index.d.ts.map +1 -0
  643. package/build-types/hooks/media-upload.d.ts +2 -0
  644. package/build-types/hooks/media-upload.d.ts.map +1 -0
  645. package/build-types/hooks/pattern-overrides.d.ts +2 -0
  646. package/build-types/hooks/pattern-overrides.d.ts.map +1 -0
  647. package/build-types/hooks/use-select-nearest-editable-block.d.ts +4 -0
  648. package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +1 -0
  649. package/build-types/index.d.ts +6 -0
  650. package/build-types/index.d.ts.map +1 -0
  651. package/build-types/lock-unlock.d.ts +3 -0
  652. package/build-types/lock-unlock.d.ts.map +1 -0
  653. package/build-types/private-apis.d.ts +2 -0
  654. package/build-types/private-apis.d.ts.map +1 -0
  655. package/build-types/store/actions.d.ts +367 -0
  656. package/build-types/store/actions.d.ts.map +1 -0
  657. package/build-types/store/constants.d.ts +31 -0
  658. package/build-types/store/constants.d.ts.map +1 -0
  659. package/build-types/store/defaults.d.ts +21 -0
  660. package/build-types/store/defaults.d.ts.map +1 -0
  661. package/build-types/store/index.d.ts +17 -0
  662. package/build-types/store/index.d.ts.map +1 -0
  663. package/build-types/store/local-autosave.d.ts +4 -0
  664. package/build-types/store/local-autosave.d.ts.map +1 -0
  665. package/build-types/store/private-actions.d.ts +37 -0
  666. package/build-types/store/private-actions.d.ts.map +1 -0
  667. package/build-types/store/private-selectors.d.ts +24 -0
  668. package/build-types/store/private-selectors.d.ts.map +1 -0
  669. package/build-types/store/reducer.d.ts +228 -0
  670. package/build-types/store/reducer.d.ts.map +1 -0
  671. package/build-types/store/selectors.d.ts +854 -0
  672. package/build-types/store/selectors.d.ts.map +1 -0
  673. package/build-types/store/utils/get-filtered-template-parts.d.ts +3 -0
  674. package/build-types/store/utils/get-filtered-template-parts.d.ts.map +1 -0
  675. package/build-types/store/utils/is-template-revertable.d.ts +8 -0
  676. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -0
  677. package/build-types/store/utils/notice-builder.d.ts +27 -0
  678. package/build-types/store/utils/notice-builder.d.ts.map +1 -0
  679. package/build-types/utils/get-template-part-icon.d.ts +9 -0
  680. package/build-types/utils/get-template-part-icon.d.ts.map +1 -0
  681. package/build-types/utils/index.d.ts +5 -0
  682. package/build-types/utils/index.d.ts.map +1 -0
  683. package/build-types/utils/media-upload/index.d.ts +21 -0
  684. package/build-types/utils/media-upload/index.d.ts.map +1 -0
  685. package/build-types/utils/set-nested-value.d.ts +20 -0
  686. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  687. package/build-types/utils/terms.d.ts +12 -0
  688. package/build-types/utils/terms.d.ts.map +1 -0
  689. package/build-types/utils/url.d.ts +18 -0
  690. package/build-types/utils/url.d.ts.map +1 -0
  691. package/package.json +36 -35
  692. package/src/bindings/pattern-overrides.js +9 -10
  693. package/src/bindings/post-meta.js +5 -0
  694. package/src/components/create-template-part-modal/index.js +2 -0
  695. package/src/components/create-template-part-modal/style.scss +0 -6
  696. package/src/components/document-bar/index.js +11 -4
  697. package/src/components/editor-interface/index.js +19 -8
  698. package/src/components/entities-saved-states/entity-record-item.js +4 -14
  699. package/src/components/entities-saved-states/index.js +1 -1
  700. package/src/components/entities-saved-states/style.scss +0 -13
  701. package/src/components/global-keyboard-shortcuts/index.js +1 -1
  702. package/src/components/global-styles-provider/index.js +7 -90
  703. package/src/components/header/index.js +2 -1
  704. package/src/components/index.js +11 -2
  705. package/src/components/inserter-sidebar/index.js +4 -24
  706. package/src/components/list-view-sidebar/index.js +34 -62
  707. package/src/components/list-view-sidebar/style.scss +0 -34
  708. package/src/components/page-attributes/parent.js +6 -3
  709. package/src/components/post-actions/actions.js +495 -621
  710. package/src/components/post-actions/index.js +4 -2
  711. package/src/components/post-card-panel/style.scss +1 -0
  712. package/src/components/post-excerpt/index.js +4 -1
  713. package/src/components/post-excerpt/panel.js +3 -2
  714. package/src/components/post-featured-image/style.scss +15 -0
  715. package/src/components/post-panel-row/style.scss +1 -0
  716. package/src/components/post-preview-button/index.js +1 -1
  717. package/src/components/post-publish-panel/index.js +1 -1
  718. package/src/components/post-publish-panel/style.scss +1 -1
  719. package/src/components/post-saved-state/index.js +11 -1
  720. package/src/components/post-schedule/index.js +5 -0
  721. package/src/components/post-slug/check.js +8 -0
  722. package/src/components/post-slug/index.js +5 -0
  723. package/src/components/post-status/index.js +3 -1
  724. package/src/components/post-sticky/index.js +10 -13
  725. package/src/components/post-sticky/style.scss +3 -2
  726. package/src/components/post-taxonomies/README.md +1 -1
  727. package/src/components/post-template/create-new-template-modal.js +2 -0
  728. package/src/components/post-title/index.js +5 -12
  729. package/src/components/post-url/style.scss +4 -0
  730. package/src/components/preview-dropdown/index.js +1 -1
  731. package/src/components/provider/index.native.js +3 -11
  732. package/src/components/provider/use-block-editor-settings.js +10 -5
  733. package/src/components/save-publish-panels/index.js +33 -23
  734. package/src/components/sidebar/index.js +3 -3
  735. package/src/components/sidebar/post-summary.js +0 -4
  736. package/src/components/template-content-panel/index.js +29 -5
  737. package/src/components/template-part-content-panel/index.js +62 -0
  738. package/src/components/visual-editor/index.js +1 -1
  739. package/src/components/visual-editor/style.scss +3 -1
  740. package/src/dataviews/actions/delete-post.tsx +107 -0
  741. package/src/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.tsx} +19 -19
  742. package/src/dataviews/actions/index.ts +25 -0
  743. package/src/dataviews/actions/reset-post.tsx +144 -0
  744. package/src/dataviews/actions/utils.ts +54 -0
  745. package/src/dataviews/store/private-actions.ts +2 -2
  746. package/src/dataviews/store/private-selectors.ts +13 -6
  747. package/src/dataviews/store/reducer.ts +12 -5
  748. package/src/dataviews/types.ts +33 -0
  749. package/src/hooks/pattern-overrides.js +6 -4
  750. package/src/lock-unlock.js +1 -1
  751. package/src/private-apis.js +2 -0
  752. package/src/private-apis.native.js +0 -2
  753. package/src/store/private-actions.js +49 -21
  754. package/src/store/private-selectors.js +0 -25
  755. package/src/store/utils/is-template-revertable.js +8 -8
  756. package/src/style.scss +0 -1
  757. package/tsconfig.json +3 -2
  758. package/tsconfig.tsbuildinfo +1 -1
  759. package/build/components/post-actions/export-pattern-action.js.map +0 -1
  760. package/build/components/post-actions/export-pattern-action.native.js +0 -11
  761. package/build/components/post-actions/export-pattern-action.native.js.map +0 -1
  762. package/build/components/template-areas/index.js +0 -84
  763. package/build/components/template-areas/index.js.map +0 -1
  764. package/build-module/components/post-actions/export-pattern-action.js.map +0 -1
  765. package/build-module/components/post-actions/export-pattern-action.native.js +0 -5
  766. package/build-module/components/post-actions/export-pattern-action.native.js.map +0 -1
  767. package/build-module/components/template-areas/index.js +0 -78
  768. package/build-module/components/template-areas/index.js.map +0 -1
  769. package/src/components/post-actions/export-pattern-action.native.js +0 -4
  770. package/src/components/template-areas/index.js +0 -94
  771. package/src/components/template-areas/style.scss +0 -22
  772. /package/src/store/{constants.js → constants.ts} +0 -0
@@ -79,22 +79,14 @@ function PostTitle(_, forwardedRef) {
79
79
  const clipboardData = event.clipboardData;
80
80
  let plainText = '';
81
81
  let html = '';
82
-
83
- // IE11 only supports `Text` as an argument for `getData` and will
84
- // otherwise throw an invalid argument error, so we try the standard
85
- // arguments first, then fallback to `Text` if they fail.
86
82
  try {
87
83
  plainText = clipboardData.getData('text/plain');
88
84
  html = clipboardData.getData('text/html');
89
- } catch (error1) {
90
- try {
91
- html = clipboardData.getData('Text');
92
- } catch (error2) {
93
- // Some browsers like UC Browser paste plain text by default and
94
- // don't support clipboardData at all, so allow default
95
- // behaviour.
96
- return;
97
- }
85
+ } catch (error) {
86
+ // Some browsers like UC Browser paste plain text by default and
87
+ // don't support clipboardData at all, so allow default
88
+ // behaviour.
89
+ return;
98
90
  }
99
91
 
100
92
  // Allows us to ask for this information when we get a report.
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","forwardRef","useState","decodeEntities","useSelect","useDispatch","store","blockEditorStore","ENTER","pasteHandler","__unstableUseRichText","useRichText","create","toHTMLString","insert","useMergeRefs","__unstableStripHTML","stripHTML","DEFAULT_CLASSNAMES","REGEXP_NEWLINES","usePostTitleFocus","usePostTitle","PostTypeSupportCheck","jsx","_jsx","PostTitle","_","forwardedRef","placeholder","select","getSettings","titlePlaceholder","isSelected","setIsSelected","ref","focusRef","title","setTitle","onUpdate","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","onChange","value","replace","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","HTML","length","firstBlock","name","contentNoHTML","attributes","slice","newValue","start","end","decodedPlaceholder","richTextRef","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","supportKeys","children","contentEditable","role","onFocus","onBlur","onKeyPress"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;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AU;QACpB4C,MAAM,EAAG3C,UAAY;QACrBG,SAAS,EAAGA,SAAW;QACvByC,UAAU,EAAG5C,UAAY;QACzBO,OAAO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAexD,UAAU,CAAEwB,SAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","forwardRef","useState","decodeEntities","useSelect","useDispatch","store","blockEditorStore","ENTER","pasteHandler","__unstableUseRichText","useRichText","create","toHTMLString","insert","useMergeRefs","__unstableStripHTML","stripHTML","DEFAULT_CLASSNAMES","REGEXP_NEWLINES","usePostTitleFocus","usePostTitle","PostTypeSupportCheck","jsx","_jsx","PostTitle","_","forwardedRef","placeholder","select","getSettings","titlePlaceholder","isSelected","setIsSelected","ref","focusRef","title","setTitle","onUpdate","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","onChange","value","replace","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","preventDefault","onPaste","clipboardData","plainText","html","getData","error","window","console","log","content","HTML","length","firstBlock","name","contentNoHTML","attributes","slice","newValue","start","end","decodedPlaceholder","richTextRef","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","supportKeys","children","contentEditable","role","onFocus","onBlur","onKeyPress"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,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U,EAAG3C,UAAY;QACzBO,OAAO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAexD,UAAU,CAAEwB,SAAU,CAAC","ignoreList":[]}
@@ -64,7 +64,7 @@ export default function PreviewDropdown({
64
64
  size: 'compact',
65
65
  showTooltip: !showIconLabels,
66
66
  disabled,
67
- __experimentalIsFocusable: disabled
67
+ accessibleWhenDisabled: disabled
68
68
  };
69
69
  const menuProps = {
70
70
  'aria-label': __('View options')
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","DropdownMenu","MenuGroup","MenuItem","VisuallyHidden","Icon","__","check","desktop","mobile","tablet","external","useSelect","useDispatch","store","coreStore","preferencesStore","editorStore","PostPreviewButton","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","select","_getPostType$viewable","getDeviceType","getCurrentPostType","getUnstableBase","getPostType","get","_currentPostType","home","viewable","setDeviceType","isMobile","popoverProps","placement","toggleProps","className","size","showTooltip","__experimentalIsFocusable","menuProps","deviceIcons","icon","toLowerCase","label","disableOpenOnArrowDown","children","onClose","onClick","href","target","as","role","textContent","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) {\n\t\treturn null;\n\t}\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\t__experimentalIsFocusable: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,kBAAkB;AAC3E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEvD,eAAe,SAASC,eAAeA,CAAE;EAAEC,mBAAmB;EAAEC;AAAS,CAAC,EAAG;EAC5E,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAe,CAAC,GACpEpB,SAAS,CAAIqB,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACxB,MAAM;MAAEC,aAA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AChB,cAAc;YAAC2D,EAAE,EAAC,MAAM;YAAAL,QAAA,EAEvB;YACApD,EAAE,CAAE,sBAAuB;UAAC,CAEd,CAAC;QAAA,CACR;MAAC,CACD,CACX,EACCyB,UAAU,iBACXX,IAAA,CAAClB,SAAS;QAAAwD,QAAA,eACTtC,IAAA,CAACF,iBAAiB;UACjB8B,SAAS,EAAC,0CAA0C;UACpDgB,IAAI,EAAC,UAAU;UACftC,mBAAmB,EAAGA,mBAAqB;UAC3CuC,WAAW,eACV3C,KAAA,CAAAE,SAAA;YAAAkC,QAAA,GACGpD,EAAE,CAAE,oBAAqB,CAAC,eAC5Bc,IAAA,CAACf,IAAI;cAACiD,IAAI,EAAG3C;YAAU,CAAE,CAAC;UAAA,CACzB,CACF;UACDuD,SAAS,EAAGP;QAAS,CACrB;MAAC,CACQ,CACX;IAAA,CACA;EACF,CACY,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["useViewportMatch","DropdownMenu","MenuGroup","MenuItem","VisuallyHidden","Icon","__","check","desktop","mobile","tablet","external","useSelect","useDispatch","store","coreStore","preferencesStore","editorStore","PostPreviewButton","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","select","_getPostType$viewable","getDeviceType","getCurrentPostType","getUnstableBase","getPostType","get","_currentPostType","home","viewable","setDeviceType","isMobile","popoverProps","placement","toggleProps","className","size","showTooltip","accessibleWhenDisabled","menuProps","deviceIcons","icon","toLowerCase","label","disableOpenOnArrowDown","children","onClose","onClick","href","target","as","role","textContent","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) {\n\t\treturn null;\n\t}\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\taccessibleWhenDisabled: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,kBAAkB;AAC3E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEvD,eAAe,SAASC,eAAeA,CAAE;E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A,eACTpC,KAAA,CAACnB,QAAQ;UACR0D,IAAI,EAAGhC,OAAS;UAChBiC,MAAM,EAAC,QAAQ;UACfR,IAAI,EAAG3C,QAAU;UACjBiD,OAAO,EAAGD,OAAS;UAAAD,QAAA,GAEjBpD,EAAE,CAAE,WAAY,CAAC,eACnBc,IAAA,CAAChB,cAAc;YAAC2D,EAAE,EAAC,MAAM;YAAAL,QAAA,EAEvB;YACApD,EAAE,CAAE,sBAAuB;UAAC,CAEd,CAAC;QAAA,CACR;MAAC,CACD,CACX,EACCyB,UAAU,iBACXX,IAAA,CAAClB,SAAS;QAAAwD,QAAA,eACTtC,IAAA,CAACF,iBAAiB;UACjB8B,SAAS,EAAC,0CAA0C;UACpDgB,IAAI,EAAC,UAAU;UACftC,mBAAmB,EAAGA,mBAAqB;UAC3CuC,WAAW,eACV3C,KAAA,CAAAE,SAAA;YAAAkC,QAAA,GACGpD,EAAE,CAAE,oBAAqB,CAAC,eAC5Bc,IAAA,CAACf,IAAI;cAACiD,IAAI,EAAG3C;YAAU,CAAE,CAAC;UAAA,CACzB,CACF;UACDuD,SAAS,EAAGP;QAAS,CACrB;MAAC,CACQ,CACX;IAAA,CACA;EACF,CACY,CAAC;AAEjB","ignoreList":[]}
@@ -120,12 +120,8 @@ class NativeEditorProvider extends Component {
120
120
  }
121
121
  });
122
122
  this.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(({
123
- galleryWithImageBlocks,
124
123
  ...editorSettings
125
124
  }) => {
126
- if (typeof galleryWithImageBlocks === 'boolean') {
127
- window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
128
- }
129
125
  updateEditorSettings(this.getThemeColors(editorSettings));
130
126
  });
131
127
  this.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(payload => {
@@ -1 +1 @@
1
- {"version":3,"names":["BackHandler","memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","subscribeToContentUpdate","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","getBlockType","createBlock","pasteHandler","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","__","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","EditorProvider","insertContentWithTitle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","onContentUpdate","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","blockType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","hardwareBackPressListener","addEventListener","subscriptionOnContentUpdate","data","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","clearSelectedBlock","content","rawContent","onClearPostTitleSelection","onInsertBlockAfter","onInsertBlocks","plainText","mode","hasChanges","raw","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","togglePostTitleSelection","updateSettings","insertBlocks","__unstableShouldCreateUndoLevel","undefined","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n\tsubscribeToContentUpdate,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tgetBlockType,\n\tcreateBlock,\n\tpasteHandler,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tstore as blockEditorStore,\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\nimport { __ } from '@wordpress/i18n';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\nimport { insertContentWithTitle } from '../post-title';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.onHardwareBackPress = this.onHardwareBackPress.bind( this );\n\t\tthis.onContentUpdate = this.onContentUpdate.bind( this );\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tcreateErrorNotice,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\n\t\t);\n\n\t\tthis.subscriptionOnContentUpdate = subscribeToContentUpdate(\n\t\t\t( data ) => {\n\t\t\t\tthis.onContentUpdate( data );\n\t\t\t}\n\t\t);\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.remove();\n\t\t}\n\n\t\tif ( this.subscriptionOnContentUpdate ) {\n\t\t\tthis.subscriptionOnContentUpdate.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonContentUpdate( { content: rawContent } ) {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tonClearPostTitleSelection,\n\t\t\tonInsertBlockAfter: onInsertBlocks,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst content = pasteHandler( {\n\t\t\tplainText: rawContent,\n\t\t} );\n\n\t\tinsertContentWithTitle( title, content, editTitle, onInsertBlocks );\n\t\tonClearPostTitleSelection();\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t\ttogglePostTitleSelection,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, undefined, undefined, false );\n\t\t\t},\n\t\t\tonClearPostTitleSelection() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AACA;AACA;AACA,OAAOC,4BAA4B,IAClCC,2BAA2B,EAC3BC,uBAAuB,EACvBC,sBAAsB,EACtBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,uBAAuB,EACvBC,wBAAwB,QAClB,gCAAgC;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,KAAK,EACLC,SAAS,EACTC,8BAA8B,EAC9BC,YAAY,EACZC,WAAW,EACXC,YAAY,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UAAUA,CAAEX,IAAI,EAAG;MAClBsC,gBAAgB,CAAEtC,IAAK,CAAC;IACzB,CAAC;IACDH,kBAAkBA,CAAElH,MAAM,EAAG;MAC5B8J,YAAY,CAAE9J,MAAM,EAAEgK,SAAS,EAAEA,SAAS,EAAE,KAAM,CAAC;IACpD,CAAC;IACD/C,yBAAyBA,CAAA,EAAG;MAC3B2C,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACD7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE9G,oBAAqB,CAAC;AAE3B,eAAeuH,sBAAsB;AACrC,SAASA,sBAAsB,IAAIyB,0BAA0B","ignoreList":[]}
1
+ {"version":3,"names":["BackHandler","memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","subscribeToContentUpdate","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","getBlockType","createBlock","pasteHandler","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","__","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","EditorProvider","insertContentWithTitle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","onContentUpdate","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","blockType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","hardwareBackPressListener","addEventListener","subscriptionOnContentUpdate","data","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","clearSelectedBlock","content","rawContent","onClearPostTitleSelection","onInsertBlockAfter","onInsertBlocks","plainText","mode","hasChanges","raw","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","togglePostTitleSelection","updateSettings","insertBlocks","__unstableShouldCreateUndoLevel","undefined","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n\tsubscribeToContentUpdate,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tgetBlockType,\n\tcreateBlock,\n\tpasteHandler,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tstore as blockEditorStore,\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\nimport { __ } from '@wordpress/i18n';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\nimport { insertContentWithTitle } from '../post-title';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.onHardwareBackPress = this.onHardwareBackPress.bind( this );\n\t\tthis.onContentUpdate = this.onContentUpdate.bind( this );\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tcreateErrorNotice,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings( ( { ...editorSettings } ) => {\n\t\t\t\tupdateEditorSettings( this.getThemeColors( editorSettings ) );\n\t\t\t} );\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\n\t\t);\n\n\t\tthis.subscriptionOnContentUpdate = subscribeToContentUpdate(\n\t\t\t( data ) => {\n\t\t\t\tthis.onContentUpdate( data );\n\t\t\t}\n\t\t);\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.remove();\n\t\t}\n\n\t\tif ( this.subscriptionOnContentUpdate ) {\n\t\t\tthis.subscriptionOnContentUpdate.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonContentUpdate( { content: rawContent } ) {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tonClearPostTitleSelection,\n\t\t\tonInsertBlockAfter: onInsertBlocks,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst content = pasteHandler( {\n\t\t\tplainText: rawContent,\n\t\t} );\n\n\t\tinsertContentWithTitle( title, content, editTitle, onInsertBlocks );\n\t\tonClearPostTitleSelection();\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t\ttogglePostTitleSelection,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, undefined, undefined, false );\n\t\t\t},\n\t\t\tonClearPostTitleSelection() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AACA;AACA;AACA,OAAOC,4BAA4B,IAClCC,2BAA2B,EAC3BC,uBAAuB,EACvBC,sBAAsB,EACtBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAA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;IACtB,CAAC;IACDzB,oBAAoB;IACpBkG,iCAAiCA,CAAEzH,MAAM,EAAG;MAC3CsJ,iBAAiB,CAAEtJ,MAAM,EAAE;QAC1B2J,+BAA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACD/B,UAAUA,CAAEX,IAAI,EAAG;MAClBsC,gBAAgB,CAAEtC,IAAK,CAAC;IACzB,CAAC;IACDH,kBAAkBA,CAAE9G,MAAM,EAAG;MAC5B0J,YAAY,CAAE1J,MAAM,EAAE4J,SAAS,EAAEA,SAAS,EAAE,KAAM,CAAC;IACpD,CAAC;IACD/C,yBAAyBA,CAAA,EAAG;MAC3B2C,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACD7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE1G,oBAAqB,CAAC;AAE3B,eAAemH,sBAAsB;AACrC,SAASA,sBAAsB,IAAIyB,0BAA0B","ignoreList":[]}
@@ -19,16 +19,17 @@ import { store as editorStore } from '../../store';
19
19
  import { lock, unlock } from '../../lock-unlock';
20
20
  import { useGlobalStylesContext } from '../global-styles-provider';
21
21
  const EMPTY_BLOCKS_LIST = [];
22
- const DEFAULT_STYLES = {};
22
+ const EMPTY_OBJECT = {};
23
23
  function __experimentalReusableBlocksSelect(select) {
24
24
  var _select$getEntityReco;
25
25
  return (_select$getEntityReco = select(coreStore).getEntityRecords('postType', 'wp_block', {
26
26
  per_page: -1
27
27
  })) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : EMPTY_BLOCKS_LIST;
28
28
  }
29
- const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'sectionRootClientId', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
29
+ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'sectionRootClientId', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
30
30
  const {
31
31
  globalStylesDataKey,
32
+ globalStylesLinksDataKey,
32
33
  selectBlockPatternsKey,
33
34
  reusableBlocksSelectKey
34
35
  } = unlock(privateApis);
@@ -44,7 +45,7 @@ const {
44
45
  * @return {Object} Block Editor Settings.
45
46
  */
46
47
  function useBlockEditorSettings(settings, postType, postId, renderingMode) {
47
- var _mergedGlobalStyles$s, _settings$__experimen, _settings$__experimen2;
48
+ var _mergedGlobalStyles$s, _mergedGlobalStyles$_, _settings$__experimen, _settings$__experimen2;
48
49
  const isLargeViewport = useViewportMatch('medium');
49
50
  const {
50
51
  allowRightClickOverrides,
@@ -111,7 +112,8 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
111
112
  const {
112
113
  merged: mergedGlobalStyles
113
114
  } = useGlobalStylesContext();
114
- const globalStylesData = (_mergedGlobalStyles$s = mergedGlobalStyles.styles) !== null && _mergedGlobalStyles$s !== void 0 ? _mergedGlobalStyles$s : DEFAULT_STYLES;
115
+ const globalStylesData = (_mergedGlobalStyles$s = mergedGlobalStyles.styles) !== null && _mergedGlobalStyles$s !== void 0 ? _mergedGlobalStyles$s : EMPTY_OBJECT;
116
+ const globalStylesLinksData = (_mergedGlobalStyles$_ = mergedGlobalStyles._links) !== null && _mergedGlobalStyles$_ !== void 0 ? _mergedGlobalStyles$_ : EMPTY_OBJECT;
115
117
  const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
116
118
  // WP 6.0
117
119
  settings.__experimentalBlockPatterns; // WP 5.9
@@ -166,6 +168,7 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
166
168
  const blockEditorSettings = {
167
169
  ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
168
170
  [globalStylesDataKey]: globalStylesData,
171
+ [globalStylesLinksDataKey]: globalStylesLinksData,
169
172
  allowedBlockTypes,
170
173
  allowRightClickOverrides,
171
174
  focusMode: focusMode && !forceDisableFocusMode,
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","preferencesStore","useViewportMatch","blocksStore","privateApis","blockEditorStore","inserterMediaCategories","mediaUpload","editorStore","lock","unlock","useGlobalStylesContext","EMPTY_BLOCKS_LIST","DEFAULT_STYLES","__experimentalReusableBlocksSelect","select","_select$getEntityReco","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","getBlockTypes","getBlocksByName","getBlockAttributes","siteSettings","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","globalStylesData","styles","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { lock, unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_BLOCKS_LIST = [];\nconst DEFAULT_STYLES = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'sectionRootClientId',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\nconst { globalStylesDataKey, selectBlockPatternsKey, reusableBlocksSelectKey } =\n\tunlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? DEFAULT_STYLES;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t\tlock( blockEditorSettings, {\n\t\t\tsectionRootClientId,\n\t\t} );\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,SAAS,EAClBC,kCAAkC,IAAIC,oBAAoB,EAC1DC,0BAA0B,IAAIC,YAAY,QACpC,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASR,KAAK,IAAIS,WAAW,QAAQ,mBAAmB;AACxD,SACCC,WAAW,EACXV,KAAK,IAAIW,gBAAgB,QACnB,yBAAyB;;AAEhC;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,qBAAqB;AACzD,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASb,KAAK,IAAIc,WAAW,QAAQ,aAAa;AAClD,SAASC,IAAI,EAAEC,MAAM,QAAQ,mBAAmB;AAChD,SAASC,sBAAsB,QAAQ,2BAA2B;AAElE,MAAMC,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,cAAc,GAAG,CAAC,CAAC;AAEzB,SAASC,kCAAkCA,CAAEC,MAAM,EAAG;EAAA,IAAAC,qBAAA;EACrD,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E;MAC1B5D;IACD,CAAE,CAAC;IACH,OAAO4D,mBAAmB;EAC3B,CAAC,EAAE,CACFN,iBAAiB,EACjBpE,wBAAwB,EACxBE,SAAS,EACTuE,qBAAqB,EACrBtE,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBb,QAAQ,EACRc,oBAAoB,EACpBM,qBAAqB,EACrBmC,aAAa,EACbM,sBAAsB,EACtB7C,oBAAoB,EACpBoD,IAAI,EACJG,gBAAgB,EAChBtD,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZlB,QAAQ,EACRoE,mBAAmB,EACnB/C,mBAAmB,EACnByB,gBAAgB,CACf,CAAC;AACJ;AAEA,eAAehD,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","preferencesStore","useViewportMatch","blocksStore","privateApis","blockEditorStore","inserterMediaCategories","mediaUpload","editorStore","lock","unlock","useGlobalStylesContext","EMPTY_BLOCKS_LIST","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","_select$getEntityReco","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","getBlockTypes","getBlocksByName","getBlockAttributes","siteSettings","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { lock, unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_BLOCKS_LIST = [];\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'sectionRootClientId',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t\tlock( blockEditorSettings, {\n\t\t\tsectionRootClientId,\n\t\t} );\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IA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AAC;AACJ;AAEA,eAAejD,sBAAsB","ignoreList":[]}
@@ -35,13 +35,25 @@ export default function SavePublishPanels({
35
35
  } = useDispatch(editorStore);
36
36
  const {
37
37
  publishSidebarOpened,
38
- hasNonPostEntityChanges,
39
- hasPostMetaChanges
40
- } = useSelect(select => ({
41
- publishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
42
- hasNonPostEntityChanges: select(editorStore).hasNonPostEntityChanges(),
43
- hasPostMetaChanges: unlock(select(editorStore)).hasPostMetaChanges()
44
- }), []);
38
+ isPublishable,
39
+ isDirty,
40
+ hasOtherEntitiesChanges
41
+ } = useSelect(select => {
42
+ const {
43
+ isPublishSidebarOpened,
44
+ isEditedPostPublishable,
45
+ isCurrentPostPublished,
46
+ isEditedPostDirty,
47
+ hasNonPostEntityChanges
48
+ } = select(editorStore);
49
+ const _hasOtherEntitiesChanges = hasNonPostEntityChanges() || unlock(select(editorStore)).hasPostMetaChanges();
50
+ return {
51
+ publishSidebarOpened: isPublishSidebarOpened(),
52
+ isPublishable: !isCurrentPostPublished() && isEditedPostPublishable(),
53
+ isDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),
54
+ hasOtherEntitiesChanges: _hasOtherEntitiesChanges
55
+ };
56
+ }, []);
45
57
  const openEntitiesSavedStates = useCallback(() => setEntitiesSavedStatesCallback(true), []);
46
58
 
47
59
  // It is ok for these components to be unmounted when not in visual use.
@@ -54,26 +66,28 @@ export default function SavePublishPanels({
54
66
  PrePublishExtension: PluginPrePublishPanel.Slot,
55
67
  PostPublishExtension: PluginPostPublishPanel.Slot
56
68
  });
57
- } else if (hasNonPostEntityChanges || hasPostMetaChanges) {
69
+ } else if (isPublishable && !hasOtherEntitiesChanges) {
58
70
  unmountableContent = /*#__PURE__*/_jsx("div", {
59
- className: "editor-layout__toggle-entities-saved-states-panel",
71
+ className: "editor-layout__toggle-publish-panel",
60
72
  children: /*#__PURE__*/_jsx(Button, {
61
73
  variant: "secondary",
62
- className: "editor-layout__toggle-entities-saved-states-panel-button",
63
- onClick: openEntitiesSavedStates,
74
+ className: "editor-layout__toggle-publish-panel-button",
75
+ onClick: togglePublishSidebar,
64
76
  "aria-expanded": false,
65
- children: __('Open save panel')
77
+ children: __('Open publish panel')
66
78
  })
67
79
  });
68
80
  } else {
69
81
  unmountableContent = /*#__PURE__*/_jsx("div", {
70
- className: "editor-layout__toggle-publish-panel",
82
+ className: "editor-layout__toggle-entities-saved-states-panel",
71
83
  children: /*#__PURE__*/_jsx(Button, {
72
84
  variant: "secondary",
73
- className: "editor-layout__toggle-publish-panel-button",
74
- onClick: togglePublishSidebar,
85
+ className: "editor-layout__toggle-entities-saved-states-panel-button",
86
+ onClick: openEntitiesSavedStates,
75
87
  "aria-expanded": false,
76
- children: __('Open publish panel')
88
+ disabled: !isDirty,
89
+ accessibleWhenDisabled: true,
90
+ children: __('Open save panel')
77
91
  })
78
92
  });
79
93
  }