@wordpress/editor 14.41.0 → 14.41.2-next.v.202603161435.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 (326) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/collab-sidebar/index.cjs +7 -4
  3. package/build/components/collab-sidebar/index.cjs.map +2 -2
  4. package/build/components/collab-sidebar/utils.cjs +13 -15
  5. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  6. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs +141 -0
  7. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +7 -0
  8. package/build/components/collaborators-overlay/collaborator-styles.cjs +38 -2
  9. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +2 -2
  10. package/build/components/collaborators-overlay/compute-selection.cjs +181 -0
  11. package/build/components/collaborators-overlay/compute-selection.cjs.map +7 -0
  12. package/build/components/collaborators-overlay/cursor-dom-utils.cjs +243 -0
  13. package/build/components/collaborators-overlay/cursor-dom-utils.cjs.map +7 -0
  14. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +148 -0
  15. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +7 -0
  16. package/build/components/collaborators-overlay/overlay.cjs +100 -229
  17. package/build/components/collaborators-overlay/overlay.cjs.map +3 -3
  18. package/build/components/collaborators-overlay/use-block-highlighting.cjs +90 -42
  19. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +2 -2
  20. package/build/components/collaborators-overlay/use-debounced-recompute.cjs +49 -0
  21. package/build/components/collaborators-overlay/use-debounced-recompute.cjs.map +7 -0
  22. package/build/components/collaborators-overlay/use-render-cursors.cjs +80 -171
  23. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  24. package/build/components/collaborators-presence/avatar/component.cjs +121 -0
  25. package/build/components/collaborators-presence/avatar/component.cjs.map +7 -0
  26. package/build/components/collaborators-presence/avatar/index.cjs +37 -0
  27. package/build/components/collaborators-presence/avatar/index.cjs.map +7 -0
  28. package/build/components/collaborators-presence/avatar/types.cjs +19 -0
  29. package/build/components/collaborators-presence/avatar/types.cjs.map +7 -0
  30. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs +44 -0
  31. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +7 -0
  32. package/build/components/collaborators-presence/avatar-group/component.cjs +78 -0
  33. package/build/components/collaborators-presence/avatar-group/component.cjs.map +7 -0
  34. package/build/components/collaborators-presence/avatar-group/index.cjs +37 -0
  35. package/build/components/collaborators-presence/avatar-group/index.cjs.map +7 -0
  36. package/build/components/collaborators-presence/avatar-group/types.cjs +19 -0
  37. package/build/components/collaborators-presence/avatar-group/types.cjs.map +7 -0
  38. package/build/components/collaborators-presence/index.cjs +54 -17
  39. package/build/components/collaborators-presence/index.cjs.map +3 -3
  40. package/build/components/collaborators-presence/list.cjs +43 -37
  41. package/build/components/collaborators-presence/list.cjs.map +3 -3
  42. package/build/components/collaborators-presence/use-collaborator-notifications.cjs +79 -107
  43. package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +3 -3
  44. package/build/components/editor-interface/index.cjs +9 -6
  45. package/build/components/editor-interface/index.cjs.map +2 -2
  46. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs +14 -5
  47. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs.map +2 -2
  48. package/build/components/global-styles/index.cjs +15 -24
  49. package/build/components/global-styles/index.cjs.map +3 -3
  50. package/build/components/global-styles-sidebar/index.cjs +6 -3
  51. package/build/components/global-styles-sidebar/index.cjs.map +2 -2
  52. package/build/components/inserter-sidebar/index.cjs +2 -1
  53. package/build/components/inserter-sidebar/index.cjs.map +2 -2
  54. package/build/components/page-attributes/parent.cjs +2 -1
  55. package/build/components/page-attributes/parent.cjs.map +2 -2
  56. package/build/components/post-revisions-preview/revisions-canvas.cjs +8 -58
  57. package/build/components/post-revisions-preview/revisions-canvas.cjs.map +3 -3
  58. package/build/components/post-revisions-preview/revisions-slider.cjs +5 -1
  59. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  60. package/build/components/post-url/panel.cjs +1 -0
  61. package/build/components/post-url/panel.cjs.map +2 -2
  62. package/build/components/preferences-modal/index.cjs +24 -0
  63. package/build/components/preferences-modal/index.cjs.map +2 -2
  64. package/build/components/provider/disable-non-page-content-blocks.cjs +31 -28
  65. package/build/components/provider/disable-non-page-content-blocks.cjs.map +3 -3
  66. package/build/components/provider/index.cjs +17 -5
  67. package/build/components/provider/index.cjs.map +2 -2
  68. package/build/components/provider/use-block-editor-settings.cjs +21 -6
  69. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  70. package/build/components/provider/{use-post-content-blocks.cjs → use-post-content-block-types.cjs} +8 -19
  71. package/build/components/provider/use-post-content-block-types.cjs.map +7 -0
  72. package/build/components/provider/use-revision-blocks.cjs +106 -0
  73. package/build/components/provider/use-revision-blocks.cjs.map +7 -0
  74. package/build/components/sidebar/dataform-post-summary.cjs +182 -0
  75. package/build/components/sidebar/dataform-post-summary.cjs.map +7 -0
  76. package/build/components/sidebar/header.cjs +1 -1
  77. package/build/components/sidebar/header.cjs.map +2 -2
  78. package/build/components/sidebar/post-summary.cjs +11 -0
  79. package/build/components/sidebar/post-summary.cjs.map +3 -3
  80. package/build/components/sync-connection-modal/index.cjs +8 -5
  81. package/build/components/sync-connection-modal/index.cjs.map +2 -2
  82. package/build/components/template-content-panel/index.cjs +35 -31
  83. package/build/components/template-content-panel/index.cjs.map +3 -3
  84. package/build/components/visual-editor/index.cjs +1 -1
  85. package/build/components/visual-editor/index.cjs.map +2 -2
  86. package/build/dataviews/store/private-actions.cjs +4 -0
  87. package/build/dataviews/store/private-actions.cjs.map +2 -2
  88. package/build/store/private-actions.cjs +11 -2
  89. package/build/store/private-actions.cjs.map +2 -2
  90. package/build/store/private-selectors.cjs +52 -13
  91. package/build/store/private-selectors.cjs.map +2 -2
  92. package/build/store/reducer.cjs +12 -0
  93. package/build/store/reducer.cjs.map +2 -2
  94. package/build/utils/media-upload/on-success.cjs +46 -0
  95. package/build/utils/media-upload/on-success.cjs.map +7 -0
  96. package/build-module/components/collab-sidebar/index.mjs +7 -4
  97. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  98. package/build-module/components/collab-sidebar/utils.mjs +13 -15
  99. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  100. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs +128 -0
  101. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +7 -0
  102. package/build-module/components/collaborators-overlay/collaborator-styles.mjs +25 -1
  103. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +2 -2
  104. package/build-module/components/collaborators-overlay/compute-selection.mjs +162 -0
  105. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +7 -0
  106. package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs +213 -0
  107. package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs.map +7 -0
  108. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +130 -0
  109. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +7 -0
  110. package/build-module/components/collaborators-overlay/overlay.mjs +91 -230
  111. package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
  112. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +91 -43
  113. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  114. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs +24 -0
  115. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs.map +7 -0
  116. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +81 -172
  117. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  118. package/build-module/components/collaborators-presence/avatar/component.mjs +90 -0
  119. package/build-module/components/collaborators-presence/avatar/component.mjs.map +7 -0
  120. package/build-module/components/collaborators-presence/avatar/index.mjs +6 -0
  121. package/build-module/components/collaborators-presence/avatar/index.mjs.map +7 -0
  122. package/build-module/components/collaborators-presence/avatar/types.mjs +1 -0
  123. package/build-module/components/collaborators-presence/avatar/types.mjs.map +7 -0
  124. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs +19 -0
  125. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +7 -0
  126. package/build-module/components/collaborators-presence/avatar-group/component.mjs +47 -0
  127. package/build-module/components/collaborators-presence/avatar-group/component.mjs.map +7 -0
  128. package/build-module/components/collaborators-presence/avatar-group/index.mjs +6 -0
  129. package/build-module/components/collaborators-presence/avatar-group/index.mjs.map +7 -0
  130. package/build-module/components/collaborators-presence/avatar-group/types.mjs +1 -0
  131. package/build-module/components/collaborators-presence/avatar-group/types.mjs.map +7 -0
  132. package/build-module/components/collaborators-presence/index.mjs +45 -21
  133. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  134. package/build-module/components/collaborators-presence/list.mjs +35 -43
  135. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  136. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +80 -108
  137. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +2 -2
  138. package/build-module/components/editor-interface/index.mjs +10 -7
  139. package/build-module/components/editor-interface/index.mjs.map +2 -2
  140. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs +14 -5
  141. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs.map +2 -2
  142. package/build-module/components/global-styles/index.mjs +15 -24
  143. package/build-module/components/global-styles/index.mjs.map +2 -2
  144. package/build-module/components/global-styles-sidebar/index.mjs +6 -3
  145. package/build-module/components/global-styles-sidebar/index.mjs.map +2 -2
  146. package/build-module/components/inserter-sidebar/index.mjs +2 -1
  147. package/build-module/components/inserter-sidebar/index.mjs.map +2 -2
  148. package/build-module/components/page-attributes/parent.mjs +2 -1
  149. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  150. package/build-module/components/post-revisions-preview/revisions-canvas.mjs +10 -63
  151. package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
  152. package/build-module/components/post-revisions-preview/revisions-slider.mjs +5 -1
  153. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  154. package/build-module/components/post-url/panel.mjs +1 -0
  155. package/build-module/components/post-url/panel.mjs.map +2 -2
  156. package/build-module/components/preferences-modal/index.mjs +24 -0
  157. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  158. package/build-module/components/provider/disable-non-page-content-blocks.mjs +31 -28
  159. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +2 -2
  160. package/build-module/components/provider/index.mjs +17 -5
  161. package/build-module/components/provider/index.mjs.map +2 -2
  162. package/build-module/components/provider/use-block-editor-settings.mjs +21 -6
  163. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  164. package/build-module/components/provider/use-post-content-block-types.mjs +23 -0
  165. package/build-module/components/provider/use-post-content-block-types.mjs.map +7 -0
  166. package/build-module/components/provider/use-revision-blocks.mjs +81 -0
  167. package/build-module/components/provider/use-revision-blocks.mjs.map +7 -0
  168. package/build-module/components/sidebar/dataform-post-summary.mjs +151 -0
  169. package/build-module/components/sidebar/dataform-post-summary.mjs.map +7 -0
  170. package/build-module/components/sidebar/header.mjs +1 -1
  171. package/build-module/components/sidebar/header.mjs.map +2 -2
  172. package/build-module/components/sidebar/post-summary.mjs +11 -0
  173. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  174. package/build-module/components/sync-connection-modal/index.mjs +8 -5
  175. package/build-module/components/sync-connection-modal/index.mjs.map +2 -2
  176. package/build-module/components/template-content-panel/index.mjs +25 -31
  177. package/build-module/components/template-content-panel/index.mjs.map +2 -2
  178. package/build-module/components/visual-editor/index.mjs +1 -1
  179. package/build-module/components/visual-editor/index.mjs.map +2 -2
  180. package/build-module/dataviews/store/private-actions.mjs +8 -1
  181. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  182. package/build-module/store/private-actions.mjs +10 -2
  183. package/build-module/store/private-actions.mjs.map +2 -2
  184. package/build-module/store/private-selectors.mjs +50 -12
  185. package/build-module/store/private-selectors.mjs.map +2 -2
  186. package/build-module/store/reducer.mjs +11 -0
  187. package/build-module/store/reducer.mjs.map +2 -2
  188. package/build-module/utils/media-upload/on-success.mjs +25 -0
  189. package/build-module/utils/media-upload/on-success.mjs.map +7 -0
  190. package/build-style/style-rtl.css +961 -159
  191. package/build-style/style.css +961 -159
  192. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  193. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  194. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts +11 -0
  195. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts.map +1 -0
  196. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts +17 -2
  197. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts.map +1 -1
  198. package/build-types/components/collaborators-overlay/compute-selection.d.ts +24 -0
  199. package/build-types/components/collaborators-overlay/compute-selection.d.ts.map +1 -0
  200. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts +72 -0
  201. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts.map +1 -0
  202. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +6 -0
  203. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -0
  204. package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
  205. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +21 -5
  206. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  207. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts +10 -0
  208. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts.map +1 -0
  209. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts +6 -1
  210. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  211. package/build-types/components/collaborators-presence/avatar/component.d.ts +7 -0
  212. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -0
  213. package/build-types/components/collaborators-presence/avatar/index.d.ts +3 -0
  214. package/build-types/components/collaborators-presence/avatar/index.d.ts.map +1 -0
  215. package/build-types/components/collaborators-presence/avatar/types.d.ts +66 -0
  216. package/build-types/components/collaborators-presence/avatar/types.d.ts.map +1 -0
  217. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts +17 -0
  218. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts.map +1 -0
  219. package/build-types/components/collaborators-presence/avatar-group/component.d.ts +7 -0
  220. package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -0
  221. package/build-types/components/collaborators-presence/avatar-group/index.d.ts +3 -0
  222. package/build-types/components/collaborators-presence/avatar-group/index.d.ts.map +1 -0
  223. package/build-types/components/collaborators-presence/avatar-group/types.d.ts +14 -0
  224. package/build-types/components/collaborators-presence/avatar-group/types.d.ts.map +1 -0
  225. package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
  226. package/build-types/components/collaborators-presence/list.d.ts +2 -1
  227. package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
  228. package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -1
  229. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  230. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
  231. package/build-types/components/global-styles/index.d.ts +2 -1
  232. package/build-types/components/global-styles/index.d.ts.map +1 -1
  233. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -1
  234. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  235. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  236. package/build-types/components/post-author/hook.d.ts +1 -1
  237. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +2 -5
  238. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
  239. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  240. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  241. package/build-types/components/provider/index.d.ts.map +1 -1
  242. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  243. package/build-types/components/provider/use-post-content-block-types.d.ts +9 -0
  244. package/build-types/components/provider/use-post-content-block-types.d.ts.map +1 -0
  245. package/build-types/components/provider/use-revision-blocks.d.ts +10 -0
  246. package/build-types/components/provider/use-revision-blocks.d.ts.map +1 -0
  247. package/build-types/components/sidebar/dataform-post-summary.d.ts +4 -0
  248. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -0
  249. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  250. package/build-types/components/sync-connection-modal/index.d.ts.map +1 -1
  251. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  252. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  253. package/build-types/store/private-actions.d.ts +7 -0
  254. package/build-types/store/private-actions.d.ts.map +1 -1
  255. package/build-types/store/private-selectors.d.ts +7 -0
  256. package/build-types/store/private-selectors.d.ts.map +1 -1
  257. package/build-types/store/reducer.d.ts +14 -3
  258. package/build-types/store/reducer.d.ts.map +1 -1
  259. package/build-types/utils/media-upload/on-success.d.ts +9 -0
  260. package/build-types/utils/media-upload/on-success.d.ts.map +1 -0
  261. package/package.json +45 -44
  262. package/src/components/collab-sidebar/index.js +7 -4
  263. package/src/components/collab-sidebar/utils.js +9 -10
  264. package/src/components/collaborators-overlay/avatar-iframe-styles.ts +134 -0
  265. package/src/components/collaborators-overlay/collaborator-styles.ts +43 -2
  266. package/src/components/collaborators-overlay/compute-selection.ts +307 -0
  267. package/src/components/collaborators-overlay/cursor-dom-utils.ts +382 -0
  268. package/src/components/collaborators-overlay/overlay-iframe-styles.ts +131 -0
  269. package/src/components/collaborators-overlay/overlay.tsx +86 -226
  270. package/src/components/collaborators-overlay/use-block-highlighting.ts +147 -63
  271. package/src/components/collaborators-overlay/use-debounced-recompute.ts +32 -0
  272. package/src/components/collaborators-overlay/use-render-cursors.ts +113 -279
  273. package/src/components/collaborators-presence/avatar/component.tsx +123 -0
  274. package/src/components/collaborators-presence/avatar/index.ts +2 -0
  275. package/src/components/collaborators-presence/avatar/styles.scss +184 -0
  276. package/src/components/collaborators-presence/avatar/test/index.tsx +389 -0
  277. package/src/components/collaborators-presence/avatar/types.ts +66 -0
  278. package/src/components/collaborators-presence/avatar/use-image-loading-status.ts +36 -0
  279. package/src/components/collaborators-presence/avatar-group/component.tsx +55 -0
  280. package/src/components/collaborators-presence/avatar-group/index.ts +2 -0
  281. package/src/components/collaborators-presence/avatar-group/styles.scss +33 -0
  282. package/src/components/collaborators-presence/avatar-group/test/index.tsx +139 -0
  283. package/src/components/collaborators-presence/avatar-group/types.ts +13 -0
  284. package/src/components/collaborators-presence/index.tsx +34 -11
  285. package/src/components/collaborators-presence/list.tsx +44 -40
  286. package/src/components/collaborators-presence/styles/collaborators-list.scss +26 -19
  287. package/src/components/collaborators-presence/styles/collaborators-presence.scss +6 -2
  288. package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +188 -246
  289. package/src/components/collaborators-presence/use-collaborator-notifications.ts +109 -166
  290. package/src/components/document-bar/style.scss +1 -1
  291. package/src/components/editor-interface/index.js +8 -6
  292. package/src/components/entities-saved-states/hooks/use-is-dirty.js +14 -5
  293. package/src/components/global-styles/index.js +20 -27
  294. package/src/components/global-styles-sidebar/index.js +3 -0
  295. package/src/components/inserter-sidebar/index.js +4 -1
  296. package/src/components/page-attributes/parent.js +2 -1
  297. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  298. package/src/components/post-revisions-preview/revisions-canvas.js +15 -84
  299. package/src/components/post-revisions-preview/revisions-slider.js +6 -1
  300. package/src/components/post-url/panel.js +1 -0
  301. package/src/components/post-url/style.scss +5 -0
  302. package/src/components/preferences-modal/index.js +18 -0
  303. package/src/components/provider/disable-non-page-content-blocks.js +42 -40
  304. package/src/components/provider/index.js +20 -2
  305. package/src/components/provider/use-block-editor-settings.js +24 -8
  306. package/src/components/provider/use-post-content-block-types.js +30 -0
  307. package/src/components/provider/use-revision-blocks.js +105 -0
  308. package/src/components/sidebar/dataform-post-summary.js +170 -0
  309. package/src/components/sidebar/header.js +1 -1
  310. package/src/components/sidebar/post-summary.js +15 -0
  311. package/src/components/sync-connection-modal/index.js +12 -6
  312. package/src/components/sync-connection-modal/style.scss +5 -0
  313. package/src/components/template-content-panel/index.js +30 -38
  314. package/src/components/visual-editor/index.js +1 -1
  315. package/src/dataviews/store/private-actions.ts +14 -0
  316. package/src/store/private-actions.js +21 -2
  317. package/src/store/private-selectors.js +75 -10
  318. package/src/store/reducer.js +19 -0
  319. package/src/style.scss +3 -0
  320. package/src/utils/media-upload/on-success.js +34 -0
  321. package/build/components/provider/use-post-content-blocks.cjs.map +0 -7
  322. package/build-module/components/provider/use-post-content-blocks.mjs +0 -34
  323. package/build-module/components/provider/use-post-content-blocks.mjs.map +0 -7
  324. package/build-types/components/provider/use-post-content-blocks.d.ts +0 -2
  325. package/build-types/components/provider/use-post-content-blocks.d.ts.map +0 -1
  326. package/src/components/provider/use-post-content-blocks.js +0 -42
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // packages/editor/src/components/collaborators-overlay/overlay.tsx
@@ -23,201 +33,16 @@ __export(overlay_exports, {
23
33
  Overlay: () => Overlay
24
34
  });
