@wordpress/editor 14.45.0 → 14.45.2-next.v.202605131032.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 (623) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +12 -0
  3. package/build/components/collab-sidebar/index.cjs +42 -25
  4. package/build/components/collab-sidebar/index.cjs.map +2 -2
  5. package/build/components/collab-sidebar/note-thread.cjs +19 -9
  6. package/build/components/collab-sidebar/note-thread.cjs.map +2 -2
  7. package/build/components/collab-sidebar/notes.cjs +8 -6
  8. package/build/components/collab-sidebar/notes.cjs.map +2 -2
  9. package/build/components/collab-sidebar/utils.cjs +24 -9
  10. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  11. package/build/components/collaborators-presence/index.cjs +0 -10
  12. package/build/components/collaborators-presence/index.cjs.map +3 -3
  13. package/build/components/collaborators-presence/list.cjs +0 -10
  14. package/build/components/collaborators-presence/list.cjs.map +3 -3
  15. package/build/components/post-last-revision/index.cjs +5 -0
  16. package/build/components/post-last-revision/index.cjs.map +2 -2
  17. package/build/components/post-publish-panel/index.cjs +112 -124
  18. package/build/components/post-publish-panel/index.cjs.map +3 -3
  19. package/build/components/post-revisions-preview/block-diff.cjs +91 -23
  20. package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
  21. package/build/components/post-revisions-preview/diff-markers.cjs +3 -2
  22. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  23. package/build/components/post-revisions-preview/revisions-slider.cjs +98 -50
  24. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  25. package/build/store/private-actions.cjs +21 -0
  26. package/build/store/private-actions.cjs.map +2 -2
  27. package/build/store/private-selectors.cjs +93 -42
  28. package/build/store/private-selectors.cjs.map +2 -2
  29. package/build/store/reducer.cjs +15 -0
  30. package/build/store/reducer.cjs.map +2 -2
  31. package/build/store/selectors.cjs.map +2 -2
  32. package/build-module/components/collab-sidebar/index.mjs +42 -25
  33. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  34. package/build-module/components/collab-sidebar/note-thread.mjs +24 -10
  35. package/build-module/components/collab-sidebar/note-thread.mjs.map +2 -2
  36. package/build-module/components/collab-sidebar/notes.mjs +8 -6
  37. package/build-module/components/collab-sidebar/notes.mjs.map +2 -2
  38. package/build-module/components/collab-sidebar/utils.mjs +22 -8
  39. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  40. package/build-module/components/collaborators-presence/index.mjs +0 -10
  41. package/build-module/components/collaborators-presence/index.mjs.map +3 -3
  42. package/build-module/components/collaborators-presence/list.mjs +0 -10
  43. package/build-module/components/collaborators-presence/list.mjs.map +3 -3
  44. package/build-module/components/post-last-revision/index.mjs +5 -0
  45. package/build-module/components/post-last-revision/index.mjs.map +2 -2
  46. package/build-module/components/post-publish-panel/index.mjs +120 -129
  47. package/build-module/components/post-publish-panel/index.mjs.map +2 -2
  48. package/build-module/components/post-revisions-preview/block-diff.mjs +91 -23
  49. package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
  50. package/build-module/components/post-revisions-preview/diff-markers.mjs +3 -2
  51. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  52. package/build-module/components/post-revisions-preview/revisions-slider.mjs +101 -53
  53. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  54. package/build-module/store/private-actions.mjs +20 -0
  55. package/build-module/store/private-actions.mjs.map +2 -2
  56. package/build-module/store/private-selectors.mjs +95 -43
  57. package/build-module/store/private-selectors.mjs.map +2 -2
  58. package/build-module/store/reducer.mjs +14 -0
  59. package/build-module/store/reducer.mjs.map +2 -2
  60. package/build-module/store/selectors.mjs.map +2 -2
  61. package/build-style/style-rtl.css +398 -33
  62. package/build-style/style.css +398 -33
  63. package/build-types/bindings/api.d.ts +1 -1
  64. package/build-types/bindings/api.d.ts.map +1 -1
  65. package/build-types/bindings/pattern-overrides.d.ts +8 -5
  66. package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
  67. package/build-types/bindings/post-data.d.ts +8 -5
  68. package/build-types/bindings/post-data.d.ts.map +1 -1
  69. package/build-types/bindings/post-meta.d.ts +10 -7
  70. package/build-types/bindings/post-meta.d.ts.map +1 -1
  71. package/build-types/bindings/term-data.d.ts +9 -6
  72. package/build-types/bindings/term-data.d.ts.map +1 -1
  73. package/build-types/components/autocompleters/index.d.ts +2 -2
  74. package/build-types/components/autocompleters/index.d.ts.map +1 -1
  75. package/build-types/components/autocompleters/link.d.ts +6 -10
  76. package/build-types/components/autocompleters/link.d.ts.map +1 -1
  77. package/build-types/components/autocompleters/user.d.ts +7 -12
  78. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  79. package/build-types/components/autosave-monitor/index.d.ts +28 -4
  80. package/build-types/components/autosave-monitor/index.d.ts.map +1 -1
  81. package/build-types/components/block-removal-warnings/index.d.ts +3 -0
  82. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -1
  83. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +7 -7
  84. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  85. package/build-types/components/block-visibility/index.d.ts.map +1 -1
  86. package/build-types/components/blog-title/index.d.ts.map +1 -1
  87. package/build-types/components/character-count/index.d.ts.map +1 -1
  88. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +2 -2
  89. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -1
  90. package/build-types/components/collab-sidebar/add-note.d.ts +2 -2
  91. package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -1
  92. package/build-types/components/collab-sidebar/board-store.d.ts +1 -1
  93. package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -1
  94. package/build-types/components/collab-sidebar/constants.d.ts +3 -3
  95. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -1
  96. package/build-types/components/collab-sidebar/floating-container.d.ts +3 -3
  97. package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -1
  98. package/build-types/components/collab-sidebar/hooks.d.ts +7 -7
  99. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  100. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  101. package/build-types/components/collab-sidebar/note-byline.d.ts +2 -2
  102. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
  103. package/build-types/components/collab-sidebar/note-card.d.ts +3 -3
  104. package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -1
  105. package/build-types/components/collab-sidebar/note-form.d.ts +4 -4
  106. package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -1
  107. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +2 -2
  108. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -1
  109. package/build-types/components/collab-sidebar/note-thread.d.ts +5 -5
  110. package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -1
  111. package/build-types/components/collab-sidebar/note.d.ts +4 -4
  112. package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
  113. package/build-types/components/collab-sidebar/notes.d.ts +2 -2
  114. package/build-types/components/collab-sidebar/notes.d.ts.map +1 -1
  115. package/build-types/components/collab-sidebar/utils.d.ts +17 -24
  116. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  117. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts.map +1 -1
  118. package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -1
  119. package/build-types/components/collaborators-overlay/index.d.ts +4 -1
  120. package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
  121. package/build-types/components/collaborators-overlay/overlay.d.ts +1 -1
  122. package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
  123. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
  124. package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -1
  125. package/build-types/components/collaborators-presence/index.d.ts +1 -2
  126. package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
  127. package/build-types/components/collaborators-presence/list.d.ts +1 -2
  128. package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
  129. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -1
  130. package/build-types/components/commands/index.d.ts.map +1 -1
  131. package/build-types/components/deprecated.d.ts +82 -53
  132. package/build-types/components/deprecated.d.ts.map +1 -1
  133. package/build-types/components/document-bar/index.d.ts +3 -3
  134. package/build-types/components/document-bar/index.d.ts.map +1 -1
  135. package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -1
  136. package/build-types/components/document-outline/check.d.ts +2 -2
  137. package/build-types/components/document-outline/check.d.ts.map +1 -1
  138. package/build-types/components/document-outline/index.d.ts +2 -2
  139. package/build-types/components/document-outline/index.d.ts.map +1 -1
  140. package/build-types/components/document-outline/item.d.ts +5 -5
  141. package/build-types/components/document-outline/item.d.ts.map +1 -1
  142. package/build-types/components/document-tools/index.d.ts +1 -1
  143. package/build-types/components/document-tools/index.d.ts.map +1 -1
  144. package/build-types/components/editor/index.d.ts +7 -7
  145. package/build-types/components/editor/index.d.ts.map +1 -1
  146. package/build-types/components/editor-history/redo.d.ts +11 -2
  147. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  148. package/build-types/components/editor-history/undo.d.ts +11 -2
  149. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  150. package/build-types/components/editor-interface/index.d.ts +5 -5
  151. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  152. package/build-types/components/editor-notices/index.d.ts +1 -1
  153. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  154. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  155. package/build-types/components/entities-saved-states/entity-record-item.d.ts +1 -1
  156. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  157. package/build-types/components/entities-saved-states/entity-type-list.d.ts +2 -2
  158. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  159. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +10 -1
  160. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
  161. package/build-types/components/entities-saved-states/index.d.ts +4 -4
  162. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  163. package/build-types/components/error-boundary/index.d.ts +18 -8
  164. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  165. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
  166. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +1 -1
  167. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -1
  168. package/build-types/components/global-styles/block-link.d.ts +1 -1
  169. package/build-types/components/global-styles/block-link.d.ts.map +1 -1
  170. package/build-types/components/global-styles/header.d.ts +2 -2
  171. package/build-types/components/global-styles/header.d.ts.map +1 -1
  172. package/build-types/components/global-styles/hooks.d.ts +3 -3
  173. package/build-types/components/global-styles/hooks.d.ts.map +1 -1
  174. package/build-types/components/global-styles/index.d.ts +3 -3
  175. package/build-types/components/global-styles/index.d.ts.map +1 -1
  176. package/build-types/components/global-styles/menu.d.ts +2 -2
  177. package/build-types/components/global-styles/menu.d.ts.map +1 -1
  178. package/build-types/components/global-styles-provider/index.d.ts +1 -1
  179. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  180. package/build-types/components/global-styles-renderer/index.d.ts +1 -1
  181. package/build-types/components/global-styles-renderer/index.d.ts.map +1 -1
  182. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +6 -6
  183. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -1
  184. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -1
  185. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +1 -1
  186. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -1
  187. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -1
  188. package/build-types/components/header/back-button.d.ts +3 -3
  189. package/build-types/components/header/back-button.d.ts.map +1 -1
  190. package/build-types/components/header/header-skeleton.d.ts +5 -5
  191. package/build-types/components/header/header-skeleton.d.ts.map +1 -1
  192. package/build-types/components/header/index.d.ts +2 -2
  193. package/build-types/components/header/index.d.ts.map +1 -1
  194. package/build-types/components/index.d.ts +94 -91
  195. package/build-types/components/index.d.ts.map +1 -1
  196. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  197. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +3 -3
  198. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -1
  199. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +1 -1
  200. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -1
  201. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +1 -1
  202. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -1
  203. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +3 -3
  204. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -1
  205. package/build-types/components/list-view-sidebar/index.d.ts.map +1 -1
  206. package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -1
  207. package/build-types/components/local-autosave-monitor/index.d.ts +12 -0
  208. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  209. package/build-types/components/media/index.d.ts +2 -2
  210. package/build-types/components/media/index.d.ts.map +1 -1
  211. package/build-types/components/media/media-editor-modal.d.ts.map +1 -1
  212. package/build-types/components/media/metadata-panel.d.ts.map +1 -1
  213. package/build-types/components/media/preview.d.ts.map +1 -1
  214. package/build-types/components/media-categories/index.d.ts +11 -4
  215. package/build-types/components/media-categories/index.d.ts.map +1 -1
  216. package/build-types/components/mode-switcher/index.d.ts +1 -1
  217. package/build-types/components/mode-switcher/index.d.ts.map +1 -1
  218. package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -1
  219. package/build-types/components/more-menu/index.d.ts.map +1 -1
  220. package/build-types/components/more-menu/tools-more-menu-group.d.ts +2 -2
  221. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  222. package/build-types/components/more-menu/view-more-menu-group.d.ts +2 -2
  223. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  224. package/build-types/components/page-attributes/check.d.ts +3 -3
  225. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  226. package/build-types/components/page-attributes/order.d.ts +1 -1
  227. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  228. package/build-types/components/page-attributes/panel.d.ts +1 -1
  229. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  230. package/build-types/components/page-attributes/parent.d.ts +3 -3
  231. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  232. package/build-types/components/pattern-duplicate-modal/index.d.ts +1 -1
  233. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -1
  234. package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -1
  235. package/build-types/components/pattern-rename-modal/index.d.ts +1 -1
  236. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -1
  237. package/build-types/components/plugin-document-setting-panel/index.d.ts +8 -61
  238. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  239. package/build-types/components/plugin-more-menu-item/index.d.ts +5 -5
  240. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  241. package/build-types/components/plugin-post-publish-panel/index.d.ts +9 -40
  242. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  243. package/build-types/components/plugin-post-status-info/index.d.ts +6 -47
  244. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  245. package/build-types/components/plugin-pre-publish-panel/index.d.ts +9 -43
  246. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  247. package/build-types/components/plugin-preview-menu-item/index.d.ts +5 -5
  248. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  249. package/build-types/components/plugin-sidebar/index.d.ts +4 -4
  250. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  251. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +3 -3
  252. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  253. package/build-types/components/post-actions/actions.d.ts +3 -3
  254. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  255. package/build-types/components/post-actions/index.d.ts +4 -4
  256. package/build-types/components/post-actions/index.d.ts.map +1 -1
  257. package/build-types/components/post-actions/set-as-homepage.d.ts +2 -2
  258. package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
  259. package/build-types/components/post-actions/set-as-posts-page.d.ts +2 -2
  260. package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -1
  261. package/build-types/components/post-author/check.d.ts +2 -2
  262. package/build-types/components/post-author/check.d.ts.map +1 -1
  263. package/build-types/components/post-author/combobox.d.ts.map +1 -1
  264. package/build-types/components/post-author/constants.d.ts +10 -8
  265. package/build-types/components/post-author/constants.d.ts.map +1 -1
  266. package/build-types/components/post-author/hook.d.ts +1 -1
  267. package/build-types/components/post-author/hook.d.ts.map +1 -1
  268. package/build-types/components/post-author/index.d.ts +2 -2
  269. package/build-types/components/post-author/index.d.ts.map +1 -1
  270. package/build-types/components/post-author/panel.d.ts +1 -1
  271. package/build-types/components/post-author/panel.d.ts.map +1 -1
  272. package/build-types/components/post-author/select.d.ts.map +1 -1
  273. package/build-types/components/post-card-panel/index.d.ts +7 -7
  274. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  275. package/build-types/components/post-comments/index.d.ts +6 -1
  276. package/build-types/components/post-comments/index.d.ts.map +1 -1
  277. package/build-types/components/post-content-information/index.d.ts +1 -1
  278. package/build-types/components/post-content-information/index.d.ts.map +1 -1
  279. package/build-types/components/post-discussion/panel.d.ts +1 -1
  280. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  281. package/build-types/components/post-excerpt/check.d.ts +3 -3
  282. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  283. package/build-types/components/post-excerpt/index.d.ts +3 -3
  284. package/build-types/components/post-excerpt/index.d.ts.map +1 -1
  285. package/build-types/components/post-excerpt/panel.d.ts +2 -2
  286. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  287. package/build-types/components/post-excerpt/plugin.d.ts +6 -43
  288. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  289. package/build-types/components/post-featured-image/check.d.ts +3 -3
  290. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  291. package/build-types/components/post-featured-image/index.d.ts +15 -0
  292. package/build-types/components/post-featured-image/index.d.ts.map +1 -1
  293. package/build-types/components/post-featured-image/panel.d.ts +1 -1
  294. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  295. package/build-types/components/post-fields/index.d.ts +1 -1
  296. package/build-types/components/post-fields/index.d.ts.map +1 -1
  297. package/build-types/components/post-format/check.d.ts +2 -2
  298. package/build-types/components/post-format/check.d.ts.map +1 -1
  299. package/build-types/components/post-format/index.d.ts +12 -12
  300. package/build-types/components/post-format/index.d.ts.map +1 -1
  301. package/build-types/components/post-format/panel.d.ts +2 -2
  302. package/build-types/components/post-format/panel.d.ts.map +1 -1
  303. package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -1
  304. package/build-types/components/post-last-revision/check.d.ts +3 -3
  305. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  306. package/build-types/components/post-last-revision/index.d.ts +3 -3
  307. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  308. package/build-types/components/post-last-revision/panel.d.ts +2 -2
  309. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  310. package/build-types/components/post-locked-modal/index.d.ts +11 -5
  311. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  312. package/build-types/components/post-panel-row/index.d.ts +1 -1
  313. package/build-types/components/post-panel-row/index.d.ts.map +1 -1
  314. package/build-types/components/post-panel-section/index.d.ts +2 -2
  315. package/build-types/components/post-panel-section/index.d.ts.map +1 -1
  316. package/build-types/components/post-pending-status/check.d.ts +3 -3
  317. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  318. package/build-types/components/post-pending-status/index.d.ts +1 -1
  319. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  320. package/build-types/components/post-pingbacks/index.d.ts +7 -1
  321. package/build-types/components/post-pingbacks/index.d.ts.map +1 -1
  322. package/build-types/components/post-preview-button/index.d.ts +2 -2
  323. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  324. package/build-types/components/post-publish-button/index.d.ts +5 -5
  325. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  326. package/build-types/components/post-publish-button/label.d.ts.map +1 -1
  327. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +1 -1
  328. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -1
  329. package/build-types/components/post-publish-panel/index.d.ts +17 -13
  330. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  331. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +1 -1
  332. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  333. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  334. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +1 -1
  335. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
  336. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  337. package/build-types/components/post-publish-panel/media-util.d.ts +2 -2
  338. package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -1
  339. package/build-types/components/post-publish-panel/postpublish.d.ts +2 -2
  340. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -1
  341. package/build-types/components/post-publish-panel/prepublish.d.ts +1 -1
  342. package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -1
  343. package/build-types/components/post-revisions-panel/index.d.ts.map +1 -1
  344. package/build-types/components/post-revisions-preview/block-diff.d.ts +1 -1
  345. package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
  346. package/build-types/components/post-revisions-preview/diff-format-types.d.ts +2 -2
  347. package/build-types/components/post-revisions-preview/diff-format-types.d.ts.map +1 -1
  348. package/build-types/components/post-revisions-preview/diff-markers.d.ts +1 -1
  349. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  350. package/build-types/components/post-revisions-preview/index.d.ts +2 -2
  351. package/build-types/components/post-revisions-preview/index.d.ts.map +1 -1
  352. package/build-types/components/post-revisions-preview/preserve-client-ids.d.ts +1 -1
  353. package/build-types/components/post-revisions-preview/preserve-client-ids.d.ts.map +1 -1
  354. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +1 -1
  355. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
  356. package/build-types/components/post-revisions-preview/revisions-header.d.ts +2 -2
  357. package/build-types/components/post-revisions-preview/revisions-header.d.ts.map +1 -1
  358. package/build-types/components/post-revisions-preview/revisions-slider.d.ts +3 -3
  359. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  360. package/build-types/components/post-saved-state/index.d.ts +1 -1
  361. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  362. package/build-types/components/post-schedule/check.d.ts +2 -2
  363. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  364. package/build-types/components/post-schedule/index.d.ts +3 -3
  365. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  366. package/build-types/components/post-schedule/label.d.ts +4 -4
  367. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  368. package/build-types/components/post-schedule/panel.d.ts +1 -1
  369. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  370. package/build-types/components/post-status/index.d.ts +2 -2
  371. package/build-types/components/post-status/index.d.ts.map +1 -1
  372. package/build-types/components/post-sticky/check.d.ts +2 -2
  373. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  374. package/build-types/components/post-sticky/index.d.ts +1 -1
  375. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  376. package/build-types/components/post-sticky/panel.d.ts +1 -1
  377. package/build-types/components/post-sticky/panel.d.ts.map +1 -1
  378. package/build-types/components/post-switch-to-draft-button/index.d.ts +1 -1
  379. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  380. package/build-types/components/post-sync-status/index.d.ts +1 -1
  381. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  382. package/build-types/components/post-taxonomies/check.d.ts +2 -2
  383. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  384. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +4 -4
  385. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  386. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +6 -6
  387. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  388. package/build-types/components/post-taxonomies/index.d.ts +9 -1
  389. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  390. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  391. package/build-types/components/post-taxonomies/panel.d.ts +1 -1
  392. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
  393. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  394. package/build-types/components/post-template/classic-theme.d.ts +8 -1
  395. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  396. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  397. package/build-types/components/post-template/create-new-template.d.ts.map +1 -1
  398. package/build-types/components/post-template/hooks.d.ts +5 -5
  399. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  400. package/build-types/components/post-template/panel.d.ts +1 -1
  401. package/build-types/components/post-template/panel.d.ts.map +1 -1
  402. package/build-types/components/post-template/reset-default-template.d.ts.map +1 -1
  403. package/build-types/components/post-template/swap-template-button.d.ts +1 -1
  404. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
  405. package/build-types/components/post-text-editor/index.d.ts +1 -1
  406. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  407. package/build-types/components/post-title/constants.d.ts +2 -2
  408. package/build-types/components/post-title/constants.d.ts.map +1 -1
  409. package/build-types/components/post-title/index.d.ts +9 -1
  410. package/build-types/components/post-title/index.d.ts.map +1 -1
  411. package/build-types/components/post-title/post-title-raw.d.ts +1 -1
  412. package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -1
  413. package/build-types/components/post-title/use-post-title.d.ts.map +1 -1
  414. package/build-types/components/post-transform-panel/hooks.d.ts +1 -1
  415. package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -1
  416. package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
  417. package/build-types/components/post-trash/check.d.ts +2 -2
  418. package/build-types/components/post-trash/check.d.ts.map +1 -1
  419. package/build-types/components/post-trash/index.d.ts +1 -1
  420. package/build-types/components/post-trash/index.d.ts.map +1 -1
  421. package/build-types/components/post-type-support-check/index.d.ts +3 -3
  422. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  423. package/build-types/components/post-url/check.d.ts +2 -2
  424. package/build-types/components/post-url/check.d.ts.map +1 -1
  425. package/build-types/components/post-url/index.d.ts +1 -1
  426. package/build-types/components/post-url/index.d.ts.map +1 -1
  427. package/build-types/components/post-url/label.d.ts +2 -2
  428. package/build-types/components/post-url/label.d.ts.map +1 -1
  429. package/build-types/components/post-url/panel.d.ts +1 -1
  430. package/build-types/components/post-url/panel.d.ts.map +1 -1
  431. package/build-types/components/post-view-link/index.d.ts.map +1 -1
  432. package/build-types/components/post-visibility/check.d.ts +1 -1
  433. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  434. package/build-types/components/post-visibility/index.d.ts +1 -1
  435. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  436. package/build-types/components/post-visibility/label.d.ts +1 -1
  437. package/build-types/components/post-visibility/label.d.ts.map +1 -1
  438. package/build-types/components/post-visibility/utils.d.ts +1 -1
  439. package/build-types/components/post-visibility/utils.d.ts.map +1 -1
  440. package/build-types/components/posts-per-page/index.d.ts.map +1 -1
  441. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
  442. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +4 -5
  443. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  444. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
  445. package/build-types/components/preferences-modal/index.d.ts +3 -0
  446. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  447. package/build-types/components/preview-dropdown/index.d.ts +1 -1
  448. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  449. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  450. package/build-types/components/provider/index.d.ts +33 -33
  451. package/build-types/components/provider/index.d.ts.map +1 -1
  452. package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -1
  453. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +1 -1
  454. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -1
  455. package/build-types/components/provider/use-block-editor-settings.d.ts +1 -1
  456. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  457. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +1 -1
  458. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -1
  459. package/build-types/components/provider/use-post-content-block-types.d.ts.map +1 -1
  460. package/build-types/components/provider/use-revision-blocks.d.ts +1 -1
  461. package/build-types/components/provider/use-revision-blocks.d.ts.map +1 -1
  462. package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
  463. package/build-types/components/provider/with-registry-provider.d.ts +1 -1
  464. package/build-types/components/provider/with-registry-provider.d.ts.map +1 -1
  465. package/build-types/components/resizable-editor/index.d.ts +2 -2
  466. package/build-types/components/resizable-editor/index.d.ts.map +1 -1
  467. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  468. package/build-types/components/revision-author-panel/index.d.ts.map +1 -1
  469. package/build-types/components/revision-block-diff/index.d.ts.map +1 -1
  470. package/build-types/components/revision-created-panel/index.d.ts.map +1 -1
  471. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -1
  472. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
  473. package/build-types/components/save-publish-panels/index.d.ts +7 -7
  474. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  475. package/build-types/components/sidebar/constants.d.ts +4 -4
  476. package/build-types/components/sidebar/constants.d.ts.map +1 -1
  477. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  478. package/build-types/components/sidebar/header.d.ts +1 -1
  479. package/build-types/components/sidebar/index.d.ts +3 -3
  480. package/build-types/components/sidebar/index.d.ts.map +1 -1
  481. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
  482. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  483. package/build-types/components/site-discussion/index.d.ts.map +1 -1
  484. package/build-types/components/start-page-options/index.d.ts +1 -1
  485. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  486. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  487. package/build-types/components/style-book/categories.d.ts +3 -0
  488. package/build-types/components/style-book/categories.d.ts.map +1 -1
  489. package/build-types/components/style-book/color-examples.d.ts.map +1 -1
  490. package/build-types/components/style-book/duotone-examples.d.ts.map +1 -1
  491. package/build-types/components/style-book/index.d.ts +19 -8
  492. package/build-types/components/style-book/index.d.ts.map +1 -1
  493. package/build-types/components/styles-canvas/index.d.ts +2 -2
  494. package/build-types/components/styles-canvas/index.d.ts.map +1 -1
  495. package/build-types/components/styles-canvas/revisions.d.ts +1 -1
  496. package/build-types/components/styles-canvas/style-book.d.ts +1 -1
  497. package/build-types/components/table-of-contents/index.d.ts +11 -1
  498. package/build-types/components/table-of-contents/index.d.ts.map +1 -1
  499. package/build-types/components/table-of-contents/panel.d.ts +1 -1
  500. package/build-types/components/table-of-contents/panel.d.ts.map +1 -1
  501. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  502. package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -1
  503. package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
  504. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  505. package/build-types/components/template-part-content-panel/index.d.ts.map +1 -1
  506. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -1
  507. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +1 -1
  508. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -1
  509. package/build-types/components/template-part-menu-items/index.d.ts.map +1 -1
  510. package/build-types/components/template-validation-notice/index.d.ts.map +1 -1
  511. package/build-types/components/text-editor/index.d.ts.map +1 -1
  512. package/build-types/components/theme-support-check/index.d.ts +2 -2
  513. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  514. package/build-types/components/time-to-read/index.d.ts +1 -1
  515. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  516. package/build-types/components/unsaved-changes-warning/index.d.ts +1 -1
  517. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  518. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
  519. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  520. package/build-types/components/visual-editor/index.d.ts +4 -4
  521. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  522. package/build-types/components/visual-editor/use-edit-content-only-section-exit.d.ts +1 -1
  523. package/build-types/components/visual-editor/use-edit-content-only-section-exit.d.ts.map +1 -1
  524. package/build-types/components/visual-editor/use-padding-appender.d.ts +1 -1
  525. package/build-types/components/visual-editor/use-padding-appender.d.ts.map +1 -1
  526. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts +1 -1
  527. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -1
  528. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +1 -1
  529. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -1
  530. package/build-types/components/word-count/index.d.ts +1 -1
  531. package/build-types/components/word-count/index.d.ts.map +1 -1
  532. package/build-types/components/zoom-out-toggle/index.d.ts +3 -3
  533. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  534. package/build-types/dataviews/api.d.ts +6 -6
  535. package/build-types/dataviews/api.d.ts.map +1 -1
  536. package/build-types/dataviews/fields/content-preview/index.d.ts.map +1 -1
  537. package/build-types/dataviews/store/private-actions.d.ts +5 -5
  538. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  539. package/build-types/dataviews/store/reducer.d.ts +2 -2
  540. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  541. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +3 -9
  542. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  543. package/build-types/hooks/index.d.ts +10 -1
  544. package/build-types/hooks/index.d.ts.map +1 -1
  545. package/build-types/hooks/pattern-overrides.d.ts +1 -1
  546. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  547. package/build-types/hooks/use-global-styles-output.d.ts +2 -2
  548. package/build-types/hooks/use-global-styles-output.d.ts.map +1 -1
  549. package/build-types/index.d.ts +10 -5
  550. package/build-types/index.d.ts.map +1 -1
  551. package/build-types/lock-unlock.d.ts +1 -2
  552. package/build-types/lock-unlock.d.ts.map +1 -1
  553. package/build-types/private-apis.d.ts +1 -1
  554. package/build-types/private-apis.d.ts.map +1 -1
  555. package/build-types/store/actions.d.ts +330 -116
  556. package/build-types/store/actions.d.ts.map +1 -1
  557. package/build-types/store/constants.d.ts.map +1 -1
  558. package/build-types/store/defaults.d.ts +1 -1
  559. package/build-types/store/defaults.d.ts.map +1 -1
  560. package/build-types/store/index.d.ts +77 -9
  561. package/build-types/store/index.d.ts.map +1 -1
  562. package/build-types/store/local-autosave.d.ts +3 -3
  563. package/build-types/store/local-autosave.d.ts.map +1 -1
  564. package/build-types/store/private-actions.d.ts +106 -46
  565. package/build-types/store/private-actions.d.ts.map +1 -1
  566. package/build-types/store/private-selectors.d.ts +96 -68
  567. package/build-types/store/private-selectors.d.ts.map +1 -1
  568. package/build-types/store/reducer.d.ts +47 -52
  569. package/build-types/store/reducer.d.ts.map +1 -1
  570. package/build-types/store/selectors.d.ts +422 -429
  571. package/build-types/store/selectors.d.ts.map +1 -1
  572. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
  573. package/build-types/store/utils/notice-builder.d.ts +3 -3
  574. package/build-types/store/utils/notice-builder.d.ts.map +1 -1
  575. package/build-types/utils/get-item-title.d.ts +1 -1
  576. package/build-types/utils/get-item-title.d.ts.map +1 -1
  577. package/build-types/utils/get-template-info.d.ts +11 -4
  578. package/build-types/utils/get-template-info.d.ts.map +1 -1
  579. package/build-types/utils/get-template-part-icon.d.ts +1 -1
  580. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  581. package/build-types/utils/index.d.ts +6 -3
  582. package/build-types/utils/index.d.ts.map +1 -1
  583. package/build-types/utils/media-finalize/index.d.ts.map +1 -1
  584. package/build-types/utils/media-sideload/index.d.ts +1 -1
  585. package/build-types/utils/media-sideload/index.d.ts.map +1 -1
  586. package/build-types/utils/media-upload/index.d.ts +1 -1
  587. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  588. package/build-types/utils/media-upload/on-success.d.ts.map +1 -1
  589. package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
  590. package/build-types/utils/search-templates.d.ts +1 -1
  591. package/build-types/utils/search-templates.d.ts.map +1 -1
  592. package/build-types/utils/set-nested-value.d.ts.map +1 -1
  593. package/build-types/utils/terms.d.ts +19 -4
  594. package/build-types/utils/terms.d.ts.map +1 -1
  595. package/build-types/utils/url.d.ts +1 -1
  596. package/build-types/utils/url.d.ts.map +1 -1
  597. package/package.json +48 -48
  598. package/src/components/block-visibility/style.scss +2 -2
  599. package/src/components/collab-sidebar/index.js +48 -36
  600. package/src/components/collab-sidebar/note-thread.js +28 -10
  601. package/src/components/collab-sidebar/notes.js +9 -6
  602. package/src/components/collab-sidebar/style.scss +4 -0
  603. package/src/components/collab-sidebar/utils.js +41 -14
  604. package/src/components/collaborators-presence/index.tsx +0 -2
  605. package/src/components/collaborators-presence/list.tsx +0 -2
  606. package/src/components/post-last-revision/index.js +5 -0
  607. package/src/components/post-publish-panel/index.js +149 -156
  608. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +11 -26
  609. package/src/components/post-publish-panel/test/index.js +41 -23
  610. package/src/components/post-revisions-preview/block-diff.js +165 -41
  611. package/src/components/post-revisions-preview/diff-markers.js +12 -9
  612. package/src/components/post-revisions-preview/revisions-slider.js +130 -71
  613. package/src/components/post-revisions-preview/style.scss +3 -3
  614. package/src/components/post-revisions-preview/test/block-diff.js +133 -4
  615. package/src/components/post-template/style.scss +1 -1
  616. package/src/components/start-page-options/style.scss +2 -2
  617. package/src/components/start-template-options/style.scss +2 -2
  618. package/src/store/private-actions.js +34 -0
  619. package/src/store/private-selectors.js +127 -51
  620. package/src/store/reducer.js +21 -0
  621. package/src/store/selectors.js +6 -0
  622. package/src/store/test/private-selectors.js +107 -1
  623. package/src/style.scss +2 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/collaborators-presence/index.tsx", "../../../src/components/collaborators-presence/styles/collaborators-presence.scss"],
