@wordpress/editor 14.44.1-next.v.202604201441.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 (322) 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-comment.cjs → add-note.cjs} +28 -41
  5. package/build/components/collab-sidebar/add-note.cjs.map +7 -0
  6. package/build/components/collab-sidebar/board-store.cjs +3 -0
  7. package/build/components/collab-sidebar/board-store.cjs.map +2 -2
  8. package/build/components/collab-sidebar/floating-container.cjs +4 -3
  9. package/build/components/collab-sidebar/floating-container.cjs.map +3 -3
  10. package/build/components/collab-sidebar/hooks.cjs +92 -135
  11. package/build/components/collab-sidebar/hooks.cjs.map +3 -3
  12. package/build/components/collab-sidebar/index.cjs +28 -79
  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} +45 -36
  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 +23 -25
  29. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  30. package/build/components/document-bar/index.cjs.map +3 -3
  31. package/build/components/error-boundary/index.cjs.map +3 -3
  32. package/build/components/list-view-sidebar/list-view-outline.cjs.map +3 -3
  33. package/build/components/media/media-editor-modal.cjs +93 -0
  34. package/build/components/media/media-editor-modal.cjs.map +7 -0
  35. package/build/components/more-menu/index.cjs +3 -2
  36. package/build/components/more-menu/index.cjs.map +2 -2
  37. package/build/components/post-actions/set-as-homepage.cjs.map +3 -3
  38. package/build/components/post-actions/set-as-posts-page.cjs.map +3 -3
  39. package/build/components/post-card-panel/index.cjs +2 -2
  40. package/build/components/post-card-panel/index.cjs.map +3 -3
  41. package/build/components/post-content-information/index.cjs.map +3 -3
  42. package/build/components/post-excerpt/panel.cjs.map +3 -3
  43. package/build/components/post-last-edited-panel/index.cjs.map +3 -3
  44. package/build/components/post-preview-button/index.cjs +3 -2
  45. package/build/components/post-preview-button/index.cjs.map +2 -2
  46. package/build/components/post-publish-button/index.cjs +2 -2
  47. package/build/components/post-publish-button/index.cjs.map +2 -2
  48. package/build/components/post-publish-button/label.cjs +4 -2
  49. package/build/components/post-publish-button/label.cjs.map +2 -2
  50. package/build/components/post-publish-panel/postpublish.cjs +3 -2
  51. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  52. package/build/components/post-revisions-panel/index.cjs +2 -2
  53. package/build/components/post-revisions-panel/index.cjs.map +2 -2
  54. package/build/components/post-revisions-preview/diff-markers.cjs +1 -1
  55. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  56. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -0
  57. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  58. package/build/components/post-saved-state/index.cjs +4 -1
  59. package/build/components/post-saved-state/index.cjs.map +2 -2
  60. package/build/components/post-text-editor/index.cjs +3 -4
  61. package/build/components/post-text-editor/index.cjs.map +2 -2
  62. package/build/components/preview-dropdown/index.cjs +3 -2
  63. package/build/components/preview-dropdown/index.cjs.map +2 -2
  64. package/build/components/provider/index.cjs +3 -1
  65. package/build/components/provider/index.cjs.map +3 -3
  66. package/build/components/provider/use-block-editor-settings.cjs +7 -1
  67. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  68. package/build/components/provider/use-upload-save-lock.cjs +2 -12
  69. package/build/components/provider/use-upload-save-lock.cjs.map +2 -2
  70. package/build/components/resizable-editor/resize-handle.cjs +2 -1
  71. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  72. package/build/components/revision-created-panel/index.cjs.map +3 -3
  73. package/build/components/site-discussion/index.cjs.map +2 -2
  74. package/build/components/template-actions-panel/classic-theme-content.cjs.map +2 -2
  75. package/build/components/template-part-menu-items/convert-to-regular.cjs +54 -11
  76. package/build/components/template-part-menu-items/convert-to-regular.cjs.map +3 -3
  77. package/build/components/visual-editor/index.cjs +5 -22
  78. package/build/components/visual-editor/index.cjs.map +2 -2
  79. package/build/store/private-actions.cjs +0 -8
  80. package/build/store/private-actions.cjs.map +2 -2
  81. package/build/store/private-selectors.cjs +0 -5
  82. package/build/store/private-selectors.cjs.map +2 -2
  83. package/build/store/reducer.cjs +0 -10
  84. package/build/store/reducer.cjs.map +2 -2
  85. package/build/utils/media-finalize/index.cjs +3 -2
  86. package/build/utils/media-finalize/index.cjs.map +2 -2
  87. package/build/utils/media-upload/index.cjs +14 -25
  88. package/build/utils/media-upload/index.cjs.map +2 -2
  89. package/build-module/components/collab-sidebar/{comment-menu-item.mjs → add-note-menu-item.mjs} +10 -11
  90. package/build-module/components/collab-sidebar/add-note-menu-item.mjs.map +7 -0
  91. package/build-module/components/collab-sidebar/{add-comment.mjs → add-note.mjs} +26 -29
  92. package/build-module/components/collab-sidebar/add-note.mjs.map +7 -0
  93. package/build-module/components/collab-sidebar/board-store.mjs +3 -0
  94. package/build-module/components/collab-sidebar/board-store.mjs.map +2 -2
  95. package/build-module/components/collab-sidebar/floating-container.mjs +4 -3
  96. package/build-module/components/collab-sidebar/floating-container.mjs.map +2 -2
  97. package/build-module/components/collab-sidebar/hooks.mjs +91 -137
  98. package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
  99. package/build-module/components/collab-sidebar/index.mjs +29 -84
  100. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  101. package/build-module/components/collab-sidebar/{comment-author-info.mjs → note-byline.mjs} +7 -7
  102. package/build-module/components/collab-sidebar/note-byline.mjs.map +7 -0
  103. package/build-module/components/collab-sidebar/note-card.mjs +33 -0
  104. package/build-module/components/collab-sidebar/note-card.mjs.map +7 -0
  105. package/build-module/components/collab-sidebar/note-form.mjs +84 -0
  106. package/build-module/components/collab-sidebar/note-form.mjs.map +7 -0
  107. package/build-module/components/collab-sidebar/{comment-indicator-toolbar.mjs → note-indicator-toolbar.mjs} +25 -29
  108. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +7 -0
  109. package/build-module/components/collab-sidebar/note-thread.mjs +289 -0
  110. package/build-module/components/collab-sidebar/note-thread.mjs.map +7 -0
  111. package/build-module/components/collab-sidebar/note.mjs +176 -0
  112. package/build-module/components/collab-sidebar/note.mjs.map +7 -0
  113. package/build-module/components/collab-sidebar/notes.mjs +215 -0
  114. package/build-module/components/collab-sidebar/notes.mjs.map +7 -0
  115. package/build-module/components/collab-sidebar/utils.mjs +19 -21
  116. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  117. package/build-module/components/document-bar/index.mjs +3 -3
  118. package/build-module/components/document-bar/index.mjs.map +2 -2
  119. package/build-module/components/error-boundary/index.mjs +2 -2
  120. package/build-module/components/error-boundary/index.mjs.map +2 -2
  121. package/build-module/components/list-view-sidebar/list-view-outline.mjs +5 -5
  122. package/build-module/components/list-view-sidebar/list-view-outline.mjs.map +2 -2
  123. package/build-module/components/media/media-editor-modal.mjs +62 -0
  124. package/build-module/components/media/media-editor-modal.mjs.map +7 -0
  125. package/build-module/components/more-menu/index.mjs +3 -7
  126. package/build-module/components/more-menu/index.mjs.map +2 -2
  127. package/build-module/components/post-actions/set-as-homepage.mjs +2 -2
  128. package/build-module/components/post-actions/set-as-homepage.mjs.map +2 -2
  129. package/build-module/components/post-actions/set-as-posts-page.mjs +2 -2
  130. package/build-module/components/post-actions/set-as-posts-page.mjs.map +2 -2
  131. package/build-module/components/post-card-panel/index.mjs +5 -5
  132. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  133. package/build-module/components/post-content-information/index.mjs +2 -2
  134. package/build-module/components/post-content-information/index.mjs.map +2 -2
  135. package/build-module/components/post-excerpt/panel.mjs +2 -2
  136. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  137. package/build-module/components/post-last-edited-panel/index.mjs +2 -2
  138. package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
  139. package/build-module/components/post-preview-button/index.mjs +3 -2
  140. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  141. package/build-module/components/post-publish-button/index.mjs +2 -2
  142. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  143. package/build-module/components/post-publish-button/label.mjs +4 -2
  144. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  145. package/build-module/components/post-publish-panel/postpublish.mjs +3 -3
  146. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  147. package/build-module/components/post-revisions-panel/index.mjs +2 -2
  148. package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
  149. package/build-module/components/post-revisions-preview/diff-markers.mjs +1 -1
  150. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  151. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -0
  152. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  153. package/build-module/components/post-saved-state/index.mjs +4 -1
  154. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  155. package/build-module/components/post-text-editor/index.mjs +2 -3
  156. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  157. package/build-module/components/preview-dropdown/index.mjs +2 -2
  158. package/build-module/components/preview-dropdown/index.mjs.map +2 -2
  159. package/build-module/components/provider/index.mjs +3 -1
  160. package/build-module/components/provider/index.mjs.map +2 -2
  161. package/build-module/components/provider/use-block-editor-settings.mjs +7 -1
  162. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  163. package/build-module/components/provider/use-upload-save-lock.mjs +2 -12
  164. package/build-module/components/provider/use-upload-save-lock.mjs.map +2 -2
  165. package/build-module/components/resizable-editor/resize-handle.mjs +2 -5
  166. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  167. package/build-module/components/revision-created-panel/index.mjs +2 -2
  168. package/build-module/components/revision-created-panel/index.mjs.map +2 -2
  169. package/build-module/components/site-discussion/index.mjs +2 -2
  170. package/build-module/components/site-discussion/index.mjs.map +2 -2
  171. package/build-module/components/template-actions-panel/classic-theme-content.mjs +2 -2
  172. package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +2 -2
  173. package/build-module/components/template-part-menu-items/convert-to-regular.mjs +60 -14
  174. package/build-module/components/template-part-menu-items/convert-to-regular.mjs.map +2 -2
  175. package/build-module/components/visual-editor/index.mjs +5 -22
  176. package/build-module/components/visual-editor/index.mjs.map +2 -2
  177. package/build-module/store/private-actions.mjs +0 -7
  178. package/build-module/store/private-actions.mjs.map +2 -2
  179. package/build-module/store/private-selectors.mjs +0 -4
  180. package/build-module/store/private-selectors.mjs.map +2 -2
  181. package/build-module/store/reducer.mjs +0 -9
  182. package/build-module/store/reducer.mjs.map +2 -2
  183. package/build-module/utils/media-finalize/index.mjs +3 -2
  184. package/build-module/utils/media-finalize/index.mjs.map +2 -2
  185. package/build-module/utils/media-upload/index.mjs +14 -25
  186. package/build-module/utils/media-upload/index.mjs.map +2 -2
  187. package/build-style/style-rtl.css +386 -142
  188. package/build-style/style.css +386 -142
  189. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +5 -0
  190. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -0
  191. package/build-types/components/collab-sidebar/add-note.d.ts +6 -0
  192. package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -0
  193. package/build-types/components/collab-sidebar/board-store.d.ts +1 -0
  194. package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -1
  195. package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -1
  196. package/build-types/components/collab-sidebar/hooks.d.ts +8 -21
  197. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  198. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  199. package/build-types/components/collab-sidebar/note-byline.d.ts +7 -0
  200. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -0
  201. package/build-types/components/collab-sidebar/note-card.d.ts +8 -0
  202. package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -0
  203. package/build-types/components/collab-sidebar/note-form.d.ts +7 -0
  204. package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -0
  205. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +5 -0
  206. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -0
  207. package/build-types/components/collab-sidebar/note-thread.d.ts +11 -0
  208. package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -0
  209. package/build-types/components/collab-sidebar/note.d.ts +9 -0
  210. package/build-types/components/collab-sidebar/note.d.ts.map +1 -0
  211. package/build-types/components/collab-sidebar/notes.d.ts +7 -0
  212. package/build-types/components/collab-sidebar/notes.d.ts.map +1 -0
  213. package/build-types/components/collab-sidebar/utils.d.ts +21 -20
  214. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  215. package/build-types/components/media/media-editor-modal.d.ts +11 -0
  216. package/build-types/components/media/media-editor-modal.d.ts.map +1 -0
  217. package/build-types/components/more-menu/index.d.ts.map +1 -1
  218. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  219. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  220. package/build-types/components/post-publish-button/label.d.ts.map +1 -1
  221. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  222. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  223. package/build-types/components/provider/index.d.ts.map +1 -1
  224. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  225. package/build-types/components/provider/use-upload-save-lock.d.ts +0 -2
  226. package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
  227. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  228. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -1
  229. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  230. package/build-types/store/private-actions.d.ts +0 -7
  231. package/build-types/store/private-actions.d.ts.map +1 -1
  232. package/build-types/store/private-selectors.d.ts +0 -7
  233. package/build-types/store/private-selectors.d.ts.map +1 -1
  234. package/build-types/store/reducer.d.ts +0 -10
  235. package/build-types/store/reducer.d.ts.map +1 -1
  236. package/build-types/utils/media-finalize/index.d.ts +1 -1
  237. package/build-types/utils/media-finalize/index.d.ts.map +1 -1
  238. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  239. package/package.json +46 -46
  240. package/src/components/collab-sidebar/README.md +117 -0
  241. package/src/components/collab-sidebar/{comment-menu-item.js → add-note-menu-item.js} +8 -10
  242. package/src/components/collab-sidebar/{add-comment.js → add-note.js} +20 -21
  243. package/src/components/collab-sidebar/board-store.js +4 -2
  244. package/src/components/collab-sidebar/floating-container.js +5 -4
  245. package/src/components/collab-sidebar/hooks.js +115 -175
  246. package/src/components/collab-sidebar/index.js +35 -95
  247. package/src/components/collab-sidebar/{comment-author-info.js → note-byline.js} +5 -6
  248. package/src/components/collab-sidebar/note-card.js +36 -0
  249. package/src/components/collab-sidebar/{comment-form.js → note-form.js} +25 -27
  250. package/src/components/collab-sidebar/{comment-indicator-toolbar.js → note-indicator-toolbar.js} +29 -32
  251. package/src/components/collab-sidebar/note-thread.js +331 -0
  252. package/src/components/collab-sidebar/note.js +209 -0
  253. package/src/components/collab-sidebar/notes.js +276 -0
  254. package/src/components/collab-sidebar/style.scss +21 -11
  255. package/src/components/collab-sidebar/test/utils.js +65 -63
  256. package/src/components/collab-sidebar/utils.js +33 -35
  257. package/src/components/document-bar/index.js +4 -4
  258. package/src/components/error-boundary/index.js +3 -3
  259. package/src/components/list-view-sidebar/list-view-outline.js +6 -6
  260. package/src/components/media/media-editor-modal.js +95 -0
  261. package/src/components/more-menu/index.js +3 -7
  262. package/src/components/post-actions/set-as-homepage.js +2 -2
  263. package/src/components/post-actions/set-as-posts-page.js +2 -2
  264. package/src/components/post-card-panel/index.js +7 -7
  265. package/src/components/post-content-information/index.js +3 -3
  266. package/src/components/post-excerpt/panel.js +3 -3
  267. package/src/components/post-last-edited-panel/index.js +3 -3
  268. package/src/components/post-preview-button/index.js +3 -2
  269. package/src/components/post-publish-button/index.js +6 -5
  270. package/src/components/post-publish-button/label.js +3 -1
  271. package/src/components/post-publish-panel/postpublish.js +2 -2
  272. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -14
  273. package/src/components/post-revisions-panel/index.js +3 -3
  274. package/src/components/post-revisions-preview/diff-markers.js +1 -1
  275. package/src/components/post-revisions-preview/revisions-slider.js +1 -0
  276. package/src/components/post-saved-state/index.js +4 -1
  277. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +0 -1
  278. package/src/components/post-text-editor/index.js +3 -3
  279. package/src/components/preview-dropdown/index.js +2 -2
  280. package/src/components/provider/index.js +4 -0
  281. package/src/components/provider/use-block-editor-settings.js +10 -0
  282. package/src/components/provider/use-upload-save-lock.js +2 -17
  283. package/src/components/resizable-editor/resize-handle.js +2 -5
  284. package/src/components/revision-created-panel/index.js +3 -3
  285. package/src/components/site-discussion/index.js +3 -3
  286. package/src/components/template-actions-panel/classic-theme-content.js +3 -3
  287. package/src/components/template-part-menu-items/convert-to-regular.js +74 -12
  288. package/src/components/visual-editor/index.js +2 -29
  289. package/src/store/private-actions.js +0 -13
  290. package/src/store/private-selectors.js +0 -10
  291. package/src/store/reducer.js +0 -16
  292. package/src/utils/media-finalize/index.js +2 -1
  293. package/src/utils/media-finalize/test/index.js +25 -1
  294. package/src/utils/media-upload/index.js +26 -29
  295. package/build/components/collab-sidebar/add-comment.cjs.map +0 -7
  296. package/build/components/collab-sidebar/comment-author-info.cjs.map +0 -7
  297. package/build/components/collab-sidebar/comment-form.cjs.map +0 -7
  298. package/build/components/collab-sidebar/comment-indicator-toolbar.cjs.map +0 -7
  299. package/build/components/collab-sidebar/comment-menu-item.cjs.map +0 -7
  300. package/build/components/collab-sidebar/comments.cjs +0 -696
  301. package/build/components/collab-sidebar/comments.cjs.map +0 -7
  302. package/build-module/components/collab-sidebar/add-comment.mjs.map +0 -7
  303. package/build-module/components/collab-sidebar/comment-author-info.mjs.map +0 -7
  304. package/build-module/components/collab-sidebar/comment-form.mjs +0 -82
  305. package/build-module/components/collab-sidebar/comment-form.mjs.map +0 -7
  306. package/build-module/components/collab-sidebar/comment-indicator-toolbar.mjs.map +0 -7
  307. package/build-module/components/collab-sidebar/comment-menu-item.mjs.map +0 -7
  308. package/build-module/components/collab-sidebar/comments.mjs +0 -678
  309. package/build-module/components/collab-sidebar/comments.mjs.map +0 -7
  310. package/build-types/components/collab-sidebar/add-comment.d.ts +0 -6
  311. package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
  312. package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
  313. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
  314. package/build-types/components/collab-sidebar/comment-form.d.ts +0 -9
  315. package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
  316. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
  317. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
  318. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
  319. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
  320. package/build-types/components/collab-sidebar/comments.d.ts +0 -10
  321. package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
  322. package/src/components/collab-sidebar/comments.js +0 -812
