@wordpress/editor 14.48.0 → 14.48.2-next.v.202606191442.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 (509) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/build/bindings/pattern-overrides.cjs +1 -1
  3. package/build/bindings/pattern-overrides.cjs.map +2 -2
  4. package/build/components/block-removal-warnings/index.cjs +0 -3
  5. package/build/components/block-removal-warnings/index.cjs.map +2 -2
  6. package/build/components/collab-sidebar/note-byline.cjs +1 -1
  7. package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
  8. package/build/components/collab-sidebar/note-indicator-toolbar.cjs +49 -43
  9. package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +3 -3
  10. package/build/components/collab-sidebar/note.cjs +49 -17
  11. package/build/components/collab-sidebar/note.cjs.map +3 -3
  12. package/build/components/collab-sidebar/notes.cjs.map +1 -1
  13. package/build/components/collab-sidebar/utils.cjs +1 -1
  14. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  15. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +1 -1
  16. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +1 -1
  17. package/build/components/collaborators-overlay/compute-selection.cjs.map +1 -1
  18. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
  19. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +1 -1
  20. package/build/components/collaborators-overlay/use-block-highlighting.cjs +1 -8
  21. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +3 -3
  22. package/build/components/collaborators-overlay/use-render-cursors.cjs +1 -7
  23. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  24. package/build/components/collaborators-presence/avatar/component.cjs.map +2 -2
  25. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +1 -1
  26. package/build/components/document-bar/index.cjs +7 -5
  27. package/build/components/document-bar/index.cjs.map +2 -2
  28. package/build/components/global-keyboard-shortcuts/index.cjs +3 -2
  29. package/build/components/global-keyboard-shortcuts/index.cjs.map +2 -2
  30. package/build/components/global-styles-sidebar/welcome-guide.cjs +3 -3
  31. package/build/components/global-styles-sidebar/welcome-guide.cjs.map +1 -1
  32. package/build/components/local-autosave-monitor/index.cjs +14 -15
  33. package/build/components/local-autosave-monitor/index.cjs.map +2 -2
  34. package/build/components/more-menu/view-more-menu-group.cjs +1 -2
  35. package/build/components/more-menu/view-more-menu-group.cjs.map +2 -2
  36. package/build/components/page-attributes/parent.cjs +2 -1
  37. package/build/components/page-attributes/parent.cjs.map +2 -2
  38. package/build/components/post-card-panel/index.cjs +1 -1
  39. package/build/components/post-card-panel/index.cjs.map +2 -2
  40. package/build/components/post-excerpt/panel.cjs +1 -1
  41. package/build/components/post-excerpt/panel.cjs.map +2 -2
  42. package/build/components/post-locked-modal/index.cjs +3 -3
  43. package/build/components/post-locked-modal/index.cjs.map +1 -1
  44. package/build/components/post-preview-button/index.cjs +2 -2
  45. package/build/components/post-preview-button/index.cjs.map +2 -2
  46. package/build/components/post-publish-button/index.cjs +115 -157
  47. package/build/components/post-publish-button/index.cjs.map +3 -3
  48. package/build/components/post-publish-button/label.cjs +2 -2
  49. package/build/components/post-publish-button/label.cjs.map +2 -2
  50. package/build/components/post-publish-panel/index.cjs.map +1 -1
  51. package/build/components/post-publish-panel/postpublish.cjs +1 -1
  52. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  53. package/build/components/post-revisions-preview/block-diff.cjs +21 -9
  54. package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
  55. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  56. package/build/components/post-revisions-preview/preserve-client-ids.cjs +2 -2
  57. package/build/components/post-revisions-preview/preserve-client-ids.cjs.map +2 -2
  58. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -1
  59. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  60. package/build/components/post-revisions-timeline/index.cjs +173 -0
  61. package/build/components/post-revisions-timeline/index.cjs.map +7 -0
  62. package/build/components/post-saved-state/index.cjs +17 -26
  63. package/build/components/post-saved-state/index.cjs.map +2 -2
  64. package/build/components/post-schedule/label.cjs +5 -5
  65. package/build/components/post-schedule/label.cjs.map +1 -1
  66. package/build/components/post-taxonomies/flat-term-selector.cjs +2 -1
  67. package/build/components/post-taxonomies/flat-term-selector.cjs.map +3 -3
  68. package/build/components/post-taxonomies/hierarchical-term-selector.cjs +1 -1
  69. package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
  70. package/build/components/post-text-editor/index.cjs +51 -0
  71. package/build/components/post-text-editor/index.cjs.map +2 -2
  72. package/build/components/post-text-editor/utils.cjs +150 -0
  73. package/build/components/post-text-editor/utils.cjs.map +7 -0
  74. package/build/components/post-url/index.cjs +1 -1
  75. package/build/components/post-url/index.cjs.map +2 -2
  76. package/build/components/post-view-link/index.cjs +1 -1
  77. package/build/components/post-view-link/index.cjs.map +2 -2
  78. package/build/components/provider/disable-non-page-content-blocks.cjs.map +1 -1
  79. package/build/components/provider/index.cjs +3 -1
  80. package/build/components/provider/index.cjs.map +3 -3
  81. package/build/components/provider/use-network-reconnect.cjs +51 -0
  82. package/build/components/provider/use-network-reconnect.cjs.map +7 -0
  83. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  84. package/build/components/revision-diff-panel/index.cjs +7 -2
  85. package/build/components/revision-diff-panel/index.cjs.map +2 -2
  86. package/build/components/revision-fields-diff/index.cjs +8 -4
  87. package/build/components/revision-fields-diff/index.cjs.map +2 -2
  88. package/build/components/sidebar/dataform-post-summary.cjs +125 -20
  89. package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
  90. package/build/components/sidebar/index.cjs +2 -15
  91. package/build/components/sidebar/index.cjs.map +3 -3
  92. package/build/components/sidebar/post-revision-summary.cjs +11 -17
  93. package/build/components/sidebar/post-revision-summary.cjs.map +3 -3
  94. package/build/components/sidebar/post-summary.cjs +1 -1
  95. package/build/components/sidebar/post-summary.cjs.map +2 -2
  96. package/build/components/style-book/examples.cjs +1 -1
  97. package/build/components/style-book/examples.cjs.map +1 -1
  98. package/build/components/style-book/index.cjs +1 -1
  99. package/build/components/style-book/index.cjs.map +2 -2
  100. package/build/components/sync-connection-error-modal/index.cjs +3 -3
  101. package/build/components/sync-connection-error-modal/index.cjs.map +1 -1
  102. package/build/components/template-actions-panel/block-theme-content.cjs +7 -1
  103. package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
  104. package/build/components/template-actions-panel/index.cjs +0 -9
  105. package/build/components/template-actions-panel/index.cjs.map +3 -3
  106. package/build/components/template-validation-notice/index.cjs +1 -1
  107. package/build/components/template-validation-notice/index.cjs.map +1 -1
  108. package/build/components/upload-progress-snackbar/index.cjs +161 -0
  109. package/build/components/upload-progress-snackbar/index.cjs.map +7 -0
  110. package/build/components/upload-progress-snackbar/tracker.cjs +90 -0
  111. package/build/components/upload-progress-snackbar/tracker.cjs.map +7 -0
  112. package/build/components/visual-editor/edit-template-blocks-notification.cjs +1 -1
  113. package/build/components/visual-editor/edit-template-blocks-notification.cjs.map +1 -1
  114. package/build/{components/revision-author-panel → dataviews/fields/revisions}/index.cjs +18 -26
  115. package/build/dataviews/fields/revisions/index.cjs.map +7 -0
  116. package/build/dataviews/fields/revisions/revisions-view.cjs +74 -0
  117. package/build/dataviews/fields/revisions/revisions-view.cjs.map +7 -0
  118. package/build/dataviews/store/private-actions.cjs +14 -4
  119. package/build/dataviews/store/private-actions.cjs.map +3 -3
  120. package/build/hooks/push-changes-to-global-styles/index.cjs +1 -1
  121. package/build/hooks/push-changes-to-global-styles/index.cjs.map +1 -1
  122. package/build/private-apis.cjs +2 -0
  123. package/build/private-apis.cjs.map +3 -3
  124. package/build/store/actions.cjs +1 -1
  125. package/build/store/actions.cjs.map +2 -2
  126. package/build/store/private-selectors.cjs +6 -1
  127. package/build/store/private-selectors.cjs.map +2 -2
  128. package/build/store/selectors.cjs +1 -2
  129. package/build/store/selectors.cjs.map +2 -2
  130. package/build/utils/media-upload/index.cjs +16 -0
  131. package/build/utils/media-upload/index.cjs.map +3 -3
  132. package/build/utils/set-nested-value.cjs.map +1 -1
  133. package/build-module/bindings/pattern-overrides.mjs +1 -1
  134. package/build-module/bindings/pattern-overrides.mjs.map +2 -2
  135. package/build-module/components/block-removal-warnings/index.mjs +0 -3
  136. package/build-module/components/block-removal-warnings/index.mjs.map +2 -2
  137. package/build-module/components/collab-sidebar/note-byline.mjs +1 -1
  138. package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
  139. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs +53 -44
  140. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +2 -2
  141. package/build-module/components/collab-sidebar/note.mjs +50 -18
  142. package/build-module/components/collab-sidebar/note.mjs.map +2 -2
  143. package/build-module/components/collab-sidebar/notes.mjs.map +1 -1
  144. package/build-module/components/collab-sidebar/utils.mjs +1 -1
  145. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  146. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +1 -1
  147. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +1 -1
  148. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +1 -1
  149. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
  150. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +1 -1
  151. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +1 -8
  152. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  153. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +1 -7
  154. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  155. package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
  156. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +1 -1
  157. package/build-module/components/document-bar/index.mjs +7 -5
  158. package/build-module/components/document-bar/index.mjs.map +2 -2
  159. package/build-module/components/global-keyboard-shortcuts/index.mjs +3 -2
  160. package/build-module/components/global-keyboard-shortcuts/index.mjs.map +2 -2
  161. package/build-module/components/global-styles-sidebar/welcome-guide.mjs +3 -3
  162. package/build-module/components/global-styles-sidebar/welcome-guide.mjs.map +1 -1
  163. package/build-module/components/local-autosave-monitor/index.mjs +15 -16
  164. package/build-module/components/local-autosave-monitor/index.mjs.map +2 -2
  165. package/build-module/components/more-menu/view-more-menu-group.mjs +1 -2
  166. package/build-module/components/more-menu/view-more-menu-group.mjs.map +2 -2
  167. package/build-module/components/page-attributes/parent.mjs +2 -1
  168. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  169. package/build-module/components/post-card-panel/index.mjs +1 -1
  170. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  171. package/build-module/components/post-excerpt/panel.mjs +1 -1
  172. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  173. package/build-module/components/post-locked-modal/index.mjs +3 -3
  174. package/build-module/components/post-locked-modal/index.mjs.map +1 -1
  175. package/build-module/components/post-preview-button/index.mjs +2 -2
  176. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  177. package/build-module/components/post-publish-button/index.mjs +117 -159
  178. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  179. package/build-module/components/post-publish-button/label.mjs +2 -2
  180. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  181. package/build-module/components/post-publish-panel/index.mjs.map +1 -1
  182. package/build-module/components/post-publish-panel/postpublish.mjs +1 -1
  183. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  184. package/build-module/components/post-revisions-preview/block-diff.mjs +20 -8
  185. package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
  186. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  187. package/build-module/components/post-revisions-preview/preserve-client-ids.mjs +1 -1
  188. package/build-module/components/post-revisions-preview/preserve-client-ids.mjs.map +1 -1
  189. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -1
  190. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  191. package/build-module/components/post-revisions-timeline/index.mjs +152 -0
  192. package/build-module/components/post-revisions-timeline/index.mjs.map +7 -0
  193. package/build-module/components/post-saved-state/index.mjs +17 -26
  194. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  195. package/build-module/components/post-schedule/label.mjs +5 -5
  196. package/build-module/components/post-schedule/label.mjs.map +1 -1
  197. package/build-module/components/post-taxonomies/flat-term-selector.mjs +3 -6
  198. package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
  199. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +1 -1
  200. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
  201. package/build-module/components/post-text-editor/index.mjs +51 -0
  202. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  203. package/build-module/components/post-text-editor/utils.mjs +123 -0
  204. package/build-module/components/post-text-editor/utils.mjs.map +7 -0
  205. package/build-module/components/post-url/index.mjs +1 -1
  206. package/build-module/components/post-url/index.mjs.map +2 -2
  207. package/build-module/components/post-view-link/index.mjs +1 -1
  208. package/build-module/components/post-view-link/index.mjs.map +2 -2
  209. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +1 -1
  210. package/build-module/components/provider/index.mjs +3 -1
  211. package/build-module/components/provider/index.mjs.map +2 -2
  212. package/build-module/components/provider/use-network-reconnect.mjs +30 -0
  213. package/build-module/components/provider/use-network-reconnect.mjs.map +7 -0
  214. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  215. package/build-module/components/revision-diff-panel/index.mjs +7 -2
  216. package/build-module/components/revision-diff-panel/index.mjs.map +2 -2
  217. package/build-module/components/revision-fields-diff/index.mjs +8 -4
  218. package/build-module/components/revision-fields-diff/index.mjs.map +2 -2
  219. package/build-module/components/sidebar/dataform-post-summary.mjs +125 -20
  220. package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
  221. package/build-module/components/sidebar/index.mjs +3 -22
  222. package/build-module/components/sidebar/index.mjs.map +2 -2
  223. package/build-module/components/sidebar/post-revision-summary.mjs +11 -17
  224. package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
  225. package/build-module/components/sidebar/post-summary.mjs +1 -1
  226. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  227. package/build-module/components/style-book/examples.mjs +1 -1
  228. package/build-module/components/style-book/examples.mjs.map +1 -1
  229. package/build-module/components/style-book/index.mjs +1 -1
  230. package/build-module/components/style-book/index.mjs.map +2 -2
  231. package/build-module/components/sync-connection-error-modal/index.mjs +3 -3
  232. package/build-module/components/sync-connection-error-modal/index.mjs.map +1 -1
  233. package/build-module/components/template-actions-panel/block-theme-content.mjs +7 -1
  234. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
  235. package/build-module/components/template-actions-panel/index.mjs +0 -9
  236. package/build-module/components/template-actions-panel/index.mjs.map +2 -2
  237. package/build-module/components/template-validation-notice/index.mjs +1 -1
  238. package/build-module/components/template-validation-notice/index.mjs.map +1 -1
  239. package/build-module/components/upload-progress-snackbar/index.mjs +135 -0
  240. package/build-module/components/upload-progress-snackbar/index.mjs.map +7 -0
  241. package/build-module/components/upload-progress-snackbar/tracker.mjs +61 -0
  242. package/build-module/components/upload-progress-snackbar/tracker.mjs.map +7 -0
  243. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs +1 -1
  244. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs.map +1 -1
  245. package/build-module/dataviews/fields/revisions/index.mjs +20 -0
  246. package/build-module/dataviews/fields/revisions/index.mjs.map +7 -0
  247. package/build-module/dataviews/fields/revisions/revisions-view.mjs +53 -0
  248. package/build-module/dataviews/fields/revisions/revisions-view.mjs.map +7 -0
  249. package/build-module/dataviews/store/private-actions.mjs +23 -7
  250. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  251. package/build-module/hooks/push-changes-to-global-styles/index.mjs +1 -1
  252. package/build-module/hooks/push-changes-to-global-styles/index.mjs.map +1 -1
  253. package/build-module/private-apis.mjs +2 -0
  254. package/build-module/private-apis.mjs.map +2 -2
  255. package/build-module/store/actions.mjs +1 -1
  256. package/build-module/store/actions.mjs.map +2 -2
  257. package/build-module/store/private-selectors.mjs +7 -1
  258. package/build-module/store/private-selectors.mjs.map +2 -2
  259. package/build-module/store/selectors.mjs +1 -2
  260. package/build-module/store/selectors.mjs.map +2 -2
  261. package/build-module/utils/media-upload/index.mjs +19 -0
  262. package/build-module/utils/media-upload/index.mjs.map +2 -2
  263. package/build-module/utils/set-nested-value.mjs.map +1 -1
  264. package/build-style/style-rtl.css +707 -270
  265. package/build-style/style.css +707 -270
  266. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -1
  267. package/build-types/components/collab-sidebar/note-byline.d.ts +0 -3
  268. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
  269. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -1
  270. package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
  271. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +0 -3
  272. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  273. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  274. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
  275. package/build-types/components/document-bar/index.d.ts.map +1 -1
  276. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
  277. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  278. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  279. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  280. package/build-types/components/post-publish-button/index.d.ts +9 -9
  281. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  282. package/build-types/components/post-revisions-preview/block-diff.d.ts +3 -0
  283. package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
  284. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  285. package/build-types/components/post-revisions-timeline/index.d.ts +2 -0
  286. package/build-types/components/post-revisions-timeline/index.d.ts.map +1 -0
  287. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  288. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  289. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  290. package/build-types/components/post-text-editor/utils.d.ts +29 -0
  291. package/build-types/components/post-text-editor/utils.d.ts.map +1 -0
  292. package/build-types/components/provider/index.d.ts.map +1 -1
  293. package/build-types/components/provider/use-network-reconnect.d.ts +8 -0
  294. package/build-types/components/provider/use-network-reconnect.d.ts.map +1 -0
  295. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  296. package/build-types/components/revision-diff-panel/index.d.ts +3 -1
  297. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -1
  298. package/build-types/components/revision-fields-diff/index.d.ts +3 -0
  299. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
  300. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  301. package/build-types/components/sidebar/index.d.ts.map +1 -1
  302. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
  303. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  304. package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
  305. package/build-types/components/upload-progress-snackbar/index.d.ts +19 -0
  306. package/build-types/components/upload-progress-snackbar/index.d.ts.map +1 -0
  307. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts +28 -0
  308. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts.map +1 -0
  309. package/build-types/components/upload-progress-snackbar/tracker.d.ts +41 -0
  310. package/build-types/components/upload-progress-snackbar/tracker.d.ts.map +1 -0
  311. package/build-types/dataviews/fields/revisions/index.d.ts +8 -0
  312. package/build-types/dataviews/fields/revisions/index.d.ts.map +1 -0
  313. package/build-types/dataviews/fields/revisions/revisions-view.d.ts +2 -0
  314. package/build-types/dataviews/fields/revisions/revisions-view.d.ts.map +1 -0
  315. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  316. package/build-types/private-apis.d.ts.map +1 -1
  317. package/build-types/store/private-selectors.d.ts +1 -1
  318. package/build-types/store/private-selectors.d.ts.map +1 -1
  319. package/build-types/store/selectors.d.ts +1 -1
  320. package/build-types/store/selectors.d.ts.map +1 -1
  321. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  322. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  323. package/package.json +59 -50
  324. package/src/bindings/pattern-overrides.js +1 -1
  325. package/src/bindings/test/pattern-overrides.js +65 -0
  326. package/src/components/README.md +1 -1
  327. package/src/components/block-removal-warnings/index.js +0 -7
  328. package/src/components/collab-sidebar/note-byline.js +0 -1
  329. package/src/components/collab-sidebar/note-indicator-toolbar.js +73 -60
  330. package/src/components/collab-sidebar/note.js +64 -29
  331. package/src/components/collab-sidebar/style.scss +20 -0
  332. package/src/components/collaborators-overlay/use-block-highlighting.ts +0 -9
  333. package/src/components/collaborators-overlay/use-render-cursors.ts +0 -8
  334. package/src/components/collaborators-presence/avatar/component.tsx +0 -1
  335. package/src/components/collaborators-presence/avatar/test/index.tsx +8 -4
  336. package/src/components/document-bar/index.js +8 -3
  337. package/src/components/document-bar/style.scss +4 -2
  338. package/src/components/global-keyboard-shortcuts/index.js +2 -1
  339. package/src/components/local-autosave-monitor/index.js +23 -21
  340. package/src/components/more-menu/view-more-menu-group.js +1 -2
  341. package/src/components/page-attributes/parent.js +1 -0
  342. package/src/components/post-card-panel/index.js +1 -1
  343. package/src/components/post-publish-button/index.js +146 -192
  344. package/src/components/post-publish-button/test/index.js +149 -113
  345. package/src/components/post-revisions-preview/block-diff.js +63 -19
  346. package/src/components/post-revisions-preview/diff-markers.js +0 -1
  347. package/src/components/post-revisions-preview/preserve-client-ids.js +1 -1
  348. package/src/components/post-revisions-preview/test/block-diff.js +109 -6
  349. package/src/components/post-revisions-timeline/index.js +186 -0
  350. package/src/components/post-revisions-timeline/style.scss +43 -0
  351. package/src/components/post-saved-state/index.js +23 -26
  352. package/src/components/post-saved-state/test/index.js +18 -0
  353. package/src/components/post-taxonomies/flat-term-selector.js +4 -7
  354. package/src/components/post-text-editor/index.js +65 -0
  355. package/src/components/post-text-editor/test/utils.js +210 -0
  356. package/src/components/post-text-editor/utils.js +204 -0
  357. package/src/components/post-type-support-check/test/index.js +11 -0
  358. package/src/components/post-url/index.js +1 -1
  359. package/src/components/post-view-link/index.js +1 -1
  360. package/src/components/post-view-link/test/index.js +71 -0
  361. package/src/components/provider/index.js +6 -1
  362. package/src/components/provider/test/use-network-reconnect.js +137 -0
  363. package/src/components/provider/use-network-reconnect.js +44 -0
  364. package/src/components/resizable-editor/resize-handle.js +0 -1
  365. package/src/components/revision-diff-panel/index.js +8 -2
  366. package/src/components/revision-fields-diff/index.js +19 -3
  367. package/src/components/sidebar/dataform-post-summary.js +196 -25
  368. package/src/components/sidebar/index.js +4 -23
  369. package/src/components/sidebar/post-revision-summary.js +8 -15
  370. package/src/components/sidebar/post-summary.js +1 -1
  371. package/src/components/style-book/index.js +1 -1
  372. package/src/components/template-actions-panel/block-theme-content.js +10 -2
  373. package/src/components/template-actions-panel/index.js +0 -15
  374. package/src/components/upload-progress-snackbar/README.md +26 -0
  375. package/src/components/upload-progress-snackbar/index.js +216 -0
  376. package/src/components/upload-progress-snackbar/stories/index.story.tsx +85 -0
  377. package/src/components/upload-progress-snackbar/style.scss +30 -0
  378. package/src/components/upload-progress-snackbar/test/index.js +199 -0
  379. package/src/components/upload-progress-snackbar/tracker.js +105 -0
  380. package/src/dataviews/fields/revisions/index.tsx +28 -0
  381. package/src/dataviews/fields/revisions/revisions-view.tsx +59 -0
  382. package/src/dataviews/store/private-actions.ts +27 -6
  383. package/src/private-apis.js +2 -0
  384. package/src/store/private-selectors.js +11 -1
  385. package/src/store/selectors.js +1 -3
  386. package/src/store/test/private-selectors.js +69 -0
  387. package/src/style.scss +2 -1
  388. package/src/utils/media-upload/index.js +27 -0
  389. package/build/components/post-revisions-panel/index.cjs +0 -173
  390. package/build/components/post-revisions-panel/index.cjs.map +0 -7
  391. package/build/components/revision-author-panel/index.cjs.map +0 -7
  392. package/build/components/revision-created-panel/index.cjs +0 -47
  393. package/build/components/revision-created-panel/index.cjs.map +0 -7
  394. package/build-module/components/post-revisions-panel/index.mjs +0 -148
  395. package/build-module/components/post-revisions-panel/index.mjs.map +0 -7
  396. package/build-module/components/revision-author-panel/index.mjs +0 -28
  397. package/build-module/components/revision-author-panel/index.mjs.map +0 -7
  398. package/build-module/components/revision-created-panel/index.mjs +0 -26
  399. package/build-module/components/revision-created-panel/index.mjs.map +0 -7
  400. package/build-types/components/post-revisions-panel/index.d.ts +0 -2
  401. package/build-types/components/post-revisions-panel/index.d.ts.map +0 -1
  402. package/build-types/components/revision-author-panel/index.d.ts +0 -2
  403. package/build-types/components/revision-author-panel/index.d.ts.map +0 -1
  404. package/build-types/components/revision-created-panel/index.d.ts +0 -2
  405. package/build-types/components/revision-created-panel/index.d.ts.map +0 -1
  406. package/src/components/commands/index.native.js +0 -2
  407. package/src/components/deprecated.native.js +0 -47
  408. package/src/components/editor-help/add-blocks.native.js +0 -40
  409. package/src/components/editor-help/customize-blocks.native.js +0 -40
  410. package/src/components/editor-help/help-detail-navigation-screen.native.js +0 -67
  411. package/src/components/editor-help/help-get-support-button.native.js +0 -38
  412. package/src/components/editor-help/help-section-title.native.js +0 -29
  413. package/src/components/editor-help/help-topic-row.native.js +0 -33
  414. package/src/components/editor-help/icon-move-blocks.native.js +0 -10
  415. package/src/components/editor-help/images/add-dark.png +0 -0
  416. package/src/components/editor-help/images/add-dark@2x.png +0 -0
  417. package/src/components/editor-help/images/add-dark@3x.png +0 -0
  418. package/src/components/editor-help/images/add-light.png +0 -0
  419. package/src/components/editor-help/images/add-light@2x.png +0 -0
  420. package/src/components/editor-help/images/add-light@3x.png +0 -0
  421. package/src/components/editor-help/images/block-layout-collage.png +0 -0
  422. package/src/components/editor-help/images/block-layout-collage@2x.png +0 -0
  423. package/src/components/editor-help/images/block-layout-collage@3x.png +0 -0
  424. package/src/components/editor-help/images/build-layouts-dark.png +0 -0
  425. package/src/components/editor-help/images/build-layouts-dark@2x.png +0 -0
  426. package/src/components/editor-help/images/build-layouts-dark@3x.png +0 -0
  427. package/src/components/editor-help/images/build-layouts-light.png +0 -0
  428. package/src/components/editor-help/images/build-layouts-light@2x.png +0 -0
  429. package/src/components/editor-help/images/build-layouts-light@3x.png +0 -0
  430. package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
  431. package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
  432. package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
  433. package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
  434. package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
  435. package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
  436. package/src/components/editor-help/images/edit-media-dark.png +0 -0
  437. package/src/components/editor-help/images/edit-media-dark@2x.png +0 -0
  438. package/src/components/editor-help/images/edit-media-dark@3x.png +0 -0
  439. package/src/components/editor-help/images/edit-media-light.png +0 -0
  440. package/src/components/editor-help/images/edit-media-light@2x.png +0 -0
  441. package/src/components/editor-help/images/edit-media-light@3x.png +0 -0
  442. package/src/components/editor-help/images/embed-media-dark.png +0 -0
  443. package/src/components/editor-help/images/embed-media-dark@2x.png +0 -0
  444. package/src/components/editor-help/images/embed-media-dark@3x.png +0 -0
  445. package/src/components/editor-help/images/embed-media-light.png +0 -0
  446. package/src/components/editor-help/images/embed-media-light@2x.png +0 -0
  447. package/src/components/editor-help/images/embed-media-light@3x.png +0 -0
  448. package/src/components/editor-help/images/move-dark.png +0 -0
  449. package/src/components/editor-help/images/move-dark@2x.png +0 -0
  450. package/src/components/editor-help/images/move-dark@3x.png +0 -0
  451. package/src/components/editor-help/images/move-light.png +0 -0
  452. package/src/components/editor-help/images/move-light@2x.png +0 -0
  453. package/src/components/editor-help/images/move-light@3x.png +0 -0
  454. package/src/components/editor-help/images/options-dark.png +0 -0
  455. package/src/components/editor-help/images/options-dark@2x.png +0 -0
  456. package/src/components/editor-help/images/options-dark@3x.png +0 -0
  457. package/src/components/editor-help/images/options-light.png +0 -0
  458. package/src/components/editor-help/images/options-light@2x.png +0 -0
  459. package/src/components/editor-help/images/options-light@3x.png +0 -0
  460. package/src/components/editor-help/images/rich-text-dark.png +0 -0
  461. package/src/components/editor-help/images/rich-text-dark@2x.png +0 -0
  462. package/src/components/editor-help/images/rich-text-dark@3x.png +0 -0
  463. package/src/components/editor-help/images/rich-text-light.png +0 -0
  464. package/src/components/editor-help/images/rich-text-light@2x.png +0 -0
  465. package/src/components/editor-help/images/rich-text-light@3x.png +0 -0
  466. package/src/components/editor-help/images/settings-dark.png +0 -0
  467. package/src/components/editor-help/images/settings-dark@2x.png +0 -0
  468. package/src/components/editor-help/images/settings-dark@3x.png +0 -0
  469. package/src/components/editor-help/images/settings-light.png +0 -0
  470. package/src/components/editor-help/images/settings-light@2x.png +0 -0
  471. package/src/components/editor-help/images/settings-light@3x.png +0 -0
  472. package/src/components/editor-help/index.native.js +0 -208
  473. package/src/components/editor-help/intro-to-blocks.native.js +0 -91
  474. package/src/components/editor-help/move-blocks.native.js +0 -55
  475. package/src/components/editor-help/remove-blocks.native.js +0 -35
  476. package/src/components/editor-help/style.android.scss +0 -6
  477. package/src/components/editor-help/style.ios.scss +0 -6
  478. package/src/components/editor-help/style.scss +0 -123
  479. package/src/components/editor-help/test/index.native.js +0 -81
  480. package/src/components/editor-help/view-sections.native.js +0 -79
  481. package/src/components/error-boundary/index.native.js +0 -192
  482. package/src/components/error-boundary/style.native.scss +0 -116
  483. package/src/components/index.native.js +0 -15
  484. package/src/components/offline-status/index.native.js +0 -99
  485. package/src/components/offline-status/style.native.scss +0 -28
  486. package/src/components/offline-status/test/index.native.js +0 -108
  487. package/src/components/post-revisions-panel/index.js +0 -161
  488. package/src/components/post-revisions-panel/style.scss +0 -16
  489. package/src/components/post-title/index.native.js +0 -282
  490. package/src/components/post-title/style.native.scss +0 -13
  491. package/src/components/post-title/test/__snapshots__/index.native.js.snap +0 -25
  492. package/src/components/post-title/test/index.native.js +0 -78
  493. package/src/components/provider/index.native.js +0 -497
  494. package/src/components/provider/use-block-editor-settings.native.js +0 -48
  495. package/src/components/revision-author-panel/index.js +0 -36
  496. package/src/components/revision-created-panel/index.js +0 -36
  497. package/src/components/template-part-menu-items/index.native.js +0 -3
  498. package/src/hooks/index.native.js +0 -0
  499. package/src/index.native.js +0 -16
  500. package/src/private-apis.native.js +0 -33
  501. package/src/store/actions.native.js +0 -27
  502. package/src/store/reducer.native.js +0 -94
  503. package/src/store/selectors.native.js +0 -57
  504. package/src/store/test/actions.native.js +0 -16
  505. package/src/store/test/reducer.native.js +0 -36
  506. package/src/store/test/selectors.native.js +0 -28
  507. package/src/utils/index.native.js +0 -6
  508. package/src/utils/media-sideload/index.native.js +0 -1
  509. package/src/utils/media-upload/index.native.js +0 -1