4
- "sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tprivateApis,\n\ttype PostEditorAwarenessState,\n} from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport Avatar from './avatar';\nimport AvatarGroup from './avatar-group';\nimport { CollaboratorsList } from './list';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { createCursorRegistry } from '../collaborators-overlay/cursor-registry';\n\nimport './styles/collaborators-presence.scss';\nimport { CollaboratorsOverlay } from '../collaborators-overlay';\n\nconst { useActiveCollaborators } = unlock( privateApis );\n\ninterface CollaboratorsPresenceProps {\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * Renders a list of avatars for the active collaborators, with a maximum of 3 visible avatars.\n * Shows a popover with all collaborators on hover.\n *\n * @param props CollaboratorsPresence component props\n * @param props.postId ID of the post\n * @param props.postType Type of the post\n */\nexport function CollaboratorsPresence( {\n\tpostId,\n\tpostType,\n}: CollaboratorsPresenceProps ) {\n\tconst activeCollaborators = useActiveCollaborators(\n\t\tpostId,\n\t\tpostType\n\t) as PostEditorAwarenessState[];\n\n\tconst otherActiveCollaborators = activeCollaborators.filter(\n\t\t( c ) => ! c.isMe\n\t);\n\n\t// Always include self in the list sorted first.\n\tconst collaboratorsForList = useMemo( () => {\n\t\treturn [ ...activeCollaborators ].sort( ( a, b ) => {\n\t\t\tif ( a.isMe && ! b.isMe ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( ! a.isMe && b.isMe ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} );\n\t}, [ activeCollaborators ] );\n\n\tconst [ cursorRegistry ] = useState( createCursorRegistry );\n\n\tconst [ isPopoverVisible, setIsPopoverVisible ] = useState( false );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(\n\t\tnull\n\t);\n\n\t// When there are no other collaborators, this component should not render\n\t// at all. This will always be the case when collaboration is not enabled, but\n\t// also when the current user is the only editor with the post open.\n\tif ( otherActiveCollaborators.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst me = activeCollaborators.find( ( c ) => c.isMe );\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-collaborators-presence\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"editor-collaborators-presence__button\"\n\t\t\t\t\tonClick={ () => setIsPopoverVisible( ! isPopoverVisible ) }\n\t\t\t\t\tisPressed={ isPopoverVisible }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %d: number of online collaborators.\n\t\t\t\t\t\t__( 'Collaborators list, %d online' ),\n\t\t\t\t\t\tcollaboratorsForList.length\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<AvatarGroup max={ 4 }>\n\t\t\t\t\t\t{ me && (\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\tkey={ me.clientId }\n\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\tme.collaboratorInfo.avatar_urls\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tname={ me.collaboratorInfo.name }\n\t\t\t\t\t\t\t\tborderColor=\"var(--wp-admin-theme-color)\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ otherActiveCollaborators.map(\n\t\t\t\t\t\t\t( collaboratorState ) => (\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AvatarGroup>\n\t\t\t\t</Button>\n\t\t\t\t{ isPopoverVisible && (\n\t\t\t\t\t<CollaboratorsList\n\t\t\t\t\t\tactiveCollaborators={ collaboratorsForList }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tsetIsPopoverVisible={ setIsPopoverVisible }\n\t\t\t\t\t\tcursorRegistry={ cursorRegistry }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<CollaboratorsOverlay\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tcursorRegistry={ cursorRegistry }\n\t\t\t/>\n\t\t</>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='9907eeab15']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"9907eeab15\");\n\tstyle.appendChild(document.createTextNode(\".editor-collaborators-presence{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-shrink:0;height:32px;margin-right:8px}.editor-collaborators-presence:has(.is-pressed),.editor-collaborators-presence:hover{background-color:#e0e0e0}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button{align-items:center;background:#0000;border-radius:4px;box-sizing:border-box;color:#2f2f2f;cursor:var(--wpds-cursor-control,pointer);display:flex;height:100%;padding:4px;position:relative}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed:hover,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:hover{background:#0000;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:focus:not(:active){box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus,2px) var(--wp-admin-theme-color,#007cba);outline:none}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,qBAAkC;AAClC,uBAGO;AACP,kBAA4B;AAE5B,oBAAmB;AACnB,0BAAwB;AACxB,kBAAkC;AAClC,yBAAuB;AACvB,4BAA6B;AAC7B,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SAAU,MAAM,oBAAqB,CAAE,gBAAiB;AAAA,UACxD,WAAY;AAAA,UACZ,KAAM;AAAA,UACN,kBAAa;AAAA;AAAA,gBAEZ,gBAAI,+BAAgC;AAAA,YACpC,qBAAqB;AAAA,UACtB;AAAA,UAEA,uDAAC,oBAAAA,SAAA,EAAY,KAAM,GAChB;AAAA,kBACD;AAAA,cAAC,cAAAC;AAAA,cAAA;AAAA,gBAEA,SAAM;AAAA,kBACL,GAAG,iBAAiB;AAAA,gBACrB;AAAA,gBACA,MAAO,GAAG,iBAAiB;AAAA,gBAC3B,aAAY;AAAA,gBACZ,MAAK;AAAA;AAAA,cANC,GAAG;AAAA,YAOV;AAAA,YAEC,yBAAyB;AAAA,cAC1B,CAAE,sBACD;AAAA,gBAAC,cAAAA;AAAA,gBAAA;AAAA,kBAEA,SAAM;AAAA,oBACL,kBAAkB,iBAChB;AAAA,kBACH;AAAA,kBACA,MACC,kBAAkB,iBAAiB;AAAA,kBAEpC,iBAAc;AAAA,oBACb,kBAAkB,iBAAiB;AAAA,kBACpC;AAAA,kBACA,MAAK;AAAA;AAAA,gBAXC,kBAAkB;AAAA,cAYzB;AAAA,YAEF;AAAA,aACD;AAAA;AAAA,MACD;AAAA,MACE,oBACD;AAAA,QAAC;AAAA;AAAA,UACA,qBAAsB;AAAA,UACtB;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
3
+ "sources": ["../../../src/components/collaborators-presence/index.tsx"],
4
+ "sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tprivateApis,\n\ttype PostEditorAwarenessState,\n} from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport Avatar from './avatar';\nimport AvatarGroup from './avatar-group';\nimport { CollaboratorsList } from './list';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { createCursorRegistry } from '../collaborators-overlay/cursor-registry';\nimport { CollaboratorsOverlay } from '../collaborators-overlay';\n\nconst { useActiveCollaborators } = unlock( privateApis );\n\ninterface CollaboratorsPresenceProps {\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * Renders a list of avatars for the active collaborators, with a maximum of 3 visible avatars.\n * Shows a popover with all collaborators on hover.\n *\n * @param props CollaboratorsPresence component props\n * @param props.postId ID of the post\n * @param props.postType Type of the post\n */\nexport function CollaboratorsPresence( {\n\tpostId,\n\tpostType,\n}: CollaboratorsPresenceProps ) {\n\tconst activeCollaborators = useActiveCollaborators(\n\t\tpostId,\n\t\tpostType\n\t) as PostEditorAwarenessState[];\n\n\tconst otherActiveCollaborators = activeCollaborators.filter(\n\t\t( c ) => ! c.isMe\n\t);\n\n\t// Always include self in the list sorted first.\n\tconst collaboratorsForList = useMemo( () => {\n\t\treturn [ ...activeCollaborators ].sort( ( a, b ) => {\n\t\t\tif ( a.isMe && ! b.isMe ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( ! a.isMe && b.isMe ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} );\n\t}, [ activeCollaborators ] );\n\n\tconst [ cursorRegistry ] = useState( createCursorRegistry );\n\n\tconst [ isPopoverVisible, setIsPopoverVisible ] = useState( false );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(\n\t\tnull\n\t);\n\n\t// When there are no other collaborators, this component should not render\n\t// at all. This will always be the case when collaboration is not enabled, but\n\t// also when the current user is the only editor with the post open.\n\tif ( otherActiveCollaborators.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst me = activeCollaborators.find( ( c ) => c.isMe );\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-collaborators-presence\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"editor-collaborators-presence__button\"\n\t\t\t\t\tonClick={ () => setIsPopoverVisible( ! isPopoverVisible ) }\n\t\t\t\t\tisPressed={ isPopoverVisible }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %d: number of online collaborators.\n\t\t\t\t\t\t__( 'Collaborators list, %d online' ),\n\t\t\t\t\t\tcollaboratorsForList.length\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<AvatarGroup max={ 4 }>\n\t\t\t\t\t\t{ me && (\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\tkey={ me.clientId }\n\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\tme.collaboratorInfo.avatar_urls\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tname={ me.collaboratorInfo.name }\n\t\t\t\t\t\t\t\tborderColor=\"var(--wp-admin-theme-color)\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ otherActiveCollaborators.map(\n\t\t\t\t\t\t\t( collaboratorState ) => (\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AvatarGroup>\n\t\t\t\t</Button>\n\t\t\t\t{ isPopoverVisible && (\n\t\t\t\t\t<CollaboratorsList\n\t\t\t\t\t\tactiveCollaborators={ collaboratorsForList }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tsetIsPopoverVisible={ setIsPopoverVisible }\n\t\t\t\t\t\tcursorRegistry={ cursorRegistry }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<CollaboratorsOverlay\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tcursorRegistry={ cursorRegistry }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,qBAAkC;AAClC,uBAGO;AACP,kBAA4B;AAE5B,oBAAmB;AACnB,0BAAwB;AACxB,kBAAkC;AAClC,yBAAuB;AACvB,4BAA6B;AAC7B,mBAAqC;AACrC,6BAAqC;AACrC,mCAAqC;AA4DnC;AA1DF,IAAM,EAAE,uBAAuB,QAAI,2BAAQ,4BAAY;AAehD,SAAS,sBAAuB;AAAA,EACtC;AAAA,EACA;AACD,GAAgC;AAC/B,QAAM,sBAAsB;AAAA,IAC3B;AAAA,IACA;AAAA,EACD;AAEA,QAAM,2BAA2B,oBAAoB;AAAA,IACpD,CAAE,MAAO,CAAE,EAAE;AAAA,EACd;AAGA,QAAM,2BAAuB,wBAAS,MAAM;AAC3C,WAAO,CAAE,GAAG,mBAAoB,EAAE,KAAM,CAAE,GAAG,MAAO;AACnD,UAAK,EAAE,QAAQ,CAAE,EAAE,MAAO;AACzB,eAAO;AAAA,MACR;AACA,UAAK,CAAE,EAAE,QAAQ,EAAE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AA;AAAA,MACD;AAAA,MACE,oBACD;AAAA,QAAC;AAAA;AAAA,UACA,qBAAsB;AAAA,UACtB;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
6
6
  "names": ["AvatarGroup", "Avatar"]
