@wordpress/editor 14.44.0 → 14.45.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 (363) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/collab-sidebar/{comment-menu-item.cjs → add-note-menu-item.cjs} +17 -14
  3. package/build/components/collab-sidebar/add-note-menu-item.cjs.map +7 -0
  4. package/build/components/collab-sidebar/add-note.cjs +100 -0
  5. package/build/components/collab-sidebar/add-note.cjs.map +7 -0
  6. package/build/components/collab-sidebar/board-store.cjs +106 -0
  7. package/build/components/collab-sidebar/board-store.cjs.map +7 -0
  8. package/build/components/collab-sidebar/floating-container.cjs +63 -0
  9. package/build/components/collab-sidebar/floating-container.cjs.map +7 -0
  10. package/build/components/collab-sidebar/hooks.cjs +105 -140
  11. package/build/components/collab-sidebar/hooks.cjs.map +3 -3
  12. package/build/components/collab-sidebar/index.cjs +28 -90
  13. package/build/components/collab-sidebar/index.cjs.map +3 -3
  14. package/build/components/collab-sidebar/{comment-author-info.cjs → note-byline.cjs} +13 -9
  15. package/build/components/collab-sidebar/note-byline.cjs.map +7 -0
  16. package/build/components/collab-sidebar/note-card.cjs +58 -0
  17. package/build/components/collab-sidebar/note-card.cjs.map +7 -0
  18. package/build/components/collab-sidebar/{comment-form.cjs → note-form.cjs} +46 -45
  19. package/build/components/collab-sidebar/note-form.cjs.map +7 -0
  20. package/build/components/collab-sidebar/{comment-indicator-toolbar.cjs → note-indicator-toolbar.cjs} +31 -27
  21. package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +7 -0
  22. package/build/components/collab-sidebar/note-thread.cjs +321 -0
  23. package/build/components/collab-sidebar/note-thread.cjs.map +7 -0
  24. package/build/components/collab-sidebar/note.cjs +207 -0
  25. package/build/components/collab-sidebar/note.cjs.map +7 -0
  26. package/build/components/collab-sidebar/notes.cjs +237 -0
  27. package/build/components/collab-sidebar/notes.cjs.map +7 -0
  28. package/build/components/collab-sidebar/utils.cjs +80 -14
  29. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  30. package/build/components/collaborators-presence/avatar/component.cjs.map +1 -1
  31. package/build/components/collaborators-presence/index.cjs +3 -3
  32. package/build/components/collaborators-presence/index.cjs.map +2 -2
  33. package/build/components/collaborators-presence/list.cjs +3 -3
  34. package/build/components/collaborators-presence/list.cjs.map +2 -2
  35. package/build/components/document-bar/index.cjs.map +3 -3
  36. package/build/components/error-boundary/index.cjs.map +3 -3
  37. package/build/components/list-view-sidebar/list-view-outline.cjs.map +3 -3
  38. package/build/components/media/media-editor-modal.cjs +93 -0
  39. package/build/components/media/media-editor-modal.cjs.map +7 -0
  40. package/build/components/media-categories/index.cjs +1 -1
  41. package/build/components/media-categories/index.cjs.map +1 -1
  42. package/build/components/more-menu/index.cjs +4 -3
  43. package/build/components/more-menu/index.cjs.map +2 -2
  44. package/build/components/post-actions/set-as-homepage.cjs.map +3 -3
  45. package/build/components/post-actions/set-as-posts-page.cjs.map +3 -3
  46. package/build/components/post-card-panel/index.cjs +2 -2
  47. package/build/components/post-card-panel/index.cjs.map +3 -3
  48. package/build/components/post-content-information/index.cjs.map +3 -3
  49. package/build/components/post-excerpt/panel.cjs.map +3 -3
  50. package/build/components/post-last-edited-panel/index.cjs.map +3 -3
  51. package/build/components/post-preview-button/index.cjs +3 -2
  52. package/build/components/post-preview-button/index.cjs.map +2 -2
  53. package/build/components/post-publish-button/index.cjs +2 -2
  54. package/build/components/post-publish-button/index.cjs.map +2 -2
  55. package/build/components/post-publish-button/label.cjs +4 -2
  56. package/build/components/post-publish-button/label.cjs.map +2 -2
  57. package/build/components/post-publish-panel/maybe-upload-media.cjs +1 -1
  58. package/build/components/post-publish-panel/maybe-upload-media.cjs.map +1 -1
  59. package/build/components/post-publish-panel/postpublish.cjs +3 -2
  60. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  61. package/build/components/post-revisions-panel/index.cjs +2 -2
  62. package/build/components/post-revisions-panel/index.cjs.map +2 -2
  63. package/build/components/post-revisions-preview/diff-markers.cjs +1 -1
  64. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  65. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -0
  66. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  67. package/build/components/post-saved-state/index.cjs +4 -1
  68. package/build/components/post-saved-state/index.cjs.map +2 -2
  69. package/build/components/post-text-editor/index.cjs +3 -4
  70. package/build/components/post-text-editor/index.cjs.map +2 -2
  71. package/build/components/preview-dropdown/index.cjs +3 -2
  72. package/build/components/preview-dropdown/index.cjs.map +2 -2
  73. package/build/components/provider/index.cjs +3 -1
  74. package/build/components/provider/index.cjs.map +3 -3
  75. package/build/components/provider/use-block-editor-settings.cjs +7 -1
  76. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  77. package/build/components/provider/use-upload-save-lock.cjs +2 -12
  78. package/build/components/provider/use-upload-save-lock.cjs.map +2 -2
  79. package/build/components/resizable-editor/resize-handle.cjs +2 -1
  80. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  81. package/build/components/revision-created-panel/index.cjs.map +3 -3
  82. package/build/components/site-discussion/index.cjs.map +2 -2
  83. package/build/components/style-book/constants.cjs +1 -1
  84. package/build/components/style-book/constants.cjs.map +1 -1
  85. package/build/components/style-book/index.cjs +1 -1
  86. package/build/components/style-book/index.cjs.map +1 -1
  87. package/build/components/template-actions-panel/classic-theme-content.cjs.map +2 -2
  88. package/build/components/template-part-menu-items/convert-to-regular.cjs +54 -11
  89. package/build/components/template-part-menu-items/convert-to-regular.cjs.map +3 -3
  90. package/build/components/visual-editor/index.cjs +5 -22
  91. package/build/components/visual-editor/index.cjs.map +2 -2
  92. package/build/store/private-actions.cjs +0 -8
  93. package/build/store/private-actions.cjs.map +2 -2
  94. package/build/store/private-selectors.cjs +0 -5
  95. package/build/store/private-selectors.cjs.map +2 -2
  96. package/build/store/reducer.cjs +0 -10
  97. package/build/store/reducer.cjs.map +2 -2
  98. package/build/utils/media-finalize/index.cjs +3 -2
  99. package/build/utils/media-finalize/index.cjs.map +2 -2
  100. package/build/utils/media-upload/index.cjs +14 -25
  101. package/build/utils/media-upload/index.cjs.map +2 -2
  102. package/build-module/components/collab-sidebar/{comment-menu-item.mjs → add-note-menu-item.mjs} +10 -11
  103. package/build-module/components/collab-sidebar/add-note-menu-item.mjs.map +7 -0
  104. package/build-module/components/collab-sidebar/add-note.mjs +78 -0
  105. package/build-module/components/collab-sidebar/add-note.mjs.map +7 -0
  106. package/build-module/components/collab-sidebar/board-store.mjs +81 -0
  107. package/build-module/components/collab-sidebar/board-store.mjs.map +7 -0
  108. package/build-module/components/collab-sidebar/floating-container.mjs +28 -0
  109. package/build-module/components/collab-sidebar/floating-container.mjs.map +7 -0
  110. package/build-module/components/collab-sidebar/hooks.mjs +105 -144
  111. package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
  112. package/build-module/components/collab-sidebar/index.mjs +29 -95
  113. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  114. package/build-module/components/collab-sidebar/{comment-author-info.mjs → note-byline.mjs} +7 -7
  115. package/build-module/components/collab-sidebar/note-byline.mjs.map +7 -0
  116. package/build-module/components/collab-sidebar/note-card.mjs +33 -0
  117. package/build-module/components/collab-sidebar/note-card.mjs.map +7 -0
  118. package/build-module/components/collab-sidebar/note-form.mjs +84 -0
  119. package/build-module/components/collab-sidebar/note-form.mjs.map +7 -0
  120. package/build-module/components/collab-sidebar/{comment-indicator-toolbar.mjs → note-indicator-toolbar.mjs} +25 -29
  121. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +7 -0
  122. package/build-module/components/collab-sidebar/note-thread.mjs +289 -0
  123. package/build-module/components/collab-sidebar/note-thread.mjs.map +7 -0
  124. package/build-module/components/collab-sidebar/note.mjs +176 -0
  125. package/build-module/components/collab-sidebar/note.mjs.map +7 -0
  126. package/build-module/components/collab-sidebar/notes.mjs +215 -0
  127. package/build-module/components/collab-sidebar/notes.mjs.map +7 -0
  128. package/build-module/components/collab-sidebar/utils.mjs +76 -10
  129. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  130. package/build-module/components/collaborators-presence/avatar/component.mjs.map +1 -1
  131. package/build-module/components/collaborators-presence/index.mjs +3 -3
  132. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  133. package/build-module/components/collaborators-presence/list.mjs +3 -3
  134. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  135. package/build-module/components/document-bar/index.mjs +3 -3
  136. package/build-module/components/document-bar/index.mjs.map +2 -2
  137. package/build-module/components/error-boundary/index.mjs +2 -2
  138. package/build-module/components/error-boundary/index.mjs.map +2 -2
  139. package/build-module/components/list-view-sidebar/list-view-outline.mjs +5 -5
  140. package/build-module/components/list-view-sidebar/list-view-outline.mjs.map +2 -2
  141. package/build-module/components/media/media-editor-modal.mjs +62 -0
  142. package/build-module/components/media/media-editor-modal.mjs.map +7 -0
  143. package/build-module/components/media-categories/index.mjs +1 -1
  144. package/build-module/components/media-categories/index.mjs.map +1 -1
  145. package/build-module/components/more-menu/index.mjs +4 -8
  146. package/build-module/components/more-menu/index.mjs.map +2 -2
  147. package/build-module/components/post-actions/set-as-homepage.mjs +2 -2
  148. package/build-module/components/post-actions/set-as-homepage.mjs.map +2 -2
  149. package/build-module/components/post-actions/set-as-posts-page.mjs +2 -2
  150. package/build-module/components/post-actions/set-as-posts-page.mjs.map +2 -2
  151. package/build-module/components/post-card-panel/index.mjs +5 -5
  152. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  153. package/build-module/components/post-content-information/index.mjs +2 -2
  154. package/build-module/components/post-content-information/index.mjs.map +2 -2
  155. package/build-module/components/post-excerpt/panel.mjs +2 -2
  156. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  157. package/build-module/components/post-last-edited-panel/index.mjs +2 -2
  158. package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
  159. package/build-module/components/post-preview-button/index.mjs +3 -2
  160. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  161. package/build-module/components/post-publish-button/index.mjs +2 -2
  162. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  163. package/build-module/components/post-publish-button/label.mjs +4 -2
  164. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  165. package/build-module/components/post-publish-panel/maybe-upload-media.mjs +1 -1
  166. package/build-module/components/post-publish-panel/maybe-upload-media.mjs.map +1 -1
  167. package/build-module/components/post-publish-panel/postpublish.mjs +3 -3
  168. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  169. package/build-module/components/post-revisions-panel/index.mjs +2 -2
  170. package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
  171. package/build-module/components/post-revisions-preview/diff-markers.mjs +1 -1
  172. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  173. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -0
  174. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  175. package/build-module/components/post-saved-state/index.mjs +4 -1
  176. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  177. package/build-module/components/post-text-editor/index.mjs +2 -3
  178. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  179. package/build-module/components/preview-dropdown/index.mjs +2 -2
  180. package/build-module/components/preview-dropdown/index.mjs.map +2 -2
  181. package/build-module/components/provider/index.mjs +3 -1
  182. package/build-module/components/provider/index.mjs.map +2 -2
  183. package/build-module/components/provider/use-block-editor-settings.mjs +7 -1
  184. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  185. package/build-module/components/provider/use-upload-save-lock.mjs +2 -12
  186. package/build-module/components/provider/use-upload-save-lock.mjs.map +2 -2
  187. package/build-module/components/resizable-editor/resize-handle.mjs +2 -5
  188. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  189. package/build-module/components/revision-created-panel/index.mjs +2 -2
  190. package/build-module/components/revision-created-panel/index.mjs.map +2 -2
  191. package/build-module/components/site-discussion/index.mjs +2 -2
  192. package/build-module/components/site-discussion/index.mjs.map +2 -2
  193. package/build-module/components/style-book/constants.mjs +1 -1
  194. package/build-module/components/style-book/constants.mjs.map +1 -1
  195. package/build-module/components/style-book/index.mjs +1 -1
  196. package/build-module/components/style-book/index.mjs.map +1 -1
  197. package/build-module/components/template-actions-panel/classic-theme-content.mjs +2 -2
  198. package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +2 -2
  199. package/build-module/components/template-part-menu-items/convert-to-regular.mjs +60 -14
  200. package/build-module/components/template-part-menu-items/convert-to-regular.mjs.map +2 -2
  201. package/build-module/components/visual-editor/index.mjs +5 -22
  202. package/build-module/components/visual-editor/index.mjs.map +2 -2
  203. package/build-module/store/private-actions.mjs +0 -7
  204. package/build-module/store/private-actions.mjs.map +2 -2
  205. package/build-module/store/private-selectors.mjs +0 -4
  206. package/build-module/store/private-selectors.mjs.map +2 -2
  207. package/build-module/store/reducer.mjs +0 -9
  208. package/build-module/store/reducer.mjs.map +2 -2
  209. package/build-module/utils/media-finalize/index.mjs +3 -2
  210. package/build-module/utils/media-finalize/index.mjs.map +2 -2
  211. package/build-module/utils/media-upload/index.mjs +14 -25
  212. package/build-module/utils/media-upload/index.mjs.map +2 -2
  213. package/build-style/style-rtl.css +397 -171
  214. package/build-style/style.css +397 -171
  215. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +5 -0
  216. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -0
  217. package/build-types/components/collab-sidebar/add-note.d.ts +6 -0
  218. package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -0
  219. package/build-types/components/collab-sidebar/board-store.d.ts +9 -0
  220. package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -0
  221. package/build-types/components/collab-sidebar/floating-container.d.ts +8 -0
  222. package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -0
  223. package/build-types/components/collab-sidebar/hooks.d.ts +13 -22
  224. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  225. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  226. package/build-types/components/collab-sidebar/note-byline.d.ts +7 -0
  227. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -0
  228. package/build-types/components/collab-sidebar/note-card.d.ts +8 -0
  229. package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -0
  230. package/build-types/components/collab-sidebar/note-form.d.ts +7 -0
  231. package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -0
  232. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +5 -0
  233. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -0
  234. package/build-types/components/collab-sidebar/note-thread.d.ts +11 -0
  235. package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -0
  236. package/build-types/components/collab-sidebar/note.d.ts +9 -0
  237. package/build-types/components/collab-sidebar/note.d.ts.map +1 -0
  238. package/build-types/components/collab-sidebar/notes.d.ts +7 -0
  239. package/build-types/components/collab-sidebar/notes.d.ts.map +1 -0
  240. package/build-types/components/collab-sidebar/utils.d.ts +41 -17
  241. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  242. package/build-types/components/media/media-editor-modal.d.ts +11 -0
  243. package/build-types/components/media/media-editor-modal.d.ts.map +1 -0
  244. package/build-types/components/more-menu/index.d.ts.map +1 -1
  245. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  246. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  247. package/build-types/components/post-publish-button/label.d.ts.map +1 -1
  248. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  249. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  250. package/build-types/components/provider/index.d.ts.map +1 -1
  251. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  252. package/build-types/components/provider/use-upload-save-lock.d.ts +0 -2
  253. package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
  254. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  255. package/build-types/components/style-book/constants.d.ts +1 -1
  256. package/build-types/components/style-book/constants.d.ts.map +1 -1
  257. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -1
  258. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  259. package/build-types/store/private-actions.d.ts +0 -7
  260. package/build-types/store/private-actions.d.ts.map +1 -1
  261. package/build-types/store/private-selectors.d.ts +0 -7
  262. package/build-types/store/private-selectors.d.ts.map +1 -1
  263. package/build-types/store/reducer.d.ts +0 -10
  264. package/build-types/store/reducer.d.ts.map +1 -1
  265. package/build-types/utils/media-finalize/index.d.ts +1 -1
  266. package/build-types/utils/media-finalize/index.d.ts.map +1 -1
  267. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  268. package/package.json +46 -46
  269. package/src/components/collab-sidebar/README.md +117 -0
  270. package/src/components/collab-sidebar/{comment-menu-item.js → add-note-menu-item.js} +8 -10
  271. package/src/components/collab-sidebar/{add-comment.js → add-note.js} +26 -49
  272. package/src/components/collab-sidebar/board-store.js +85 -0
  273. package/src/components/collab-sidebar/floating-container.js +30 -0
  274. package/src/components/collab-sidebar/hooks.js +130 -178
  275. package/src/components/collab-sidebar/index.js +35 -106
  276. package/src/components/collab-sidebar/{comment-author-info.js → note-byline.js} +5 -6
  277. package/src/components/collab-sidebar/note-card.js +36 -0
  278. package/src/components/collab-sidebar/{comment-form.js → note-form.js} +29 -40
  279. package/src/components/collab-sidebar/{comment-indicator-toolbar.js → note-indicator-toolbar.js} +29 -32
  280. package/src/components/collab-sidebar/note-thread.js +331 -0
  281. package/src/components/collab-sidebar/note.js +209 -0
  282. package/src/components/collab-sidebar/notes.js +276 -0
  283. package/src/components/collab-sidebar/style.scss +21 -11
  284. package/src/components/collab-sidebar/test/utils.js +155 -0
  285. package/src/components/collab-sidebar/utils.js +125 -19
  286. package/src/components/collaborators-presence/avatar/component.tsx +1 -1
  287. package/src/components/collaborators-presence/styles/collaborators-list.scss +1 -1
  288. package/src/components/collaborators-presence/styles/collaborators-presence.scss +1 -1
  289. package/src/components/document-bar/index.js +4 -4
  290. package/src/components/document-outline/style.scss +1 -1
  291. package/src/components/error-boundary/index.js +3 -3
  292. package/src/components/list-view-sidebar/list-view-outline.js +6 -6
  293. package/src/components/media/media-editor-modal.js +95 -0
  294. package/src/components/media-categories/index.js +1 -1
  295. package/src/components/more-menu/index.js +4 -8
  296. package/src/components/post-actions/set-as-homepage.js +2 -2
  297. package/src/components/post-actions/set-as-posts-page.js +2 -2
  298. package/src/components/post-card-panel/index.js +7 -7
  299. package/src/components/post-content-information/index.js +3 -3
  300. package/src/components/post-excerpt/panel.js +3 -3
  301. package/src/components/post-last-edited-panel/index.js +3 -3
  302. package/src/components/post-preview-button/index.js +3 -2
  303. package/src/components/post-publish-button/index.js +6 -5
  304. package/src/components/post-publish-button/label.js +3 -1
  305. package/src/components/post-publish-panel/maybe-upload-media.js +1 -1
  306. package/src/components/post-publish-panel/postpublish.js +2 -2
  307. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +10 -16
  308. package/src/components/post-revisions-panel/index.js +3 -3
  309. package/src/components/post-revisions-preview/diff-markers.js +1 -1
  310. package/src/components/post-revisions-preview/revisions-slider.js +1 -0
  311. package/src/components/post-revisions-preview/style.scss +1 -1
  312. package/src/components/post-saved-state/index.js +4 -1
  313. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +0 -1
  314. package/src/components/post-text-editor/index.js +3 -3
  315. package/src/components/preview-dropdown/index.js +2 -2
  316. package/src/components/provider/index.js +4 -0
  317. package/src/components/provider/use-block-editor-settings.js +10 -0
  318. package/src/components/provider/use-upload-save-lock.js +2 -17
  319. package/src/components/resizable-editor/resize-handle.js +2 -5
  320. package/src/components/revision-created-panel/index.js +3 -3
  321. package/src/components/site-discussion/index.js +3 -3
  322. package/src/components/style-book/constants.ts +1 -1
  323. package/src/components/style-book/index.js +1 -1
  324. package/src/components/template-actions-panel/classic-theme-content.js +3 -3
  325. package/src/components/template-actions-panel/style.scss +1 -1
  326. package/src/components/template-part-menu-items/convert-to-regular.js +74 -12
  327. package/src/components/visual-editor/index.js +2 -29
  328. package/src/store/private-actions.js +0 -13
  329. package/src/store/private-selectors.js +0 -10
  330. package/src/store/reducer.js +0 -16
  331. package/src/utils/media-finalize/index.js +2 -1
  332. package/src/utils/media-finalize/test/index.js +25 -1
  333. package/src/utils/media-upload/index.js +26 -29
  334. package/build/components/collab-sidebar/add-comment.cjs +0 -129
  335. package/build/components/collab-sidebar/add-comment.cjs.map +0 -7
  336. package/build/components/collab-sidebar/comment-author-info.cjs.map +0 -7
  337. package/build/components/collab-sidebar/comment-form.cjs.map +0 -7
  338. package/build/components/collab-sidebar/comment-indicator-toolbar.cjs.map +0 -7
  339. package/build/components/collab-sidebar/comment-menu-item.cjs.map +0 -7
  340. package/build/components/collab-sidebar/comments.cjs +0 -816
  341. package/build/components/collab-sidebar/comments.cjs.map +0 -7
  342. package/build-module/components/collab-sidebar/add-comment.mjs +0 -100
  343. package/build-module/components/collab-sidebar/add-comment.mjs.map +0 -7
  344. package/build-module/components/collab-sidebar/comment-author-info.mjs.map +0 -7
  345. package/build-module/components/collab-sidebar/comment-form.mjs +0 -90
  346. package/build-module/components/collab-sidebar/comment-form.mjs.map +0 -7
  347. package/build-module/components/collab-sidebar/comment-indicator-toolbar.mjs.map +0 -7
  348. package/build-module/components/collab-sidebar/comment-menu-item.mjs.map +0 -7
  349. package/build-module/components/collab-sidebar/comments.mjs +0 -799
  350. package/build-module/components/collab-sidebar/comments.mjs.map +0 -7
  351. package/build-types/components/collab-sidebar/add-comment.d.ts +0 -10
  352. package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
  353. package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
  354. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
  355. package/build-types/components/collab-sidebar/comment-form.d.ts +0 -11
  356. package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
  357. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
  358. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
  359. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
  360. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
  361. package/build-types/components/collab-sidebar/comments.d.ts +0 -12
  362. package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
  363. package/src/components/collab-sidebar/comments.js +0 -985
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/media-finalize/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\nexport default async function mediaFinalize( id ) {\n\tawait apiFetch( {\n\t\tpath: `/wp/v2/media/${ id }/finalize`,\n\t\tmethod: 'POST',\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAqB;AAErB,eAAO,cAAsC,IAAK;AACjD,YAAM,iBAAAA,SAAU;AAAA,IACf,MAAM,gBAAiB,EAAG;AAAA,IAC1B,QAAQ;AAAA,EACT,CAAE;AACH;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\nexport default async function mediaFinalize( id, subSizes = [] ) {\n\tawait apiFetch( {\n\t\tpath: `/wp/v2/media/${ id }/finalize`,\n\t\tmethod: 'POST',\n\t\tdata: { sub_sizes: subSizes },\n\t} );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAqB;AAErB,eAAO,cAAsC,IAAI,WAAW,CAAC,GAAI;AAChE,YAAM,iBAAAA,SAAU;AAAA,IACf,MAAM,gBAAiB,EAAG;AAAA,IAC1B,QAAQ;AAAA,IACR,MAAM,EAAE,WAAW,SAAS;AAAA,EAC7B,CAAE;AACH;",
6
6
  "names": ["apiFetch"]
7
7
  }
@@ -27,6 +27,7 @@ var import_uuid = require("uuid");
27
27
  var import_data = require("@wordpress/data");
28
28
  var import_core_data = require("@wordpress/core-data");
29
29
  var import_media_utils = require("@wordpress/media-utils");
30
+ var import_upload_media = require("@wordpress/upload-media");
30
31
  var import_store = require("../../store/index.cjs");
31
32
  var noop = () => {
32
33
  };
@@ -49,41 +50,26 @@ function mediaUpload({
49
50
  unlockPostSaving
50
51
  } = (0, import_data.dispatch)(import_store.store);
51
52
  const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;
53
+ const isClientSideMediaActive = window.__clientSideMediaProcessing && (0, import_upload_media.isClientSideMediaSupported)();
52
54
  const lockKey = `image-upload-${(0, import_uuid.v4)()}`;
53
- let imageIsUploading = false;
54
55
  maxUploadFileSize = maxUploadFileSize || getEditorSettings().maxUploadFileSize;
55
56
  const currentPost = getCurrentPost();
56
57
  const currentPostId = typeof currentPost?.id === "number" ? currentPost.id : currentPost?.wp_id;
57
- const setSaveLock = () => {
58
- if (window.__clientSideMediaProcessing) {
59
- return;
60
- }
61
- lockPostSaving(lockKey);
62
- lockPostAutosaving(lockKey);
63
- imageIsUploading = true;
64
- };
65
- const postData = currentPostId ? { post: currentPostId } : {};
66
58
  const clearSaveLock = () => {
67
- if (window.__clientSideMediaProcessing) {
68
- return;
69
- }
70
59
  unlockPostSaving(lockKey);
71
60
  unlockPostAutosaving(lockKey);
72
- imageIsUploading = false;
73
61
  };
62
+ if (!isClientSideMediaActive) {
63
+ lockPostSaving(lockKey);
64
+ lockPostAutosaving(lockKey);
65
+ }
66
+ const postData = currentPostId ? { post: currentPostId } : {};
74
67
  (0, import_media_utils.uploadMedia)({
75
68
  allowedTypes,
76
69
  filesList,
77
- onFileChange: (file) => {
78
- if (!window.__clientSideMediaProcessing) {
79
- if (!imageIsUploading) {
80
- setSaveLock();
81
- } else {
82
- clearSaveLock();
83
- }
84
- }
85
- onFileChange?.(file);
86
- const entityFiles = file.filter((_file) => _file?.id);
70
+ onFileChange: (files) => {
71
+ onFileChange?.(files);
72
+ const entityFiles = files.filter((_file) => _file?.id);
87
73
  if (entityFiles?.length) {
88
74
  const invalidateCache = true;
89
75
  receiveEntityRecords(
@@ -94,6 +80,9 @@ function mediaUpload({
94
80
  invalidateCache
95
81
  );
96
82
  }
83
+ if (!isClientSideMediaActive && entityFiles.length === files.length) {
84
+ clearSaveLock();
85
+ }
97
86
  },
98
87
  onSuccess,
99
88
  additionalData: {
@@ -102,7 +91,7 @@ function mediaUpload({
102
91
  },
103
92
  maxUploadFileSize,
104
93
  onError: ({ message }) => {
105
- if (!window.__clientSideMediaProcessing) {
94
+ if (!isClientSideMediaActive) {
106
95
  clearSaveLock();
107
96
  }
108
97
  onError(message);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/media-upload/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around uploadMedia() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $0.onSuccess Function called after the final representation of the file is available.\n * @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n\tonSuccess,\n\tmultiple = true,\n} ) {\n\tconst { receiveEntityRecords } = dispatch( coreDataStore );\n\tconst { getCurrentPost, getEditorSettings } = select( editorStore );\n\tconst {\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t} = dispatch( editorStore );\n\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tconst lockKey = `image-upload-${ uuid() }`;\n\tlet imageIsUploading = false;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\tconst currentPost = getCurrentPost();\n\t// Templates and template parts' numerical ID is stored in `wp_id`.\n\tconst currentPostId =\n\t\ttypeof currentPost?.id === 'number'\n\t\t\t? currentPost.id\n\t\t\t: currentPost?.wp_id;\n\tconst setSaveLock = () => {\n\t\tif ( window.__clientSideMediaProcessing ) {\n\t\t\treturn; // Skip - handled by useUploadSaveLock in editor provider\n\t\t}\n\t\tlockPostSaving( lockKey );\n\t\tlockPostAutosaving( lockKey );\n\t\timageIsUploading = true;\n\t};\n\n\tconst postData = currentPostId ? { post: currentPostId } : {};\n\tconst clearSaveLock = () => {\n\t\tif ( window.__clientSideMediaProcessing ) {\n\t\t\treturn; // Skip - handled by useUploadSaveLock in editor provider\n\t\t}\n\t\tunlockPostSaving( lockKey );\n\t\tunlockPostAutosaving( lockKey );\n\t\timageIsUploading = false;\n\t};\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange: ( file ) => {\n\t\t\t// When client-side media processing is enabled, save locking\n\t\t\t// is handled by useUploadSaveLock in the editor provider.\n\t\t\tif ( ! window.__clientSideMediaProcessing ) {\n\t\t\t\tif ( ! imageIsUploading ) {\n\t\t\t\t\tsetSaveLock();\n\t\t\t\t} else {\n\t\t\t\t\tclearSaveLock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tonFileChange?.( file );\n\n\t\t\t// Files are initially received by `onFileChange` as a blob.\n\t\t\t// After that the function is called a second time with the file as an entity.\n\t\t\t// For core-data, we only care about receiving/invalidating entities.\n\t\t\tconst entityFiles = file.filter( ( _file ) => _file?.id );\n\t\t\tif ( entityFiles?.length ) {\n\t\t\t\tconst invalidateCache = true;\n\t\t\t\treceiveEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tentityFiles,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinvalidateCache\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonSuccess,\n\t\tadditionalData: {\n\t\t\t...postData,\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => {\n\t\t\tif ( ! window.__clientSideMediaProcessing ) {\n\t\t\t\tclearSaveLock();\n\t\t\t}\n\t\t\tonError( message );\n\t\t},\n\t\twpAllowedMimeTypes,\n\t\tmultiple,\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA2B;AAK3B,kBAAiC;AACjC,uBAAuC;AACvC,yBAA4B;AAK5B,mBAAqC;AAErC,IAAM,OAAO,MAAM;AAAC;AAgBL,SAAR,YAA8B;AAAA,EACpC,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,WAAW;AACZ,GAAI;AACH,QAAM,EAAE,qBAAqB,QAAI,sBAAU,iBAAAA,KAAc;AACzD,QAAM,EAAE,gBAAgB,kBAAkB,QAAI,oBAAQ,aAAAC,KAAY;AAClE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,sBAAU,aAAAA,KAAY;AAE1B,QAAM,qBAAqB,kBAAkB,EAAE;AAC/C,QAAM,UAAU,oBAAiB,YAAAC,IAAK,CAAE;AACxC,MAAI,mBAAmB;AACvB,sBACC,qBAAqB,kBAAkB,EAAE;AAC1C,QAAM,cAAc,eAAe;AAEnC,QAAM,gBACL,OAAO,aAAa,OAAO,WACxB,YAAY,KACZ,aAAa;AACjB,QAAM,cAAc,MAAM;AACzB,QAAK,OAAO,6BAA8B;AACzC;AAAA,IACD;AACA,mBAAgB,OAAQ;AACxB,uBAAoB,OAAQ;AAC5B,uBAAmB;AAAA,EACpB;AAEA,QAAM,WAAW,gBAAgB,EAAE,MAAM,cAAc,IAAI,CAAC;AAC5D,QAAM,gBAAgB,MAAM;AAC3B,QAAK,OAAO,6BAA8B;AACzC;AAAA,IACD;AACA,qBAAkB,OAAQ;AAC1B,yBAAsB,OAAQ;AAC9B,uBAAmB;AAAA,EACpB;AAEA,sCAAa;AAAA,IACZ;AAAA,IACA;AAAA,IACA,cAAc,CAAE,SAAU;AAGzB,UAAK,CAAE,OAAO,6BAA8B;AAC3C,YAAK,CAAE,kBAAmB;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,wBAAc;AAAA,QACf;AAAA,MACD;AACA,qBAAgB,IAAK;AAKrB,YAAM,cAAc,KAAK,OAAQ,CAAE,UAAW,OAAO,EAAG;AACxD,UAAK,aAAa,QAAS;AAC1B,cAAM,kBAAkB;AACxB;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,MACf,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS,CAAE,EAAE,QAAQ,MAAO;AAC3B,UAAK,CAAE,OAAO,6BAA8B;AAC3C,sBAAc;AAAA,MACf;AACA,cAAS,OAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isClientSideMediaSupported } from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around uploadMedia() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $0.onSuccess Function called after the final representation of the file is available.\n * @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n\tonSuccess,\n\tmultiple = true,\n} ) {\n\tconst { receiveEntityRecords } = dispatch( coreDataStore );\n\tconst { getCurrentPost, getEditorSettings } = select( editorStore );\n\tconst {\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t} = dispatch( editorStore );\n\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tconst isClientSideMediaActive =\n\t\twindow.__clientSideMediaProcessing && isClientSideMediaSupported();\n\tconst lockKey = `image-upload-${ uuid() }`;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\tconst currentPost = getCurrentPost();\n\t// Templates and template parts' numerical ID is stored in `wp_id`.\n\tconst currentPostId =\n\t\ttypeof currentPost?.id === 'number'\n\t\t\t? currentPost.id\n\t\t\t: currentPost?.wp_id;\n\tconst clearSaveLock = () => {\n\t\tunlockPostSaving( lockKey );\n\t\tunlockPostAutosaving( lockKey );\n\t};\n\n\t// Lock saving immediately when the upload starts.\n\t// When client-side media processing is enabled, save locking\n\t// is handled by useUploadSaveLock in the editor provider.\n\tif ( ! isClientSideMediaActive ) {\n\t\tlockPostSaving( lockKey );\n\t\tlockPostAutosaving( lockKey );\n\t}\n\n\tconst postData = currentPostId ? { post: currentPostId } : {};\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange: ( files ) => {\n\t\t\tonFileChange?.( files );\n\n\t\t\t// Files are initially received by `onFileChange` as a blob.\n\t\t\t// After that the function is called again with the file as an entity.\n\t\t\t// For core-data, we only care about receiving/invalidating entities.\n\t\t\tconst entityFiles = files.filter( ( _file ) => _file?.id );\n\t\t\tif ( entityFiles?.length ) {\n\t\t\t\tconst invalidateCache = true;\n\t\t\t\treceiveEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tentityFiles,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinvalidateCache\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Unlock saving once all files have been uploaded (all have IDs).\n\t\t\tif (\n\t\t\t\t! isClientSideMediaActive &&\n\t\t\t\tentityFiles.length === files.length\n\t\t\t) {\n\t\t\t\tclearSaveLock();\n\t\t\t}\n\t\t},\n\t\tonSuccess,\n\t\tadditionalData: {\n\t\t\t...postData,\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => {\n\t\t\tif ( ! isClientSideMediaActive ) {\n\t\t\t\tclearSaveLock();\n\t\t\t}\n\t\t\tonError( message );\n\t\t},\n\t\twpAllowedMimeTypes,\n\t\tmultiple,\n\t} );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA2B;AAK3B,kBAAiC;AACjC,uBAAuC;AACvC,yBAA4B;AAC5B,0BAA2C;AAK3C,mBAAqC;AAErC,IAAM,OAAO,MAAM;AAAC;AAgBL,SAAR,YAA8B;AAAA,EACpC,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,WAAW;AACZ,GAAI;AACH,QAAM,EAAE,qBAAqB,QAAI,sBAAU,iBAAAA,KAAc;AACzD,QAAM,EAAE,gBAAgB,kBAAkB,QAAI,oBAAQ,aAAAC,KAAY;AAClE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,sBAAU,aAAAA,KAAY;AAE1B,QAAM,qBAAqB,kBAAkB,EAAE;AAC/C,QAAM,0BACL,OAAO,mCAA+B,gDAA2B;AAClE,QAAM,UAAU,oBAAiB,YAAAC,IAAK,CAAE;AACxC,sBACC,qBAAqB,kBAAkB,EAAE;AAC1C,QAAM,cAAc,eAAe;AAEnC,QAAM,gBACL,OAAO,aAAa,OAAO,WACxB,YAAY,KACZ,aAAa;AACjB,QAAM,gBAAgB,MAAM;AAC3B,qBAAkB,OAAQ;AAC1B,yBAAsB,OAAQ;AAAA,EAC/B;AAKA,MAAK,CAAE,yBAA0B;AAChC,mBAAgB,OAAQ;AACxB,uBAAoB,OAAQ;AAAA,EAC7B;AAEA,QAAM,WAAW,gBAAgB,EAAE,MAAM,cAAc,IAAI,CAAC;AAE5D,sCAAa;AAAA,IACZ;AAAA,IACA;AAAA,IACA,cAAc,CAAE,UAAW;AAC1B,qBAAgB,KAAM;AAKtB,YAAM,cAAc,MAAM,OAAQ,CAAE,UAAW,OAAO,EAAG;AACzD,UAAK,aAAa,QAAS;AAC1B,cAAM,kBAAkB;AACxB;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAGA,UACC,CAAE,2BACF,YAAY,WAAW,MAAM,QAC5B;AACD,sBAAc;AAAA,MACf;AAAA,IACD;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,MACf,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS,CAAE,EAAE,QAAQ,MAAO;AAC3B,UAAK,CAAE,yBAA0B;AAChC,sBAAc;AAAA,MACf;AACA,cAAS,OAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
6
6
  "names": ["coreDataStore", "editorStore", "uuid"]
7
7
  }
@@ -1,4 +1,4 @@
1
- // packages/editor/src/components/collab-sidebar/comment-menu-item.js
1
+ // packages/editor/src/components/collab-sidebar/add-note-menu-item.js
2
2
  import { MenuItem } from "@wordpress/components";
3
3
  import { __ } from "@wordpress/i18n";
4
4
  import {
@@ -10,8 +10,8 @@ import { getUnregisteredTypeHandlerName } from "@wordpress/blocks";
10
10
  import { store as keyboardShortcutsStore } from "@wordpress/keyboard-shortcuts";
11
11
  import { unlock } from "../../lock-unlock.mjs";
12
12
  import { jsx } from "react/jsx-runtime";
13
- var { CommentIconSlotFill } = unlock(blockEditorPrivateApis);
14
- var AddCommentMenuItem = ({ clientId, onClick, isDistractionFree }) => {
13
+ var { NoteIconSlotFill } = unlock(blockEditorPrivateApis);
14
+ function NoteMenuItem({ clientId, onClick, isDistractionFree }) {
15
15
  const block = useSelect(
16
16
  (select) => {
17
17
  return select(blockEditorStore).getBlock(clientId);
@@ -45,10 +45,10 @@ var AddCommentMenuItem = ({ clientId, onClick, isDistractionFree }) => {
45
45
  children: __("Add note")
46
46
  }
47
47
  );
48
- };
49
- var AddCommentMenuItemFill = ({ onClick, isDistractionFree }) => {
50
- return /* @__PURE__ */ jsx(CommentIconSlotFill.Fill, { children: ({ clientId, onClose }) => /* @__PURE__ */ jsx(
51
- AddCommentMenuItem,
48
+ }
49
+ function AddNoteMenuItem({ onClick, isDistractionFree }) {
50
+ return /* @__PURE__ */ jsx(NoteIconSlotFill.Fill, { children: ({ clientId, onClose }) => /* @__PURE__ */ jsx(
51
+ NoteMenuItem,
52
52
  {
53
53
  clientId,
54
54
  isDistractionFree,
@@ -58,9 +58,8 @@ var AddCommentMenuItemFill = ({ onClick, isDistractionFree }) => {
58
58
  }
59
59
  }
60
60
  ) });
61
- };
62
- var comment_menu_item_default = AddCommentMenuItemFill;
61
+ }
63
62
  export {
64
- comment_menu_item_default as default
63
+ AddNoteMenuItem
65
64
  };
66
- //# sourceMappingURL=comment-menu-item.mjs.map
65
+ //# sourceMappingURL=add-note-menu-item.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collab-sidebar/add-note-menu-item.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { getUnregisteredTypeHandlerName } from '@wordpress/blocks';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { NoteIconSlotFill } = unlock( blockEditorPrivateApis );\n\nfunction NoteMenuItem( { clientId, onClick, isDistractionFree } ) {\n\tconst block = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlock( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst shortcut = useSelect(\n\t\t( select ) =>\n\t\t\tselect( keyboardShortcutsStore ).getShortcutRepresentation(\n\t\t\t\t'core/editor/new-note'\n\t\t\t),\n\t\t[]\n\t);\n\n\tif (\n\t\t! block?.isValid ||\n\t\tblock?.name === getUnregisteredTypeHandlerName()\n\t) {\n\t\treturn null;\n\t}\n\n\tconst isDisabled = isDistractionFree || block?.name === 'core/freeform';\n\n\tlet infoText;\n\n\tif ( isDistractionFree ) {\n\t\tinfoText = __( 'Notes are disabled in distraction free mode.' );\n\t} else if ( block?.name === 'core/freeform' ) {\n\t\tinfoText = __( 'Convert to blocks to add notes.' );\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ onClick }\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdisabled={ isDisabled }\n\t\t\tinfo={ infoText }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ __( 'Add note' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport function AddNoteMenuItem( { onClick, isDistractionFree } ) {\n\treturn (\n\t\t<NoteIconSlotFill.Fill>\n\t\t\t{ ( { clientId, onClose } ) => (\n\t\t\t\t<NoteMenuItem\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonClick( clientId );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</NoteIconSlotFill.Fill>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB;AAAA,EACC,eAAe;AAAA,EACf,SAAS;AAAA,OACH;AACP,SAAS,iBAAiB;AAC1B,SAAS,sCAAsC;AAC/C,SAAS,SAAS,8BAA8B;AAKhD,SAAS,cAAc;AAqCrB;AAnCF,IAAM,EAAE,iBAAiB,IAAI,OAAQ,sBAAuB;AAE5D,SAAS,aAAc,EAAE,UAAU,SAAS,kBAAkB,GAAI;AACjE,QAAM,QAAQ;AAAA,IACb,CAAE,WAAY;AACb,aAAO,OAAQ,gBAAiB,EAAE,SAAU,QAAS;AAAA,IACtD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AACA,QAAM,WAAW;AAAA,IAChB,CAAE,WACD,OAAQ,sBAAuB,EAAE;AAAA,MAChC;AAAA,IACD;AAAA,IACD,CAAC;AAAA,EACF;AAEA,MACC,CAAE,OAAO,WACT,OAAO,SAAS,+BAA+B,GAC9C;AACD,WAAO;AAAA,EACR;AAEA,QAAM,aAAa,qBAAqB,OAAO,SAAS;AAExD,MAAI;AAEJ,MAAK,mBAAoB;AACxB,eAAW,GAAI,8CAA+C;AAAA,EAC/D,WAAY,OAAO,SAAS,iBAAkB;AAC7C,eAAW,GAAI,iCAAkC;AAAA,EAClD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,iBAAc;AAAA,MACd,UAAW;AAAA,MACX,MAAO;AAAA,MACP;AAAA,MAEE,aAAI,UAAW;AAAA;AAAA,EAClB;AAEF;AAEO,SAAS,gBAAiB,EAAE,SAAS,kBAAkB,GAAI;AACjE,SACC,oBAAC,iBAAiB,MAAjB,EACE,WAAE,EAAE,UAAU,QAAQ,MACvB;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAU,MAAM;AACf,gBAAS,QAAS;AAClB,gBAAQ;AAAA,MACT;AAAA;AAAA,EACD,GAEF;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,78 @@
1
+ // packages/editor/src/components/collab-sidebar/add-note.js
2
+ import { __ } from "@wordpress/i18n";
3
+ import { useSelect, useDispatch } from "@wordpress/data";
4
+ import {
5
+ store as blockEditorStore,
6
+ privateApis as blockEditorPrivateApis
7
+ } from "@wordpress/block-editor";
8
+ import { NoteCard } from "./note-card.mjs";
9
+ import { NoteForm } from "./note-form.mjs";
10
+ import { FloatingContainer } from "./floating-container.mjs";
11
+ import { focusNoteThread } from "./utils.mjs";
12
+ import { store as editorStore } from "../../store/index.mjs";
13
+ import { unlock } from "../../lock-unlock.mjs";
14
+ import { jsx } from "react/jsx-runtime";
15
+ var { useBlockElement } = unlock(blockEditorPrivateApis);
16
+ function AddNote({ onSubmit, sidebarRef, floating }) {
17
+ const { clientId } = useSelect((select) => {
18
+ const { getSelectedBlockClientId } = select(blockEditorStore);
19
+ return {
20
+ clientId: getSelectedBlockClientId()
21
+ };
22
+ }, []);
23
+ const selectedNote = useSelect(
24
+ (select) => unlock(select(editorStore)).getSelectedNote(),
25
+ []
26
+ );
27
+ const blockElement = useBlockElement(clientId);
28
+ const { toggleBlockSpotlight } = unlock(useDispatch(blockEditorStore));
29
+ const { selectNote } = unlock(useDispatch(editorStore));
30
+ const unselectNote = () => {
31
+ selectNote(void 0);
32
+ blockElement?.focus();
33
+ toggleBlockSpotlight(clientId, false);
34
+ };
35
+ if (selectedNote !== "new" || !clientId) {
36
+ return null;
37
+ }
38
+ return /* @__PURE__ */ jsx(
39
+ FloatingContainer,
40
+ {
41
+ floating,
42
+ className: "editor-collab-sidebar-panel__thread is-selected",
43
+ gap: "md",
44
+ tabIndex: 0,
45
+ "aria-label": __("New note"),
46
+ role: "treeitem",
47
+ style: floating ? { opacity: !floating.y ? 0 : void 0 } : void 0,
48
+ onBlur: (event) => {
49
+ if (!document.hasFocus()) {
50
+ return;
51
+ }
52
+ if (event.currentTarget.contains(event.relatedTarget)) {
53
+ return;
54
+ }
55
+ toggleBlockSpotlight(clientId, false);
56
+ selectNote(void 0);
57
+ },
58
+ children: /* @__PURE__ */ jsx(NoteCard, { children: /* @__PURE__ */ jsx(
59
+ NoteForm,
60
+ {
61
+ onSubmit: async (inputComment) => {
62
+ const { id } = await onSubmit({
63
+ content: inputComment
64
+ });
65
+ selectNote(id);
66
+ focusNoteThread(id, sidebarRef.current);
67
+ },
68
+ onCancel: unselectNote,
69
+ labels: { input: __("New note") }
70
+ }
71
+ ) })
72
+ }
73
+ );
74
+ }
75
+ export {
76
+ AddNote
77
+ };
78
+ //# sourceMappingURL=add-note.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collab-sidebar/add-note.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NoteCard } from './note-card';\nimport { NoteForm } from './note-form';\nimport { FloatingContainer } from './floating-container';\nimport { focusNoteThread } from './utils';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useBlockElement } = unlock( blockEditorPrivateApis );\n\nexport function AddNote( { onSubmit, sidebarRef, floating } ) {\n\tconst { clientId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlockClientId } = select( blockEditorStore );\n\t\treturn {\n\t\t\tclientId: getSelectedBlockClientId(),\n\t\t};\n\t}, [] );\n\tconst selectedNote = useSelect(\n\t\t( select ) => unlock( select( editorStore ) ).getSelectedNote(),\n\t\t[]\n\t);\n\tconst blockElement = useBlockElement( clientId );\n\tconst { toggleBlockSpotlight } = unlock( useDispatch( blockEditorStore ) );\n\tconst { selectNote } = unlock( useDispatch( editorStore ) );\n\n\tconst unselectNote = () => {\n\t\tselectNote( undefined );\n\t\tblockElement?.focus();\n\t\ttoggleBlockSpotlight( clientId, false );\n\t};\n\n\tif ( selectedNote !== 'new' || ! clientId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<FloatingContainer\n\t\t\tfloating={ floating }\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread is-selected\"\n\t\t\tgap=\"md\"\n\t\t\ttabIndex={ 0 }\n\t\t\taria-label={ __( 'New note' ) }\n\t\t\trole=\"treeitem\"\n\t\t\tstyle={\n\t\t\t\tfloating ? { opacity: ! floating.y ? 0 : undefined } : undefined\n\t\t\t}\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\t// Don't deselect notes when the browser window/tab loses focus.\n\t\t\t\tif ( ! document.hasFocus() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( event.currentTarget.contains( event.relatedTarget ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttoggleBlockSpotlight( clientId, false );\n\t\t\t\tselectNote( undefined );\n\t\t\t} }\n\t\t>\n\t\t\t<NoteCard>\n\t\t\t\t<NoteForm\n\t\t\t\t\tonSubmit={ async ( inputComment ) => {\n\t\t\t\t\t\tconst { id } = await onSubmit( {\n\t\t\t\t\t\t\tcontent: inputComment,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tselectNote( id );\n\t\t\t\t\t\tfocusNoteThread( id, sidebarRef.current );\n\t\t\t\t\t} }\n\t\t\t\t\tonCancel={ unselectNote }\n\t\t\t\t\tlabels={ { input: __( 'New note' ) } }\n\t\t\t\t/>\n\t\t\t</NoteCard>\n\t\t</FloatingContainer>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,WAAW,mBAAmB;AACvC;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AAKP,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AAqDnB;AAnDJ,IAAM,EAAE,gBAAgB,IAAI,OAAQ,sBAAuB;AAEpD,SAAS,QAAS,EAAE,UAAU,YAAY,SAAS,GAAI;AAC7D,QAAM,EAAE,SAAS,IAAI,UAAW,CAAE,WAAY;AAC7C,UAAM,EAAE,yBAAyB,IAAI,OAAQ,gBAAiB;AAC9D,WAAO;AAAA,MACN,UAAU,yBAAyB;AAAA,IACpC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,eAAe;AAAA,IACpB,CAAE,WAAY,OAAQ,OAAQ,WAAY,CAAE,EAAE,gBAAgB;AAAA,IAC9D,CAAC;AAAA,EACF;AACA,QAAM,eAAe,gBAAiB,QAAS;AAC/C,QAAM,EAAE,qBAAqB,IAAI,OAAQ,YAAa,gBAAiB,CAAE;AACzE,QAAM,EAAE,WAAW,IAAI,OAAQ,YAAa,WAAY,CAAE;AAE1D,QAAM,eAAe,MAAM;AAC1B,eAAY,MAAU;AACtB,kBAAc,MAAM;AACpB,yBAAsB,UAAU,KAAM;AAAA,EACvC;AAEA,MAAK,iBAAiB,SAAS,CAAE,UAAW;AAC3C,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,WAAU;AAAA,MACV,KAAI;AAAA,MACJ,UAAW;AAAA,MACX,cAAa,GAAI,UAAW;AAAA,MAC5B,MAAK;AAAA,MACL,OACC,WAAW,EAAE,SAAS,CAAE,SAAS,IAAI,IAAI,OAAU,IAAI;AAAA,MAExD,QAAS,CAAE,UAAW;AAErB,YAAK,CAAE,SAAS,SAAS,GAAI;AAC5B;AAAA,QACD;AACA,YAAK,MAAM,cAAc,SAAU,MAAM,aAAc,GAAI;AAC1D;AAAA,QACD;AACA,6BAAsB,UAAU,KAAM;AACtC,mBAAY,MAAU;AAAA,MACvB;AAAA,MAEA,8BAAC,YACA;AAAA,QAAC;AAAA;AAAA,UACA,UAAW,OAAQ,iBAAkB;AACpC,kBAAM,EAAE,GAAG,IAAI,MAAM,SAAU;AAAA,cAC9B,SAAS;AAAA,YACV,CAAE;AACF,uBAAY,EAAG;AACf,4BAAiB,IAAI,WAAW,OAAQ;AAAA,UACzC;AAAA,UACA,UAAW;AAAA,UACX,QAAS,EAAE,OAAO,GAAI,UAAW,EAAE;AAAA;AAAA,MACpC,GACD;AAAA;AAAA,EACD;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,81 @@
1
+ // packages/editor/src/components/collab-sidebar/board-store.js
2
+ function createBoardStore() {
3
+ const listeners = /* @__PURE__ */ new Set();
4
+ const blockRefs = /* @__PURE__ */ new Map();
5
+ const floatingRefs = /* @__PURE__ */ new Map();
6
+ const idByElement = /* @__PURE__ */ new WeakMap();
7
+ const heights = {};
8
+ let snapshot = {};
9
+ function emit() {
10
+ snapshot = { ...heights };
11
+ for (const listener of listeners) {
12
+ listener();
13
+ }
14
+ }
15
+ const observer = new window.ResizeObserver((entries) => {
16
+ let changed = false;
17
+ for (const entry of entries) {
18
+ const id = idByElement.get(entry.target);
19
+ const newHeight = entry.borderBoxSize[0].blockSize;
20
+ if (heights[id] !== newHeight) {
21
+ heights[id] = newHeight;
22
+ changed = true;
23
+ }
24
+ }
25
+ if (changed) {
26
+ emit();
27
+ }
28
+ });
29
+ return {
30
+ subscribe(listener) {
31
+ listeners.add(listener);
32
+ return () => {
33
+ listeners.delete(listener);
34
+ if (listeners.size === 0) {
35
+ observer.disconnect();
36
+ }
37
+ };
38
+ },
39
+ getSnapshot() {
40
+ return snapshot;
41
+ },
42
+ registerThread(id, blockEl, floatingEl) {
43
+ blockRefs.set(id, blockEl);
44
+ const prev = floatingRefs.get(id);
45
+ if (prev && prev !== floatingEl) {
46
+ observer.unobserve(prev);
47
+ idByElement.delete(prev);
48
+ }
49
+ if (floatingEl) {
50
+ floatingRefs.set(id, floatingEl);
51
+ idByElement.set(floatingEl, id);
52
+ observer.observe(floatingEl);
53
+ }
54
+ emit();
55
+ },
56
+ unregisterThread(id) {
57
+ blockRefs.delete(id);
58
+ const prev = floatingRefs.get(id);
59
+ if (prev) {
60
+ observer.unobserve(prev);
61
+ idByElement.delete(prev);
62
+ floatingRefs.delete(id);
63
+ }
64
+ delete heights[id];
65
+ },
66
+ getBlockRects() {
67
+ return Object.fromEntries(
68
+ Array.from(blockRefs).flatMap(
69
+ ([id, el]) => el ? [[id, el.getBoundingClientRect()]] : []
70
+ )
71
+ );
72
+ },
73
+ getFirstBlockElement() {
74
+ return blockRefs.values().next().value ?? null;
75
+ }
76
+ };
77
+ }
78
+ export {
79
+ createBoardStore
80
+ };
81
+ //# sourceMappingURL=board-store.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collab-sidebar/board-store.js"],
4
+ "sourcesContent": ["export function createBoardStore() {\n\tconst listeners = new Set();\n\tconst blockRefs = new Map();\n\tconst floatingRefs = new Map();\n\tconst idByElement = new WeakMap();\n\tconst heights = {};\n\tlet snapshot = {};\n\n\tfunction emit() {\n\t\tsnapshot = { ...heights };\n\t\tfor ( const listener of listeners ) {\n\t\t\tlistener();\n\t\t}\n\t}\n\n\tconst observer = new window.ResizeObserver( ( entries ) => {\n\t\tlet changed = false;\n\t\tfor ( const entry of entries ) {\n\t\t\tconst id = idByElement.get( entry.target );\n\t\t\tconst newHeight = entry.borderBoxSize[ 0 ].blockSize;\n\t\t\tif ( heights[ id ] !== newHeight ) {\n\t\t\t\theights[ id ] = newHeight;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tif ( changed ) {\n\t\t\temit();\n\t\t}\n\t} );\n\n\treturn {\n\t\tsubscribe( listener ) {\n\t\t\tlisteners.add( listener );\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete( listener );\n\t\t\t\tif ( listeners.size === 0 ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\n\t\tgetSnapshot() {\n\t\t\treturn snapshot;\n\t\t},\n\n\t\tregisterThread( id, blockEl, floatingEl ) {\n\t\t\tblockRefs.set( id, blockEl );\n\t\t\tconst prev = floatingRefs.get( id );\n\t\t\tif ( prev && prev !== floatingEl ) {\n\t\t\t\tobserver.unobserve( prev );\n\t\t\t\tidByElement.delete( prev );\n\t\t\t}\n\t\t\tif ( floatingEl ) {\n\t\t\t\tfloatingRefs.set( id, floatingEl );\n\t\t\t\tidByElement.set( floatingEl, id );\n\t\t\t\tobserver.observe( floatingEl );\n\t\t\t}\n\t\t\temit();\n\t\t},\n\n\t\tunregisterThread( id ) {\n\t\t\tblockRefs.delete( id );\n\t\t\tconst prev = floatingRefs.get( id );\n\t\t\tif ( prev ) {\n\t\t\t\tobserver.unobserve( prev );\n\t\t\t\tidByElement.delete( prev );\n\t\t\t\tfloatingRefs.delete( id );\n\t\t\t}\n\t\t\tdelete heights[ id ];\n\t\t},\n\n\t\tgetBlockRects() {\n\t\t\t// Batch all rect reads before any writes to avoid layout thrashing.\n\t\t\treturn Object.fromEntries(\n\t\t\t\tArray.from( blockRefs ).flatMap( ( [ id, el ] ) =>\n\t\t\t\t\tel ? [ [ id, el.getBoundingClientRect() ] ] : []\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\n\t\tgetFirstBlockElement() {\n\t\t\treturn blockRefs.values().next().value ?? null;\n\t\t},\n\t};\n}\n"],
5
+ "mappings": ";AAAO,SAAS,mBAAmB;AAClC,QAAM,YAAY,oBAAI,IAAI;AAC1B,QAAM,YAAY,oBAAI,IAAI;AAC1B,QAAM,eAAe,oBAAI,IAAI;AAC7B,QAAM,cAAc,oBAAI,QAAQ;AAChC,QAAM,UAAU,CAAC;AACjB,MAAI,WAAW,CAAC;AAEhB,WAAS,OAAO;AACf,eAAW,EAAE,GAAG,QAAQ;AACxB,eAAY,YAAY,WAAY;AACnC,eAAS;AAAA,IACV;AAAA,EACD;AAEA,QAAM,WAAW,IAAI,OAAO,eAAgB,CAAE,YAAa;AAC1D,QAAI,UAAU;AACd,eAAY,SAAS,SAAU;AAC9B,YAAM,KAAK,YAAY,IAAK,MAAM,MAAO;AACzC,YAAM,YAAY,MAAM,cAAe,CAAE,EAAE;AAC3C,UAAK,QAAS,EAAG,MAAM,WAAY;AAClC,gBAAS,EAAG,IAAI;AAChB,kBAAU;AAAA,MACX;AAAA,IACD;AACA,QAAK,SAAU;AACd,WAAK;AAAA,IACN;AAAA,EACD,CAAE;AAEF,SAAO;AAAA,IACN,UAAW,UAAW;AACrB,gBAAU,IAAK,QAAS;AACxB,aAAO,MAAM;AACZ,kBAAU,OAAQ,QAAS;AAC3B,YAAK,UAAU,SAAS,GAAI;AAC3B,mBAAS,WAAW;AAAA,QACrB;AAAA,MACD;AAAA,IACD;AAAA,IAEA,cAAc;AACb,aAAO;AAAA,IACR;AAAA,IAEA,eAAgB,IAAI,SAAS,YAAa;AACzC,gBAAU,IAAK,IAAI,OAAQ;AAC3B,YAAM,OAAO,aAAa,IAAK,EAAG;AAClC,UAAK,QAAQ,SAAS,YAAa;AAClC,iBAAS,UAAW,IAAK;AACzB,oBAAY,OAAQ,IAAK;AAAA,MAC1B;AACA,UAAK,YAAa;AACjB,qBAAa,IAAK,IAAI,UAAW;AACjC,oBAAY,IAAK,YAAY,EAAG;AAChC,iBAAS,QAAS,UAAW;AAAA,MAC9B;AACA,WAAK;AAAA,IACN;AAAA,IAEA,iBAAkB,IAAK;AACtB,gBAAU,OAAQ,EAAG;AACrB,YAAM,OAAO,aAAa,IAAK,EAAG;AAClC,UAAK,MAAO;AACX,iBAAS,UAAW,IAAK;AACzB,oBAAY,OAAQ,IAAK;AACzB,qBAAa,OAAQ,EAAG;AAAA,MACzB;AACA,aAAO,QAAS,EAAG;AAAA,IACpB;AAAA,IAEA,gBAAgB;AAEf,aAAO,OAAO;AAAA,QACb,MAAM,KAAM,SAAU,EAAE;AAAA,UAAS,CAAE,CAAE,IAAI,EAAG,MAC3C,KAAK,CAAE,CAAE,IAAI,GAAG,sBAAsB,CAAE,CAAE,IAAI,CAAC;AAAA,QAChD;AAAA,MACD;AAAA,IACD;AAAA,IAEA,uBAAuB;AACtB,aAAO,UAAU,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA,IAC3C;AAAA,EACD;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ // packages/editor/src/components/collab-sidebar/floating-container.js
2
+ import clsx from "clsx";
3
+ import { Stack } from "@wordpress/ui";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function FloatingContainer({
6
+ floating,
7
+ className,
8
+ style,
9
+ children,
10
+ ...props
11
+ }) {
12
+ const isFloating = !!floating;
13
+ return /* @__PURE__ */ jsx(
14
+ Stack,
15
+ {
16
+ direction: "column",
17
+ className: clsx(className, { "is-floating": isFloating }),
18
+ ref: isFloating ? floating.ref : void 0,
19
+ style: isFloating ? { top: floating.y, ...style } : style,
20
+ ...props,
21
+ children
22
+ }
23
+ );
24
+ }
25
+ export {
26
+ FloatingContainer
27
+ };
28
+ //# sourceMappingURL=floating-container.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collab-sidebar/floating-container.js"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Stack } from '@wordpress/ui';\n\nexport function FloatingContainer( {\n\tfloating,\n\tclassName,\n\tstyle,\n\tchildren,\n\t...props\n} ) {\n\tconst isFloating = !! floating;\n\treturn (\n\t\t<Stack\n\t\t\tdirection=\"column\"\n\t\t\tclassName={ clsx( className, { 'is-floating': isFloating } ) }\n\t\t\tref={ isFloating ? floating.ref : undefined }\n\t\t\tstyle={ isFloating ? { top: floating.y, ...style } : style }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</Stack>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,aAAa;AAWpB;AATK,SAAS,kBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,QAAM,aAAa,CAAC,CAAE;AACtB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,WAAY,KAAM,WAAW,EAAE,eAAe,WAAW,CAAE;AAAA,MAC3D,KAAM,aAAa,SAAS,MAAM;AAAA,MAClC,OAAQ,aAAa,EAAE,KAAK,SAAS,GAAG,GAAG,MAAM,IAAI;AAAA,MACnD,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEF;",
6
+ "names": []
7
+ }