@@ -1,161 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- PanelBody,
6
- Button,
7
- __experimentalHStack as HStack,
8
- __experimentalVStack as VStack,
9
- privateApis as componentsPrivateApis,
10
- } from '@wordpress/components';
11
- import { store as coreStore } from '@wordpress/core-data';
12
- import { DataViews } from '@wordpress/dataviews';
13
- import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
14
- import { useSelect, useDispatch } from '@wordpress/data';
15
- import { __ } from '@wordpress/i18n';
16
- import { authorField } from '@wordpress/fields';
17
-
18
- /**
19
- * Internal dependencies
20
- */
21
- import PostLastRevisionCheck from '../post-last-revision/check';
22
- import { store as editorStore } from '../../store';
23
- import { unlock } from '../../lock-unlock';
24
-
25
- const { Badge: WCBadge } = unlock( componentsPrivateApis );
26
- const DAY_IN_MILLISECONDS = 86400000;
27
- const EMPTY_ARRAY = [];
28
- const defaultLayouts = { activity: true };
29
- const noop = () => {};
30
- const paginationInfo = {};
31
- const view = {
32
- type: 'activity',
33
- titleField: 'date',
34
- fields: [ 'author' ],
35
- layout: { density: 'compact' },
36
- };
37
- const fields = [
38
- {
39
- id: 'date',
40
- label: __( 'Date' ),
41
- render: ( { item, field } ) => {
42
- const dateNowInMs = getDate( null ).getTime();
43
- const _value = field.getValue( { item } );
44
- const date = getDate( _value ?? null );
45
- const displayDate =
46
- dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS
47
- ? dateI18n(
48
- getSettings().formats.datetimeAbbreviated,
49
- date
50
- )
51
- : humanTimeDiff( date );
52
- return (
53
- <time
54
- className="editor-post-revisions-panel__revision-date"
55
- dateTime={ _value }
56
- >
57
- { displayDate }
58
- </time>
59
- );
60
- },
61
- enableSorting: false,
62
- enableHiding: false,
63
- },
64
- authorField,
65
- ];
66
-
67
- function PostRevisionsPanelContent() {
68
- const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
69
- const {
70
- revisionsCount,
71
- revisions,
72
- revisionKey,
73
- isLoading,
74
- lastRevisionId,
75
- } = useSelect( ( select ) => {
76
- const { getCurrentPostId, getCurrentPostType } = select( editorStore );
77
- const { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } =
78
- select( editorStore );
79
- const { getRevisions, getEntityConfig, isResolving } =
80
- select( coreStore );
81
- const _postType = getCurrentPostType();
82
- const entityConfig = getEntityConfig( 'postType', _postType );
83
- const _revisionKey = entityConfig?.revisionKey || 'id';
84
- const revisionsQuery = {
85
- per_page: 3,
86
- orderby: 'date',
87
- order: 'desc',
88
- _fields: `${ _revisionKey },date,author`,
89
- };
90
- const query = [
91
- 'postType',
92
- _postType,
93
- getCurrentPostId(),
94
- revisionsQuery,
95
- ];
96
- const _revisions = getRevisions( ...query );
97
- return {
98
- revisionsCount: getCurrentPostRevisionsCount(),
99
- lastRevisionId: getCurrentPostLastRevisionId(),
100
- revisions: _revisions,
101
- revisionKey: _revisionKey,
102
- isLoading: isResolving( 'getRevisions', query ),
103
- };
104
- }, [] );
105
- return (
106
- <PanelBody
107
- title={
108
- <HStack justify="space-between" align="center" as="span">
109
- <span>{ __( 'Revisions' ) }</span>
110
- <WCBadge className="editor-post-revisions-panel__revisions-count">
111
- { revisionsCount }
112
- </WCBadge>
113
- </HStack>
114
- }
115
- initialOpen={ false }
116
- >
117
- <VStack className="editor-post-revisions-panel">
118
- <DataViews
119
- view={ view }
120
- onChangeView={ noop }
121
- fields={ fields }
122
- data={ revisions || EMPTY_ARRAY }
123
- isLoading={ isLoading }
124
- paginationInfo={ paginationInfo }
125
- defaultLayouts={ defaultLayouts }
126
- getItemId={ ( item ) => item[ revisionKey ] }
127
- isItemClickable={ () => true }
128
- onClickItem={ ( item ) => {
129
- setCurrentRevisionId( item[ revisionKey ] );
130
- } }
131
- >
132
- <DataViews.Layout />
133
- </DataViews>
134
- <Button
135
- className="editor-post-revisions-panel__view-all"
136
- __next40pxDefaultSize
137
- variant="secondary"
138
- onClick={ () => setCurrentRevisionId( lastRevisionId ) }
139
- >
140
- { __( 'View all revisions' ) }
141
- </Button>
142
- </VStack>
143
- </PanelBody>
144
- );
145
- }
146
-
147
- export default function PostRevisionsPanel() {
148
- const disableVisualRevisions = useSelect(
149
- ( select ) =>
150
- !! select( editorStore ).getEditorSettings().disableVisualRevisions,
151
- []
152
- );
153
- if ( disableVisualRevisions ) {
154
- return null;
155
- }
156
- return (
157
- <PostLastRevisionCheck>
158
- <PostRevisionsPanelContent />
159
- </PostLastRevisionCheck>
160
- );
161
- }
@@ -1,16 +0,0 @@
1
- .editor-post-revisions-panel {
2
- .editor-post-revisions-panel__view-all {
3
- justify-content: center;
4
- }
5
-
6
- .editor-post-revisions-panel__revision-date {
7
- text-transform: uppercase;
8
- font-weight: 600;
9
- font-size: 12px;
10
- }
11
- }
12
-
13
- .editor-post-revisions-panel__revisions-count {
14
- margin-top: -4.5px;
15
- margin-bottom: -4.5px;
16
- }
@@ -1,282 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { View } from 'react-native';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { Component } from '@wordpress/element';
10
- import { create, toHTMLString, insert } from '@wordpress/rich-text';
11
- import { decodeEntities } from '@wordpress/html-entities';
12
- import { withDispatch, withSelect } from '@wordpress/data';
13
- import { withFocusOutside } from '@wordpress/components';
14
- import { withInstanceId, compose } from '@wordpress/compose';
15
- import { __, sprintf } from '@wordpress/i18n';
16
- import { pasteHandler } from '@wordpress/blocks';
17
- import { store as blockEditorStore, RichText } from '@wordpress/block-editor';
18
- import { store as editorStore } from '@wordpress/editor';
19
- import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
20
-
21
- /** @typedef {import('./types').RichTextValue} RichTextValue */
22
-
23
- /**
24
- * Internal dependencies
25
- */
26
- import styles from './style.scss';
27
-
28
- /**
29
- * Inserts content with title
30
- *
31
- * This function processes the given content and title, updating the title
32
- * and content based on certain conditions. If the content is an array of
33
- * blocks, it will check the first block for a heading or paragraph to use
34
- * as the title. If the content is a string, it will strip HTML and update
35
- * the title and content accordingly.
36
- *
37
- * @param {string} title The post title.
38
- * @param {Array | string} content The content to be processed. It can be an array of blocks or a string.
39
- * @param {Function} onUpdateTitle Callback function to update the title.
40
- * @param {Function} onUpdateContent Callback function to update the content.
41
- * @param {RichTextValue} value The initial value object, default is an object with empty text.
42
- */
43
- export function insertContentWithTitle(
44
- title,
45
- content,
46
- onUpdateTitle,
47
- onUpdateContent,
48
- value = create( { text: '' } )
49
- ) {
50
- if ( ! content.length ) {
51
- return;
52
- }
53
-
54
- if ( typeof content !== 'string' ) {
55
- const [ firstBlock ] = content;
56
-
57
- if (
58
- ! title &&
59
- ( firstBlock.name === 'core/heading' ||
60
- firstBlock.name === 'core/paragraph' )
61
- ) {
62
- // Strip HTML to avoid unwanted HTML being added to the title.
63
- // In the majority of cases it is assumed that HTML in the title
64
- // is undesirable.
65
- const contentNoHTML = stripHTML( firstBlock.attributes.content );
66
- onUpdateTitle( contentNoHTML );
67
- onUpdateContent( content.slice( 1 ) );
68
- } else {
69
- onUpdateContent( content );
70
- }
71
- } else {
72
- // Strip HTML to avoid unwanted HTML being added to the title.
73
- // In the majority of cases it is assumed that HTML in the title
74
- // is undesirable.
75
- const contentNoHTML = stripHTML( content );
76
-
77
- const newValue = insert( value, create( { html: contentNoHTML } ) );
78
- onUpdateTitle( toHTMLString( { value: newValue } ) );
79
- }
80
- }
81
-
82
- class PostTitle extends Component {
83
- constructor( props ) {
84
- super( props );
85
-
86
- this.setRef = this.setRef.bind( this );
87
- this.onPaste = this.onPaste.bind( this );
88
- }
89
- componentDidUpdate( prevProps ) {
90
- // Unselect if any other block is selected and blur the RichText.
91
- if (
92
- this.props.isSelected &&
93
- ! prevProps.isAnyBlockSelected &&
94
- this.props.isAnyBlockSelected
95
- ) {
96
- if ( this.richTextRef ) {
97
- this.richTextRef.blur();
98
- }
99
- this.props.onUnselect();
100
- }
101
- }
102
-
103
- componentDidMount() {
104
- if ( this.props.innerRef ) {
105
- this.props.innerRef( this );
106
- }
107
- }
108
-
109
- handleFocusOutside() {
110
- this.props.onUnselect();
111
- }
112
-
113
- focus() {
114
- this.props.onSelect();
115
- }
116
-
117
- onPaste( { value, plainText, html } ) {
118
- const {
119
- title,
120
- onInsertBlockAfter: onInsertBlocks,
121
- onUpdate,
122
- } = this.props;
123
-
124
- const content = pasteHandler( {
125
- HTML: html,
126
- plainText,
127
- } );
128
-
129
- insertContentWithTitle(
130
- title,
131
- content,
132
- onUpdate,
133
- onInsertBlocks,
134
- value
135
- );
136
- }
137
-
138
- setRef( richText ) {
139
- this.richTextRef = richText;
140
- }
141
-
142
- getTitle( title, postType ) {
143
- if ( 'page' === postType ) {
144
- return ! title
145
- ? /* translators: accessibility text. empty page title. */
146
- __( 'Page title. Empty' )
147
- : sprintf(
148
- /* translators: accessibility text. %s: text content of the page title. */
149
- __( 'Page title. %s' ),
150
- title
151
- );
152
- }
153
-
154
- return ! title
155
- ? /* translators: accessibility text. empty post title. */
156
- __( 'Post title. Empty' )
157
- : sprintf(
158
- /* translators: accessibility text. %s: text content of the post title. */
159
- __( 'Post title. %s' ),
160
- title
161
- );
162
- }
163
-
164
- render() {
165
- const {
166
- placeholder,
167
- style,
168
- title,
169
- focusedBorderColor,
170
- borderStyle,
171
- isDimmed,
172
- postType,
173
- globalStyles,
174
- } = this.props;
175
-
176
- const decodedPlaceholder = decodeEntities( placeholder );
177
- const borderColor = this.props.isSelected
178
- ? focusedBorderColor
179
- : 'transparent';
180
- const titleStyles = {
181
- ...style,
182
- ...( globalStyles?.text && {
183
- color: globalStyles.text,
184
- placeholderColor: globalStyles.text,
185
- } ),
186
- };
187
-
188
- return (
189
- <View
190
- testID="post-title"
191
- style={ [
192
- styles.titleContainer,
193
- borderStyle,
194
- { borderColor },
195
- isDimmed && styles.dimmed,
196
- ] }
197
- accessible={ ! this.props.isSelected }
198
- accessibilityLabel={ this.getTitle( title, postType ) }
199
- accessibilityHint={ __( 'Updates the title.' ) }
200
- >
201
- <RichText.Raw
202
- ref={ this.setRef }
203
- accessibilityLabel={ this.getTitle( title, postType ) }
204
- tagName="p"
205
- tagsToEliminate={ [ 'strong' ] }
206
- unstableOnFocus={ this.props.onSelect }
207
- onBlur={ this.props.onBlur } // Always assign onBlur as a props.
208
- style={ titleStyles }
209
- styles={ styles }
210
- fontSize={ 24 }
211
- lineHeight={ 1 }
212
- fontWeight="bold"
213
- deleteEnter
214
- onChange={ ( value ) => {
215
- this.props.onUpdate( value );
216
- } }
217
- onPaste={ this.onPaste }
218
- placeholder={ decodedPlaceholder }
219
- value={ title }
220
- onSelectionChange={ () => {} }
221
- onEnter={ this.props.onEnterPress }
222
- disableEditingMenu
223
- __unstableIsSelected={ this.props.isSelected }
224
- __unstableOnCreateUndoLevel={ () => {} }
225
- />
226
- </View>
227
- );
228
- }
229
- }
230
-
231
- export default compose(
232
- withSelect( ( select ) => {
233
- const { isPostTitleSelected, getEditedPostAttribute } =
234
- select( editorStore );
235
- const { getSelectedBlockClientId, getBlockRootClientId, getSettings } =
236
- select( blockEditorStore );
237
-
238
- const selectedId = getSelectedBlockClientId();
239
- const selectionIsNested = !! getBlockRootClientId( selectedId );
240
- const globalStyles =
241
- getSettings()?.__experimentalGlobalStylesBaseStyles?.color;
242
-
243
- return {
244
- postType: getEditedPostAttribute( 'type' ),
245
- title: getEditedPostAttribute( 'title' ),
246
- isAnyBlockSelected: !! selectedId,
247
- isSelected: isPostTitleSelected(),
248
- isDimmed: selectionIsNested,
249
- globalStyles,
250
- };
251
- } ),
252
- withDispatch( ( dispatch ) => {
253
- const { undo, redo, togglePostTitleSelection, editPost } =
254
- dispatch( editorStore );
255
-
256
- const { clearSelectedBlock, insertDefaultBlock, insertBlocks } =
257
- dispatch( blockEditorStore );
258
-
259
- return {
260
- onEnterPress() {
261
- insertDefaultBlock( undefined, undefined, 0 );
262
- },
263
- onUndo: undo,
264
- onRedo: redo,
265
- onSelect() {
266
- togglePostTitleSelection( true );
267
- clearSelectedBlock();
268
- },
269
- onUnselect() {
270
- togglePostTitleSelection( false );
271
- },
272
- onUpdate( title ) {
273
- editPost( { title } );
274
- },
275
- onInsertBlockAfter( blocks ) {
276
- insertBlocks( blocks, 0 );
277
- },
278
- };
279
- } ),
280
- withInstanceId,
281
- withFocusOutside
282
- )( PostTitle );
@@ -1,13 +0,0 @@
1
-
2
- .titleContainer {
3
- padding-left: $block-edge-to-content;
4
- padding-right: $block-edge-to-content;
5
- padding-top: 6;
6
- padding-bottom: 6;
7
- margin-top: 12;
8
- }
9
-
10
- .dimmed {
11
- opacity: $dimmed-opacity;
12
- }
13
-
@@ -1,25 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`PostTitle does not update title with existing content when pasting HTML 1`] = `
4
- "<!-- wp:heading -->
5
- <h2 class="wp-block-heading">Howdy</h2>
6
- <!-- /wp:heading -->
7
-
8
- <!-- wp:heading -->
9
- <h2 class="wp-block-heading">This is a heading.</h2>
10
- <!-- /wp:heading -->
11
-
12
- <!-- wp:paragraph -->
13
- <p>This is a paragraph.</p>
14
- <!-- /wp:paragraph -->"
15
- `;
16
-
17
- exports[`PostTitle populates empty title with first block content when pasting HTML 1`] = `
18
- "<!-- wp:heading -->
19
- <h2 class="wp-block-heading">This is a heading.</h2>
20
- <!-- /wp:heading -->
21
-
22
- <!-- wp:paragraph -->
23
- <p>This is a paragraph.</p>
24
- <!-- /wp:paragraph -->"
25
- `;
@@ -1,78 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import {
5
- getEditorHtml,
6
- getEditorTitle,
7
- initializeEditor,
8
- pasteIntoRichText,
9
- selectRangeInRichText,
10
- screen,
11
- setupCoreBlocks,
12
- within,
13
- } from 'test/helpers';
14
-
15
- setupCoreBlocks();
16
-
17
- const HTML_MULTIPLE_TAGS = `<h2>Howdy</h2>
18
- <h2>This is a heading.</h2>
19
- <p>This is a paragraph.</p>`;
20
-
21
- describe( 'PostTitle', () => {
22
- it( 'populates empty title with first block content when pasting HTML', async () => {
23
- await initializeEditor( { initialTitle: '' } );
24
-
25
- const postTitle = within(
26
- screen.getByTestId( 'post-title' )
27
- ).getByPlaceholderText( 'Add title' );
28
- pasteIntoRichText( postTitle, { html: HTML_MULTIPLE_TAGS } );
29
-
30
- expect( console ).toHaveLogged();
31
- expect( getEditorTitle() ).toBe( 'Howdy' );
32
- expect( getEditorHtml() ).toMatchSnapshot();
33
- } );
34
-
35
- it( 'does not update title with existing content when pasting HTML', async () => {
36
- const initialTitle = 'Hello';
37
- await initializeEditor( { initialTitle } );
38
-
39
- const postTitle = within(
40
- screen.getByTestId( 'post-title' )
41
- ).getByPlaceholderText( 'Add title' );
42
- selectRangeInRichText( postTitle, 0 );
43
- pasteIntoRichText( postTitle, { html: HTML_MULTIPLE_TAGS } );
44
-
45
- expect( console ).toHaveLogged();
46
- expect( getEditorTitle() ).toBe( initialTitle );
47
- expect( getEditorHtml() ).toMatchSnapshot();
48
- } );
49
-
50
- it( 'updates title with existing content when pasting text', async () => {
51
- await initializeEditor( { initialTitle: 'World' } );
52
-
53
- const postTitle = within(
54
- screen.getByTestId( 'post-title' )
55
- ).getByPlaceholderText( 'Add title' );
56
- selectRangeInRichText( postTitle, 0 );
57
- pasteIntoRichText( postTitle, { text: 'Hello' } );
58
-
59
- expect( console ).toHaveLogged();
60
- expect( getEditorTitle() ).toBe( 'HelloWorld' );
61
- expect( getEditorHtml() ).toBe( '' );
62
- } );
63
-
64
- it( 'does not add HTML to title when pasting span tag', async () => {
65
- const pasteHTML = `<span style="border: 1px solid black">l</span>`;
66
- await initializeEditor( { initialTitle: 'Helo' } );
67
-
68
- const postTitle = within(
69
- screen.getByTestId( 'post-title' )
70
- ).getByPlaceholderText( 'Add title' );
71
- selectRangeInRichText( postTitle, 2 );
72
- pasteIntoRichText( postTitle, { html: pasteHTML } );
73
-
74
- expect( console ).toHaveLogged();
75
- expect( getEditorTitle() ).toBe( 'Hello' );
76
- expect( getEditorHtml() ).toBe( '' );
77
- } );
78
- } );