25
35
  module.exports = __toCommonJS(overlay_exports);
26
- var import_components = require("@wordpress/components");
27
36
  var import_compose = require("@wordpress/compose");
28
37
  var import_element = require("@wordpress/element");
29
- var import_lock_unlock = require("../../lock-unlock.cjs");
38
+ var import_i18n = require("@wordpress/i18n");
39
+ var import_avatar = __toESM(require("../collaborators-presence/avatar/index.cjs"));
40
+ var import_avatar_iframe_styles = require("./avatar-iframe-styles.cjs");
41
+ var import_overlay_iframe_styles = require("./overlay-iframe-styles.cjs");
30
42
  var import_use_block_highlighting = require("./use-block-highlighting.cjs");
31
43
  var import_use_render_cursors = require("./use-render-cursors.cjs");
32
- var import_collaborator_styles = require("./collaborator-styles.cjs");
33
44
  var import_jsx_runtime = require("react/jsx-runtime");
34
- var { Avatar } = (0, import_lock_unlock.unlock)(import_components.privateApis);
35
- var COLLABORATORS_OVERLAY_STYLES = `
36
- .block-canvas-cover {
37
- position: absolute;
38
- top: 0;
39
- left: 0;
40
- width: 100%;
41
- height: 100%;
42
- pointer-events: none;
43
- z-index: 20000;
44
- }
45
- .block-canvas-cover .collaborators-overlay-full {
46
- position: absolute;
47
- top: 0;
48
- left: 0;
49
- width: 100%;
50
- height: 100%;
51
- }
52
- .block-canvas-cover .collaborators-overlay-fixed {
53
- position: fixed;
54
- width: 100%;
55
- height: 100%;
56
- }
57
- .collaborators-overlay-user {
58
- position: absolute;
59
- }
60
- .collaborators-overlay-user-cursor {
61
- position: absolute;
62
- width: 2px;
63
- border-radius: 1px;
64
- outline: 1px solid #fff;
65
- box-shadow: ${import_collaborator_styles.ELEVATION_X_SMALL};
66
- animation: collaborators-overlay-cursor-blink 1s infinite;
67
- }
68
-
69
- /* \u2500\u2500 Avatar component (compiled from packages/components/src/avatar/styles.scss) \u2500\u2500 */
70
- .components-avatar {
71
- display: inline-flex;
72
- align-items: center;
73
- border-radius: 9999px;
74
- overflow: clip;
75
- flex-shrink: 0;
76
- background-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
77
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 2px) #fff, ${import_collaborator_styles.ELEVATION_X_SMALL};
78
- }
79
- .components-avatar__image {
80
- box-sizing: border-box;
81
- position: relative;
82
- width: 32px;
83
- height: 32px;
84
- border-radius: 9999px;
85
- border: 0;
86
- background-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
87
- overflow: clip;
88
- flex-shrink: 0;
89
- font-size: 0;
90
- color: #fff;
91
- }
92
- .is-small > .components-avatar__image {
93
- width: 24px;
94
- height: 24px;
95
- }
96
- .has-src > .components-avatar__image {
97
- background-image: var(--components-avatar-url);
98
- background-size: cover;
99
- background-position: center;
100
- }
101
- .has-avatar-border-color > .components-avatar__image {
102
- border: var(--wp-admin-border-width-focus, 2px) solid var(--components-avatar-outline-color);
103
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 2px) #fff;
104
- background-clip: padding-box;
105
- }
106
- .components-avatar:not(.has-src) > .components-avatar__image {
107
- display: flex;
108
- align-items: center;
109
- justify-content: center;
110
- font-size: 11px;
111
- font-weight: 499;
112
- border: 0;
113
- box-shadow: none;
114
- background-clip: border-box;
115
- }
116
- .components-avatar:not(.has-src).has-avatar-border-color > .components-avatar__image {
117
- background-color: var(--components-avatar-outline-color);
118
- }
119
- .components-avatar__name {
120
- font-size: 13px;
121
- line-height: 20px;
122
- color: #fff;
123
- min-width: 0;
124
- padding-bottom: 2px;
125
- overflow: hidden;
126
- opacity: 0;
127
- white-space: nowrap;
128
- transition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);
129
- }
130
- .components-avatar.has-badge {
131
- display: inline-grid;
132
- grid-template-columns: min-content 0fr;
133
- column-gap: 0;
134
- padding-inline-end: 0;
135
- transition:
136
- grid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),
137
- column-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),
138
- padding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);
139
- }
140
- .components-avatar.has-badge:hover {
141
- grid-template-columns: min-content 1fr;
142
- column-gap: 4px;
143
- padding-inline-end: 8px;
144
- transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
145
- }
146
- .components-avatar.has-badge:hover .components-avatar__name {
147
- opacity: 1;
148
- transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
149
- }
150
- .components-avatar.has-badge.has-avatar-border-color {
151
- background-color: var(--components-avatar-outline-color);
152
- }
153
- /* \u2500\u2500 end Avatar \u2500\u2500 */
154
-
155
- /* Overlay-specific positioning applied to the Avatar cursor label. */
156
- .collaborators-overlay-user-label.components-avatar {
157
- position: absolute;
158
- transform: translate(-11px, -100%);
159
- margin-top: -4px;
160
- pointer-events: auto;
161
- overflow: visible;
162
- width: max-content;
163
- }
164
-
165
- @keyframes collaborators-overlay-cursor-blink {
166
- 0%, 45% { opacity: 1; }
167
- 55%, 95% { opacity: 0; }
168
- 100% { opacity: 1; }
169
- }
170
- .collaborators-overlay-cursor-highlighted .collaborators-overlay-user-cursor {
171
- animation: collaborators-overlay-cursor-highlight 0.6s ease-in-out 3;
172
- }
173
- .collaborators-overlay-cursor-highlighted .collaborators-overlay-user-label {
174
- animation: collaborators-overlay-label-highlight 0.6s ease-in-out 3;
175
- }
176
- @keyframes collaborators-overlay-cursor-highlight {
177
- 0%, 100% {
178
- transform: scale(1);
179
- filter: drop-shadow(0 0 0 transparent);
180
- }
181
- 50% {
182
- transform: scale(1.2);
183
- filter: drop-shadow(0 0 8px currentColor);
184
- }
185
- }
186
- @keyframes collaborators-overlay-label-highlight {
187
- 0%, 100% {
188
- transform: translate(-11px, -100%) scale(1);
189
- filter: drop-shadow(0 0 0 transparent);
190
- }
191
- 50% {
192
- transform: translate(-11px, -100%) scale(1.1);
193
- filter: drop-shadow(0 0 6px currentColor);
194
- }
195
- }
196
- .block-editor-block-list__block.is-collaborator-selected:not(:focus)::after {
197
- content: "";
198
- position: absolute;
199
- pointer-events: none;
200
- top: 0;
201
- right: 0;
202
- bottom: 0;
203
- left: 0;
204
- outline-color: var(--collaborator-outline-color);
205
- outline-style: solid;
206
- outline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
207
- outline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
208
- box-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus, 2px) + 1px) #fff, 0 0 0 1px #fff, ${import_collaborator_styles.ELEVATION_X_SMALL};
209
- z-index: 1;
210
- }
211
- @media (prefers-reduced-motion: reduce) {
212
- .components-avatar.has-badge,
213
- .components-avatar__name,
214
- .collaborators-overlay-user-label,
215
- .collaborators-overlay-user-cursor {
216
- transition: none;
217
- animation: none;
218
- }
219
- }
220
- `;
45
+ var RERENDER_DELAY_MS = 500;
221
46
  function Overlay({
222
47
  blockEditorDocument,
223
48
  postId,
@@ -228,54 +53,100 @@ function Overlay({
228
53
  overlayElement,
229
54
  blockEditorDocument ?? null,
230
55
  postId ?? null,
231
- postType ?? null
56
+ postType ?? null,
57
+ RERENDER_DELAY_MS
58
+ );
59
+ const { highlights, rerenderHighlightsAfterDelay } = (0, import_use_block_highlighting.useBlockHighlighting)(
60
+ overlayElement,
61
+ blockEditorDocument ?? null,
62
+ postId ?? null,
63
+ postType ?? null,
64
+ RERENDER_DELAY_MS
232
65
  );
233
- const resizeObserverRef = (0, import_compose.useResizeObserver)(rerenderCursorsAfterDelay);
234
- (0, import_element.useEffect)(rerenderCursorsAfterDelay, [rerenderCursorsAfterDelay]);
66
+ const onResize = (0, import_element.useCallback)(() => {
67
+ rerenderCursorsAfterDelay();
68
+ rerenderHighlightsAfterDelay();
69
+ }, [rerenderCursorsAfterDelay, rerenderHighlightsAfterDelay]);
70
+ const resizeObserverRef = (0, import_compose.useResizeObserver)(onResize);
71
+ (0, import_element.useEffect)(() => {
72
+ const cleanupCursors = rerenderCursorsAfterDelay();
73
+ const cleanupHighlights = rerenderHighlightsAfterDelay();
74
+ return () => {
75
+ cleanupCursors();
76
+ cleanupHighlights();
77
+ };
78
+ }, [rerenderCursorsAfterDelay, rerenderHighlightsAfterDelay]);
235
79
  const mergedRef = (0, import_compose.useMergeRefs)([
236
80
  setOverlayElement,
237
81
  resizeObserverRef
238
82
  ]);
239
- (0, import_use_block_highlighting.useBlockHighlighting)(
240
- blockEditorDocument ?? null,
241
- postId ?? null,
242
- postType ?? null
243
- );
244
83
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "collaborators-overlay-full", ref: mergedRef, children: [
245
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: COLLABORATORS_OVERLAY_STYLES }),
246
- cursors.map((cursor) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
247
- "div",
248
- {
249
- className: "collaborators-overlay-user",
250
- style: {
251
- left: `${cursor.x}px`,
252
- top: `${cursor.y}px`
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: import_avatar_iframe_styles.AVATAR_IFRAME_STYLES + import_overlay_iframe_styles.OVERLAY_IFRAME_STYLES }),
85
+ cursors.map((cursor) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
86
+ !cursor.isMe && cursor.selectionRects?.map((rect, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
+ "div",
88
+ {
89
+ className: "collaborators-overlay-selection-rect",
90
+ style: {
91
+ left: `${rect.x}px`,
92
+ top: `${rect.y}px`,
93
+ width: `${rect.width}px`,
94
+ height: `${rect.height}px`,
95
+ backgroundColor: cursor.color
96
+ }
253
97
  },
254
- children: [
255
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
256
- "div",
257
- {
258
- className: "collaborators-overlay-user-cursor",
259
- style: {
260
- backgroundColor: cursor.color,
261
- height: `${cursor.height}px`
98
+ `${cursor.clientId}-sel-${index}`
99
+ )),
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
101
+ "div",
102
+ {
103
+ className: "collaborators-overlay-user",
104
+ style: {
105
+ left: `${cursor.x}px`,
106
+ top: `${cursor.y}px`
107
+ },
108
+ children: [
109
+ !cursor.isMe && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
+ "div",
111
+ {
112
+ className: "collaborators-overlay-user-cursor",
113
+ style: {
114
+ backgroundColor: cursor.color,
115
+ height: `${cursor.height}px`
116
+ }
117
+ }
118
+ ),
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ import_avatar.default,
121
+ {
122
+ className: "collaborators-overlay-user-label",
123
+ variant: "badge",
124
+ size: "small",
125
+ src: cursor.avatarUrl,
126
+ name: cursor.userName,
127
+ label: cursor.isMe ? (0, import_i18n.__)("You") : void 0,
128
+ borderColor: cursor.color
262
129
  }
263
- }
264
- ),
265
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
266
- Avatar,
267
- {
268
- className: "collaborators-overlay-user-label",
269
- badge: true,
270
- size: "small",
271
- src: cursor.avatarUrl,
272
- name: cursor.userName,
273
- borderColor: cursor.color
274
- }
275
- )
276
- ]
130
+ )
131
+ ]
132
+ }
133
+ )
134
+ ] }, cursor.clientId)),
135
+ highlights.map((highlight) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
136
+ import_avatar.default,
137
+ {
138
+ className: "collaborators-overlay-block-label",
139
+ variant: "badge",
140
+ size: "small",
141
+ src: highlight.avatarUrl,
142
+ name: highlight.userName,
143
+ borderColor: highlight.color,
144
+ style: {
145
+ left: `${highlight.x}px`,
146
+ top: `${highlight.y}px`
147
+ }
277
148
  },
278
- cursor.clientId
149
+ highlight.blockId
279
150
  ))