@@ -0,0 +1,215 @@
1
+ // packages/editor/src/components/collab-sidebar/notes.js
2
+ import { useEffect, useMemo } from "@wordpress/element";
3
+ import { __ } from "@wordpress/i18n";
4
+ import { useSelect, useDispatch } from "@wordpress/data";
5
+ import { Stack } from "@wordpress/ui";
6
+ import {
7
+ store as blockEditorStore,
8
+ privateApis as blockEditorPrivateApis
9
+ } from "@wordpress/block-editor";
10
+ import { unlock } from "../../lock-unlock.mjs";
11
+ import { NoteThread } from "./note-thread.mjs";
12
+ import { focusNoteThread } from "./utils.mjs";
13
+ import { useFloatingBoard, useNoteActions } from "./hooks.mjs";
14
+ import { AddNote } from "./add-note.mjs";
15
+ import { store as editorStore } from "../../store/index.mjs";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ var { useBlockElement } = unlock(blockEditorPrivateApis);
18
+ function Notes({ notes, sidebarRef, isFloating = false, styles }) {
19
+ const {
20
+ onCreate: onAddReply,
21
+ onEdit: onEditNote,
22
+ onDelete
23
+ } = useNoteActions();
24
+ const { selectNote } = unlock(useDispatch(editorStore));
25
+ const { selectBlock, toggleBlockSpotlight } = unlock(
26
+ useDispatch(blockEditorStore)
27
+ );
28
+ const { blockNoteId, selectedBlockClientId, orderedBlockIds } = useSelect(
29
+ (select) => {
30
+ const {
31
+ getBlockAttributes,
32
+ getSelectedBlockClientId,
33
+ getClientIdsWithDescendants
34
+ } = select(blockEditorStore);
35
+ const clientId = getSelectedBlockClientId();
36
+ return {
37
+ blockNoteId: clientId ? getBlockAttributes(clientId)?.metadata?.noteId : null,
38
+ selectedBlockClientId: clientId,
39
+ orderedBlockIds: getClientIdsWithDescendants()
40
+ };
41
+ },
42
+ []
43
+ );
44
+ const { selectedNote, noteFocused } = useSelect((select) => {
45
+ const { getSelectedNote, isNoteFocused } = unlock(
46
+ select(editorStore)
47
+ );
48
+ return {
49
+ selectedNote: getSelectedNote(),
50
+ noteFocused: isNoteFocused()
51
+ };
52
+ }, []);
53
+ const relatedBlockElement = useBlockElement(selectedBlockClientId);
54
+ const threads = useMemo(() => {
55
+ if (!isFloating || selectedNote !== "new") {
56
+ return notes;
57
+ }
58
+ const newNoteThread = {
59
+ id: "new",
60
+ blockClientId: selectedBlockClientId,
61
+ content: { rendered: "" }
62
+ };
63
+ const out = [];
64
+ orderedBlockIds.forEach((blockId) => {
65
+ if (blockId === selectedBlockClientId) {
66
+ out.push(newNoteThread);
67
+ } else {
68
+ const threadForBlock = notes.find(
69
+ (t) => t.blockClientId === blockId
70
+ );
71
+ if (threadForBlock) {
72
+ out.push(threadForBlock);
73
+ }
74
+ }
75
+ });
76
+ return out;
77
+ }, [
78
+ notes,
79
+ isFloating,
80
+ selectedNote,
81
+ selectedBlockClientId,
82
+ orderedBlockIds
83
+ ]);
84
+ const handleDelete = async (note) => {
85
+ const currentIndex = threads.findIndex((t) => t.id === note.id);
86
+ const nextThread = threads[currentIndex + 1];
87
+ const prevThread = threads[currentIndex - 1];
88
+ await onDelete(note);
89
+ if (note.parent !== 0) {
90
+ selectNote(note.parent);
91
+ focusNoteThread(note.parent, sidebarRef.current);
92
+ return;
93
+ }
94
+ if (nextThread) {
95
+ selectNote(nextThread.id);
96
+ focusNoteThread(nextThread.id, sidebarRef.current);
97
+ } else if (prevThread) {
98
+ selectNote(prevThread.id);
99
+ focusNoteThread(prevThread.id, sidebarRef.current);
100
+ } else {
101
+ selectNote(void 0);
102
+ toggleBlockSpotlight(note.blockClientId, false);
103
+ relatedBlockElement?.focus();
104
+ }
105
+ };
106
+ useEffect(() => {
107
+ selectNote(blockNoteId ?? void 0);
108
+ }, [blockNoteId, selectNote]);
109
+ useEffect(() => {
110
+ if (noteFocused && selectedNote) {
111
+ focusNoteThread(
112
+ selectedNote,
113
+ sidebarRef.current,
114
+ selectedNote === "new" ? "textarea" : void 0
115
+ );
116
+ selectNote(selectedNote);
117
+ }
118
+ }, [noteFocused, selectedNote, selectNote, sidebarRef]);
119
+ const { notePositions, registerThread, unregisterThread } = useFloatingBoard({
120
+ threads,
121
+ selectedNoteId: selectedNote,
122
+ isFloating,
123
+ sidebarRef
124
+ });
125
+ const hasThreads = Array.isArray(threads) && threads.length > 0;
126
+ const navigate = (event, thread, isSelected) => {
127
+ if (event.defaultPrevented) {
128
+ return;
129
+ }
130
+ const currentIndex = threads.findIndex((t) => t.id === thread.id);
131
+ const isSelfTarget = event.currentTarget === event.target;
132
+ if ((event.key === "Enter" || event.key === "ArrowRight") && isSelfTarget && !isSelected) {
133
+ selectNote(thread.id);
134
+ if (!!thread.blockClientId) {
135
+ selectBlock(thread.blockClientId, null);
136
+ toggleBlockSpotlight(thread.blockClientId, true);
137
+ }
138
+ } else if ((event.key === "Enter" || event.key === "ArrowLeft") && isSelfTarget && isSelected || event.key === "Escape") {
139
+ selectNote(void 0);
140
+ if (thread.blockClientId) {
141
+ toggleBlockSpotlight(thread.blockClientId, false);
142
+ }
143
+ focusNoteThread(thread.id, sidebarRef.current);
144
+ } else if (event.key === "ArrowDown" && currentIndex < threads.length - 1 && isSelfTarget) {
145
+ focusNoteThread(
146
+ threads[currentIndex + 1].id,
147
+ sidebarRef.current
148
+ );
149
+ } else if (event.key === "ArrowUp" && currentIndex > 0 && isSelfTarget) {
150
+ focusNoteThread(
151
+ threads[currentIndex - 1].id,
152
+ sidebarRef.current
153
+ );
154
+ } else if (event.key === "Home" && isSelfTarget) {
155
+ focusNoteThread(threads[0].id, sidebarRef.current);
156
+ } else if (event.key === "End" && isSelfTarget) {
157
+ focusNoteThread(
158
+ threads[threads.length - 1].id,
159
+ sidebarRef.current
160
+ );
161
+ }
162
+ };
163
+ return /* @__PURE__ */ jsx(
164
+ Stack,
165
+ {
166
+ className: "editor-collab-sidebar-panel",
167
+ style: styles,
168
+ role: "tree",
169
+ direction: "column",
170
+ gap: "md",
171
+ justify: "flex-start",
172
+ ref: (node) => {
173
+ if (node) {
174
+ sidebarRef.current = node;
175
+ }
176
+ },
177
+ "aria-label": isFloating ? __("Unresolved notes") : __("All notes"),
178
+ children: !hasThreads && !isFloating ? /* @__PURE__ */ jsx(AddNote, { onSubmit: onAddReply, sidebarRef }) : /* @__PURE__ */ jsxs(Fragment, { children: [
179
+ !isFloating && selectedNote === "new" && /* @__PURE__ */ jsx(
180
+ AddNote,
181
+ {
182
+ onSubmit: onAddReply,
183
+ sidebarRef
184
+ }
185
+ ),
186
+ threads.map((thread) => /* @__PURE__ */ jsx(
187
+ NoteThread,
188
+ {
189
+ note: thread,
190
+ onAddReply,
191
+ onDeleteNote: handleDelete,
192
+ onEditNote,
193
+ isSelected: selectedNote === thread.id,
194
+ sidebarRef,
195
+ floating: isFloating ? {
196
+ y: notePositions[thread.id],
197
+ registerThread,
198
+ unregisterThread
199
+ } : void 0,
200
+ onKeyDown: (event) => navigate(
201
+ event,
202
+ thread,
203
+ selectedNote === thread.id
204
+ )
205
+ },
206
+ thread.id
207
+ ))
208
+ ] })
209
+ }
210
+ );
211
+ }
212
+ export {
213
+ Notes
214
+ };
215
+ //# sourceMappingURL=notes.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/collab-sidebar/notes.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Stack } from '@wordpress/ui';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { NoteThread } from './note-thread';\nimport { focusNoteThread } from './utils';\nimport { useFloatingBoard, useNoteActions } from './hooks';\nimport { AddNote } from './add-note';\nimport { store as editorStore } from '../../store';\n\nconst { useBlockElement } = unlock( blockEditorPrivateApis );\n\nexport function Notes( { notes, sidebarRef, isFloating = false, styles } ) {\n\tconst {\n\t\tonCreate: onAddReply,\n\t\tonEdit: onEditNote,\n\t\tonDelete,\n\t} = useNoteActions();\n\tconst { selectNote } = unlock( useDispatch( editorStore ) );\n\tconst { selectBlock, toggleBlockSpotlight } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst { blockNoteId, selectedBlockClientId, orderedBlockIds } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetClientIdsWithDescendants,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tblockNoteId: clientId\n\t\t\t\t\t? getBlockAttributes( clientId )?.metadata?.noteId\n\t\t\t\t\t: null,\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t\torderedBlockIds: getClientIdsWithDescendants(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { selectedNote, noteFocused } = useSelect( ( select ) => {\n\t\tconst { getSelectedNote, isNoteFocused } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\treturn {\n\t\t\tselectedNote: getSelectedNote(),\n\t\t\tnoteFocused: isNoteFocused(),\n\t\t};\n\t}, [] );\n\n\tconst relatedBlockElement = useBlockElement( selectedBlockClientId );\n\n\tconst threads = useMemo( () => {\n\t\t// In floating mode with a pending new note, splice a placeholder\n\t\t// entry at the selected block's position so the board can float it\n\t\t// alongside regular threads.\n\t\tif ( ! isFloating || selectedNote !== 'new' ) {\n\t\t\treturn notes;\n\t\t}\n\t\tconst newNoteThread = {\n\t\t\tid: 'new',\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tcontent: { rendered: '' },\n\t\t};\n\t\tconst out = [];\n\t\torderedBlockIds.forEach( ( blockId ) => {\n\t\t\tif ( blockId === selectedBlockClientId ) {\n\t\t\t\tout.push( newNoteThread );\n\t\t\t} else {\n\t\t\t\tconst threadForBlock = notes.find(\n\t\t\t\t\t( t ) => t.blockClientId === blockId\n\t\t\t\t);\n\t\t\t\tif ( threadForBlock ) {\n\t\t\t\t\tout.push( threadForBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t\treturn out;\n\t}, [\n\t\tnotes,\n\t\tisFloating,\n\t\tselectedNote,\n\t\tselectedBlockClientId,\n\t\torderedBlockIds,\n\t] );\n\n\tconst handleDelete = async ( note ) => {\n\t\tconst currentIndex = threads.findIndex( ( t ) => t.id === note.id );\n\t\tconst nextThread = threads[ currentIndex + 1 ];\n\t\tconst prevThread = threads[ currentIndex - 1 ];\n\n\t\tawait onDelete( note );\n\n\t\tif ( note.parent !== 0 ) {\n\t\t\t// Move focus to the parent thread when a reply was deleted.\n\t\t\tselectNote( note.parent );\n\t\t\tfocusNoteThread( note.parent, sidebarRef.current );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nextThread ) {\n\t\t\tselectNote( nextThread.id );\n\t\t\tfocusNoteThread( nextThread.id, sidebarRef.current );\n\t\t} else if ( prevThread ) {\n\t\t\tselectNote( prevThread.id );\n\t\t\tfocusNoteThread( prevThread.id, sidebarRef.current );\n\t\t} else {\n\t\t\tselectNote( undefined );\n\t\t\ttoggleBlockSpotlight( note.blockClientId, false );\n\t\t\t// Move focus to the related block.\n\t\t\trelatedBlockElement?.focus();\n\t\t}\n\t};\n\n\t// Auto-select the related note thread when a block is selected.\n\tuseEffect( () => {\n\t\tselectNote( blockNoteId ?? undefined );\n\t}, [ blockNoteId, selectNote ] );\n\n\t// Focus the selected note when requested.\n\tuseEffect( () => {\n\t\tif ( noteFocused && selectedNote ) {\n\t\t\tfocusNoteThread(\n\t\t\t\tselectedNote,\n\t\t\t\tsidebarRef.current,\n\t\t\t\tselectedNote === 'new' ? 'textarea' : undefined\n\t\t\t);\n\t\t\t// Clear focus flag to avoid re-triggering.\n\t\t\tselectNote( selectedNote );\n\t\t}\n\t}, [ noteFocused, selectedNote, selectNote, sidebarRef ] );\n\n\tconst { notePositions, registerThread, unregisterThread } =\n\t\tuseFloatingBoard( {\n\t\t\tthreads,\n\t\t\tselectedNoteId: selectedNote,\n\t\t\tisFloating,\n\t\t\tsidebarRef,\n\t\t} );\n\n\tconst hasThreads = Array.isArray( threads ) && threads.length > 0;\n\n\tconst navigate = ( event, thread, isSelected ) => {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentIndex = threads.findIndex( ( t ) => t.id === thread.id );\n\t\tconst isSelfTarget = event.currentTarget === event.target;\n\n\t\tif (\n\t\t\t( event.key === 'Enter' || event.key === 'ArrowRight' ) &&\n\t\t\tisSelfTarget &&\n\t\t\t! isSelected\n\t\t) {\n\t\t\t// Expand thread.\n\t\t\tselectNote( thread.id );\n\t\t\tif ( !! thread.blockClientId ) {\n\t\t\t\t// Pass `null` as the second parameter to prevent focusing the block.\n\t\t\t\tselectBlock( thread.blockClientId, null );\n\t\t\t\ttoggleBlockSpotlight( thread.blockClientId, true );\n\t\t\t}\n\t\t} else if (\n\t\t\t( ( event.key === 'Enter' || event.key === 'ArrowLeft' ) &&\n\t\t\t\tisSelfTarget &&\n\t\t\t\tisSelected ) ||\n\t\t\tevent.key === 'Escape'\n\t\t) {\n\t\t\t// Collapse thread.\n\t\t\tselectNote( undefined );\n\t\t\tif ( thread.blockClientId ) {\n\t\t\t\ttoggleBlockSpotlight( thread.blockClientId, false );\n\t\t\t}\n\t\t\tfocusNoteThread( thread.id, sidebarRef.current );\n\t\t} else if (\n\t\t\tevent.key === 'ArrowDown' &&\n\t\t\tcurrentIndex < threads.length - 1 &&\n\t\t\tisSelfTarget\n\t\t) {\n\t\t\tfocusNoteThread(\n\t\t\t\tthreads[ currentIndex + 1 ].id,\n\t\t\t\tsidebarRef.current\n\t\t\t);\n\t\t} else if (\n\t\t\tevent.key === 'ArrowUp' &&\n\t\t\tcurrentIndex > 0 &&\n\t\t\tisSelfTarget\n\t\t) {\n\t\t\tfocusNoteThread(\n\t\t\t\tthreads[ currentIndex - 1 ].id,\n\t\t\t\tsidebarRef.current\n\t\t\t);\n\t\t} else if ( event.key === 'Home' && isSelfTarget ) {\n\t\t\tfocusNoteThread( threads[ 0 ].id, sidebarRef.current );\n\t\t} else if ( event.key === 'End' && isSelfTarget ) {\n\t\t\tfocusNoteThread(\n\t\t\t\tthreads[ threads.length - 1 ].id,\n\t\t\t\tsidebarRef.current\n\t\t\t);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\tclassName=\"editor-collab-sidebar-panel\"\n\t\t\tstyle={ styles }\n\t\t\trole=\"tree\"\n\t\t\tdirection=\"column\"\n\t\t\tgap=\"md\"\n\t\t\tjustify=\"flex-start\"\n\t\t\tref={ ( node ) => {\n\t\t\t\t// Sometimes previous sidebar unmounts after the new one mounts.\n\t\t\t\t// This ensures we always have the latest reference.\n\t\t\t\tif ( node ) {\n\t\t\t\t\tsidebarRef.current = node;\n\t\t\t\t}\n\t\t\t} }\n\t\t\taria-label={\n\t\t\t\tisFloating ? __( 'Unresolved notes' ) : __( 'All notes' )\n\t\t\t}\n\t\t>\n\t\t\t{ ! hasThreads && ! isFloating ? (\n\t\t\t\t<AddNote onSubmit={ onAddReply } sidebarRef={ sidebarRef } />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{ ! isFloating && selectedNote === 'new' && (\n\t\t\t\t\t\t<AddNote\n\t\t\t\t\t\t\tonSubmit={ onAddReply }\n\t\t\t\t\t\t\tsidebarRef={ sidebarRef }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ threads.map( ( thread ) => (\n\t\t\t\t\t\t<NoteThread\n\t\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\t\tnote={ thread }\n\t\t\t\t\t\t\tonAddReply={ onAddReply }\n\t\t\t\t\t\t\tonDeleteNote={ handleDelete }\n\t\t\t\t\t\t\tonEditNote={ onEditNote }\n\t\t\t\t\t\t\tisSelected={ selectedNote === thread.id }\n\t\t\t\t\t\t\tsidebarRef={ sidebarRef }\n\t\t\t\t\t\t\tfloating={\n\t\t\t\t\t\t\t\tisFloating\n\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\ty: notePositions[ thread.id ],\n\t\t\t\t\t\t\t\t\t\t\tregisterThread,\n\t\t\t\t\t\t\t\t\t\t\tunregisterThread,\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonKeyDown={ ( event ) =>\n\t\t\t\t\t\t\t\tnavigate(\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\tthread,\n\t\t\t\t\t\t\t\t\tselectedNote === thread.id\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) ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Stack>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,WAAW,eAAe;AACnC,SAAS,UAAU;AACnB,SAAS,WAAW,mBAAmB;AACvC,SAAS,aAAa;AACtB;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AAKP,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,eAAe;AACxB,SAAS,SAAS,mBAAmB;AAuNjC,SAEA,UAFA,KAEA,YAFA;AArNJ,IAAM,EAAE,gBAAgB,IAAI,OAAQ,sBAAuB;AAEpD,SAAS,MAAO,EAAE,OAAO,YAAY,aAAa,OAAO,OAAO,GAAI;AAC1E,QAAM;AAAA,IACL,UAAU;AAAA,IACV,QAAQ;AAAA,IACR;AAAA,EACD,IAAI,eAAe;AACnB,QAAM,EAAE,WAAW,IAAI,OAAQ,YAAa,WAAY,CAAE;AAC1D,QAAM,EAAE,aAAa,qBAAqB,IAAI;AAAA,IAC7C,YAAa,gBAAiB;AAAA,EAC/B;AAEA,QAAM,EAAE,aAAa,uBAAuB,gBAAgB,IAAI;AAAA,IAC/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E,cAAc,iBAAiB,SAClC;AAAA,UAAC;AAAA;AAAA,YACA,UAAW;AAAA,YACX;AAAA;AAAA,QACD;AAAA,QAEC,QAAQ,IAAK,CAAE,WAChB;AAAA,UAAC;AAAA;AAAA,YAEA,MAAO;AAAA,YACP;AAAA,YACA,cAAe;AAAA,YACf;AAAA,YACA,YAAa,iBAAiB,OAAO;AAAA,YACrC;AAAA,YACA,UACC,aACG;AAAA,cACA,GAAG,cAAe,OAAO,EAAG;AAAA,cAC5B;AAAA,cACA;AAAA,YACA,IACA;AAAA,YAEJ,WAAY,CAAE,UACb;AAAA,cACC;AAAA,cACA;AAAA,cACA,iBAAiB,OAAO;AAAA,YACzB;AAAA;AAAA,UArBK,OAAO;AAAA,QAuBd,CACC;AAAA,SACH;AAAA;AAAA,EAEF;AAEF;",
6
+ "names": []
7
+ }
@@ -1,12 +1,11 @@
1
1
  // packages/editor/src/components/collab-sidebar/utils.js