7
7
  }
@@ -40,16 +40,6 @@ var import_a11y = require("@wordpress/a11y");
40
40
  var import_avatar = __toESM(require("./avatar/index.cjs"));
41
41
  var import_get_avatar_url = require("../collaborators-overlay/get-avatar-url.cjs");
42
42
  var import_utils = require("../collab-sidebar/utils.cjs");
43
-
44
- // packages/editor/src/components/collaborators-presence/styles/collaborators-list.scss
45
- if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='b52a84ee9f']")) {
46
- const style = document.createElement("style");
47
- style.setAttribute("data-wp-hash", "b52a84ee9f");
48
- style.appendChild(document.createTextNode(".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:8px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{display:flex;font-size:13px;font-weight:499;gap:4px;line-height:20px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:32px;padding:0;width:32px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding-bottom:16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);display:flex;gap:8px;padding:12px 16px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#3858e9);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;min-width:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-name{color:#1e1e1e;font-size:13px;font-weight:499;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"));
49
- document.head.appendChild(style);
50
- }
51
-
52
- // packages/editor/src/components/collaborators-presence/list.tsx
53
43
  var import_jsx_runtime = require("react/jsx-runtime");
54
44
  function CollaboratorsList({
55
45
  activeCollaborators,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/collaborators-presence/list.tsx", "../../../src/components/collaborators-presence/styles/collaborators-list.scss"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Popover, Button } from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { type PostEditorAwarenessState } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\n\nimport Avatar from './avatar';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { type CursorRegistry } from '../collaborators-overlay/cursor-registry';\n\nimport './styles/collaborators-list.scss';\n\ninterface CollaboratorsListProps {\n\tactiveCollaborators: PostEditorAwarenessState[];\n\tpopoverAnchor?: HTMLElement | null;\n\tsetIsPopoverVisible: ( isVisible: boolean ) => void;\n\tcursorRegistry: CursorRegistry;\n}\n\n/**\n * Renders a list showing all active collaborators with their details.\n * When the showCollaborationCursor preference is enabled, the current user\n * is included and expected to be first in the list.\n * @param props Component props\n * @param props.activeCollaborators List of active collaborators\n * @param props.popoverAnchor Anchor element for the popover\n * @param props.setIsPopoverVisible Callback to set the visibility of the popover\n * @param props.cursorRegistry Shared registry for scroll-to-cursor support\n */\nexport function CollaboratorsList( {\n\tactiveCollaborators,\n\tpopoverAnchor,\n\tsetIsPopoverVisible,\n\tcursorRegistry,\n}: CollaboratorsListProps ) {\n\tconst handleCollaboratorClick = ( clientId: number ) => {\n\t\tconst success = cursorRegistry.scrollToCursor( clientId, {\n\t\t\tbehavior: 'smooth',\n\t\t\tblock: 'center',\n\t\t\thighlightDuration: 2000,\n\t\t} );\n\n\t\tif ( success ) {\n\t\t\tspeak( __( 'Scrolled to cursor' ), 'polite' );\n\n\t\t\tsetIsPopoverVisible( false );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Popover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tplacement=\"bottom\"\n\t\t\toffset={ 8 }\n\t\t\tclassName=\"editor-collaborators-presence__list\"\n\t\t\tonClose={ () => setIsPopoverVisible( false ) }\n\t\t>\n\t\t\t<div className=\"editor-collaborators-presence__list-content\">\n\t\t\t\t<div className=\"editor-collaborators-presence__list-header\">\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-title\">\n\t\t\t\t\t\t{ __( 'Collaborators' ) }\n\t\t\t\t\t\t<span>{ activeCollaborators.length }</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-action\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tlabel={ __( 'Close Collaborators List' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsPopoverVisible( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-collaborators-presence__list-items\">\n\t\t\t\t\t{ activeCollaborators.map( ( collaboratorState ) => {\n\t\t\t\t\t\tconst isCurrentUser = collaboratorState.isMe;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\tclassName=\"editor-collaborators-presence__list-item\"\n\t\t\t\t\t\t\t\tdisabled={ isCurrentUser }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\thandleCollaboratorClick(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.clientId\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={\n\t\t\t\t\t\t\t\t\t\tisCurrentUser\n\t\t\t\t\t\t\t\t\t\t\t? 'var(--wp-admin-theme-color)'\n\t\t\t\t\t\t\t\t\t\t\t: getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcollaboratorState\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdimmed={ ! collaboratorState.isConnected }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-info\">\n\t\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-name\">\n\t\t\t\t\t\t\t\t\t\t{ isCurrentUser\n\t\t\t\t\t\t\t\t\t\t\t? __( 'You' )\n\t\t\t\t\t\t\t\t\t\t\t: collaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t\t\t.name }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='b52a84ee9f']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"b52a84ee9f\");\n\tstyle.appendChild(document.createTextNode(\".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:8px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{display:flex;font-size:13px;font-weight:499;gap:4px;line-height:20px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:32px;padding:0;width:32px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding-bottom:16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);display:flex;gap:8px;padding:12px 16px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#3858e9);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;min-width:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-name{color:#1e1e1e;font-size:13px;font-weight:499;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAChC,mBAA2B;AAE3B,kBAAsB;AAEtB,oBAAmB;AACnB,4BAA6B;AAC7B,mBAAqC;;;ACRrC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,ojFAAojF,CAAC;AAC/lF,WAAS,KAAK,YAAY,KAAK;AAChC;;;ADuDK;AA9BE,SAAS,kBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAA4B;AAC3B,QAAM,0BAA0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AC9B;AAAA,gBACA,4CAAC,SAAI,WAAU,iDACd,sDAAC,SAAI,WAAU,iDACZ,8BACC,gBAAI,KAAM,IACV,kBAAkB,iBACjB,MACL,GACD;AAAA;AAAA;AAAA,YAlCM,kBAAkB;AAAA,UAmCzB;AAAA,QAEF,CAAE,GACH;AAAA,SACD;AAAA;AAAA,EACD;AAEF;",
3
+ "sources": ["../../../src/components/collaborators-presence/list.tsx"],
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Popover, Button } from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { type PostEditorAwarenessState } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\n\nimport Avatar from './avatar';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { type CursorRegistry } from '../collaborators-overlay/cursor-registry';\n\ninterface CollaboratorsListProps {\n\tactiveCollaborators: PostEditorAwarenessState[];\n\tpopoverAnchor?: HTMLElement | null;\n\tsetIsPopoverVisible: ( isVisible: boolean ) => void;\n\tcursorRegistry: CursorRegistry;\n}\n\n/**\n * Renders a list showing all active collaborators with their details.\n * When the showCollaborationCursor preference is enabled, the current user\n * is included and expected to be first in the list.\n * @param props Component props\n * @param props.activeCollaborators List of active collaborators\n * @param props.popoverAnchor Anchor element for the popover\n * @param props.setIsPopoverVisible Callback to set the visibility of the popover\n * @param props.cursorRegistry Shared registry for scroll-to-cursor support\n */\nexport function CollaboratorsList( {\n\tactiveCollaborators,\n\tpopoverAnchor,\n\tsetIsPopoverVisible,\n\tcursorRegistry,\n}: CollaboratorsListProps ) {\n\tconst handleCollaboratorClick = ( clientId: number ) => {\n\t\tconst success = cursorRegistry.scrollToCursor( clientId, {\n\t\t\tbehavior: 'smooth',\n\t\t\tblock: 'center',\n\t\t\thighlightDuration: 2000,\n\t\t} );\n\n\t\tif ( success ) {\n\t\t\tspeak( __( 'Scrolled to cursor' ), 'polite' );\n\n\t\t\tsetIsPopoverVisible( false );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Popover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tplacement=\"bottom\"\n\t\t\toffset={ 8 }\n\t\t\tclassName=\"editor-collaborators-presence__list\"\n\t\t\tonClose={ () => setIsPopoverVisible( false ) }\n\t\t>\n\t\t\t<div className=\"editor-collaborators-presence__list-content\">\n\t\t\t\t<div className=\"editor-collaborators-presence__list-header\">\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-title\">\n\t\t\t\t\t\t{ __( 'Collaborators' ) }\n\t\t\t\t\t\t<span>{ activeCollaborators.length }</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-action\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tlabel={ __( 'Close Collaborators List' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsPopoverVisible( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-collaborators-presence__list-items\">\n\t\t\t\t\t{ activeCollaborators.map( ( collaboratorState ) => {\n\t\t\t\t\t\tconst isCurrentUser = collaboratorState.isMe;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\tclassName=\"editor-collaborators-presence__list-item\"\n\t\t\t\t\t\t\t\tdisabled={ isCurrentUser }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\thandleCollaboratorClick(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.clientId\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={\n\t\t\t\t\t\t\t\t\t\tisCurrentUser\n\t\t\t\t\t\t\t\t\t\t\t? 'var(--wp-admin-theme-color)'\n\t\t\t\t\t\t\t\t\t\t\t: getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcollaboratorState\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdimmed={ ! collaboratorState.isConnected }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-info\">\n\t\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-name\">\n\t\t\t\t\t\t\t\t\t\t{ isCurrentUser\n\t\t\t\t\t\t\t\t\t\t\t? __( 'You' )\n\t\t\t\t\t\t\t\t\t\t\t: collaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t\t\t.name }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAChC,mBAA2B;AAE3B,kBAAsB;AAEtB,oBAAmB;AACnB,4BAA6B;AAC7B,mBAAqC;AAkDhC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ACG,oCACA;AAAA,sBACA,kBACE,iBAAiB;AAAA,oBACnB;AAAA,oBAEJ,QAAS,CAAE,kBAAkB;AAAA;AAAA,gBAC9B;AAAA,gBACA,4CAAC,SAAI,WAAU,iDACd,sDAAC,SAAI,WAAU,iDACZ,8BACC,gBAAI,KAAM,IACV,kBAAkB,iBACjB,MACL,GACD;AAAA;AAAA;AAAA,YAlCM,kBAAkB;AAAA,UAmCzB;AAAA,QAEF,CAAE,GACH;AAAA,SACD;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": ["Avatar"]
7
7
  }
@@ -80,6 +80,11 @@ function PrivatePostLastRevision() {
80
80
  onClick: () => setCurrentRevisionId(lastRevisionId),
81
81
  className: "editor-private-post-last-revision__button",
82
82
  text: revisionsCount,
83
+ "aria-label": (0, import_i18n.sprintf)(
84
+ /* translators: %s: number of revisions. */
85
+ (0, import_i18n.__)("Open revisions screen: %s revisions"),
86
+ revisionsCount
87
+ ),
83
88
  variant: "tertiary",
84
89
  size: "compact"
85
90
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-last-revision/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default PostLastRevision;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAAuB;AACvB,kBAAuC;AACvC,mBAAuB;AAKvB,mBAAkC;AAClC,4BAAyB;AACzB,mBAAqC;AACrC,yBAAuB;AAwBpB;AAtBH,SAAS,0BAA0B;AAClC,aAAO,uBAAW,CAAE,WAAY;AAC/B,UAAM,EAAE,8BAA8B,6BAA6B,IAClE,OAAQ,aAAAA,KAAY;AACrB,WAAO;AAAA,MACN,gBAAgB,6BAA6B;AAAA,MAC7C,gBAAgB,6BAA6B;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACP;AAOA,SAAS,mBAAmB;AAC3B,QAAM,EAAE,gBAAgB,eAAe,IAAI,wBAAwB;AACnE,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAA,KAAY,CAAE;AAEpE,SACC,4CAAC,aAAAC,SAAA,EACA;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,SAAU,MAAM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,cAAa;AAAA,MACb,UAAO;AAAA;AAAA,YAEN,gBAAI,gBAAiB;AAAA,QACrB;AAAA,MACD;AAAA;AAAA,EACD,GACD;AAEF;AAEO,SAAS,0BAA0B;AACzC,QAAM,EAAE,gBAAgB,eAAe,IAAI,wBAAwB;AACnE,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAD,KAAY,CAAE;AAEpE,SACC,4CAAC,aAAAC,SAAA,EACA,sDAAC,sBAAAC,SAAA,EAAa,WAAQ,gBAAI,WAAY,GACrC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA;AAAA,EACN,GACD,GACD;AAEF;AAEA,IAAO,6BAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t\t__( 'Open revisions screen: %s revisions' ),\n\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t) }\n\t\t\t\t\tvariant=\"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AM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,kBAAa;AAAA;AAAA,YAEZ,gBAAI,qCAAsC;AAAA,QAC1C;AAAA,MACD;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA;AAAA,EACN,GACD,GACD;AAEF;AAEA,IAAO,6BAAQ;",
6
6
  "names": ["editorStore", "PostLastRevisionCheck", "PostPanelRow"]
7
7
  }
@@ -30,8 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // packages/editor/src/components/post-publish-panel/index.js
31
31
  var post_publish_panel_exports = {};
32
32
  __export(post_publish_panel_exports, {
33
- PostPublishPanel: () => PostPublishPanel,
34
- default: () => post_publish_panel_default
33
+ default: () => PostPublishPanel
35
34
  });
36
35
  module.exports = __toCommonJS(post_publish_panel_exports);
37
36
  var import_i18n = require("@wordpress/i18n");
@@ -46,104 +45,25 @@ var import_prepublish = __toESM(require("./prepublish.cjs"));
46
45
  var import_postpublish = __toESM(require("./postpublish.cjs"));
47
46
  var import_store = require("../../store/index.cjs");
48
47
  var import_jsx_runtime = require("react/jsx-runtime");
49
- var PostPublishPanel = class extends import_element.Component {
50
- constructor() {
51
- super(...arguments);
52
- this.onSubmit = this.onSubmit.bind(this);
53
- this.cancelButtonNode = (0, import_element.createRef)();
54
- }
55
- componentDidMount() {
56
- this.timeoutID = setTimeout(() => {
57
- this.cancelButtonNode.current.focus();
58
- }, 0);
59
- }
60
- componentWillUnmount() {
61
- clearTimeout(this.timeoutID);
62
- }
63
- componentDidUpdate(prevProps) {
64
- if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty || this.props.currentPostId !== prevProps.currentPostId) {
65
- this.props.onClose();
66
- }
67
- }
68
- onSubmit() {
69
- const { onClose, hasPublishAction, isPostTypeViewable } = this.props;
70
- if (!hasPublishAction || !isPostTypeViewable) {
71
- onClose();
72
- }
73
- }
74
- render() {
75
- const {
76
- forceIsDirty,
77
- isBeingScheduled,
78
- isPublished,
79
- isPublishSidebarEnabled,
80
- isScheduled,
81
- isSaving,
82
- isSavingNonPostEntityChanges,
83
- onClose,
84
- onTogglePublishSidebar,
85
- PostPublishExtension,
86
- PrePublishExtension,
87
- currentPostId,
88
- ...additionalProps
89
- } = this.props;
90
- const {
91
- hasPublishAction,
92
- isDirty,
93
- isPostTypeViewable,
94
- ...propsForPanel
95
- } = additionalProps;
96
- const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
97
- const isPrePublish = !isPublishedOrScheduled && !isSaving;
98
- const isPostPublish = isPublishedOrScheduled && !isSaving;
99
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-publish-panel", ...propsForPanel, children: [
100
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header", children: isPostPublish ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
- import_components.Button,
102
- {
103
- size: "compact",
104
- onClick: onClose,
105
- icon: import_icons.closeSmall,
106
- label: (0, import_i18n.__)("Close panel")
107
- }
108
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
109
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-cancel-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
- import_components.Button,
111
- {
112
- ref: this.cancelButtonNode,
113
- accessibleWhenDisabled: true,
114
- disabled: isSavingNonPostEntityChanges,
115
- onClick: onClose,
116
- variant: "secondary",
117
- size: "compact",
118
- children: (0, import_i18n.__)("Cancel")
119
- }
120
- ) }),
121
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-publish-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
- import_post_publish_button.default,
123
- {
124
- onSubmit: this.onSubmit,
125
- forceIsDirty
126
- }
127
- ) })
128
- ] }) }),
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-publish-panel__content", children: [
130
- isPrePublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_prepublish.default, { children: PrePublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrePublishExtension, {}) }),
131
- isPostPublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_postpublish.default, { focusOnMount: true, children: PostPublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PostPublishExtension, {}) }),
132
- isSaving && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {})
133
- ] }),
134
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
- import_components.CheckboxControl,
136
- {
137
- label: (0, import_i18n.__)("Always show pre-publish checks."),
138
- checked: isPublishSidebarEnabled,
139
- onChange: onTogglePublishSidebar
140
- }
141
- ) })
142
- ] });
143
- }
144
- };
145
- var post_publish_panel_default = (0, import_compose.compose)([
146
- (0, import_data.withSelect)((select) => {
48
+ function PostPublishPanel({
49
+ forceIsDirty,
50
+ onClose,
51
+ PostPublishExtension,
52
+ PrePublishExtension,
53
+ ...propsForPanel
54
+ }) {
55
+ const {
56
+ hasPublishAction,
57
+ isPostTypeViewable,
58
+ isBeingScheduled,
59
+ isDirty,
60
+ isPublished,
61
+ isPublishSidebarEnabled,
62
+ isSaving,
63
+ isSavingNonPostEntityChanges,
64
+ isScheduled,
65
+ currentPostId
66
+ } = (0, import_data.useSelect)((select) => {
147
67
  const { getPostType } = select(import_core_data.store);
148
68
  const {
149
69
  getCurrentPost,
@@ -155,9 +75,9 @@ var post_publish_panel_default = (0, import_compose.compose)([
155
75
  isEditedPostDirty,
156
76
  isAutosavingPost,
157
77
  isSavingPost,
158
- isSavingNonPostEntityChanges
78
+ isSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,
79
+ isPublishSidebarEnabled: _isPublishSidebarEnabled
159
80
  } = select(import_store.store);
160
- const { isPublishSidebarEnabled } = select(import_store.store);
161
81
  const postType = getPostType(getEditedPostAttribute("type"));
162
82
  return {
163
83
  hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
@@ -165,30 +85,98 @@ var post_publish_panel_default = (0, import_compose.compose)([
165
85
  isBeingScheduled: isEditedPostBeingScheduled(),
166
86
  isDirty: isEditedPostDirty(),
167
87
  isPublished: isCurrentPostPublished(),
168
- isPublishSidebarEnabled: isPublishSidebarEnabled(),
88
+ isPublishSidebarEnabled: _isPublishSidebarEnabled(),
169
89
  isSaving: isSavingPost() && !isAutosavingPost(),
170
- isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
90
+ isSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),
171
91
  isScheduled: isCurrentPostScheduled(),
172
92
  currentPostId: getCurrentPostId()
173
93
  };
174
- }),
175
- (0, import_data.withDispatch)((dispatch, { isPublishSidebarEnabled }) => {
176
- const { disablePublishSidebar, enablePublishSidebar } = dispatch(import_store.store);
177
- return {
178
- onTogglePublishSidebar: () => {
179
- if (isPublishSidebarEnabled) {
180
- disablePublishSidebar();
181
- } else {
182
- enablePublishSidebar();
183
- }
184
- }
185
- };
186
- }),
187
- import_components.withFocusReturn,
188
- import_components.withConstrainedTabbing
189
- ])(PostPublishPanel);
190
- // Annotate the CommonJS export names for ESM import in node:
191
- 0 && (module.exports = {
192
- PostPublishPanel
193
- });
94
+ }, []);
95
+ const { disablePublishSidebar, enablePublishSidebar } = (0, import_data.useDispatch)(import_store.store);
96
+ const cancelButtonRef = (0, import_element.useRef)(null);
97
+ const wrapperRef = (0, import_compose.useMergeRefs)([
98
+ (0, import_compose.useFocusReturn)(),
99
+ (0, import_compose.useConstrainedTabbing)()
100
+ ]);
101
+ (0, import_element.useEffect)(() => {
102
+ cancelButtonRef.current?.focus();
103
+ }, []);
104
+ const prevPostIdRef = (0, import_element.useRef)(currentPostId);
105
+ const stableOnClose = (0, import_compose.useEvent)(onClose);
106
+ (0, import_element.useEffect)(() => {
107
+ const postChanged = currentPostId !== prevPostIdRef.current;
108
+ prevPostIdRef.current = currentPostId;
109
+ if (postChanged || isPublished && !isSaving && isDirty) {
110
+ stableOnClose();
111
+ }
112
+ }, [isPublished, isSaving, isDirty, currentPostId, stableOnClose]);
113
+ function onTogglePublishSidebar() {
114
+ if (isPublishSidebarEnabled) {
115
+ disablePublishSidebar();
116
+ } else {
117
+ enablePublishSidebar();
118
+ }
119
+ }
120
+ function onSubmit() {
121
+ if (!hasPublishAction || !isPostTypeViewable) {
122
+ onClose();
123
+ }
124
+ }
125
+ const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
126
+ const isPrePublish = !isPublishedOrScheduled && !isSaving;
127
+ const isPostPublish = isPublishedOrScheduled && !isSaving;
128
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
129
+ "div",
130
+ {
131
+ ref: wrapperRef,
132
+ tabIndex: -1,
133
+ className: "editor-post-publish-panel",
134
+ ...propsForPanel,
135
+ children: [
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header", children: isPostPublish ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
137
+ import_components.Button,
138
+ {
139
+ size: "compact",
140
+ onClick: onClose,
141
+ icon: import_icons.closeSmall,
142
+ label: (0, import_i18n.__)("Close panel")
143
+ }
144
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-cancel-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
146
+ import_components.Button,
147
+ {
148
+ ref: cancelButtonRef,
149
+ accessibleWhenDisabled: true,
150
+ disabled: isSavingNonPostEntityChanges,
151
+ onClick: onClose,
152
+ variant: "secondary",
153
+ size: "compact",
154
+ children: (0, import_i18n.__)("Cancel")
155
+ }
156
+ ) }),
157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-publish-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
158
+ import_post_publish_button.default,
159
+ {
160
+ onSubmit,
161
+ forceIsDirty
162
+ }
163
+ ) })
164
+ ] }) }),
165
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-publish-panel__content", children: [
166
+ isPrePublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_prepublish.default, { children: PrePublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrePublishExtension, {}) }),
167
+ isPostPublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_postpublish.default, { focusOnMount: true, children: PostPublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PostPublishExtension, {}) }),
168
+ isSaving && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {})
169
+ ] }),
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
171
+ import_components.CheckboxControl,
172
+ {
173
+ label: (0, import_i18n.__)("Always show pre-publish checks."),
174
+ checked: isPublishSidebarEnabled,
175
+ onChange: onTogglePublishSidebar
176
+ }
177
+ ) })
178
+ ]
179
+ }
180
+ );
181
+ }
194
182
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t\tthis.cancelButtonNode = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t// PostPublishPanel) otherwise it will get this button.\n\t\tthis.timeoutID = setTimeout( () => {\n\t\t\tthis.cancelButtonNode.current.focus();\n\t\t}, 0 );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\t( prevProps.isPublished &&\n\t\t\t\t! this.props.isSaving &&\n\t\t\t\tthis.props.isDirty ) ||\n\t\t\tthis.props.currentPostId !== prevProps.currentPostId\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\tcurrentPostId,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ this.cancelButtonNode }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishPanel );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,qBAAqC;AACrC,wBAMO;AACP,kBAAyC;AACzC,qBAAwB;AACxB,mBAA2B;AAC3B,uBAAmC;AAKnC,iCAA8B;AAC9B,wBAAuC;AACvC,yBAAwC;AACxC,mBAAqC;AAwE/B;AAtEC,IAAM,mBAAN,cAA+B,yBAAU;AAAA,EAC/C,cAAc;AACb,UAAO,GAAG,SAAU;AACpB,SAAK,WAAW,KAAK,SAAS,KAAM,IAAK;AACzC,SAAK,uBAAmB,0BAAU;AAAA,EACnC;AAAA,EAEA,oBAAoB;AAInB,SAAK,YAAY,WAAY,MAAM;AAClC,WAAK,iBAAiB,QAAQ,MAAM;AAAA,IACrC,GAAG,CAAE;AAAA,EACN;AAAA,EAEA,uBAAuB;AACtB,iBAAc,KAAK,SAAU;AAAA,EAC9B;AAAA,EAEA,mBAAoB,WAAY;AAG/B,QACG,UAAU,eACX,CAAE,K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,KAAY;AACvB,WAAO;AAAA,MACN,wBAAwB,MAAM;AAC7B,YAAK,yBAA0B;AAC9B,gCAAsB;AAAA,QACvB,OAAO;AACN,+BAAqB;AAAA,QACtB;AAAA,MACD;AAAA,IACD;AAAA,EACD,CAAE;AAAA,EACF;AAAA,EACA;AACD,CAAE,EAAG,gBAAiB;",
6
- "names": ["PostPublishButton", "PostPublishPanelPrepublish", "PostPublishPanelPostpublish", "coreStore", "editorStore"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { Button, Spinner, CheckboxControl } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseConstrainedTabbing,\n\tuseEvent,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders a panel for publishing a post.\n *\n * @param {Object} props Component props.\n * @param {boolean} [props.forceIsDirty] Whether to force the dirty state.\n * @param {()=>void} props.onClose Called when the panel requests to close.\n * @param {React.ComponentType} [props.PostPublishExtension] Component rendered after publishing.\n * @param {React.ComponentType} [props.PrePublishExtension] Component rendered before publishing.\n *\n * @return {React.JSX.Element} The post publish panel.\n */\nexport default function PostPublishPanel( {\n\tforceIsDirty,\n\tonClose,\n\tPostPublishExtension,\n\tPrePublishExtension,\n\t...propsForPanel\n} ) {\n\tconst {\n\t\thasPublishAction,\n\t\tisPostTypeViewable,\n\t\tisBeingScheduled,\n\t\tisDirty,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisSaving,\n\t\tisSavingNonPostEntityChanges,\n\t\tisScheduled,\n\t\tcurrentPostId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled,\n\t\t} = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\n\tconst cancelButtonRef = useRef( null );\n\tconst wrapperRef = useMergeRefs( [\n\t\tuseFocusReturn(),\n\t\tuseConstrainedTabbing(),\n\t] );\n\n\tuseEffect( () => {\n\t\tcancelButtonRef.current?.focus();\n\t}, [] );\n\n\t// Auto-collapse the publish sidebar when a post is published and the user\n\t// makes an edit, or when the edited post changes. The panel only mounts\n\t// for unpublished posts, so `isPublished && isDirty` cannot be true on\n\t// mount \u2014 it implies a publish-then-edit transition.\n\tconst prevPostIdRef = useRef( currentPostId );\n\tconst stableOnClose = useEvent( onClose );\n\tuseEffect( () => {\n\t\tconst postChanged = currentPostId !== prevPostIdRef.current;\n\t\tprevPostIdRef.current = currentPostId;\n\n\t\tif ( postChanged || ( isPublished && ! isSaving && isDirty ) ) {\n\t\t\tstableOnClose();\n\t\t}\n\t}, [ isPublished, isSaving, isDirty, currentPostId, stableOnClose ] );\n\n\tfunction onTogglePublishSidebar() {\n\t\tif ( isPublishSidebarEnabled ) {\n\t\t\tdisablePublishSidebar();\n\t\t} else {\n\t\t\tenablePublishSidebar();\n\t\t}\n\t}\n\n\tfunction onSubmit() {\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tconst isPublishedOrScheduled =\n\t\tisPublished || ( isScheduled && isBeingScheduled );\n\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\n\treturn (\n\t\t<div\n\t\t\tref={ wrapperRef }\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName=\"editor-post-publish-panel\"\n\t\t\t{ ...propsForPanel }\n\t\t>\n\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ cancelButtonRef }\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\tonSubmit={ onSubmit }\n\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t) }\n\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t) }\n\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,qBAAkC;AAClC,wBAAiD;AACjD,kBAAuC;AACvC,qBAKO;AACP,mBAA2B;AAC3B,uBAAmC;AAKnC,iCAA8B;AAC9B,wBAAuC;AACvC,yBAAwC;AACxC,mBAAqC;AAuHhC;AA1GU,SAAR,iBAAmC;AAAA,EACzC;AAAA,EACA;AAAA,EAC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,MACtC,kCAAwB,4CAAC,wBAAqB,GACjD;AAAA,UAEC,YAAY,4CAAC,6BAAQ;AAAA,WACxB;AAAA,QACA,4CAAC,SAAI,WAAU,qCACd;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,iCAAkC;AAAA,YAC9C,SAAU;AAAA,YACV,UAAW;AAAA;AAAA,QACZ,GACD;AAAA;AAAA;AAAA,EACD;AAEF;",
6
+ "names": ["coreStore", "editorStore", "PostPublishButton", "PostPublishPanelPrepublish", "PostPublishPanelPostpublish"]
7
7
  }
@@ -47,10 +47,33 @@ function textSimilarity(text1, text2) {
47
47
  if (!text1 || !text2) {
48
48
  return 0;
49
49
  }
50
- const changes = (0, import_word.diffWords)(text1, text2);
51
- const unchanged = changes.filter((c) => !c.added && !c.removed).reduce((sum, c) => sum + c.value.length, 0);
52
- const total = Math.max(text1.length, text2.length);
53
- return total > 0 ? unchanged / total : 0;
50
+ const segmenter = new Intl.Segmenter(void 0, {
51
+ granularity: "word"
52
+ });
53
+ const wordLikeRegex = /[\p{L}\p{N}]/u;
54
+ const getWords = (text) => {
55
+ const words = [];
56
+ for (const { segment, isWordLike } of segmenter.segment(text)) {
57
+ if (isWordLike || wordLikeRegex.test(segment)) {
58
+ words.push(segment);
59
+ }
60
+ }
61
+ return words;
62
+ };
63
+ const words1 = getWords(text1);
64
+ const words2 = getWords(text2);
65
+ if (words1.length === 0 && words2.length === 0) {
66
+ return 1;
67
+ }
68
+ const set1 = new Set(words1);
69
+ let intersection = 0;
70
+ for (const word of words2) {
71
+ if (set1.has(word)) {
72
+ intersection++;
73
+ }
74
+ }
75
+ const total = Math.max(words1.length, words2.length);
76
+ return total > 0 ? intersection / total : 0;
54
77
  }
55
78
  function pairSimilarBlocks(blocks) {
56
79
  const removed = [];
@@ -67,39 +90,84 @@ function pairSimilarBlocks(blocks) {
67
90
  return blocks;
68
91
  }
69
92
  const pairedRemoved = /* @__PURE__ */ new Set();
93
+ const pairedAdded = /* @__PURE__ */ new Set();
70
94
  const modifications = /* @__PURE__ */ new Map();
71
- const SIMILARITY_THRESHOLD = 0.3;
95
+ const SIMILARITY_THRESHOLD = 0.5;
96
+ const addedByName = /* @__PURE__ */ new Map();
97
+ for (const add of added) {
98
+ const name = add.block.blockName;
99
+ if (!addedByName.has(name)) {
100
+ addedByName.set(name, []);
101
+ }
102
+ addedByName.get(name).push(add);
103
+ }
104
+ const removedByName = /* @__PURE__ */ new Map();
105
+ for (const rem of removed) {
106
+ const name = rem.block.blockName;
107
+ if (!removedByName.has(name)) {
108
+ removedByName.set(name, []);
109
+ }
110
+ removedByName.get(name).push(rem);
111
+ }
112
+ let maxPairedAddedIndex = -1;
72
113
  for (const rem of removed) {
114
+ const candidates = addedByName.get(rem.block.blockName) || [];
115
+ const sameNameRemoved = removedByName.get(rem.block.blockName) || [];
116
+ const unpaired = candidates.filter(
117
+ (add) => !modifications.has(add.index) && add.index > maxPairedAddedIndex
118
+ );
119
+ if (unpaired.length === 0) {
120
+ continue;
121
+ }
73
122
  let bestMatch = null;
74
- let bestScore = 0;
75
- for (const add of added) {
76
- if (modifications.has(add.index)) {
77
- continue;
78
- }
79
- if (add.block.blockName !== rem.block.blockName) {
80
- continue;
81
- }
82
- const score = textSimilarity(
83
- rem.block.innerHTML || "",
84
- add.block.innerHTML || ""
85
- );
123
+ if (sameNameRemoved.length === 1 && unpaired.length === 1) {
124
+ const add = unpaired[0];
86
125
  const attrsMatch = JSON.stringify(rem.block.attrs) === JSON.stringify(add.block.attrs);
87
- if (score > bestScore && score > SIMILARITY_THRESHOLD && (score < 1 || !attrsMatch)) {
88
- bestScore = score;
126
+ const contentMatch = (rem.block.innerHTML || "") === (add.block.innerHTML || "");
127
+ if (!contentMatch || !attrsMatch) {
89
128
  bestMatch = add;
90
129
  }
130
+ } else {
131
+ let bestScore = 0;
132
+ for (const add of unpaired) {
133
+ const score = textSimilarity(
134
+ rem.block.innerHTML || "",
135
+ add.block.innerHTML || ""
136
+ );
137
+ const attrsMatch = JSON.stringify(rem.block.attrs) === JSON.stringify(add.block.attrs);
138
+ if (score > bestScore && score > SIMILARITY_THRESHOLD && (score < 1 || !attrsMatch)) {
139
+ bestScore = score;
140
+ bestMatch = add;
141
+ }
142
+ }
91
143
  }
92
144
  if (bestMatch) {
93
- pairedRemoved.add(rem.index);
94
- modifications.set(bestMatch.index, {
145
+ maxPairedAddedIndex = bestMatch.index;
146
+ const modifiedBlock = {
95
147
  ...bestMatch.block,
96
148
  __revisionDiffStatus: { status: "modified" },
97
149
  __previousRawBlock: rem.block
98
- });
150
+ };
151
+ const lo = Math.min(rem.index, bestMatch.index);
152
+ const hi = Math.max(rem.index, bestMatch.index);
153
+ let hasAddedBetween = false;
154
+ for (let i = lo + 1; i < hi; i++) {
155
+ if (blocks[i].__revisionDiffStatus?.status === "added" && !pairedAdded.has(i)) {
156
+ hasAddedBetween = true;
157
+ break;
158
+ }
159
+ }
160
+ if (hasAddedBetween) {
161
+ modifications.set(bestMatch.index, modifiedBlock);
162
+ pairedRemoved.add(rem.index);
163
+ } else {
164
+ modifications.set(rem.index, modifiedBlock);
165
+ pairedAdded.add(bestMatch.index);
166
+ }
99
167
  }
100
168
  }
101
169
  return blocks.map((block, index) => {
102
- if (pairedRemoved.has(index)) {
170
+ if (pairedRemoved.has(index) || pairedAdded.has(index)) {
103
171
  return null;
104
172
  }
105
173
  if (modifications.has(index)) {