280
151
  ] });
281
152
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/collaborators-overlay/overlay.tsx"],
4
- "sourcesContent": ["import { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { useResizeObserver, useMergeRefs } from '@wordpress/compose';\nimport { useEffect, useState } from '@wordpress/element';\n\nimport { unlock } from '../../lock-unlock';\nimport { useBlockHighlighting } from './use-block-highlighting';\nimport { useRenderCursors } from './use-render-cursors';\nimport { ELEVATION_X_SMALL } from './collaborator-styles';\n\nconst { Avatar } = unlock( componentsPrivateApis );\n\n// wp-components styles are excluded from the editor canvas iframe, so the\n// Avatar component's SCSS is not available there. We inject compiled versions\n// of the relevant rules alongside the overlay-specific positioning styles.\nconst COLLABORATORS_OVERLAY_STYLES = `\n.block-canvas-cover {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n\tz-index: 20000;\n}\n.block-canvas-cover .collaborators-overlay-full {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}\n.block-canvas-cover .collaborators-overlay-fixed {\n\tposition: fixed;\n\twidth: 100%;\n\theight: 100%;\n}\n.collaborators-overlay-user {\n\tposition: absolute;\n}\n.collaborators-overlay-user-cursor {\n\tposition: absolute;\n\twidth: 2px;\n\tborder-radius: 1px;\n\toutline: 1px solid #fff;\n\tbox-shadow: ${ ELEVATION_X_SMALL };\n\tanimation: collaborators-overlay-cursor-blink 1s infinite;\n}\n\n/* \u2500\u2500 Avatar component (compiled from packages/components/src/avatar/styles.scss) \u2500\u2500 */\n.components-avatar {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tborder-radius: 9999px;\n\toverflow: clip;\n\tflex-shrink: 0;\n\tbackground-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));\n\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus, 2px) #fff, ${ ELEVATION_X_SMALL };\n}\n.components-avatar__image {\n\tbox-sizing: border-box;\n\tposition: relative;\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 9999px;\n\tborder: 0;\n\tbackground-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));\n\toverflow: clip;\n\tflex-shrink: 0;\n\tfont-size: 0;\n\tcolor: #fff;\n}\n.is-small > .components-avatar__image {\n\twidth: 24px;\n\theight: 24px;\n}\n.has-src > .components-avatar__image {\n\tbackground-image: var(--components-avatar-url);\n\tbackground-size: cover;\n\tbackground-position: center;\n}\n.has-avatar-border-color > .components-avatar__image {\n\tborder: var(--wp-admin-border-width-focus, 2px) solid var(--components-avatar-outline-color);\n\tbox-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 2px) #fff;\n\tbackground-clip: padding-box;\n}\n.components-avatar:not(.has-src) > .components-avatar__image {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 11px;\n\tfont-weight: 499;\n\tborder: 0;\n\tbox-shadow: none;\n\tbackground-clip: border-box;\n}\n.components-avatar:not(.has-src).has-avatar-border-color > .components-avatar__image {\n\tbackground-color: var(--components-avatar-outline-color);\n}\n.components-avatar__name {\n\tfont-size: 13px;\n\tline-height: 20px;\n\tcolor: #fff;\n\tmin-width: 0;\n\tpadding-bottom: 2px;\n\toverflow: hidden;\n\topacity: 0;\n\twhite-space: nowrap;\n\ttransition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);\n}\n.components-avatar.has-badge {\n\tdisplay: inline-grid;\n\tgrid-template-columns: min-content 0fr;\n\tcolumn-gap: 0;\n\tpadding-inline-end: 0;\n\ttransition:\n\t\tgrid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),\n\t\tcolumn-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),\n\t\tpadding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);\n}\n.components-avatar.has-badge:hover {\n\tgrid-template-columns: min-content 1fr;\n\tcolumn-gap: 4px;\n\tpadding-inline-end: 8px;\n\ttransition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);\n}\n.components-avatar.has-badge:hover .components-avatar__name {\n\topacity: 1;\n\ttransition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);\n}\n.components-avatar.has-badge.has-avatar-border-color {\n\tbackground-color: var(--components-avatar-outline-color);\n}\n/* \u2500\u2500 end Avatar \u2500\u2500 */\n\n/* Overlay-specific positioning applied to the Avatar cursor label. */\n.collaborators-overlay-user-label.components-avatar {\n\tposition: absolute;\n\ttransform: translate(-11px, -100%);\n\tmargin-top: -4px;\n\tpointer-events: auto;\n\toverflow: visible;\n\twidth: max-content;\n}\n\n@keyframes collaborators-overlay-cursor-blink {\n\t0%, 45% { opacity: 1; }\n\t55%, 95% { opacity: 0; }\n\t100% { opacity: 1; }\n}\n.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-cursor {\n\tanimation: collaborators-overlay-cursor-highlight 0.6s ease-in-out 3;\n}\n.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-label {\n\tanimation: collaborators-overlay-label-highlight 0.6s ease-in-out 3;\n}\n@keyframes collaborators-overlay-cursor-highlight {\n\t0%, 100% {\n\t\ttransform: scale(1);\n\t\tfilter: drop-shadow(0 0 0 transparent);\n\t}\n\t50% {\n\t\ttransform: scale(1.2);\n\t\tfilter: drop-shadow(0 0 8px currentColor);\n\t}\n}\n@keyframes collaborators-overlay-label-highlight {\n\t0%, 100% {\n\t\ttransform: translate(-11px, -100%) scale(1);\n\t\tfilter: drop-shadow(0 0 0 transparent);\n\t}\n\t50% {\n\t\ttransform: translate(-11px, -100%) scale(1.1);\n\t\tfilter: drop-shadow(0 0 6px currentColor);\n\t}\n}\n.block-editor-block-list__block.is-collaborator-selected:not(:focus)::after {\n\tcontent: \"\";\n\tposition: absolute;\n\tpointer-events: none;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\toutline-color: var(--collaborator-outline-color);\n\toutline-style: solid;\n\toutline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));\n\toutline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));\n\tbox-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus, 2px) + 1px) #fff, 0 0 0 1px #fff, ${ ELEVATION_X_SMALL };\n\tz-index: 1;\n}\n@media (prefers-reduced-motion: reduce) {\n\t.components-avatar.has-badge,\n\t.components-avatar__name,\n\t.collaborators-overlay-user-label,\n\t.collaborators-overlay-user-cursor {\n\t\ttransition: none;\n\t\tanimation: none;\n\t}\n}\n`;\n\ninterface OverlayProps {\n\tblockEditorDocument?: Document;\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * This component is responsible for rendering the overlay components within the editor iframe.\n *\n * @param props - The overlay props.\n * @param props.blockEditorDocument - The block editor document.\n * @param props.postId - The ID of the post.\n * @param props.postType - The type of the post.\n * @return The Overlay component.\n */\nexport function Overlay( {\n\tblockEditorDocument,\n\tpostId,\n\tpostType,\n}: OverlayProps ) {\n\t// Use state for the overlay element so that the hook re-runs once the ref is attached.\n\tconst [ overlayElement, setOverlayElement ] =\n\t\tuseState< HTMLDivElement | null >( null );\n\n\tconst { cursors, rerenderCursorsAfterDelay } = useRenderCursors(\n\t\toverlayElement,\n\t\tblockEditorDocument ?? null,\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\n\t// Detect layout changes on overlay (e.g. turning on \"Show Template\") and window\n\t// resizes, and re-render the cursors.\n\tconst resizeObserverRef = useResizeObserver( rerenderCursorsAfterDelay );\n\tuseEffect( rerenderCursorsAfterDelay, [ rerenderCursorsAfterDelay ] );\n\n\t// Merge the refs to use the same element for both overlay and resize observation\n\tconst mergedRef = useMergeRefs< HTMLDivElement | null >( [\n\t\tsetOverlayElement,\n\t\tresizeObserverRef,\n\t] );\n\n\tuseBlockHighlighting(\n\t\tblockEditorDocument ?? null,\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\n\t// This is a full overlay that covers the entire iframe document. Good for\n\t// scrollable elements like cursor indicators.\n\treturn (\n\t\t<div className=\"collaborators-overlay-full\" ref={ mergedRef }>\n\t\t\t<style>{ COLLABORATORS_OVERLAY_STYLES }</style>\n\t\t\t{ cursors.map( ( cursor ) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={ cursor.clientId }\n\t\t\t\t\tclassName=\"collaborators-overlay-user\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft: `${ cursor.x }px`,\n\t\t\t\t\t\ttop: `${ cursor.y }px`,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"collaborators-overlay-user-cursor\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tbackgroundColor: cursor.color,\n\t\t\t\t\t\t\theight: `${ cursor.height }px`,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<Avatar\n\t\t\t\t\t\tclassName=\"collaborators-overlay-user-label\"\n\t\t\t\t\t\tbadge\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tsrc={ cursor.avatarUrl }\n\t\t\t\t\t\tname={ cursor.userName }\n\t\t\t\t\t\tborderColor={ cursor.color }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAqD;AACrD,qBAAgD;AAChD,qBAAoC;AAEpC,yBAAuB;AACvB,oCAAqC;AACrC,gCAAiC;AACjC,iCAAkC;AAsP/B;AApPH,IAAM,EAAE,OAAO,QAAI,2BAAQ,kBAAAA,WAAsB;AAKjD,IAAM,+BAA+B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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ACV,YAAY;AAAA,EACb;AAIA,QAAM,wBAAoB,kCAAmB,yBAA0B;AACvE,gCAAW,2BAA2B,CAAE,yBAA0B,CAAE;AAGpE,QAAM,gBAAY,6BAAuC;AAAA,IACxD;AAAA,IACA;AAAA,EACD,CAAE;AAEF;AAAA,IACC,uBAAuB;AAAA,IACvB,UAAU;AAAA,IACV,YAAY;AAAA,EACb;AAIA,SACC,6CAAC,SAAI,WAAU,8BAA6B,KAAM,WACjD;AAAA,gDAAC,WAAQ,wCAA8B;AAAA,IACrC,QAAQ,IAAK,CAAE,WAChB;AAAA,MAAC;AAAA;AAAA,QAEA,WAAU;AAAA,QACV,OAAQ;AAAA,UACP,MAAM,GAAI,OAAO,CAAE;AAAA,UACnB,KAAK,GAAI,OAAO,CAAE;AAAA,QACnB;AAAA,QAEA;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,OAAQ;AAAA,gBACP,iBAAiB,OAAO;AAAA,gBACxB,QAAQ,GAAI,OAAO,MAAO;AAAA,cAC3B;AAAA;AAAA,UACD;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,OAAK;AAAA,cACL,MAAK;AAAA,cACL,KAAM,OAAO;AAAA,cACb,MAAO,OAAO;AAAA,cACd,aAAc,OAAO;AAAA;AAAA,UACtB;AAAA;AAAA;AAAA,MArBM,OAAO;AAAA,IAsBd,CACC;AAAA,KACH;AAEF;",
6
- "names": ["componentsPrivateApis"]
4
+ "sourcesContent": ["import { useResizeObserver, useMergeRefs } from '@wordpress/compose';\nimport { useCallback, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\nimport Avatar from '../collaborators-presence/avatar';\nimport { AVATAR_IFRAME_STYLES } from './avatar-iframe-styles';\nimport { OVERLAY_IFRAME_STYLES } from './overlay-iframe-styles';\nimport { useBlockHighlighting } from './use-block-highlighting';\nimport { useRenderCursors } from './use-render-cursors';\n\nconst RERENDER_DELAY_MS = 500;\n\ninterface OverlayProps {\n\tblockEditorDocument?: Document;\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * This component is responsible for rendering the overlay components within the editor iframe.\n *\n * @param props - The overlay props.\n * @param props.blockEditorDocument - The block editor document.\n * @param props.postId - The ID of the post.\n * @param props.postType - The type of the post.\n * @return The Overlay component.\n */\nexport function Overlay( {\n\tblockEditorDocument,\n\tpostId,\n\tpostType,\n}: OverlayProps ) {\n\t// Use state for the overlay element so that the hook re-runs once the ref is attached.\n\tconst [ overlayElement, setOverlayElement ] =\n\t\tuseState< HTMLDivElement | null >( null );\n\n\tconst { cursors, rerenderCursorsAfterDelay } = useRenderCursors(\n\t\toverlayElement,\n\t\tblockEditorDocument ?? null,\n\t\tpostId ?? null,\n\t\tpostType ?? null,\n\t\tRERENDER_DELAY_MS\n\t);\n\n\tconst { highlights, rerenderHighlightsAfterDelay } = useBlockHighlighting(\n\t\toverlayElement,\n\t\tblockEditorDocument ?? null,\n\t\tpostId ?? null,\n\t\tpostType ?? null,\n\t\tRERENDER_DELAY_MS\n\t);\n\n\t// Detect layout changes on overlay (e.g. turning on \"Show Template\") and window\n\t// resizes, and re-render the cursors and block highlights.\n\tconst onResize = useCallback( () => {\n\t\trerenderCursorsAfterDelay();\n\t\trerenderHighlightsAfterDelay();\n\t}, [ rerenderCursorsAfterDelay, rerenderHighlightsAfterDelay ] );\n\tconst resizeObserverRef = useResizeObserver( onResize );\n\n\t// Trigger the initial position computation on mount.\n\tuseEffect( () => {\n\t\tconst cleanupCursors = rerenderCursorsAfterDelay();\n\t\tconst cleanupHighlights = rerenderHighlightsAfterDelay();\n\t\treturn () => {\n\t\t\tcleanupCursors();\n\t\t\tcleanupHighlights();\n\t\t};\n\t}, [ rerenderCursorsAfterDelay, rerenderHighlightsAfterDelay ] );\n\n\t// Merge the refs to use the same element for both overlay and resize observation\n\tconst mergedRef = useMergeRefs< HTMLDivElement | null >( [\n\t\tsetOverlayElement,\n\t\tresizeObserverRef,\n\t] );\n\n\t// This is a full overlay that covers the entire iframe document. Good for\n\t// scrollable elements like cursor indicators.\n\treturn (\n\t\t<div className=\"collaborators-overlay-full\" ref={ mergedRef }>\n\t\t\t<style>{ AVATAR_IFRAME_STYLES + OVERLAY_IFRAME_STYLES }</style>\n\t\t\t{ cursors.map( ( cursor ) => (\n\t\t\t\t<div key={ cursor.clientId }>\n\t\t\t\t\t{ ! cursor.isMe &&\n\t\t\t\t\t\tcursor.selectionRects?.map( ( rect, index ) => (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tkey={ `${ cursor.clientId }-sel-${ index }` }\n\t\t\t\t\t\t\t\tclassName=\"collaborators-overlay-selection-rect\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tleft: `${ rect.x }px`,\n\t\t\t\t\t\t\t\t\ttop: `${ rect.y }px`,\n\t\t\t\t\t\t\t\t\twidth: `${ rect.width }px`,\n\t\t\t\t\t\t\t\t\theight: `${ rect.height }px`,\n\t\t\t\t\t\t\t\t\tbackgroundColor: cursor.color,\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<div\n\t\t\t\t\t\tclassName=\"collaborators-overlay-user\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tleft: `${ cursor.x }px`,\n\t\t\t\t\t\t\ttop: `${ cursor.y }px`,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! cursor.isMe && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"collaborators-overlay-user-cursor\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tbackgroundColor: cursor.color,\n\t\t\t\t\t\t\t\t\theight: `${ cursor.height }px`,\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\t<Avatar\n\t\t\t\t\t\t\tclassName=\"collaborators-overlay-user-label\"\n\t\t\t\t\t\t\tvariant=\"badge\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tsrc={ cursor.avatarUrl }\n\t\t\t\t\t\t\tname={ cursor.userName }\n\t\t\t\t\t\t\tlabel={ cursor.isMe ? __( 'You' ) : undefined }\n\t\t\t\t\t\t\tborderColor={ cursor.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) ) }\n\t\t\t{ highlights.map( ( highlight ) => (\n\t\t\t\t<Avatar\n\t\t\t\t\tkey={ highlight.blockId }\n\t\t\t\t\tclassName=\"collaborators-overlay-block-label\"\n\t\t\t\t\tvariant=\"badge\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tsrc={ highlight.avatarUrl }\n\t\t\t\t\tname={ highlight.userName }\n\t\t\t\t\tborderColor={ highlight.color }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft: `${ highlight.x }px`,\n\t\t\t\t\t\ttop: `${ highlight.y }px`,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAgD;AAChD,qBAAiD;AACjD,kBAAmB;AAEnB,oBAAmB;AACnB,kCAAqC;AACrC,mCAAsC;AACtC,oCAAqC;AACrC,gCAAiC;AAwE9B;AAtEH,IAAM,oBAAoB;AAiBnB,SAAS,QAAS;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACD,GAAkB;AAEjB,QAAM,CAAE,gBAAgB,iBAAkB,QACzC,yBAAmC,IAAK;AAEzC,QAAM,EAAE,SAAS,0BAA0B,QAAI;AAAA,IAC9C;AAAA,IACA,uBAAuB;AAAA,IACvB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,EAAE,YAAY,6BAA6B,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,kBACP,iBAAiB,OAAO;AAAA,kBACxB,QAAQ,GAAI,OAAO,MAAO;AAAA,gBAC3B;AAAA;AAAA,YACD;AAAA,YAED;AAAA,cAAC,cAAAA;AAAA,cAAA;AAAA,gBACA,WAAU;AAAA,gBACV,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,KAAM,OAAO;AAAA,gBACb,MAAO,OAAO;AAAA,gBACd,OAAQ,OAAO,WAAO,gBAAI,KAAM,IAAI;AAAA,gBACpC,aAAc,OAAO;AAAA;AAAA,YACtB;AAAA;AAAA;AAAA,MACD;AAAA,SAxCU,OAAO,QAyClB,CACC;AAAA,IACA,WAAW,IAAK,CAAE,cACnB;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QAEA,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,KAAM,UAAU;AAAA,QAChB,MAAO,UAAU;AAAA,QACjB,aAAc,UAAU;AAAA,QACxB,OAAQ;AAAA,UACP,MAAM,GAAI,UAAU,CAAE;AAAA,UACtB,KAAK,GAAI,UAAU,CAAE;AAAA,QACtB;AAAA;AAAA,MAVM,UAAU;AAAA,IAWjB,CACC;AAAA,KACH;AAEF;",
6
+ "names": ["Avatar"]
7
7
  }
@@ -27,8 +27,10 @@ var import_core_data = require("@wordpress/core-data");
27
27
  var import_element = require("@wordpress/element");
28
28
  var import_lock_unlock = require("../../lock-unlock.cjs");
29
29
  var import_utils = require("../collab-sidebar/utils.cjs");
30
+ var import_get_avatar_url = require("./get-avatar-url.cjs");
31
+ var import_use_debounced_recompute = require("./use-debounced-recompute.cjs");
30
32
  var { useActiveCollaborators, useResolvedSelection } = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
31
- function useBlockHighlighting(blockEditorDocument, postId, postType) {
33
+ function useBlockHighlighting(overlayElement, blockEditorDocument, postId, postType, delayMs) {
32
34
  const highlightedBlockIds = (0, import_element.useRef)(/* @__PURE__ */ new Set());
33
35
  const userStates = useActiveCollaborators(
34
36
  postId ?? null,
@@ -38,12 +40,55 @@ function useBlockHighlighting(blockEditorDocument, postId, postType) {
38
40
  postId ?? null,
39
41
  postType ?? null
40
42
  );
43
+ const [highlights, setHighlights] = (0, import_element.useState)(
44
+ []
45
+ );
46
+ const [recomputeToken, rerenderHighlightsAfterDelay] = (0, import_use_debounced_recompute.useDebouncedRecompute)(delayMs);
41
47
  (0, import_element.useEffect)(() => {
42
- if (blockEditorDocument === null) {
48
+ if (!blockEditorDocument) {
49
+ setHighlights([]);
43
50
  return;
44
51
  }
45
- const unhighlightBlocks = (blockIds) => {
46
- blockIds.forEach((blockId) => {
52
+ const currentHighlightedIds = highlightedBlockIds.current;
53
+ const seen = /* @__PURE__ */ new Set();
54
+ const blocksToHighlight = userStates.filter((userState) => {
55
+ const isWholeBlockSelected = userState.editorState?.selection?.type === import_core_data.SelectionType.WholeBlock;
56
+ return !userState.isMe && isWholeBlockSelected;
57
+ }).map((userState) => {
58
+ let localClientId;
59
+ try {
60
+ ({ localClientId } = resolveSelection(
61
+ userState.editorState?.selection
62
+ ));
63
+ } catch {
64
+ return null;
65
+ }
66
+ if (!localClientId) {
67
+ return null;
68
+ }
69
+ return {
70
+ blockId: localClientId,
71
+ color: userState.isMe ? "var(--wp-admin-theme-color)" : (0, import_utils.getAvatarBorderColor)(userState.collaboratorInfo.id),
72
+ userName: userState.collaboratorInfo.name,
73
+ avatarUrl: (0, import_get_avatar_url.getAvatarUrl)(
74
+ userState.collaboratorInfo.avatar_urls
75
+ )
76
+ };
77
+ }).filter((block) => {
78
+ if (!block) {
79
+ return false;
80
+ }
81
+ if (seen.has(block.blockId)) {
82
+ return false;
83
+ }
84
+ seen.add(block.blockId);
85
+ return true;
86
+ });
87
+ const selectedBlockIds = new Set(
88
+ blocksToHighlight.map((block) => block.blockId)
89
+ );
90
+ for (const blockId of currentHighlightedIds) {
91
+ if (!selectedBlockIds.has(blockId)) {
47
92
  const blockElement = getBlockElementById(
48
93
  blockEditorDocument,
49
94
  blockId
@@ -54,37 +99,13 @@ function useBlockHighlighting(blockEditorDocument, postId, postType) {
54
99
  "--collaborator-outline-color"
55
100
  );
56
101
  }
57
- highlightedBlockIds.current.delete(blockId);
58
- });
59
- };
60
- const blocksToHighlight = userStates.map((userState) => {
61
- const isWholeBlockSelected = userState.editorState?.selection?.type === import_core_data.SelectionType.WholeBlock;
62
- const shouldDrawUser = !userState.isMe;
63
- if (isWholeBlockSelected && shouldDrawUser) {
64
- const { localClientId } = resolveSelection(
65
- userState.editorState?.selection
66
- );
67
- if (!localClientId) {
68
- return null;
69
- }
70
- return {
71
- blockId: localClientId,
72
- color: (0, import_utils.getAvatarBorderColor)(
73
- userState.collaboratorInfo.id
74
- )
75
- };
102
+ currentHighlightedIds.delete(blockId);
76
103
  }
77
- return null;
78
- }).filter((block) => block !== null);
79
- const selectedBlockIds = blocksToHighlight.map(
80
- (block) => block.blockId
81
- );
82
- const blocksIdsToUnhighlight = Array.from(
83
- highlightedBlockIds.current
84
- ).filter((blockId) => !selectedBlockIds.includes(blockId));
85
- unhighlightBlocks(blocksIdsToUnhighlight);
86
- blocksToHighlight.forEach((blockColorPair) => {
87
- const { color, blockId } = blockColorPair;
104
+ }
105
+ const results = [];
106
+ const overlayRect = overlayElement?.getBoundingClientRect() ?? null;
107
+ blocksToHighlight.forEach((block) => {
108
+ const { color, blockId, userName, avatarUrl } = block;
88
109
  const blockElement = getBlockElementById(
89
110
  blockEditorDocument,
90
111
  blockId
@@ -92,16 +113,43 @@ function useBlockHighlighting(blockEditorDocument, postId, postType) {
92
113
  if (!blockElement) {
93
114
  return;
94
115
  }
95
- if (blockElement) {
96
- blockElement.classList.add("is-collaborator-selected");
97
- blockElement.style.setProperty(
98
- "--collaborator-outline-color",
99
- color
100
- );
101
- highlightedBlockIds.current.add(blockId);
116
+ blockElement.classList.add("is-collaborator-selected");
117
+ blockElement.style.setProperty(
118
+ "--collaborator-outline-color",
119
+ color
120
+ );
121
+ currentHighlightedIds.add(blockId);
122
+ if (overlayRect) {
123
+ const blockRect = blockElement.getBoundingClientRect();
124
+ results.push({
125
+ blockId,
126
+ userName,
127
+ avatarUrl,
128
+ color,
129
+ x: blockRect.left - overlayRect.left,
130
+ y: blockRect.top - overlayRect.top
131
+ });
102
132
  }
103
133
  });
104
- }, [userStates, blockEditorDocument, resolveSelection]);
134
+ setHighlights(results);
135
+ return () => {
136
+ for (const blockId of currentHighlightedIds) {
137
+ const el = getBlockElementById(blockEditorDocument, blockId);
138
+ if (el) {
139
+ el.classList.remove("is-collaborator-selected");
140
+ el.style.removeProperty("--collaborator-outline-color");
141
+ }
142
+ }
143
+ currentHighlightedIds.clear();
144
+ };
145
+ }, [
146
+ userStates,
147
+ blockEditorDocument,
148
+ overlayElement,
149
+ recomputeToken,
150
+ resolveSelection
151
+ ]);
152
+ return { highlights, rerenderHighlightsAfterDelay };
105
153
  }
106
154
  var getBlockElementById = (blockEditorDocument, blockId) => {
107
155
  return blockEditorDocument.querySelector(`[data-block="${blockId}"]`);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/collaborators-overlay/use-block-highlighting.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as coreDataPrivateApis,\n\tSelectionType,\n} from '@wordpress/core-data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\n\nconst { useActiveCollaborators, useResolvedSelection } =\n\tunlock( coreDataPrivateApis );\n\n/**\n * Custom hook for highlighting selected blocks in the editor\n * @param blockEditorDocument - Ref to the block editor document, used to directly style block elements.\n * @param postId - The ID of the post\n * @param postType - The type of the post\n */\nexport function useBlockHighlighting(\n\tblockEditorDocument: Document | null,\n\tpostId: number | null,\n\tpostType: string | null\n) {\n\tconst highlightedBlockIds = useRef< Set< string > >( new Set() );\n\tconst userStates = useActiveCollaborators(\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\tconst resolveSelection = useResolvedSelection(\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\n\t// Draw block highlights\n\tuseEffect( () => {\n\t\t// Don't do anything if editor is not rendered yet.\n\t\tif ( blockEditorDocument === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst unhighlightBlocks = ( blockIds: string[] ) => {\n\t\t\tblockIds.forEach( ( blockId ) => {\n\t\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\t\tblockEditorDocument,\n\t\t\t\t\tblockId\n\t\t\t\t);\n\n\t\t\t\tif ( blockElement ) {\n\t\t\t\t\tblockElement.classList.remove( 'is-collaborator-selected' );\n\t\t\t\t\tblockElement.style.removeProperty(\n\t\t\t\t\t\t'--collaborator-outline-color'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\thighlightedBlockIds.current.delete( blockId );\n\t\t\t} );\n\t\t};\n\n\t\tconst blocksToHighlight = userStates\n\t\t\t.map( ( userState: any ) => {\n\t\t\t\tconst isWholeBlockSelected =\n\t\t\t\t\tuserState.editorState?.selection?.type ===\n\t\t\t\t\tSelectionType.WholeBlock;\n\t\t\t\tconst shouldDrawUser = ! userState.isMe;\n\n\t\t\t\tif ( isWholeBlockSelected && shouldDrawUser ) {\n\t\t\t\t\tconst { localClientId } = resolveSelection(\n\t\t\t\t\t\tuserState.editorState?.selection\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( ! localClientId ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tblockId: localClientId,\n\t\t\t\t\t\tcolor: getAvatarBorderColor(\n\t\t\t\t\t\t\tuserState.collaboratorInfo.id\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t} )\n\t\t\t.filter( ( block: any ) => block !== null );\n\n\t\t// Unhighlight blocks that are no longer highlighted.\n\t\tconst selectedBlockIds = blocksToHighlight.map(\n\t\t\t( block: any ) => block.blockId\n\t\t);\n\t\tconst blocksIdsToUnhighlight = Array.from(\n\t\t\thighlightedBlockIds.current\n\t\t).filter( ( blockId ) => ! selectedBlockIds.includes( blockId ) );\n\n\t\tunhighlightBlocks( blocksIdsToUnhighlight );\n\n\t\t// Highlight blocks that are currently highlighted.\n\t\tblocksToHighlight.forEach( ( blockColorPair: any ) => {\n\t\t\tconst { color, blockId } = blockColorPair;\n\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\tblockEditorDocument,\n\t\t\t\tblockId\n\t\t\t);\n\n\t\t\tif ( ! blockElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockElement ) {\n\t\t\t\tblockElement.classList.add( 'is-collaborator-selected' );\n\t\t\t\tblockElement.style.setProperty(\n\t\t\t\t\t'--collaborator-outline-color',\n\t\t\t\t\tcolor\n\t\t\t\t);\n\t\t\t\thighlightedBlockIds.current.add( blockId );\n\t\t\t}\n\t\t} );\n\t}, [ userStates, blockEditorDocument, resolveSelection ] );\n}\n\nconst getBlockElementById = (\n\tblockEditorDocument: Document,\n\tblockId: string\n): HTMLElement | null => {\n\treturn blockEditorDocument.querySelector( `[data-block=\"${ blockId }\"]` );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAGO;AACP,qBAAkC;AAKlC,yBAAuB;AACvB,mBAAqC;AAErC,IAAM,EAAE,wBAAwB,qBAAqB,QACpD,2BAAQ,iBAAAA,WAAoB;AAQtB,SAAS,qBACf,qBACA,QACA,UACC;AACD,QAAM,0BAAsB,uBAAyB,oBAAI,IAAI,CAAE;AAC/D,QAAM,aAAa;AAAA,IAClB,UAAU;AAAA,IACV,YAAY;AAAA,EACb;AACA,QAAM,mBAAmB;AAAA,IACxB,UAAU;AAAA,IACV,YAAY;AAAA,EACb;AAGA,gCAAW,MAAM;AAEhB,QAAK,wBAAwB,MAAO;AACnC;AAAA,IACD;AAEA,U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Q,IAAK,OAAQ;AAAA,MAC1C;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAE,YAAY,qBAAqB,gBAAiB,CAAE;AAC1D;AAEA,IAAM,sBAAsB,CAC3B,qBACA,YACwB;AACxB,SAAO,oBAAoB,cAAe,gBAAiB,OAAQ,IAAK;AACzE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as coreDataPrivateApis,\n\tSelectionType,\n\ttype PostEditorAwarenessState as ActiveCollaborator,\n} from '@wordpress/core-data';\nimport { useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { getAvatarUrl } from './get-avatar-url';\nimport { useDebouncedRecompute } from './use-debounced-recompute';\n\nconst { useActiveCollaborators, useResolvedSelection } =\n\tunlock( coreDataPrivateApis );\n\nexport interface BlockHighlightData {\n\tblockId: string;\n\tuserName: string;\n\tavatarUrl?: string;\n\tcolor: string;\n\tx: number;\n\ty: number;\n}\n\n/**\n * Custom hook for highlighting selected blocks in the editor and computing\n * their positions for rendering avatar labels in the overlay.\n *\n * @param overlayElement - The overlay element used as position reference.\n * @param blockEditorDocument - Ref to the block editor document.\n * @param postId - The ID of the post.\n * @param postType - The type of the post.\n * @param delayMs - Milliseconds to wait before recomputing highlight positions.\n * @return Highlight data for rendering and a delayed recompute function.\n */\nexport function useBlockHighlighting(\n\toverlayElement: HTMLElement | null,\n\tblockEditorDocument: Document | null,\n\tpostId: number | null,\n\tpostType: string | null,\n\tdelayMs: number\n): {\n\thighlights: BlockHighlightData[];\n\trerenderHighlightsAfterDelay: () => () => void;\n} {\n\tconst highlightedBlockIds = useRef< Set< string > >( new Set() );\n\tconst userStates: ActiveCollaborator[] = useActiveCollaborators(\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\tconst resolveSelection = useResolvedSelection(\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\n\tconst [ highlights, setHighlights ] = useState< BlockHighlightData[] >(\n\t\t[]\n\t);\n\n\t// Bump this counter to force the effect to re-run (e.g. after a layout shift).\n\tconst [ recomputeToken, rerenderHighlightsAfterDelay ] =\n\t\tuseDebouncedRecompute( delayMs );\n\n\t// All DOM mutations and position computations live inside useEffect.\n\tuseEffect( () => {\n\t\tif ( ! blockEditorDocument ) {\n\t\t\tsetHighlights( [] );\n\t\t\treturn;\n\t\t}\n\n\t\t// Capture the ref value so the cleanup closure sees the same Set\n\t\t// even if a later render replaces it.\n\t\tconst currentHighlightedIds = highlightedBlockIds.current;\n\n\t\t// Deduplicate by blockId \u2014 when multiple collaborators select the\n\t\t// same block, only the first one gets the highlight and avatar label.\n\t\tconst seen = new Set< string >();\n\t\tconst blocksToHighlight = userStates\n\t\t\t.filter( ( userState: ActiveCollaborator ) => {\n\t\t\t\tconst isWholeBlockSelected =\n\t\t\t\t\tuserState.editorState?.selection?.type ===\n\t\t\t\t\tSelectionType.WholeBlock;\n\n\t\t\t\treturn ! userState.isMe && isWholeBlockSelected;\n\t\t\t} )\n\t\t\t.map( ( userState ) => {\n\t\t\t\tlet localClientId;\n\t\t\t\ttry {\n\t\t\t\t\t( { localClientId } = resolveSelection(\n\t\t\t\t\t\tuserState.editorState?.selection\n\t\t\t\t\t) );\n\t\t\t\t} catch {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif ( ! localClientId ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tblockId: localClientId,\n\t\t\t\t\tcolor: userState.isMe\n\t\t\t\t\t\t? 'var(--wp-admin-theme-color)'\n\t\t\t\t\t\t: getAvatarBorderColor( userState.collaboratorInfo.id ),\n\t\t\t\t\tuserName: userState.collaboratorInfo.name,\n\t\t\t\t\tavatarUrl: getAvatarUrl(\n\t\t\t\t\t\tuserState.collaboratorInfo.avatar_urls\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( block ): block is NonNullable< typeof block > => {\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif ( seen.has( block.blockId ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tseen.add( block.blockId );\n\t\t\t\treturn true;\n\t\t\t} );\n\n\t\t// Unhighlight blocks that are no longer selected.\n\t\tconst selectedBlockIds = new Set(\n\t\t\tblocksToHighlight.map( ( block ) => block.blockId )\n\t\t);\n\n\t\tfor ( const blockId of currentHighlightedIds ) {\n\t\t\tif ( ! selectedBlockIds.has( blockId ) ) {\n\t\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\t\tblockEditorDocument,\n\t\t\t\t\tblockId\n\t\t\t\t);\n\n\t\t\t\tif ( blockElement ) {\n\t\t\t\t\tblockElement.classList.remove( 'is-collaborator-selected' );\n\t\t\t\t\tblockElement.style.removeProperty(\n\t\t\t\t\t\t'--collaborator-outline-color'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcurrentHighlightedIds.delete( blockId );\n\t\t\t}\n\t\t}\n\n\t\t// Highlight blocks and compute positions for avatar labels.\n\t\tconst results: BlockHighlightData[] = [];\n\t\tconst overlayRect = overlayElement?.getBoundingClientRect() ?? null;\n\n\t\tblocksToHighlight.forEach( ( block ) => {\n\t\t\tconst { color, blockId, userName, avatarUrl } = block;\n\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\tblockEditorDocument,\n\t\t\t\tblockId\n\t\t\t);\n\n\t\t\tif ( ! blockElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tblockElement.classList.add( 'is-collaborator-selected' );\n\t\t\tblockElement.style.setProperty(\n\t\t\t\t'--collaborator-outline-color',\n\t\t\t\tcolor\n\t\t\t);\n\t\t\tcurrentHighlightedIds.add( blockId );\n\n\t\t\tif ( overlayRect ) {\n\t\t\t\tconst blockRect = blockElement.getBoundingClientRect();\n\n\t\t\t\tresults.push( {\n\t\t\t\t\tblockId,\n\t\t\t\t\tuserName,\n\t\t\t\t\tavatarUrl,\n\t\t\t\t\tcolor,\n\t\t\t\t\tx: blockRect.left - overlayRect.left,\n\t\t\t\t\ty: blockRect.top - overlayRect.top,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tsetHighlights( results );\n\n\t\t// Clean up all highlights on unmount.\n\t\treturn () => {\n\t\t\tfor ( const blockId of currentHighlightedIds ) {\n\t\t\t\tconst el = getBlockElementById( blockEditorDocument, blockId );\n\t\t\t\tif ( el ) {\n\t\t\t\t\tel.classList.remove( 'is-collaborator-selected' );\n\t\t\t\t\tel.style.removeProperty( '--collaborator-outline-color' );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentHighlightedIds.clear();\n\t\t};\n\t}, [\n\t\tuserStates,\n\t\tblockEditorDocument,\n\t\toverlayElement,\n\t\trecomputeToken,\n\t\tresolveSelection,\n\t] );\n\n\treturn { highlights, rerenderHighlightsAfterDelay };\n}\n\nconst getBlockElementById = (\n\tblockEditorDocument: Document,\n\tblockId: string\n): HTMLElement | null => {\n\treturn blockEditorDocument.querySelector( `[data-block=\"${ blockId }\"]` );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAIO;AACP,qBAA4C;AAK5C,yBAAuB;AACvB,mBAAqC;AACrC,4BAA6B;AAC7B,qCAAsC;AAEtC,IAAM,EAAE,wBAAwB,qBAAqB,QACpD,2BAAQ,iBAAAA,WAAoB;AAsBtB,SAAS,qBACf,gBACA,qBACA,QACA,UACA,SAIC;AACD,QAAM,0BAAsB,uBAAyB,oBAAI,IAAI,CAAE;AAC/D,QAAM,aAAmC;AAAA,IACxC,UAAU;AAAA,IACV,YAAY;AAAA,EACb;AACA,QAAM,mBAAmB;AAAA,IACxB,UAAU;AAAA,IACV,YAAY;AAAA,EACb;AAEA,QAAM,CAAE,YAAY,aAAc,QAAI;AAAA,IACrC,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