2
2
  import { _x } from "@wordpress/i18n";
3
- function sanitizeCommentString(str) {
3
+ function sanitizeNoteContent(str) {
4
4
  return str.trim();
5
5
  }
6
6
  var THREAD_ALIGN_OFFSET = -16;
7
7
  var THREAD_GAP = 16;
8
8
  var OVERLAP_MARGIN = 20;
9
- var BOARD_BOTTOM_PADDING = 32;
10
9
  var AVATAR_BORDER_COLORS = [
11
10
  "#C36EFF",
12
11
  // Purple
@@ -26,7 +25,7 @@ var AVATAR_BORDER_COLORS = [
26
25
  function getAvatarBorderColor(userId) {
27
26
  return AVATAR_BORDER_COLORS[userId % AVATAR_BORDER_COLORS.length];
28
27
  }
29
- function getCommentExcerpt(text, excerptLength = 10) {
28
+ function getNoteExcerpt(text, excerptLength = 10) {
30
29
  if (!text) {
31
30
  return "";
32
31
  }
@@ -45,11 +44,12 @@ function getCommentExcerpt(text, excerptLength = 10) {
45
44
  const isTrimmed = trimmedExcerpt !== rawText;
46
45
  return isTrimmed ? trimmedExcerpt + "\u2026" : trimmedExcerpt;
47
46
  }
48
- function calculateAllOffsets({
47
+ function calculateNotePositions({
49
48
  threads,
50
49
  selectedNoteId,
51
50
  blockRects,
52
- heights
51
+ heights,
52
+ scrollTop = 0
53
53
  }) {
54
54
  const offsets = {};
55
55
  const anchorIndex = Math.max(
@@ -58,7 +58,7 @@ function calculateAllOffsets({
58
58
  );
59
59
  const anchorThread = threads[anchorIndex];
60
60
  if (!anchorThread || !blockRects[anchorThread.id]) {
61
- return { offsets, minHeight: 0 };
61
+ return { positions: {} };
62
62
  }
63
63
  const anchorRect = blockRects[anchorThread.id];
64
64
  const anchorTop = anchorRect.top || 0;
@@ -100,22 +100,20 @@ function calculateAllOffsets({
100
100
  offsets[thread.id] = offset;
101
101
  belowAdjustedTop = threadTop + offset;
102
102
  }
103
- let editorMinHeight = 0;
104
- const lastThread = threads[threads.length - 1];
105
- const lastBlockRect = blockRects[lastThread.id];
106
- if (lastBlockRect) {
107
- const lastThreadTop = lastBlockRect.top || 0;
108
- const lastThreadHeight = heights[lastThread.id] || 0;
109
- const lastThreadOffset = offsets[lastThread.id] || 0;
110
- editorMinHeight = lastThreadTop + lastThreadHeight + lastThreadOffset + BOARD_BOTTOM_PADDING;
103
+ const positions = {};
104
+ for (const thread of threads) {
105
+ const blockRect = blockRects[thread.id];
106
+ if (blockRect && offsets[thread.id] !== void 0) {
107
+ positions[thread.id] = blockRect.top + scrollTop + offsets[thread.id];
108
+ }
111
109
  }
112
- return { offsets, minHeight: editorMinHeight };
110
+ return { positions };
113
111
  }
114
- function focusCommentThread(commentId, container, additionalSelector) {
112
+ function focusNoteThread(noteId, container, additionalSelector) {
115
113
  if (!container) {
116
114
  return;
117
115
  }
118
- const threadSelector = commentId && commentId !== "new" ? `[role=treeitem][id="comment-thread-${commentId}"]` : "[role=treeitem]:not([id])";
116
+ const threadSelector = noteId && noteId !== "new" ? `[role=treeitem][id="note-thread-${noteId}"]` : "[role=treeitem]:not([id])";
119
117
  const selector = additionalSelector ? `${threadSelector} ${additionalSelector}` : threadSelector;
120
118
  return new Promise((resolve) => {
121
119
  if (container.querySelector(selector)) {
@@ -140,10 +138,10 @@ function focusCommentThread(commentId, container, additionalSelector) {
140
138
  }).then((element) => element?.focus());
141
139
  }
142
140
  export {
143
- calculateAllOffsets,
144
- focusCommentThread,
141
+ calculateNotePositions,
142
+ focusNoteThread,
145
143
  getAvatarBorderColor,
146
- getCommentExcerpt,
147
- sanitizeCommentString
144
+ getNoteExcerpt,
145
+ sanitizeNoteContent
148
146
  };
149
147
  //# sourceMappingURL=utils.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/collab-sidebar/utils.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Sanitizes a comment string by removing non-printable ASCII characters.\n *\n * @param {string} str - The comment string to sanitize.\n * @return {string} - The sanitized comment string.\n */\nexport function sanitizeCommentString( str ) {\n\treturn str.trim();\n}\n\nconst THREAD_ALIGN_OFFSET = -16;\nconst THREAD_GAP = 16;\nconst OVERLAP_MARGIN = 20;\nconst BOARD_BOTTOM_PADDING = 32;\n\n/**\n * Avatar border colors chosen to be visually distinct from each other and from\n * the editor's semantic UI colors (Delta E > 10 between all pairs).\n */\nconst AVATAR_BORDER_COLORS = [\n\t'#C36EFF', // Purple\n\t'#FF51A8', // Pink\n\t'#E4780A', // Orange\n\t'#FF35EE', // Magenta\n\t'#879F11', // Olive\n\t'#46A494', // Teal\n\t'#00A2C3', // Cyan\n];\n\n/**\n * Gets the border color for an avatar based on the user ID.\n *\n * @param {number} userId - The user ID.\n * @return {string} - The border color.\n */\nexport function getAvatarBorderColor( userId ) {\n\treturn AVATAR_BORDER_COLORS[ userId % AVATAR_BORDER_COLORS.length ];\n}\n\n/**\n * Generates a comment excerpt from text based on word count type and length.\n *\n * @param {string} text - The comment text to generate excerpt from.\n * @param {number} excerptLength - The maximum length for the commentexcerpt.\n * @return {string} - The generated comment excerpt.\n */\nexport function getCommentExcerpt( text, excerptLength = 10 ) {\n\tif ( ! text ) {\n\t\treturn '';\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\tconst rawText = text.trim();\n\tlet trimmedExcerpt = '';\n\n\tif ( wordCountType === 'words' ) {\n\t\ttrimmedExcerpt = rawText.split( ' ', excerptLength ).join( ' ' );\n\t} else if ( wordCountType === 'characters_excluding_spaces' ) {\n\t\t/*\n\t\t * 1. Split the text at the character limit,\n\t\t * then join the substrings back into one string.\n\t\t * 2. Count the number of spaces in the text\n\t\t * by comparing the lengths of the string with and without spaces.\n\t\t * 3. Add the number to the length of the visible excerpt,\n\t\t * so that the spaces are excluded from the word count.\n\t\t */\n\t\tconst textWithSpaces = rawText.split( '', excerptLength ).join( '' );\n\n\t\tconst numberOfSpaces =\n\t\t\ttextWithSpaces.length - textWithSpaces.replaceAll( ' ', '' ).length;\n\n\t\ttrimmedExcerpt = rawText\n\t\t\t.split( '', excerptLength + numberOfSpaces )\n\t\t\t.join( '' );\n\t} else if ( wordCountType === 'characters_including_spaces' ) {\n\t\ttrimmedExcerpt = rawText.split( '', excerptLength ).join( '' );\n\t}\n\n\tconst isTrimmed = trimmedExcerpt !== rawText;\n\treturn isTrimmed ? trimmedExcerpt + '\u2026' : trimmedExcerpt;\n}\n\n/**\n * Calculate y offsets for all floating comment threads. Adjusts positions\n * to prevent overlapping by pushing threads above the selected one upward\n * and threads below it downward.\n *\n * @param {Object} params\n * @param {Array} params.threads Ordered list of thread objects.\n * @param {string|number|undefined} params.selectedNoteId ID of the currently selected thread.\n * @param {Object<string,DOMRect>} params.blockRects Pre-read bounding rects keyed by thread ID.\n * @param {Object<string,number>} params.heights Rendered heights keyed by thread ID.\n * @return {{ offsets: Object<string,number>, minHeight: number }} Computed offsets and minimum editor height.\n */\nexport function calculateAllOffsets( {\n\tthreads,\n\tselectedNoteId,\n\tblockRects,\n\theights,\n} ) {\n\tconst offsets = {};\n\n\tconst anchorIndex = Math.max(\n\t\t0,\n\t\tthreads.findIndex( ( thread ) => thread.id === selectedNoteId )\n\t);\n\n\tconst anchorThread = threads[ anchorIndex ];\n\n\tif ( ! anchorThread || ! blockRects[ anchorThread.id ] ) {\n\t\treturn { offsets, minHeight: 0 };\n\t}\n\n\tconst anchorRect = blockRects[ anchorThread.id ];\n\tconst anchorTop = anchorRect.top || 0;\n\tconst anchorHeight = heights[ anchorThread.id ] || 0;\n\n\toffsets[ anchorThread.id ] = THREAD_ALIGN_OFFSET;\n\n\t// Process threads after the anchor, offsetting overlapping threads downward.\n\tlet prevAdjustedTop = anchorTop + THREAD_ALIGN_OFFSET;\n\tlet prevHeight = anchorHeight;\n\n\tfor ( let i = anchorIndex + 1; i < threads.length; i++ ) {\n\t\tconst thread = threads[ i ];\n\t\tconst threadRect = blockRects[ thread.id ];\n\t\tif ( ! threadRect ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst threadTop = threadRect.top || 0;\n\t\tconst threadHeight = heights[ thread.id ] || 0;\n\n\t\tlet offset = THREAD_ALIGN_OFFSET;\n\n\t\tconst prevBottom = prevAdjustedTop + prevHeight;\n\t\tif ( threadTop < prevBottom + THREAD_GAP ) {\n\t\t\toffset = prevBottom - threadTop + OVERLAP_MARGIN;\n\t\t}\n\n\t\toffsets[ thread.id ] = offset;\n\n\t\tprevAdjustedTop = threadTop + offset;\n\t\tprevHeight = threadHeight;\n\t}\n\n\t// Process threads before the anchor, offsetting overlapping threads upward.\n\tlet belowAdjustedTop = anchorTop + THREAD_ALIGN_OFFSET;\n\n\tfor ( let i = anchorIndex - 1; i >= 0; i-- ) {\n\t\tconst thread = threads[ i ];\n\t\tconst threadRect = blockRects[ thread.id ];\n\t\tif ( ! threadRect ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst threadTop = threadRect.top || 0;\n\t\tconst threadHeight = heights[ thread.id ] || 0;\n\n\t\tlet offset = THREAD_ALIGN_OFFSET;\n\n\t\tconst threadBottom = threadTop + threadHeight;\n\n\t\tif ( threadBottom > belowAdjustedTop ) {\n\t\t\toffset =\n\t\t\t\tbelowAdjustedTop - threadTop - threadHeight - OVERLAP_MARGIN;\n\t\t}\n\n\t\toffsets[ thread.id ] = offset;\n\n\t\tbelowAdjustedTop = threadTop + offset;\n\t}\n\n\tlet editorMinHeight = 0;\n\tconst lastThread = threads[ threads.length - 1 ];\n\tconst lastBlockRect = blockRects[ lastThread.id ];\n\tif ( lastBlockRect ) {\n\t\tconst lastThreadTop = lastBlockRect.top || 0;\n\t\tconst lastThreadHeight = heights[ lastThread.id ] || 0;\n\t\tconst lastThreadOffset = offsets[ lastThread.id ] || 0;\n\t\teditorMinHeight =\n\t\t\tlastThreadTop +\n\t\t\tlastThreadHeight +\n\t\t\tlastThreadOffset +\n\t\t\tBOARD_BOTTOM_PADDING;\n\t}\n\n\treturn { offsets, minHeight: editorMinHeight };\n}\n\n/**\n * Shift focus to the comment thread associated with a particular comment ID.\n * If an additional selector is provided, the focus will be shifted to the element matching the selector.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} commentId The ID of the comment thread to focus.\n * @param {?HTMLElement} container The container element to search within.\n * @param {string} additionalSelector The additional selector to focus on.\n */\nexport function focusCommentThread( commentId, container, additionalSelector ) {\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\t// A thread without a commentId is a new comment thread.\n\tconst threadSelector =\n\t\tcommentId && commentId !== 'new'\n\t\t\t? `[role=treeitem][id=\"comment-thread-${ commentId }\"]`\n\t\t\t: '[role=treeitem]:not([id])';\n\tconst selector = additionalSelector\n\t\t? `${ threadSelector } ${ additionalSelector }`\n\t\t: threadSelector;\n\n\treturn new Promise( ( resolve ) => {\n\t\tif ( container.querySelector( selector ) ) {\n\t\t\treturn resolve( container.querySelector( selector ) );\n\t\t}\n\n\t\tlet timer = null;\n\t\t// Wait for the element to be added to the DOM.\n\t\tconst observer = new window.MutationObserver( () => {\n\t\t\tif ( container.querySelector( selector ) ) {\n\t\t\t\tclearTimeout( timer );\n\t\t\t\tobserver.disconnect();\n\t\t\t\tresolve( container.querySelector( selector ) );\n\t\t\t}\n\t\t} );\n\n\t\tobserver.observe( container, {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t} );\n\n\t\t// Stop trying after 3 seconds.\n\t\ttimer = setTimeout( () => {\n\t\t\tobserver.disconnect();\n\t\t\tresolve( null );\n\t\t}, 3000 );\n\t} ).then( ( element ) => element?.focus() );\n}\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AAQZ,SAAS,sBAAuB,KAAM;AAC5C,SAAO,IAAI,KAAK;AACjB;AAEA,IAAM,sBAAsB;AAC5B,IAAM,aAAa;AACnB,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAM7B,IAAM,uBAAuB;AAAA,EAC5B;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACD;AAQO,SAAS,qBAAsB,QAAS;AAC9C,SAAO,qBAAsB,SAAS,qBAAqB,MAAO;AACnE;AASO,SAAS,kBAAmB,MAAM,gBAAgB,IAAK;AAC7D,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAOA,QAAM,gBAAgB,GAAI,SAAS,oCAAqC;AAExE,QAAM,UAAU,KAAK,KAAK;AAC1B,MAAI,iBAAiB;AAErB,MAAK,kBAAkB,SAAU;AAChC,qBAAiB,QAAQ,MAAO,KAAK,aAAc,EAAE,KAAM,GAAI;AAAA,EAChE,WAAY,kBAAkB,+BAAgC;AAS7D,UAAM,iBAAiB,QAAQ,MAAO,IAAI,aAAc,EAAE,KAAM,EAAG;AAEnE,UAAM,iBACL,eAAe,SAAS,eAAe,WAAY,KAAK,EAAG,EAAE;AAE9D,qBAAiB,QACf,MAAO,IAAI,gB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,aAAS,QAAS,WAAW;AAAA,MAC5B,WAAW;AAAA,MACX,SAAS;AAAA,IACV,CAAE;AAGF,YAAQ,WAAY,MAAM;AACzB,eAAS,WAAW;AACpB,cAAS,IAAK;AAAA,IACf,GAAG,GAAK;AAAA,EACT,CAAE,EAAE,KAAM,CAAE,YAAa,SAAS,MAAM,CAAE;AAC3C;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Sanitizes a note string by removing non-printable ASCII characters.\n *\n * @param {string} str - The note string to sanitize.\n * @return {string} - The sanitized note string.\n */\nexport function sanitizeNoteContent( str ) {\n\treturn str.trim();\n}\n\nconst THREAD_ALIGN_OFFSET = -16;\nconst THREAD_GAP = 16;\nconst OVERLAP_MARGIN = 20;\n\n/**\n * Avatar border colors chosen to be visually distinct from each other and from\n * the editor's semantic UI colors (Delta E > 10 between all pairs).\n */\nconst AVATAR_BORDER_COLORS = [\n\t'#C36EFF', // Purple\n\t'#FF51A8', // Pink\n\t'#E4780A', // Orange\n\t'#FF35EE', // Magenta\n\t'#879F11', // Olive\n\t'#46A494', // Teal\n\t'#00A2C3', // Cyan\n];\n\n/**\n * Gets the border color for an avatar based on the user ID.\n *\n * @param {number} userId - The user ID.\n * @return {string} - The border color.\n */\nexport function getAvatarBorderColor( userId ) {\n\treturn AVATAR_BORDER_COLORS[ userId % AVATAR_BORDER_COLORS.length ];\n}\n\n/**\n * Generates a note excerpt from text based on word count type and length.\n *\n * @param {string} text - The note text to generate excerpt from.\n * @param {number} excerptLength - The maximum length for the note excerpt.\n * @return {string} - The generated note excerpt.\n */\nexport function getNoteExcerpt( text, excerptLength = 10 ) {\n\tif ( ! text ) {\n\t\treturn '';\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\tconst rawText = text.trim();\n\tlet trimmedExcerpt = '';\n\n\tif ( wordCountType === 'words' ) {\n\t\ttrimmedExcerpt = rawText.split( ' ', excerptLength ).join( ' ' );\n\t} else if ( wordCountType === 'characters_excluding_spaces' ) {\n\t\t/*\n\t\t * 1. Split the text at the character limit,\n\t\t * then join the substrings back into one string.\n\t\t * 2. Count the number of spaces in the text\n\t\t * by comparing the lengths of the string with and without spaces.\n\t\t * 3. Add the number to the length of the visible excerpt,\n\t\t * so that the spaces are excluded from the word count.\n\t\t */\n\t\tconst textWithSpaces = rawText.split( '', excerptLength ).join( '' );\n\n\t\tconst numberOfSpaces =\n\t\t\ttextWithSpaces.length - textWithSpaces.replaceAll( ' ', '' ).length;\n\n\t\ttrimmedExcerpt = rawText\n\t\t\t.split( '', excerptLength + numberOfSpaces )\n\t\t\t.join( '' );\n\t} else if ( wordCountType === 'characters_including_spaces' ) {\n\t\ttrimmedExcerpt = rawText.split( '', excerptLength ).join( '' );\n\t}\n\n\tconst isTrimmed = trimmedExcerpt !== rawText;\n\treturn isTrimmed ? trimmedExcerpt + '\u2026' : trimmedExcerpt;\n}\n\n/**\n * Calculate final top positions for all floating note threads in the\n * editor's content coordinate space. Adjusts positions to prevent overlapping\n * by pushing threads above the selected one upward and threads below it downward.\n *\n * @param {Object} params\n * @param {Array} params.threads Ordered list of thread objects.\n * @param {string|number|undefined} params.selectedNoteId ID of the currently selected thread.\n * @param {Object<string,DOMRect>} params.blockRects Pre-read bounding rects keyed by thread ID.\n * @param {Object<string,number>} params.heights Rendered heights keyed by thread ID.\n * @param {number} params.scrollTop Current scroll offset of the editor content.\n * @return {{ positions: Object<string,number> }} Computed top positions.\n */\nexport function calculateNotePositions( {\n\tthreads,\n\tselectedNoteId,\n\tblockRects,\n\theights,\n\tscrollTop = 0,\n} ) {\n\tconst offsets = {};\n\n\tconst anchorIndex = Math.max(\n\t\t0,\n\t\tthreads.findIndex( ( thread ) => thread.id === selectedNoteId )\n\t);\n\n\tconst anchorThread = threads[ anchorIndex ];\n\n\tif ( ! anchorThread || ! blockRects[ anchorThread.id ] ) {\n\t\treturn { positions: {} };\n\t}\n\n\tconst anchorRect = blockRects[ anchorThread.id ];\n\tconst anchorTop = anchorRect.top || 0;\n\tconst anchorHeight = heights[ anchorThread.id ] || 0;\n\n\toffsets[ anchorThread.id ] = THREAD_ALIGN_OFFSET;\n\n\t// Process threads after the anchor, offsetting overlapping threads downward.\n\tlet prevAdjustedTop = anchorTop + THREAD_ALIGN_OFFSET;\n\tlet prevHeight = anchorHeight;\n\n\tfor ( let i = anchorIndex + 1; i < threads.length; i++ ) {\n\t\tconst thread = threads[ i ];\n\t\tconst threadRect = blockRects[ thread.id ];\n\t\tif ( ! threadRect ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst threadTop = threadRect.top || 0;\n\t\tconst threadHeight = heights[ thread.id ] || 0;\n\n\t\tlet offset = THREAD_ALIGN_OFFSET;\n\n\t\tconst prevBottom = prevAdjustedTop + prevHeight;\n\t\tif ( threadTop < prevBottom + THREAD_GAP ) {\n\t\t\toffset = prevBottom - threadTop + OVERLAP_MARGIN;\n\t\t}\n\n\t\toffsets[ thread.id ] = offset;\n\n\t\tprevAdjustedTop = threadTop + offset;\n\t\tprevHeight = threadHeight;\n\t}\n\n\t// Process threads before the anchor, offsetting overlapping threads upward.\n\tlet belowAdjustedTop = anchorTop + THREAD_ALIGN_OFFSET;\n\n\tfor ( let i = anchorIndex - 1; i >= 0; i-- ) {\n\t\tconst thread = threads[ i ];\n\t\tconst threadRect = blockRects[ thread.id ];\n\t\tif ( ! threadRect ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst threadTop = threadRect.top || 0;\n\t\tconst threadHeight = heights[ thread.id ] || 0;\n\n\t\tlet offset = THREAD_ALIGN_OFFSET;\n\n\t\tconst threadBottom = threadTop + threadHeight;\n\n\t\tif ( threadBottom > belowAdjustedTop ) {\n\t\t\toffset =\n\t\t\t\tbelowAdjustedTop - threadTop - threadHeight - OVERLAP_MARGIN;\n\t\t}\n\n\t\toffsets[ thread.id ] = offset;\n\n\t\tbelowAdjustedTop = threadTop + offset;\n\t}\n\n\t// blockRect.top + scrollTop is the block's absolute y within the editor's\n\t// scroll content; CSS translates each thread by -scrollTop at render time.\n\tconst positions = {};\n\tfor ( const thread of threads ) {\n\t\tconst blockRect = blockRects[ thread.id ];\n\t\tif ( blockRect && offsets[ thread.id ] !== undefined ) {\n\t\t\tpositions[ thread.id ] =\n\t\t\t\tblockRect.top + scrollTop + offsets[ thread.id ];\n\t\t}\n\t}\n\n\treturn { positions };\n}\n\n/**\n * Shift focus to the note thread associated with a particular note ID.\n * If an additional selector is provided, the focus will be shifted to the element matching the selector.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} noteId The ID of the note thread to focus.\n * @param {?HTMLElement} container The container element to search within.\n * @param {string} additionalSelector The additional selector to focus on.\n */\nexport function focusNoteThread( noteId, container, additionalSelector ) {\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\t// A thread without a noteId is a new note thread.\n\tconst threadSelector =\n\t\tnoteId && noteId !== 'new'\n\t\t\t? `[role=treeitem][id=\"note-thread-${ noteId }\"]`\n\t\t\t: '[role=treeitem]:not([id])';\n\tconst selector = additionalSelector\n\t\t? `${ threadSelector } ${ additionalSelector }`\n\t\t: threadSelector;\n\n\treturn new Promise( ( resolve ) => {\n\t\tif ( container.querySelector( selector ) ) {\n\t\t\treturn resolve( container.querySelector( selector ) );\n\t\t}\n\n\t\tlet timer = null;\n\t\t// Wait for the element to be added to the DOM.\n\t\tconst observer = new window.MutationObserver( () => {\n\t\t\tif ( container.querySelector( selector ) ) {\n\t\t\t\tclearTimeout( timer );\n\t\t\t\tobserver.disconnect();\n\t\t\t\tresolve( container.querySelector( selector ) );\n\t\t\t}\n\t\t} );\n\n\t\tobserver.observe( container, {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t} );\n\n\t\t// Stop trying after 3 seconds.\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YAAY,eAAe;AAAA,IAChD;AAEA,YAAS,OAAO,EAAG,IAAI;AAEvB,uBAAmB,YAAY;AAAA,EAChC;AAIA,QAAM,YAAY,CAAC;AACnB,aAAY,UAAU,SAAU;AAC/B,UAAM,YAAY,WAAY,OAAO,EAAG;AACxC,QAAK,aAAa,QAAS,OAAO,EAAG,MAAM,QAAY;AACtD,gBAAW,OAAO,EAAG,IACpB,UAAU,MAAM,YAAY,QAAS,OAAO,EAAG;AAAA,IACjD;AAAA,EACD;AAEA,SAAO,EAAE,UAAU;AACpB;AAYO,SAAS,gBAAiB,QAAQ,WAAW,oBAAqB;AACxE,MAAK,CAAE,WAAY;AAClB;AAAA,EACD;AAGA,QAAM,iBACL,UAAU,WAAW,QAClB,mCAAoC,MAAO,OAC3C;AACJ,QAAM,WAAW,qBACd,GAAI,cAAe,IAAK,kBAAmB,KAC3C;AAEH,SAAO,IAAI,QAAS,CAAE,YAAa;AAClC,QAAK,UAAU,cAAe,QAAS,GAAI;AAC1C,aAAO,QAAS,UAAU,cAAe,QAAS,CAAE;AAAA,IACrD;AAEA,QAAI,QAAQ;AAEZ,UAAM,WAAW,IAAI,OAAO,iBAAkB,MAAM;AACnD,UAAK,UAAU,cAAe,QAAS,GAAI;AAC1C,qBAAc,KAAM;AACpB,iBAAS,WAAW;AACpB,gBAAS,UAAU,cAAe,QAAS,CAAE;AAAA,MAC9C;AAAA,IACD,CAAE;AAEF,aAAS,QAAS,WAAW;AAAA,MAC5B,WAAW;AAAA,MACX,SAAS;AAAA,IACV,CAAE;AAGF,YAAQ,WAAY,MAAM;AACzB,eAAS,WAAW;AACpB,cAAS,IAAK;AAAA,IACf,GAAG,GAAK;AAAA,EACT,CAAE,EAAE,KAAM,CAAE,YAAa,SAAS,MAAM,CAAE;AAC3C;",
6
6
  "names": []
7
7
  }
@@ -4,7 +4,7 @@ import { __, isRTL } from "@wordpress/i18n";
4
4
  import { useSelect, useDispatch } from "@wordpress/data";
5
5
  import {
6
6
  Button,
7
- __experimentalText as Text,
7
+ __experimentalText as WCText,
8
8
  __unstableMotion as motion,
9
9
  __unstableAnimatePresence as AnimatePresence
10
10
  } from "@wordpress/components";
@@ -141,7 +141,7 @@ function DocumentBar(props) {
141
141
  className: "editor-document-bar__icon-layout"
142
142
  }
143
143
  ),
144
- isNotFound ? /* @__PURE__ */ jsx(Text, { children: __("Document not found") }) : /* @__PURE__ */ jsxs(
144
+ isNotFound ? /* @__PURE__ */ jsx(WCText, { children: __("Document not found") }) : /* @__PURE__ */ jsxs(
145
145
  Button,
146
146
  {
147
147
  className: "editor-document-bar__command",
@@ -163,7 +163,7 @@ function DocumentBar(props) {
163
163
  transition: isReducedMotion ? { duration: 0 } : void 0,
164
164
  children: [
165
165
  icon && /* @__PURE__ */ jsx(BlockIcon, { icon }),
166
- /* @__PURE__ */ jsxs(Text, { size: "body", as: "h1", children: [
166
+ /* @__PURE__ */ jsxs(WCText, { size: "body", as: "h1", children: [
167
167
  /* @__PURE__ */ jsx("span", { className: "editor-document-bar__post-title", children: title ? stripHTML(title) : __("No title") }),
168
168
  unlockedPatternInfo && /* @__PURE__ */ jsx("span", { className: "editor-document-bar__post-type-label", children: unlockedPatternInfo.type === "template-part" ? `\xB7 ${__("Template Part")}` : `\xB7 ${__("Pattern")}` }),
169
169
  !unlockedPatternInfo && pageTypeBadge && /* @__PURE__ */ jsx("span", { className: "editor-document-bar__post-type-label", children: `\xB7 ${pageTypeBadge}` }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/document-bar/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon, store as blockEditorStore } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nimport { getStylesCanvasTitle } from '../styles-canvas';\nimport { unlock } from '../../lock-unlock';\nimport useEditedSectionDetails from './useEditedSectionDetails';\n\n/** @typedef {import(\"@wordpress/components\").IconType} IconType */\n\nconst MotionButton = motion.create( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n *\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or template title currently being edited.\n * @param {IconType} props.icon An icon for the document, no default.\n * (A default icon indicating the document post type is no longer used.)\n *\n * @return {React.ReactNode} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\t// Get action to lock the pattern design\n\tconst { stopEditingContentOnlySection } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\t// Get details about the currently edited content-only section\n\tconst unlockedPatternInfo = useEditedSectionDetails();\n\n\tconst {\n\t\tpostId,\n\t\tpostType,\n\t\tpostTypeLabel,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tisTemplatePreview,\n\t\tstylesCanvasTitle,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t} = select( editorStore );\n\n\t\tconst {\n\t\t\tgetEditedEntityRecord,\n\t\t\tgetPostType,\n\t\t\tgetCurrentTheme,\n\t\t\tisResolving: isResolvingSelector,\n\t\t} = select( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\n\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\tgetCurrentTheme() ?? {};\n\n\t\tconst _templateInfo = getTemplateInfo( {\n\t\t\ttemplateTypes,\n\t\t\ttemplate: _document,\n\t\t} );\n\t\tconst _postTypeLabel = getPostType( _postType )?.labels?.singular_name;\n\n\t\t// Check if styles canvas is active and get its title\n\t\tconst { getStylesPath, getShowStylebook } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst _stylesPath = getStylesPath();\n\t\tconst _showStylebook = getShowStylebook();\n\t\tconst _stylesCanvasTitle = getStylesCanvasTitle(\n\t\t\t_stylesPath,\n\t\t\t_showStylebook\n\t\t);\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tpostType: _postType,\n\t\t\tpostTypeLabel: _postTypeLabel,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisTemplatePreview: getRenderingMode() === 'template-locked',\n\t\t\tstylesCanvasTitle: _stylesCanvasTitle,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst hasBackButton =\n\t\t!! onNavigateToPreviousEntityRecord || !! unlockedPatternInfo;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\n\t// Use pattern info if a pattern block is unlocked, otherwise use document/entity info\n\tconst title =\n\t\tunlockedPatternInfo?.patternTitle ||\n\t\tprops.title ||\n\t\tstylesCanvasTitle ||\n\t\tentityTitle;\n\tconst icon = props.icon;\n\n\t// Determine the back button action\n\tconst handleBackClick = ( event ) => {\n\t\tevent.stopPropagation();\n\t\tif ( unlockedPatternInfo ) {\n\t\t\tstopEditingContentOnlySection();\n\t\t} else if ( onNavigateToPreviousEntityRecord ) {\n\t\t\tonNavigateToPreviousEntityRecord();\n\t\t}\n\t};\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ handleBackClick }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ ! isTemplate && isTemplatePreview && ! hasBackButton && (\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tclassName=\"editor-document-bar__icon-layout\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon && <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-title\">\n\t\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t\t? stripHTML( title )\n\t\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{ unlockedPatternInfo && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ unlockedPatternInfo.type ===\n\t\t\t\t\t\t\t\t\t'template-part'\n\t\t\t\t\t\t\t\t\t\t? `\u00B7 ${ __( 'Template Part' ) }`\n\t\t\t\t\t\t\t\t\t\t: `\u00B7 ${ __( 'Pattern' ) }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! unlockedPatternInfo && pageTypeBadge && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ `\u00B7 ${ pageTypeBadge }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! unlockedPatternInfo &&\n\t\t\t\t\t\t\t\tpostTypeLabel &&\n\t\t\t\t\t\t\t\t! props.title &&\n\t\t\t\t\t\t\t\t! pageTypeBadge && (\n\t\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t\t{ `\u00B7 ${ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tpostTypeLabel\n\t\t\t\t\t\t\t\t\t\t) }` }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t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AAW,GACnB;AAAA,sBACE,uBACD,oBAAC,UAAK,WAAU,wCACb,8BAAoB,SACtB,kBACG,QAAM,GAAI,eAAgB,CAAE,KAC5B,QAAM,GAAI,SAAU,CAAE,IAC1B;AAAA,sBAEC,CAAE,uBAAuB,iBAC1B,oBAAC,UAAK,WAAU,wCACb,kBAAM,aAAc,IACvB;AAAA,sBAEC,CAAE,uBACH,iBACA,CAAE,MAAM,SACR,CAAE,iBACD,oBAAC,UAAK,WAAU,wCACb,kBAAM;AAAA,wBACP;AAAA,sBACD,CAAE,IACH;AAAA,uBAEH;AAAA;AAAA;AAAA,gBAjDM;AAAA,cAkDP;AAAA,cACA,oBAAC,UAAK,WAAU,iCACb,0BAAgB,QAAS,GAAI,GAChC;AAAA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF;AAEF;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as WCText,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon, store as blockEditorStore } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nimport { getStylesCanvasTitle } from '../styles-canvas';\nimport { unlock } from '../../lock-unlock';\nimport useEditedSectionDetails from './useEditedSectionDetails';\n\n/** @typedef {import(\"@wordpress/components\").IconType} IconType */\n\nconst MotionButton = motion.create( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n *\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or template title currently being edited.\n * @param {IconType} props.icon An icon for the document, no default.\n * (A default icon indicating the document post type is no longer used.)\n *\n * @return {React.ReactNode} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\t// Get action to lock the pattern design\n\tconst { stopEditingContentOnlySection } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\t// Get details about the currently edited content-only section\n\tconst unlockedPatternInfo = useEditedSectionDetails();\n\n\tconst {\n\t\tpostId,\n\t\tpostType,\n\t\tpostTypeLabel,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tisTemplatePreview,\n\t\tstylesCanvasTitle,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t} = select( editorStore );\n\n\t\tconst {\n\t\t\tgetEditedEntityRecord,\n\t\t\tgetPostType,\n\t\t\tgetCurrentTheme,\n\t\t\tisResolving: isResolvingSelector,\n\t\t} = select( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\n\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\tgetCurrentTheme() ?? {};\n\n\t\tconst _templateInfo = getTemplateInfo( {\n\t\t\ttemplateTypes,\n\t\t\ttemplate: _document,\n\t\t} );\n\t\tconst _postTypeLabel = getPostType( _postType )?.labels?.singular_name;\n\n\t\t// Check if styles canvas is active and get its title\n\t\tconst { getStylesPath, getShowStylebook } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst _stylesPath = getStylesPath();\n\t\tconst _showStylebook = getShowStylebook();\n\t\tconst _stylesCanvasTitle = getStylesCanvasTitle(\n\t\t\t_stylesPath,\n\t\t\t_showStylebook\n\t\t);\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tpostType: _postType,\n\t\t\tpostTypeLabel: _postTypeLabel,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisTemplatePreview: getRenderingMode() === 'template-locked',\n\t\t\tstylesCanvasTitle: _stylesCanvasTitle,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst hasBackButton =\n\t\t!! onNavigateToPreviousEntityRecord || !! unlockedPatternInfo;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\n\t// Use pattern info if a pattern block is unlocked, otherwise use document/entity info\n\tconst title =\n\t\tunlockedPatternInfo?.patternTitle ||\n\t\tprops.title ||\n\t\tstylesCanvasTitle ||\n\t\tentityTitle;\n\tconst icon = props.icon;\n\n\t// Determine the back button action\n\tconst handleBackClick = ( event ) => {\n\t\tevent.stopPropagation();\n\t\tif ( unlockedPatternInfo ) {\n\t\t\tstopEditingContentOnlySection();\n\t\t} else if ( onNavigateToPreviousEntityRecord ) {\n\t\t\tonNavigateToPreviousEntityRecord();\n\t\t}\n\t};\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ handleBackClick }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ ! isTemplate && isTemplatePreview && ! hasBackButton && (\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tclassName=\"editor-document-bar__icon-layout\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isNotFound ? (\n\t\t\t\t<WCText>{ __( 'Document not found' ) }</WCText>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon && <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\t<WCText size=\"body\" as=\"h1\">\n\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-title\">\n\t\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t\t? stripHTML( title )\n\t\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{ unlockedPatternInfo && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ unlockedPatternInfo.type ===\n\t\t\t\t\t\t\t\t\t'template-part'\n\t\t\t\t\t\t\t\t\t\t? `\u00B7 ${ __( 'Template Part' ) }`\n\t\t\t\t\t\t\t\t\t\t: `\u00B7 ${ __( 'Pattern' ) }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! unlockedPatternInfo && pageTypeBadge && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ `\u00B7 ${ pageTypeBadge }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! unlockedPatternInfo &&\n\t\t\t\t\t\t\t\tpostTypeLabel &&\n\t\t\t\t\t\t\t\t! props.title &&\n\t\t\t\t\t\t\t\t! pageTypeBadge && (\n\t\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t\t{ `\u00B7 ${ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tpostTypeLabel\n\t\t\t\t\t\t\t\t\t\t) }` }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</WCText>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,IAAI,aAAa;AAC1B,SAAS,WAAW,mBAAmB;AACvC;AAAA,EACC;AAAA,EACA,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,OACvB;AACP,SAAS,WAAW,SAAS,wBAAwB;AACrD,SAAS,kBAAkB,mBAAmB,cAAc;AAC5D,SAAS,uBAAuB;AAChC,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,qBAAqB;AACvC,SAAS,QAAQ,iBAAiB;AAClC,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB,iBAAiB;AAKjD,SAAS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,QAAS,GAAI,GAChC;AAAA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF;AAEF;",
6
6
  "names": []
7
7
  }
@@ -4,7 +4,7 @@ import { __ } from "@wordpress/i18n";
4
4
  import {
5
5
  Button,
6
6
  __experimentalHStack as HStack,
7
- __experimentalText as Text
7
+ __experimentalText as WCText
8
8
  } from "@wordpress/components";
9
9
  import { select } from "@wordpress/data";
10
10
  import { useCopyToClipboard } from "@wordpress/compose";
@@ -50,7 +50,7 @@ var ErrorBoundary = class extends Component {
50
50
  expanded: false,
51
51
  wrap: true,
52
52
  children: [
53
- /* @__PURE__ */ jsx(Text, { as: "p", children: __("The editor has encountered an unexpected error.") }),
53
+ /* @__PURE__ */ jsx(WCText, { as: "p", children: __("The editor has encountered an unexpected error.") }),
54
54
  /* @__PURE__ */ jsxs(HStack, { expanded: false, children: [
55
55
  canCopyContent && /* @__PURE__ */ jsx(CopyButton, { text: getContent, children: __("Copy contents") }),
56
56
  /* @__PURE__ */ jsx(CopyButton, { variant: "primary", text: error?.stack, children: __("Copy error") })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/error-boundary/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { select } from '@wordpress/data';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch {}\n}\n\nfunction CopyButton( { text, children, variant = 'secondary' } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant={ variant } ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tconst { canCopyContent = false } = this.props;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<HStack\n\t\t\t\tclassName=\"editor-error-boundary\"\n\t\t\t\talignment=\"baseline\"\n\t\t\t\tspacing={ 4 }\n\t\t\t\tjustify=\"space-between\"\n\t\t\t\texpanded={ false }\n\t\t\t\twrap\n\t\t\t>\n\t\t\t\t<Text as=\"p\">\n\t\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t\t</Text>\n\t\t\t\t<HStack expanded={ false }>\n\t\t\t\t\t{ canCopyContent && (\n\t\t\t\t\t\t<CopyButton text={ getContent }>\n\t\t\t\t\t\t\t{ __( 'Copy contents' ) }\n\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<CopyButton variant=\"primary\" text={ error?.stack }>\n\t\t\t\t\t\t{ __( 'Copy error' ) }\n\t\t\t\t\t</CopyButton>\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t);\n\t}\n}\n\n/**\n * ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.\n *\n * It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.\n *\n * getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.\n *\n * @class ErrorBoundary\n * @augments Component\n */\nexport default ErrorBoundary;\n"],
5
- "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,OAChB;AACP,SAAS,cAAc;AACvB,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AAKzB,SAAS,SAAS,mBAAmB;AAiBnC,cA0CE,YA1CF;AAfF,SAAS,aAAa;AACrB,MAAI;AAOH,WAAO,OAAQ,WAAY,EAAE,qBAAqB;AAAA,EACnD,QAAQ;AAAA,EAAC;AACV;AAEA,SAAS,WAAY,EAAE,MAAM,UAAU,UAAU,YAAY,GAAI;AAChE,QAAM,MAAM,mBAAoB,IAAK;AACrC,SACC,oBAAC,UAAO,uBAAqB,MAAC,SAAoB,KAC/C,UACH;AAEF;AAEA,IAAM,gBAAN,cAA4B,UAAU;AAAA,EACrC,cAAc;AACb,UAAO,GAAG,SAAU;AAEpB,SAAK,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,kBAAmB,OAAQ;AAC1B,aAAU,oCAAoC,KAAM;AAAA,EACrD;AAAA,EAEA,OAAO,yBAA0B,OAAQ;AACxC,WAAO,EAAE,MAAM;AAAA,EAChB;AAAA,EAEA,SAAS;AACR,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAM,EAAE,iBAAiB,MAAM,IAAI,KAAK;AACxC,QAAK,CAAE,OAAQ;AACd,aAAO,KAAK,MAAM;AAAA,IACnB;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,WAAU;AAAA,QACV,SAAU;AAAA,QACV,SAAQ;AAAA,QACR,UAAW;AAAA,QACX,MAAI;AAAA,QAEJ;AAAA,8BAAC,QAAK,IAAG,KACN,aAAI,iDAAkD,GACzD;AAAA,UACA,qBAAC,UAAO,UAAW,OAChB;AAAA,8BACD,oBAAC,cAAW,MAAO,YAChB,aAAI,eAAgB,GACvB;AAAA,YAED,oBAAC,cAAW,SAAQ,WAAU,MAAO,OAAO,OACzC,aAAI,YAAa,GACpB;AAAA,aACD;AAAA;AAAA;AAAA,IACD;AAAA,EAEF;AACD;AAYA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalText as WCText,\n} from '@wordpress/components';\nimport { select } from '@wordpress/data';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch {}\n}\n\nfunction CopyButton( { text, children, variant = 'secondary' } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant={ variant } ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tconst { canCopyContent = false } = this.props;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<HStack\n\t\t\t\tclassName=\"editor-error-boundary\"\n\t\t\t\talignment=\"baseline\"\n\t\t\t\tspacing={ 4 }\n\t\t\t\tjustify=\"space-between\"\n\t\t\t\texpanded={ false }\n\t\t\t\twrap\n\t\t\t>\n\t\t\t\t<WCText as=\"p\">\n\t\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t\t</WCText>\n\t\t\t\t<HStack expanded={ false }>\n\t\t\t\t\t{ canCopyContent && (\n\t\t\t\t\t\t<CopyButton text={ getContent }>\n\t\t\t\t\t\t\t{ __( 'Copy contents' ) }\n\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<CopyButton variant=\"primary\" text={ error?.stack }>\n\t\t\t\t\t\t{ __( 'Copy error' ) }\n\t\t\t\t\t</CopyButton>\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t);\n\t}\n}\n\n/**\n * ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.\n *\n * It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.\n *\n * getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.\n *\n * @class ErrorBoundary\n * @augments Component\n */\nexport default ErrorBoundary;\n"],
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,OAChB;AACP,SAAS,cAAc;AACvB,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AAKzB,SAAS,SAAS,mBAAmB;AAiBnC,cA0CE,YA1CF;AAfF,SAAS,aAAa;AACrB,MAAI;AAOH,WAAO,OAAQ,WAAY,EAAE,qBAAqB;AAAA,EACnD,QAAQ;AAAA,EAAC;AACV;AAEA,SAAS,WAAY,EAAE,MAAM,UAAU,UAAU,YAAY,GAAI;AAChE,QAAM,MAAM,mBAAoB,IAAK;AACrC,SACC,oBAAC,UAAO,uBAAqB,MAAC,SAAoB,KAC/C,UACH;AAEF;AAEA,IAAM,gBAAN,cAA4B,UAAU;AAAA,EACrC,cAAc;AACb,UAAO,GAAG,SAAU;AAEpB,SAAK,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,kBAAmB,OAAQ;AAC1B,aAAU,oCAAoC,KAAM;AAAA,EACrD;AAAA,EAEA,OAAO,yBAA0B,OAAQ;AACxC,WAAO,EAAE,MAAM;AAAA,EAChB;AAAA,EAEA,SAAS;AACR,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAM,EAAE,iBAAiB,MAAM,IAAI,KAAK;AACxC,QAAK,CAAE,OAAQ;AACd,aAAO,KAAK,MAAM;AAAA,IACnB;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,WAAU;AAAA,QACV,SAAU;AAAA,QACV,SAAQ;AAAA,QACR,UAAW;AAAA,QACX,MAAI;AAAA,QAEJ;AAAA,8BAAC,UAAO,IAAG,KACR,aAAI,iDAAkD,GACzD;AAAA,UACA,qBAAC,UAAO,UAAW,OAChB;AAAA,8BACD,oBAAC,cAAW,MAAO,YAChB,aAAI,eAAgB,GACvB;AAAA,YAED,oBAAC,cAAW,SAAQ,WAAU,MAAO,OAAO,OACzC,aAAI,YAAa,GACpB;AAAA,aACD;AAAA;AAAA;AAAA,IACD;AAAA,EAEF;AACD;AAYA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  // packages/editor/src/components/list-view-sidebar/list-view-outline.js
2
- import { __experimentalText as Text } from "@wordpress/components";
2
+ import { __experimentalText as WCText } from "@wordpress/components";
3
3
  import { __ } from "@wordpress/i18n";
4
4
  import CharacterCount from "../character-count/index.mjs";
5
5
  import WordCount from "../word-count/index.mjs";
@@ -10,15 +10,15 @@ function ListViewOutline() {
10
10
  return /* @__PURE__ */ jsxs(Fragment, { children: [
11
11
  /* @__PURE__ */ jsxs("div", { className: "editor-list-view-sidebar__outline", children: [
12
12
  /* @__PURE__ */ jsxs("div", { children: [
13
- /* @__PURE__ */ jsx(Text, { children: __("Characters:") }),
14
- /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(CharacterCount, {}) })
13
+ /* @__PURE__ */ jsx(WCText, { children: __("Characters:") }),
14
+ /* @__PURE__ */ jsx(WCText, { children: /* @__PURE__ */ jsx(CharacterCount, {}) })
15
15
  ] }),
16
16
  /* @__PURE__ */ jsxs("div", { children: [
17
- /* @__PURE__ */ jsx(Text, { children: __("Words:") }),
17
+ /* @__PURE__ */ jsx(WCText, { children: __("Words:") }),
18
18
  /* @__PURE__ */ jsx(WordCount, {})
19
19
  ] }),
20
20
  /* @__PURE__ */ jsxs("div", { children: [
21
- /* @__PURE__ */ jsx(Text, { children: __("Time to read:") }),
21
+ /* @__PURE__ */ jsx(WCText, { children: __("Time to read:") }),
22
22
  /* @__PURE__ */ jsx(TimeToRead, {})
23
23
  ] })
24
24
  ] }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/list-view-sidebar/list-view-outline.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CharacterCount from '../character-count';\nimport WordCount from '../word-count';\nimport TimeToRead from '../time-to-read';\nimport DocumentOutline from '../document-outline';\n\nexport default function ListViewOutline() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-list-view-sidebar__outline\">\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Characters:' ) }</Text>\n\t\t\t\t\t<Text>\n\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Words:' ) }</Text>\n\t\t\t\t\t<WordCount />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Time to read:' ) }</Text>\n\t\t\t\t\t<TimeToRead />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DocumentOutline />\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,sBAAsB,YAAY;AAC3C,SAAS,UAAU;AAKnB,OAAO,oBAAoB;AAC3B,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,qBAAqB;AAI1B,mBAGG,KADD,YAFF;AAFa,SAAR,kBAAmC;AACzC,SACC,iCACC;AAAA,yBAAC,SAAI,WAAU,qCACd;AAAA,2BAAC,SACA;AAAA,4BAAC,QAAO,aAAI,aAAc,GAAG;AAAA,QAC7B,oBAAC,QACA,8BAAC,kBAAe,GACjB;AAAA,SACD;AAAA,MACA,qBAAC,SACA;AAAA,4BAAC,QAAO,aAAI,QAAS,GAAG;AAAA,QACxB,oBAAC,aAAU;AAAA,SACZ;AAAA,MACA,qBAAC,SACA;AAAA,4BAAC,QAAO,aAAI,eAAgB,GAAG;AAAA,QAC/B,oBAAC,cAAW;AAAA,SACb;AAAA,OACD;AAAA,IACA,oBAAC,mBAAgB;AAAA,KAClB;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as WCText } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CharacterCount from '../character-count';\nimport WordCount from '../word-count';\nimport TimeToRead from '../time-to-read';\nimport DocumentOutline from '../document-outline';\n\nexport default function ListViewOutline() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-list-view-sidebar__outline\">\n\t\t\t\t<div>\n\t\t\t\t\t<WCText>{ __( 'Characters:' ) }</WCText>\n\t\t\t\t\t<WCText>\n\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t</WCText>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<WCText>{ __( 'Words:' ) }</WCText>\n\t\t\t\t\t<WordCount />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<WCText>{ __( 'Time to read:' ) }</WCText>\n\t\t\t\t\t<TimeToRead />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DocumentOutline />\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,sBAAsB,cAAc;AAC7C,SAAS,UAAU;AAKnB,OAAO,oBAAoB;AAC3B,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,qBAAqB;AAI1B,mBAGG,KADD,YAFF;AAFa,SAAR,kBAAmC;AACzC,SACC,iCACC;AAAA,yBAAC,SAAI,WAAU,qCACd;AAAA,2BAAC,SACA;AAAA,4BAAC,UAAS,aAAI,aAAc,GAAG;AAAA,QAC/B,oBAAC,UACA,8BAAC,kBAAe,GACjB;AAAA,SACD;AAAA,MACA,qBAAC,SACA;AAAA,4BAAC,UAAS,aAAI,QAAS,GAAG;AAAA,QAC1B,oBAAC,aAAU;AAAA,SACZ;AAAA,MACA,qBAAC,SACA;AAAA,4BAAC,UAAS,aAAI,eAAgB,GAAG;AAAA,QACjC,oBAAC,cAAW;AAAA,SACb;AAAA,OACD;AAAA,IACA,oBAAC,mBAAgB;AAAA,KAClB;AAEF;",
6
6
  "names": []
7
7
  }