@wordpress/editor 14.40.2-next.v.202602241322.0 → 14.40.2

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 (464) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/collab-sidebar/index.cjs +7 -4
  3. package/build/components/collab-sidebar/index.cjs.map +2 -2
  4. package/build/components/collab-sidebar/utils.cjs +13 -15
  5. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  6. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs +141 -0
  7. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +7 -0
  8. package/build/components/collaborators-overlay/collaborator-styles.cjs +38 -2
  9. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +2 -2
  10. package/build/components/collaborators-overlay/compute-selection.cjs +185 -0
  11. package/build/components/collaborators-overlay/compute-selection.cjs.map +7 -0
  12. package/build/components/collaborators-overlay/cursor-dom-utils.cjs +243 -0
  13. package/build/components/collaborators-overlay/cursor-dom-utils.cjs.map +7 -0
  14. package/build/components/collaborators-overlay/cursor-registry.cjs +86 -0
  15. package/build/components/collaborators-overlay/cursor-registry.cjs.map +7 -0
  16. package/build/components/collaborators-overlay/index.cjs +7 -2
  17. package/build/components/collaborators-overlay/index.cjs.map +2 -2
  18. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +148 -0
  19. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +7 -0
  20. package/build/components/collaborators-overlay/overlay.cjs +146 -236
  21. package/build/components/collaborators-overlay/overlay.cjs.map +3 -3
  22. package/build/components/collaborators-overlay/timing-utils.cjs +46 -0
  23. package/build/components/collaborators-overlay/timing-utils.cjs.map +7 -0
  24. package/build/components/collaborators-overlay/use-block-highlighting.cjs +91 -42
  25. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +2 -2
  26. package/build/components/collaborators-overlay/use-debounced-recompute.cjs +49 -0
  27. package/build/components/collaborators-overlay/use-debounced-recompute.cjs.map +7 -0
  28. package/build/components/collaborators-overlay/use-render-cursors.cjs +82 -172
  29. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  30. package/build/components/collaborators-presence/avatar/component.cjs +121 -0
  31. package/build/components/collaborators-presence/avatar/component.cjs.map +7 -0
  32. package/build/components/collaborators-presence/avatar/index.cjs +37 -0
  33. package/build/components/collaborators-presence/avatar/index.cjs.map +7 -0
  34. package/build/components/collaborators-presence/avatar/types.cjs +19 -0
  35. package/build/components/collaborators-presence/avatar/types.cjs.map +7 -0
  36. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs +44 -0
  37. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +7 -0
  38. package/build/components/collaborators-presence/avatar-group/component.cjs +78 -0
  39. package/build/components/collaborators-presence/avatar-group/component.cjs.map +7 -0
  40. package/build/components/collaborators-presence/avatar-group/index.cjs +37 -0
  41. package/build/components/collaborators-presence/avatar-group/index.cjs.map +7 -0
  42. package/build/components/collaborators-presence/avatar-group/types.cjs +19 -0
  43. package/build/components/collaborators-presence/avatar-group/types.cjs.map +7 -0
  44. package/build/components/collaborators-presence/index.cjs +66 -19
  45. package/build/components/collaborators-presence/index.cjs.map +3 -3
  46. package/build/components/collaborators-presence/list.cjs +60 -38
  47. package/build/components/collaborators-presence/list.cjs.map +3 -3
  48. package/build/components/collaborators-presence/use-collaborator-notifications.cjs +149 -0
  49. package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +7 -0
  50. package/build/components/editor-interface/index.cjs +11 -6
  51. package/build/components/editor-interface/index.cjs.map +2 -2
  52. package/build/components/inserter-sidebar/index.cjs +2 -1
  53. package/build/components/inserter-sidebar/index.cjs.map +2 -2
  54. package/build/components/post-last-revision/index.cjs +27 -6
  55. package/build/components/post-last-revision/index.cjs.map +2 -2
  56. package/build/components/post-locked-modal/index.cjs +49 -17
  57. package/build/components/post-locked-modal/index.cjs.map +3 -3
  58. package/build/components/post-revisions-preview/block-diff.cjs +130 -34
  59. package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
  60. package/build/components/post-revisions-preview/diff-markers.cjs +6 -5
  61. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  62. package/build/components/post-revisions-preview/revisions-canvas.cjs +16 -60
  63. package/build/components/post-revisions-preview/revisions-canvas.cjs.map +3 -3
  64. package/build/components/post-revisions-preview/revisions-header.cjs +33 -26
  65. package/build/components/post-revisions-preview/revisions-header.cjs.map +3 -3
  66. package/build/components/post-revisions-preview/revisions-slider.cjs +104 -39
  67. package/build/components/post-revisions-preview/revisions-slider.cjs.map +3 -3
  68. package/build/components/preferences-modal/index.cjs +36 -4
  69. package/build/components/preferences-modal/index.cjs.map +2 -2
  70. package/build/components/provider/disable-non-page-content-blocks.cjs +31 -28
  71. package/build/components/provider/disable-non-page-content-blocks.cjs.map +3 -3
  72. package/build/components/provider/index.cjs +17 -5
  73. package/build/components/provider/index.cjs.map +2 -2
  74. package/build/components/provider/use-block-editor-settings.cjs +20 -4
  75. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  76. package/build/components/provider/{use-post-content-blocks.cjs → use-post-content-block-types.cjs} +8 -19
  77. package/build/components/provider/use-post-content-block-types.cjs.map +7 -0
  78. package/build/components/provider/use-revision-blocks.cjs +106 -0
  79. package/build/components/provider/use-revision-blocks.cjs.map +7 -0
  80. package/build/components/revision-block-diff/index.cjs +61 -0
  81. package/build/components/revision-block-diff/index.cjs.map +7 -0
  82. package/build/components/revision-diff-panel/index.cjs +68 -0
  83. package/build/components/revision-diff-panel/index.cjs.map +7 -0
  84. package/build/components/revision-fields-diff/index.cjs +96 -0
  85. package/build/components/revision-fields-diff/index.cjs.map +7 -0
  86. package/build/components/sidebar/header.cjs +1 -1
  87. package/build/components/sidebar/header.cjs.map +2 -2
  88. package/build/components/sidebar/index.cjs +7 -1
  89. package/build/components/sidebar/index.cjs.map +3 -3
  90. package/build/components/style-book/index.cjs +4 -3
  91. package/build/components/style-book/index.cjs.map +2 -2
  92. package/build/components/sync-connection-error-modal/index.cjs +187 -0
  93. package/build/components/sync-connection-error-modal/index.cjs.map +7 -0
  94. package/build/components/sync-connection-error-modal/use-retry-countdown.cjs +84 -0
  95. package/build/components/sync-connection-error-modal/use-retry-countdown.cjs.map +7 -0
  96. package/build/components/template-content-panel/index.cjs +35 -31
  97. package/build/components/template-content-panel/index.cjs.map +3 -3
  98. package/build/components/template-part-menu-items/convert-to-regular.cjs +54 -11
  99. package/build/components/template-part-menu-items/convert-to-regular.cjs.map +3 -3
  100. package/build/components/visual-editor/index.cjs +6 -15
  101. package/build/components/visual-editor/index.cjs.map +2 -2
  102. package/build/store/private-actions.cjs +46 -2
  103. package/build/store/private-actions.cjs.map +2 -2
  104. package/build/store/private-selectors.cjs +156 -21
  105. package/build/store/private-selectors.cjs.map +2 -2
  106. package/build/store/reducer.cjs +27 -0
  107. package/build/store/reducer.cjs.map +2 -2
  108. package/build/store/selectors.cjs +0 -14
  109. package/build/store/selectors.cjs.map +2 -2
  110. package/build/utils/media-finalize/index.cjs +43 -0
  111. package/build/utils/media-finalize/index.cjs.map +7 -0
  112. package/build/utils/media-upload/on-success.cjs +46 -0
  113. package/build/utils/media-upload/on-success.cjs.map +7 -0
  114. package/build/utils/sync-error-messages.cjs +32 -15
  115. package/build/utils/sync-error-messages.cjs.map +3 -3
  116. package/build-module/components/collab-sidebar/index.mjs +7 -4
  117. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  118. package/build-module/components/collab-sidebar/utils.mjs +13 -15
  119. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  120. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs +128 -0
  121. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +7 -0
  122. package/build-module/components/collaborators-overlay/collaborator-styles.mjs +25 -1
  123. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +2 -2
  124. package/build-module/components/collaborators-overlay/compute-selection.mjs +166 -0
  125. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +7 -0
  126. package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs +213 -0
  127. package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs.map +7 -0
  128. package/build-module/components/collaborators-overlay/cursor-registry.mjs +61 -0
  129. package/build-module/components/collaborators-overlay/cursor-registry.mjs.map +7 -0
  130. package/build-module/components/collaborators-overlay/index.mjs +7 -2
  131. package/build-module/components/collaborators-overlay/index.mjs.map +2 -2
  132. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +130 -0
  133. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +7 -0
  134. package/build-module/components/collaborators-overlay/overlay.mjs +137 -237
  135. package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
  136. package/build-module/components/collaborators-overlay/timing-utils.mjs +21 -0
  137. package/build-module/components/collaborators-overlay/timing-utils.mjs.map +7 -0
  138. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +93 -45
  139. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  140. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs +24 -0
  141. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs.map +7 -0
  142. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +83 -176
  143. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  144. package/build-module/components/collaborators-presence/avatar/component.mjs +90 -0
  145. package/build-module/components/collaborators-presence/avatar/component.mjs.map +7 -0
  146. package/build-module/components/collaborators-presence/avatar/index.mjs +6 -0
  147. package/build-module/components/collaborators-presence/avatar/index.mjs.map +7 -0
  148. package/build-module/components/collaborators-presence/avatar/types.mjs +1 -0
  149. package/build-module/components/collaborators-presence/avatar/types.mjs.map +7 -0
  150. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs +19 -0
  151. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +7 -0
  152. package/build-module/components/collaborators-presence/avatar-group/component.mjs +47 -0
  153. package/build-module/components/collaborators-presence/avatar-group/component.mjs.map +7 -0
  154. package/build-module/components/collaborators-presence/avatar-group/index.mjs +6 -0
  155. package/build-module/components/collaborators-presence/avatar-group/index.mjs.map +7 -0
  156. package/build-module/components/collaborators-presence/avatar-group/types.mjs +1 -0
  157. package/build-module/components/collaborators-presence/avatar-group/types.mjs.map +7 -0
  158. package/build-module/components/collaborators-presence/index.mjs +57 -23
  159. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  160. package/build-module/components/collaborators-presence/list.mjs +52 -44
  161. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  162. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +126 -0
  163. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +7 -0
  164. package/build-module/components/editor-interface/index.mjs +12 -7
  165. package/build-module/components/editor-interface/index.mjs.map +2 -2
  166. package/build-module/components/inserter-sidebar/index.mjs +2 -1
  167. package/build-module/components/inserter-sidebar/index.mjs.map +2 -2
  168. package/build-module/components/post-last-revision/index.mjs +27 -6
  169. package/build-module/components/post-last-revision/index.mjs.map +2 -2
  170. package/build-module/components/post-locked-modal/index.mjs +49 -17
  171. package/build-module/components/post-locked-modal/index.mjs.map +2 -2
  172. package/build-module/components/post-revisions-preview/block-diff.mjs +130 -34
  173. package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
  174. package/build-module/components/post-revisions-preview/diff-markers.mjs +6 -5
  175. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  176. package/build-module/components/post-revisions-preview/revisions-canvas.mjs +18 -65
  177. package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
  178. package/build-module/components/post-revisions-preview/revisions-header.mjs +36 -33
  179. package/build-module/components/post-revisions-preview/revisions-header.mjs.map +2 -2
  180. package/build-module/components/post-revisions-preview/revisions-slider.mjs +112 -42
  181. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  182. package/build-module/components/preferences-modal/index.mjs +36 -4
  183. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  184. package/build-module/components/provider/disable-non-page-content-blocks.mjs +31 -28
  185. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +2 -2
  186. package/build-module/components/provider/index.mjs +17 -5
  187. package/build-module/components/provider/index.mjs.map +2 -2
  188. package/build-module/components/provider/use-block-editor-settings.mjs +20 -4
  189. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  190. package/build-module/components/provider/use-post-content-block-types.mjs +23 -0
  191. package/build-module/components/provider/use-post-content-block-types.mjs.map +7 -0
  192. package/build-module/components/provider/use-revision-blocks.mjs +81 -0
  193. package/build-module/components/provider/use-revision-blocks.mjs.map +7 -0
  194. package/build-module/components/revision-block-diff/index.mjs +30 -0
  195. package/build-module/components/revision-block-diff/index.mjs.map +7 -0
  196. package/build-module/components/revision-diff-panel/index.mjs +37 -0
  197. package/build-module/components/revision-diff-panel/index.mjs.map +7 -0
  198. package/build-module/components/revision-fields-diff/index.mjs +65 -0
  199. package/build-module/components/revision-fields-diff/index.mjs.map +7 -0
  200. package/build-module/components/sidebar/header.mjs +1 -1
  201. package/build-module/components/sidebar/header.mjs.map +2 -2
  202. package/build-module/components/sidebar/index.mjs +7 -1
  203. package/build-module/components/sidebar/index.mjs.map +2 -2
  204. package/build-module/components/style-book/index.mjs +4 -3
  205. package/build-module/components/style-book/index.mjs.map +2 -2
  206. package/build-module/components/sync-connection-error-modal/index.mjs +170 -0
  207. package/build-module/components/sync-connection-error-modal/index.mjs.map +7 -0
  208. package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs +59 -0
  209. package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs.map +7 -0
  210. package/build-module/components/template-content-panel/index.mjs +25 -31
  211. package/build-module/components/template-content-panel/index.mjs.map +2 -2
  212. package/build-module/components/template-part-menu-items/convert-to-regular.mjs +60 -14
  213. package/build-module/components/template-part-menu-items/convert-to-regular.mjs.map +2 -2
  214. package/build-module/components/visual-editor/index.mjs +6 -15
  215. package/build-module/components/visual-editor/index.mjs.map +2 -2
  216. package/build-module/store/private-actions.mjs +44 -2
  217. package/build-module/store/private-actions.mjs.map +2 -2
  218. package/build-module/store/private-selectors.mjs +155 -21
  219. package/build-module/store/private-selectors.mjs.map +2 -2
  220. package/build-module/store/reducer.mjs +25 -0
  221. package/build-module/store/reducer.mjs.map +2 -2
  222. package/build-module/store/selectors.mjs +0 -13
  223. package/build-module/store/selectors.mjs.map +2 -2
  224. package/build-module/utils/media-finalize/index.mjs +12 -0
  225. package/build-module/utils/media-finalize/index.mjs.map +7 -0
  226. package/build-module/utils/media-upload/on-success.mjs +25 -0
  227. package/build-module/utils/media-upload/on-success.mjs.map +7 -0
  228. package/build-module/utils/sync-error-messages.mjs +27 -15
  229. package/build-module/utils/sync-error-messages.mjs.map +3 -3
  230. package/build-style/style-rtl.css +388 -132
  231. package/build-style/style.css +388 -132
  232. package/build-types/components/autocompleters/link.d.ts +8 -0
  233. package/build-types/components/autocompleters/link.d.ts.map +1 -0
  234. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +5 -0
  235. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -0
  236. package/build-types/components/collab-sidebar/add-note.d.ts +6 -0
  237. package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -0
  238. package/build-types/components/collab-sidebar/board-store.d.ts +9 -0
  239. package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -0
  240. package/build-types/components/collab-sidebar/floating-container.d.ts +8 -0
  241. package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -0
  242. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  243. package/build-types/components/collab-sidebar/note-byline.d.ts +10 -0
  244. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -0
  245. package/build-types/components/collab-sidebar/note-card.d.ts +8 -0
  246. package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -0
  247. package/build-types/components/collab-sidebar/note-form.d.ts +7 -0
  248. package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -0
  249. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +5 -0
  250. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -0
  251. package/build-types/components/collab-sidebar/note-thread.d.ts +11 -0
  252. package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -0
  253. package/build-types/components/collab-sidebar/note.d.ts +9 -0
  254. package/build-types/components/collab-sidebar/note.d.ts.map +1 -0
  255. package/build-types/components/collab-sidebar/notes.d.ts +7 -0
  256. package/build-types/components/collab-sidebar/notes.d.ts.map +1 -0
  257. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  258. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts +11 -0
  259. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts.map +1 -0
  260. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts +17 -2
  261. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts.map +1 -1
  262. package/build-types/components/collaborators-overlay/compute-selection.d.ts +24 -0
  263. package/build-types/components/collaborators-overlay/compute-selection.d.ts.map +1 -0
  264. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts +72 -0
  265. package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts.map +1 -0
  266. package/build-types/components/collaborators-overlay/cursor-registry.d.ts +36 -0
  267. package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -0
  268. package/build-types/components/collaborators-overlay/index.d.ts +7 -4
  269. package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
  270. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +6 -0
  271. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -0
  272. package/build-types/components/collaborators-overlay/overlay.d.ts +4 -1
  273. package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
  274. package/build-types/components/collaborators-overlay/timing-utils.d.ts +11 -0
  275. package/build-types/components/collaborators-overlay/timing-utils.d.ts.map +1 -0
  276. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +21 -5
  277. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  278. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts +10 -0
  279. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts.map +1 -0
  280. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts +6 -1
  281. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  282. package/build-types/components/collaborators-presence/avatar/component.d.ts +7 -0
  283. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -0
  284. package/build-types/components/collaborators-presence/avatar/index.d.ts +3 -0
  285. package/build-types/components/collaborators-presence/avatar/index.d.ts.map +1 -0
  286. package/build-types/components/collaborators-presence/avatar/types.d.ts +66 -0
  287. package/build-types/components/collaborators-presence/avatar/types.d.ts.map +1 -0
  288. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts +17 -0
  289. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts.map +1 -0
  290. package/build-types/components/collaborators-presence/avatar-group/component.d.ts +7 -0
  291. package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -0
  292. package/build-types/components/collaborators-presence/avatar-group/index.d.ts +3 -0
  293. package/build-types/components/collaborators-presence/avatar-group/index.d.ts.map +1 -0
  294. package/build-types/components/collaborators-presence/avatar-group/types.d.ts +14 -0
  295. package/build-types/components/collaborators-presence/avatar-group/types.d.ts.map +1 -0
  296. package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
  297. package/build-types/components/collaborators-presence/list.d.ts +6 -2
  298. package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
  299. package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts +9 -0
  300. package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -0
  301. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  302. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  303. package/build-types/components/media/media-editor-modal.d.ts +15 -0
  304. package/build-types/components/media/media-editor-modal.d.ts.map +1 -0
  305. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  306. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  307. package/build-types/components/post-revisions-panel/index.d.ts +2 -0
  308. package/build-types/components/post-revisions-panel/index.d.ts.map +1 -0
  309. package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
  310. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  311. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +2 -5
  312. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
  313. package/build-types/components/post-revisions-preview/revisions-header.d.ts.map +1 -1
  314. package/build-types/components/post-revisions-preview/revisions-slider.d.ts +1 -1
  315. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  316. package/build-types/components/post-text-editor/utils.d.ts +29 -0
  317. package/build-types/components/post-text-editor/utils.d.ts.map +1 -0
  318. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  319. package/build-types/components/provider/index.d.ts.map +1 -1
  320. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  321. package/build-types/components/provider/use-network-reconnect.d.ts +8 -0
  322. package/build-types/components/provider/use-network-reconnect.d.ts.map +1 -0
  323. package/build-types/components/provider/use-post-content-block-types.d.ts +9 -0
  324. package/build-types/components/provider/use-post-content-block-types.d.ts.map +1 -0
  325. package/build-types/components/provider/use-revision-blocks.d.ts +10 -0
  326. package/build-types/components/provider/use-revision-blocks.d.ts.map +1 -0
  327. package/build-types/components/revision-block-diff/index.d.ts +6 -0
  328. package/build-types/components/revision-block-diff/index.d.ts.map +1 -0
  329. package/build-types/components/revision-diff-panel/index.d.ts +14 -0
  330. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -0
  331. package/build-types/components/revision-fields-diff/index.d.ts +6 -0
  332. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -0
  333. package/build-types/components/sidebar/dataform-post-summary.d.ts +4 -0
  334. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -0
  335. package/build-types/components/sidebar/index.d.ts.map +1 -1
  336. package/build-types/components/sidebar/post-revision-summary.d.ts +2 -0
  337. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -0
  338. package/build-types/components/style-book/index.d.ts +2 -1
  339. package/build-types/components/style-book/index.d.ts.map +1 -1
  340. package/build-types/components/sync-connection-error-modal/index.d.ts +8 -0
  341. package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -0
  342. package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts +11 -0
  343. package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts.map +1 -0
  344. package/build-types/components/template-actions-panel/block-theme-content.d.ts +2 -0
  345. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -0
  346. package/build-types/components/template-actions-panel/classic-theme-content.d.ts +2 -0
  347. package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -0
  348. package/build-types/components/template-actions-panel/index.d.ts +2 -0
  349. package/build-types/components/template-actions-panel/index.d.ts.map +1 -0
  350. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  351. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -1
  352. package/build-types/components/upload-progress-snackbar/index.d.ts +19 -0
  353. package/build-types/components/upload-progress-snackbar/index.d.ts.map +1 -0
  354. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts +28 -0
  355. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts.map +1 -0
  356. package/build-types/components/upload-progress-snackbar/tracker.d.ts +41 -0
  357. package/build-types/components/upload-progress-snackbar/tracker.d.ts.map +1 -0
  358. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  359. package/build-types/store/private-actions.d.ts +12 -0
  360. package/build-types/store/private-actions.d.ts.map +1 -1
  361. package/build-types/store/private-selectors.d.ts +45 -0
  362. package/build-types/store/private-selectors.d.ts.map +1 -1
  363. package/build-types/store/reducer.d.ts +21 -0
  364. package/build-types/store/reducer.d.ts.map +1 -1
  365. package/build-types/store/selectors.d.ts +0 -10
  366. package/build-types/store/selectors.d.ts.map +1 -1
  367. package/build-types/utils/media-delete/index.d.ts +2 -0
  368. package/build-types/utils/media-delete/index.d.ts.map +1 -0
  369. package/build-types/utils/media-finalize/index.d.ts +2 -0
  370. package/build-types/utils/media-finalize/index.d.ts.map +1 -0
  371. package/build-types/utils/media-upload/on-success.d.ts +9 -0
  372. package/build-types/utils/media-upload/on-success.d.ts.map +1 -0
  373. package/build-types/utils/sync-error-messages.d.ts +17 -3
  374. package/build-types/utils/sync-error-messages.d.ts.map +1 -1
  375. package/package.json +45 -44
  376. package/src/components/collab-sidebar/index.js +7 -4
  377. package/src/components/collab-sidebar/utils.js +9 -10
  378. package/src/components/collaborators-overlay/avatar-iframe-styles.ts +134 -0
  379. package/src/components/collaborators-overlay/collaborator-styles.ts +43 -2
  380. package/src/components/collaborators-overlay/compute-selection.ts +315 -0
  381. package/src/components/collaborators-overlay/cursor-dom-utils.ts +382 -0
  382. package/src/components/collaborators-overlay/cursor-registry.ts +96 -0
  383. package/src/components/collaborators-overlay/index.tsx +12 -4
  384. package/src/components/collaborators-overlay/overlay-iframe-styles.ts +131 -0
  385. package/src/components/collaborators-overlay/overlay.tsx +145 -229
  386. package/src/components/collaborators-overlay/timing-utils.ts +30 -0
  387. package/src/components/collaborators-overlay/use-block-highlighting.ts +152 -64
  388. package/src/components/collaborators-overlay/use-debounced-recompute.ts +32 -0
  389. package/src/components/collaborators-overlay/use-render-cursors.ts +120 -282
  390. package/src/components/collaborators-presence/avatar/component.tsx +123 -0
  391. package/src/components/collaborators-presence/avatar/index.ts +2 -0
  392. package/src/components/collaborators-presence/avatar/styles.scss +184 -0
  393. package/src/components/collaborators-presence/avatar/test/index.tsx +389 -0
  394. package/src/components/collaborators-presence/avatar/types.ts +66 -0
  395. package/src/components/collaborators-presence/avatar/use-image-loading-status.ts +36 -0
  396. package/src/components/collaborators-presence/avatar-group/component.tsx +55 -0
  397. package/src/components/collaborators-presence/avatar-group/index.ts +2 -0
  398. package/src/components/collaborators-presence/avatar-group/styles.scss +33 -0
  399. package/src/components/collaborators-presence/avatar-group/test/index.tsx +139 -0
  400. package/src/components/collaborators-presence/avatar-group/types.ts +13 -0
  401. package/src/components/collaborators-presence/index.tsx +43 -12
  402. package/src/components/collaborators-presence/list.tsx +68 -40
  403. package/src/components/collaborators-presence/styles/collaborators-list.scss +26 -19
  404. package/src/components/collaborators-presence/styles/collaborators-presence.scss +6 -2
  405. package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +397 -0
  406. package/src/components/collaborators-presence/use-collaborator-notifications.ts +203 -0
  407. package/src/components/document-bar/style.scss +1 -1
  408. package/src/components/editor-interface/index.js +13 -6
  409. package/src/components/inserter-sidebar/index.js +4 -1
  410. package/src/components/post-last-revision/index.js +35 -6
  411. package/src/components/post-last-revision/style.scss +0 -3
  412. package/src/components/post-locked-modal/index.js +69 -25
  413. package/src/components/post-panel-row/style.scss +1 -0
  414. package/src/components/post-revisions-preview/block-diff.js +224 -61
  415. package/src/components/post-revisions-preview/diff-markers.js +15 -12
  416. package/src/components/post-revisions-preview/revisions-canvas.js +23 -86
  417. package/src/components/post-revisions-preview/revisions-header.js +35 -37
  418. package/src/components/post-revisions-preview/revisions-slider.js +138 -62
  419. package/src/components/post-revisions-preview/style.scss +3 -3
  420. package/src/components/post-revisions-preview/test/block-diff.js +202 -35
  421. package/src/components/preferences-modal/index.js +37 -7
  422. package/src/components/provider/disable-non-page-content-blocks.js +42 -40
  423. package/src/components/provider/index.js +20 -2
  424. package/src/components/provider/use-block-editor-settings.js +21 -1
  425. package/src/components/provider/use-post-content-block-types.js +30 -0
  426. package/src/components/provider/use-revision-blocks.js +105 -0
  427. package/src/components/revision-block-diff/index.js +39 -0
  428. package/src/components/revision-diff-panel/index.js +59 -0
  429. package/src/components/revision-diff-panel/style.scss +13 -0
  430. package/src/components/revision-fields-diff/index.js +91 -0
  431. package/src/components/sidebar/header.js +1 -1
  432. package/src/components/sidebar/index.js +4 -0
  433. package/src/components/style-book/index.js +4 -2
  434. package/src/components/sync-connection-error-modal/index.tsx +253 -0
  435. package/src/components/sync-connection-error-modal/style.scss +14 -0
  436. package/src/components/sync-connection-error-modal/use-retry-countdown.ts +93 -0
  437. package/src/components/template-content-panel/index.js +30 -38
  438. package/src/components/template-part-menu-items/convert-to-regular.js +74 -12
  439. package/src/components/visual-editor/index.js +6 -23
  440. package/src/store/private-actions.js +70 -1
  441. package/src/store/private-selectors.js +216 -28
  442. package/src/store/reducer.js +41 -0
  443. package/src/store/selectors.js +0 -19
  444. package/src/style.scss +4 -1
  445. package/src/utils/media-finalize/index.js +11 -0
  446. package/src/utils/media-finalize/test/index.js +34 -0
  447. package/src/utils/media-upload/on-success.js +34 -0
  448. package/src/utils/sync-error-messages.ts +72 -0
  449. package/src/utils/test/sync-error-messages.js +34 -0
  450. package/build/components/provider/use-post-content-blocks.cjs.map +0 -7
  451. package/build/components/sync-connection-modal/index.cjs +0 -130
  452. package/build/components/sync-connection-modal/index.cjs.map +0 -7
  453. package/build-module/components/provider/use-post-content-blocks.mjs +0 -34
  454. package/build-module/components/provider/use-post-content-blocks.mjs.map +0 -7
  455. package/build-module/components/sync-connection-modal/index.mjs +0 -114
  456. package/build-module/components/sync-connection-modal/index.mjs.map +0 -7
  457. package/build-types/components/provider/use-post-content-blocks.d.ts +0 -2
  458. package/build-types/components/provider/use-post-content-blocks.d.ts.map +0 -1
  459. package/build-types/components/sync-connection-modal/index.d.ts +0 -8
  460. package/build-types/components/sync-connection-modal/index.d.ts.map +0 -1
  461. package/src/components/provider/use-post-content-blocks.js +0 -42
  462. package/src/components/sync-connection-modal/index.js +0 -140
  463. package/src/components/sync-connection-modal/style.scss +0 -11
  464. package/src/utils/sync-error-messages.js +0 -53
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { getSyncErrorMessages } from '../sync-error-messages';
5
+
6
+ describe( 'getSyncErrorMessages', () => {
7
+ it.each( [
8
+ 'authentication-failed',
9
+ 'connection-expired',
10
+ 'connection-limit-exceeded',
11
+ 'document-size-limit-exceeded',
12
+ 'unknown-error',
13
+ ] )( 'should return title and description for "%s"', ( code ) => {
14
+ const result = getSyncErrorMessages( { code } );
15
+ expect( result ).toEqual(
16
+ expect.objectContaining( {
17
+ title: expect.any( String ),
18
+ description: expect.any( String ),
19
+ } )
20
+ );
21
+ } );
22
+
23
+ it( 'should fall back to unknown-error for unrecognized codes', () => {
24
+ const result = getSyncErrorMessages( { code: 'some-new-error' } );
25
+ const unknownResult = getSyncErrorMessages( { code: 'unknown-error' } );
26
+ expect( result ).toBe( unknownResult );
27
+ } );
28
+
29
+ it( 'should fall back to unknown-error when error is undefined', () => {
30
+ const result = getSyncErrorMessages( undefined );
31
+ const unknownResult = getSyncErrorMessages( { code: 'unknown-error' } );
32
+ expect( result ).toBe( unknownResult );
33
+ } );
34
+ } );
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/provider/use-post-content-blocks.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst POST_CONTENT_BLOCK_TYPES = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n];\n\nexport default function usePostContentBlocks() {\n\tconst contentOnlyBlockTypes = useMemo(\n\t\t() => [\n\t\t\t...applyFilters(\n\t\t\t\t'editor.postContentBlockTypes',\n\t\t\t\tPOST_CONTENT_BLOCK_TYPES\n\t\t\t),\n\t\t],\n\t\t[]\n\t);\n\n\t// Note that there are two separate subscriptions because the result for each\n\t// returns a new array.\n\tconst contentOnlyIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostBlocksByName } = unlock( select( editorStore ) );\n\t\t\treturn getPostBlocksByName( contentOnlyBlockTypes );\n\t\t},\n\t\t[ contentOnlyBlockTypes ]\n\t);\n\n\treturn contentOnlyIds;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,qBAAwB;AACxB,mBAA6B;AAK7B,mBAAqC;AACrC,yBAAuB;AAEvB,IAAM,2BAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACD;AAEe,SAAR,uBAAwC;AAC9C,QAAM,4BAAwB;AAAA,IAC7B,MAAM;AAAA,MACL,OAAG;AAAA,QACF;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAIA,QAAM,qBAAiB;AAAA,IACtB,CAAE,WAAY;AACb,YAAM,EAAE,oBAAoB,QAAI,2BAAQ,OAAQ,aAAAA,KAAY,CAAE;AAC9D,aAAO,oBAAqB,qBAAsB;AAAA,IACnD;AAAA,IACA,CAAE,qBAAsB;AAAA,EACzB;AAEA,SAAO;AACR;",
6
- "names": ["editorStore"]
7
- }
@@ -1,130 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/editor/src/components/sync-connection-modal/index.js
21
- var sync_connection_modal_exports = {};
22
- __export(sync_connection_modal_exports, {
23
- SyncConnectionModal: () => SyncConnectionModal
24
- });
25
- module.exports = __toCommonJS(sync_connection_modal_exports);
26
- var import_data = require("@wordpress/data");
27
- var import_compose = require("@wordpress/compose");
28
- var import_blocks = require("@wordpress/blocks");
29
- var import_core_data = require("@wordpress/core-data");
30
- var import_block_editor = require("@wordpress/block-editor");
31
- var import_components = require("@wordpress/components");
32
- var import_element = require("@wordpress/element");
33
- var import_i18n = require("@wordpress/i18n");
34
- var import_icons = require("@wordpress/icons");
35
- var import_sync_error_messages = require("../../utils/sync-error-messages.cjs");
36
- var import_lock_unlock = require("../../lock-unlock.cjs");
37
- var import_jsx_runtime = require("react/jsx-runtime");
38
- var { BlockCanvasCover } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
39
- var INITIAL_DISCONNECTED_DEBOUNCE_MS = 5e3;
40
- function SyncConnectionModal() {
41
- const connectionState = (0, import_data.useSelect)((selectFn) => {
42
- return selectFn(import_core_data.store).getSyncConnectionStatus() || null;
43
- }, []);
44
- const copyButtonRef = (0, import_compose.useCopyToClipboard)(() => {
45
- const blocks = (0, import_data.select)(import_block_editor.store).getBlocks();
46
- return (0, import_blocks.serialize)(blocks);
47
- });
48
- const [syncConnectionMessage, setSyncConnectionMessage] = (0, import_element.useState)(null);
49
- const debounceTimerRef = (0, import_element.useRef)(null);
50
- const hasInitializedRef = (0, import_element.useRef)(false);
51
- (0, import_element.useEffect)(() => {
52
- const status = connectionState?.status;
53
- if (debounceTimerRef.current) {
54
- clearTimeout(debounceTimerRef.current);
55
- debounceTimerRef.current = null;
56
- }
57
- if (status === "connected") {
58
- hasInitializedRef.current = true;
59
- setSyncConnectionMessage(null);
60
- } else if (status === "disconnected") {
61
- const showModal = () => {
62
- hasInitializedRef.current = true;
63
- setSyncConnectionMessage(
64
- (0, import_sync_error_messages.getSyncErrorMessages)(connectionState.error ?? {})
65
- );
66
- };
67
- if (hasInitializedRef.current) {
68
- showModal();
69
- } else {
70
- debounceTimerRef.current = setTimeout(
71
- showModal,
72
- INITIAL_DISCONNECTED_DEBOUNCE_MS
73
- );
74
- }
75
- }
76
- return () => {
77
- if (debounceTimerRef.current) {
78
- clearTimeout(debounceTimerRef.current);
79
- }
80
- };
81
- }, [connectionState]);
82
- if (!syncConnectionMessage) {
83
- return null;
84
- }
85
- const { title, description } = syncConnectionMessage;
86
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockCanvasCover.Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
- import_components.Modal,
88
- {
89
- __experimentalHideHeader: true,
90
- icon: import_icons.error,
91
- isDismissible: false,
92
- isFullScreen: false,
93
- onRequestClose: () => {
94
- },
95
- shouldCloseOnClickOutside: false,
96
- shouldCloseOnEsc: false,
97
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-sync-connection-modal__container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { alignment: "center", justify: "center", spacing: 2, children: [
98
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Icon, { fill: "#ccc", icon: import_icons.error, size: 64 }),
99
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { children: title }),
100
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "editor-sync-connection-modal__description", children: description }),
101
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { spacing: 2, justify: "center", children: [
102
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
- import_components.Button,
104
- {
105
- __next40pxDefaultSize: true,
106
- ref: copyButtonRef,
107
- variant: "primary",
108
- children: (0, import_i18n.__)("Copy post content")
109
- }
110
- ),
111
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
112
- import_components.Button,
113
- {
114
- __next40pxDefaultSize: true,
115
- href: "edit.php",
116
- isDestructive: true,
117
- variant: "secondary",
118
- children: (0, import_i18n.__)("Edit another post")
119
- }
120
- )
121
- ] })
122
- ] }) })
123
- }
124
- ) });
125
- }
126
- // Annotate the CommonJS export names for ESM import in node:
127
- 0 && (module.exports = {
128
- SyncConnectionModal
129
- });
130
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/sync-connection-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, select } from '@wordpress/data';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { serialize } from '@wordpress/blocks';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tButton,\n\tModal,\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { error as errorIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getSyncErrorMessages } from '../../utils/sync-error-messages';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockCanvasCover } = unlock( privateApis );\n\n// Debounce time for initial disconnected status to allow connection to establish.\nconst INITIAL_DISCONNECTED_DEBOUNCE_MS = 5000;\n\n/**\n * Sync connection modal that displays when any entity reports a disconnection.\n * Uses BlockCanvasCover.Fill to render in the block canvas.\n *\n * @return {Element|null} The modal component or null if not disconnected.\n */\nexport function SyncConnectionModal() {\n\tconst connectionState = useSelect( ( selectFn ) => {\n\t\treturn selectFn( coreDataStore ).getSyncConnectionStatus() || null;\n\t}, [] );\n\n\tconst copyButtonRef = useCopyToClipboard( () => {\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\treturn serialize( blocks );\n\t} );\n\tconst [ syncConnectionMessage, setSyncConnectionMessage ] =\n\t\tuseState( null );\n\tconst debounceTimerRef = useRef( null );\n\t// Track whether we've passed the initial load phase.\n\t// Once true, disconnected status will show immediately without debounce.\n\tconst hasInitializedRef = useRef( false );\n\n\tuseEffect( () => {\n\t\tconst status = connectionState?.status;\n\n\t\t// Clear any pending debounce timer when status changes.\n\t\tif ( debounceTimerRef.current ) {\n\t\t\tclearTimeout( debounceTimerRef.current );\n\t\t\tdebounceTimerRef.current = null;\n\t\t}\n\n\t\tif ( status === 'connected' ) {\n\t\t\thasInitializedRef.current = true;\n\t\t\tsetSyncConnectionMessage( null );\n\t\t} else if ( status === 'disconnected' ) {\n\t\t\tconst showModal = () => {\n\t\t\t\thasInitializedRef.current = true;\n\t\t\t\tsetSyncConnectionMessage(\n\t\t\t\t\tgetSyncErrorMessages( connectionState.error ?? {} )\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Debounce only on first load to allow connection to establish.\n\t\t\tif ( hasInitializedRef.current ) {\n\t\t\t\tshowModal();\n\t\t\t} else {\n\t\t\t\tdebounceTimerRef.current = setTimeout(\n\t\t\t\t\tshowModal,\n\t\t\t\t\tINITIAL_DISCONNECTED_DEBOUNCE_MS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( debounceTimerRef.current ) {\n\t\t\t\tclearTimeout( debounceTimerRef.current );\n\t\t\t}\n\t\t};\n\t}, [ connectionState ] );\n\n\tif ( ! syncConnectionMessage ) {\n\t\treturn null;\n\t}\n\n\tconst { title, description } = syncConnectionMessage;\n\n\treturn (\n\t\t<BlockCanvasCover.Fill>\n\t\t\t<Modal\n\t\t\t\t__experimentalHideHeader\n\t\t\t\ticon={ errorIcon }\n\t\t\t\tisDismissible={ false }\n\t\t\t\tisFullScreen={ false }\n\t\t\t\tonRequestClose={ () => {} }\n\t\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\t\tshouldCloseOnEsc={ false }\n\t\t\t>\n\t\t\t\t<div className=\"editor-sync-connection-modal__container\">\n\t\t\t\t\t<VStack alignment=\"center\" justify=\"center\" spacing={ 2 }>\n\t\t\t\t\t\t<Icon fill=\"#ccc\" icon={ errorIcon } size={ 64 } />\n\t\t\t\t\t\t<h1>{ title }</h1>\n\t\t\t\t\t\t<p className=\"editor-sync-connection-modal__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<HStack spacing={ 2 } justify=\"center\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tref={ copyButtonRef }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Copy post content' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\thref=\"edit.php\"\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit another post' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t</Modal>\n\t\t</BlockCanvasCover.Fill>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAkC;AAClC,qBAAmC;AACnC,oBAA0B;AAC1B,uBAAuC;AACvC,0BAGO;AACP,wBAMO;AACP,qBAA4C;AAC5C,kBAAmB;AACnB,mBAAmC;AAKnC,iCAAqC;AACrC,yBAAuB;AAsFjB;AApFN,IAAM,EAAE,iBAAiB,QAAI,2BAAQ,+BAAY;AAGjD,IAAM,mCAAmC;AAQlC,SAAS,sBAAsB;AACrC,QAAM,sBAAkB,uBAAW,CAAE,aAAc;AAClD,WAAO,SAAU,iBAAAA,KAAc,EAAE,wBAAwB,KAAK;AAAA,EAC/D,GAAG,CAAC,CAAE;AAEN,QAAM,oBAAgB,mCAAoB,MAAM;AAC/C,UAAM,aAAS,oBAAQ,oBAAAC,KAAiB,EAAE,UAAU;AACpD,eAAO,yBAAW,MAAO;AAAA,EAC1B,CAAE;AACF,QAAM,CAAE,uBAAuB,wBAAyB,QACvD,yBAAU,IAAK;AAChB,QAAM,uBAAmB,uBAAQ,IAAK;AAGtC,QAAM,wBAAoB,uBAAQ,KAAM;AAExC,gCAAW,MAAM;AAChB,UAAM,SAAS,iBAAiB;AAGhC,QAAK,iBAAiB,SAAU;AAC/B,mBAAc,iBAAiB,OAAQ;AACvC,uBAAiB,UAAU;AAAA,IAC5B;AAEA,QAAK,WAAW,aAAc;AAC7B,wBAAkB,UAAU;AAC5B,+BAA0B,IAAK;AAAA,IAChC,WAAY,WAAW,gBAAiB;AACvC,YAAM,YAAY,MAAM;AACvB,0BAAkB,UAAU;AAC5B;AAAA,cACC,iDAAsB,gBAAgB,SAAS,CAAC,CAAE;AAAA,QACnD;AAAA,MACD;AAGA,UAAK,kBAAkB,SAAU;AAChC,kBAAU;AAAA,MACX,OAAO;AACN,yBAAiB,UAAU;AAAA,UAC1B;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAEA,WAAO,MAAM;AACZ,UAAK,iBAAiB,SAAU;AAC/B,qBAAc,iBAAiB,OAAQ;AAAA,MACxC;AAAA,IACD;AAAA,EACD,GAAG,CAAE,eAAgB,CAAE;AAEvB,MAAK,CAAE,uBAAwB;AAC9B,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,OAAO,YAAY,IAAI;AAE/B,SACC,4CAAC,iBAAiB,MAAjB,EACA;AAAA,IAAC;AAAA;AAAA,MACA,0BAAwB;AAAA,MACxB,MAAO,aAAAC;AAAA,MACP,eAAgB;AAAA,MAChB,cAAe;AAAA,MACf,gBAAiB,MAAM;AAAA,MAAC;AAAA,MACxB,2BAA4B;AAAA,MAC5B,kBAAmB;AAAA,MAEnB,sDAAC,SAAI,WAAU,2CACd,uDAAC,kBAAAC,sBAAA,EAAO,WAAU,UAAS,SAAQ,UAAS,SAAU,GACrD;AAAA,oDAAC,0BAAK,MAAK,QAAO,MAAO,aAAAD,OAAY,MAAO,IAAK;AAAA,QACjD,4CAAC,QAAK,iBAAO;AAAA,QACb,4CAAC,OAAE,WAAU,6CACV,uBACH;AAAA,QACA,6CAAC,kBAAAE,sBAAA,EAAO,SAAU,GAAI,SAAQ,UAC7B;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,KAAM;AAAA,cACN,SAAQ;AAAA,cAEN,8BAAI,mBAAoB;AAAA;AAAA,UAC3B;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,MAAK;AAAA,cACL,eAAa;AAAA,cACb,SAAQ;AAAA,cAEN,8BAAI,mBAAoB;AAAA;AAAA,UAC3B;AAAA,WACD;AAAA,SACD,GACD;AAAA;AAAA,EACD,GACD;AAEF;",
6
- "names": ["coreDataStore", "blockEditorStore", "errorIcon", "VStack", "HStack"]
7
- }
@@ -1,34 +0,0 @@
1
- // packages/editor/src/components/provider/use-post-content-blocks.js
2
- import { useSelect } from "@wordpress/data";
3
- import { useMemo } from "@wordpress/element";
4
- import { applyFilters } from "@wordpress/hooks";
5
- import { store as editorStore } from "../../store/index.mjs";
6
- import { unlock } from "../../lock-unlock.mjs";
7
- var POST_CONTENT_BLOCK_TYPES = [
8
- "core/post-title",
9
- "core/post-featured-image",
10
- "core/post-content"
11
- ];
12
- function usePostContentBlocks() {
13
- const contentOnlyBlockTypes = useMemo(
14
- () => [
15
- ...applyFilters(
16
- "editor.postContentBlockTypes",
17
- POST_CONTENT_BLOCK_TYPES
18
- )
19
- ],
20
- []
21
- );
22
- const contentOnlyIds = useSelect(
23
- (select) => {
24
- const { getPostBlocksByName } = unlock(select(editorStore));
25
- return getPostBlocksByName(contentOnlyBlockTypes);
26
- },
27
- [contentOnlyBlockTypes]
28
- );
29
- return contentOnlyIds;
30
- }
31
- export {
32
- usePostContentBlocks as default
33
- };
34
- //# sourceMappingURL=use-post-content-blocks.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/provider/use-post-content-blocks.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst POST_CONTENT_BLOCK_TYPES = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n];\n\nexport default function usePostContentBlocks() {\n\tconst contentOnlyBlockTypes = useMemo(\n\t\t() => [\n\t\t\t...applyFilters(\n\t\t\t\t'editor.postContentBlockTypes',\n\t\t\t\tPOST_CONTENT_BLOCK_TYPES\n\t\t\t),\n\t\t],\n\t\t[]\n\t);\n\n\t// Note that there are two separate subscriptions because the result for each\n\t// returns a new array.\n\tconst contentOnlyIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostBlocksByName } = unlock( select( editorStore ) );\n\t\t\treturn getPostBlocksByName( contentOnlyBlockTypes );\n\t\t},\n\t\t[ contentOnlyBlockTypes ]\n\t);\n\n\treturn contentOnlyIds;\n}\n"],
5
- "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAK7B,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AAEvB,IAAM,2BAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACD;AAEe,SAAR,uBAAwC;AAC9C,QAAM,wBAAwB;AAAA,IAC7B,MAAM;AAAA,MACL,GAAG;AAAA,QACF;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAIA,QAAM,iBAAiB;AAAA,IACtB,CAAE,WAAY;AACb,YAAM,EAAE,oBAAoB,IAAI,OAAQ,OAAQ,WAAY,CAAE;AAC9D,aAAO,oBAAqB,qBAAsB;AAAA,IACnD;AAAA,IACA,CAAE,qBAAsB;AAAA,EACzB;AAEA,SAAO;AACR;",
6
- "names": []
7
- }
@@ -1,114 +0,0 @@
1
- // packages/editor/src/components/sync-connection-modal/index.js
2
- import { useSelect, select } from "@wordpress/data";
3
- import { useCopyToClipboard } from "@wordpress/compose";
4
- import { serialize } from "@wordpress/blocks";
5
- import { store as coreDataStore } from "@wordpress/core-data";
6
- import {
7
- privateApis,
8
- store as blockEditorStore
9
- } from "@wordpress/block-editor";
10
- import {
11
- Button,
12
- Modal,
13
- Icon,
14
- __experimentalHStack as HStack,
15
- __experimentalVStack as VStack
16
- } from "@wordpress/components";
17
- import { useState, useEffect, useRef } from "@wordpress/element";
18
- import { __ } from "@wordpress/i18n";
19
- import { error as errorIcon } from "@wordpress/icons";
20
- import { getSyncErrorMessages } from "../../utils/sync-error-messages.mjs";
21
- import { unlock } from "../../lock-unlock.mjs";
22
- import { jsx, jsxs } from "react/jsx-runtime";
23
- var { BlockCanvasCover } = unlock(privateApis);
24
- var INITIAL_DISCONNECTED_DEBOUNCE_MS = 5e3;
25
- function SyncConnectionModal() {
26
- const connectionState = useSelect((selectFn) => {
27
- return selectFn(coreDataStore).getSyncConnectionStatus() || null;
28
- }, []);
29
- const copyButtonRef = useCopyToClipboard(() => {
30
- const blocks = select(blockEditorStore).getBlocks();
31
- return serialize(blocks);
32
- });
33
- const [syncConnectionMessage, setSyncConnectionMessage] = useState(null);
34
- const debounceTimerRef = useRef(null);
35
- const hasInitializedRef = useRef(false);
36
- useEffect(() => {
37
- const status = connectionState?.status;
38
- if (debounceTimerRef.current) {
39
- clearTimeout(debounceTimerRef.current);
40
- debounceTimerRef.current = null;
41
- }
42
- if (status === "connected") {
43
- hasInitializedRef.current = true;
44
- setSyncConnectionMessage(null);
45
- } else if (status === "disconnected") {
46
- const showModal = () => {
47
- hasInitializedRef.current = true;
48
- setSyncConnectionMessage(
49
- getSyncErrorMessages(connectionState.error ?? {})
50
- );
51
- };
52
- if (hasInitializedRef.current) {
53
- showModal();
54
- } else {
55
- debounceTimerRef.current = setTimeout(
56
- showModal,
57
- INITIAL_DISCONNECTED_DEBOUNCE_MS
58
- );
59
- }
60
- }
61
- return () => {
62
- if (debounceTimerRef.current) {
63
- clearTimeout(debounceTimerRef.current);
64
- }
65
- };
66
- }, [connectionState]);
67
- if (!syncConnectionMessage) {
68
- return null;
69
- }
70
- const { title, description } = syncConnectionMessage;
71
- return /* @__PURE__ */ jsx(BlockCanvasCover.Fill, { children: /* @__PURE__ */ jsx(
72
- Modal,
73
- {
74
- __experimentalHideHeader: true,
75
- icon: errorIcon,
76
- isDismissible: false,
77
- isFullScreen: false,
78
- onRequestClose: () => {
79
- },
80
- shouldCloseOnClickOutside: false,
81
- shouldCloseOnEsc: false,
82
- children: /* @__PURE__ */ jsx("div", { className: "editor-sync-connection-modal__container", children: /* @__PURE__ */ jsxs(VStack, { alignment: "center", justify: "center", spacing: 2, children: [
83
- /* @__PURE__ */ jsx(Icon, { fill: "#ccc", icon: errorIcon, size: 64 }),
84
- /* @__PURE__ */ jsx("h1", { children: title }),
85
- /* @__PURE__ */ jsx("p", { className: "editor-sync-connection-modal__description", children: description }),
86
- /* @__PURE__ */ jsxs(HStack, { spacing: 2, justify: "center", children: [
87
- /* @__PURE__ */ jsx(
88
- Button,
89
- {
90
- __next40pxDefaultSize: true,
91
- ref: copyButtonRef,
92
- variant: "primary",
93
- children: __("Copy post content")
94
- }
95
- ),
96
- /* @__PURE__ */ jsx(
97
- Button,
98
- {
99
- __next40pxDefaultSize: true,
100
- href: "edit.php",
101
- isDestructive: true,
102
- variant: "secondary",
103
- children: __("Edit another post")
104
- }
105
- )
106
- ] })
107
- ] }) })
108
- }
109
- ) });
110
- }
111
- export {
112
- SyncConnectionModal
113
- };
114
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/sync-connection-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, select } from '@wordpress/data';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { serialize } from '@wordpress/blocks';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tButton,\n\tModal,\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { error as errorIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getSyncErrorMessages } from '../../utils/sync-error-messages';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockCanvasCover } = unlock( privateApis );\n\n// Debounce time for initial disconnected status to allow connection to establish.\nconst INITIAL_DISCONNECTED_DEBOUNCE_MS = 5000;\n\n/**\n * Sync connection modal that displays when any entity reports a disconnection.\n * Uses BlockCanvasCover.Fill to render in the block canvas.\n *\n * @return {Element|null} The modal component or null if not disconnected.\n */\nexport function SyncConnectionModal() {\n\tconst connectionState = useSelect( ( selectFn ) => {\n\t\treturn selectFn( coreDataStore ).getSyncConnectionStatus() || null;\n\t}, [] );\n\n\tconst copyButtonRef = useCopyToClipboard( () => {\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\treturn serialize( blocks );\n\t} );\n\tconst [ syncConnectionMessage, setSyncConnectionMessage ] =\n\t\tuseState( null );\n\tconst debounceTimerRef = useRef( null );\n\t// Track whether we've passed the initial load phase.\n\t// Once true, disconnected status will show immediately without debounce.\n\tconst hasInitializedRef = useRef( false );\n\n\tuseEffect( () => {\n\t\tconst status = connectionState?.status;\n\n\t\t// Clear any pending debounce timer when status changes.\n\t\tif ( debounceTimerRef.current ) {\n\t\t\tclearTimeout( debounceTimerRef.current );\n\t\t\tdebounceTimerRef.current = null;\n\t\t}\n\n\t\tif ( status === 'connected' ) {\n\t\t\thasInitializedRef.current = true;\n\t\t\tsetSyncConnectionMessage( null );\n\t\t} else if ( status === 'disconnected' ) {\n\t\t\tconst showModal = () => {\n\t\t\t\thasInitializedRef.current = true;\n\t\t\t\tsetSyncConnectionMessage(\n\t\t\t\t\tgetSyncErrorMessages( connectionState.error ?? {} )\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Debounce only on first load to allow connection to establish.\n\t\t\tif ( hasInitializedRef.current ) {\n\t\t\t\tshowModal();\n\t\t\t} else {\n\t\t\t\tdebounceTimerRef.current = setTimeout(\n\t\t\t\t\tshowModal,\n\t\t\t\t\tINITIAL_DISCONNECTED_DEBOUNCE_MS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( debounceTimerRef.current ) {\n\t\t\t\tclearTimeout( debounceTimerRef.current );\n\t\t\t}\n\t\t};\n\t}, [ connectionState ] );\n\n\tif ( ! syncConnectionMessage ) {\n\t\treturn null;\n\t}\n\n\tconst { title, description } = syncConnectionMessage;\n\n\treturn (\n\t\t<BlockCanvasCover.Fill>\n\t\t\t<Modal\n\t\t\t\t__experimentalHideHeader\n\t\t\t\ticon={ errorIcon }\n\t\t\t\tisDismissible={ false }\n\t\t\t\tisFullScreen={ false }\n\t\t\t\tonRequestClose={ () => {} }\n\t\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\t\tshouldCloseOnEsc={ false }\n\t\t\t>\n\t\t\t\t<div className=\"editor-sync-connection-modal__container\">\n\t\t\t\t\t<VStack alignment=\"center\" justify=\"center\" spacing={ 2 }>\n\t\t\t\t\t\t<Icon fill=\"#ccc\" icon={ errorIcon } size={ 64 } />\n\t\t\t\t\t\t<h1>{ title }</h1>\n\t\t\t\t\t\t<p className=\"editor-sync-connection-modal__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<HStack spacing={ 2 } justify=\"center\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tref={ copyButtonRef }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Copy post content' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\thref=\"edit.php\"\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit another post' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t</Modal>\n\t\t</BlockCanvasCover.Fill>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,WAAW,cAAc;AAClC,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,qBAAqB;AACvC;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AACP,SAAS,UAAU,WAAW,cAAc;AAC5C,SAAS,UAAU;AACnB,SAAS,SAAS,iBAAiB;AAKnC,SAAS,4BAA4B;AACrC,SAAS,cAAc;AAsFjB,cAKA,YALA;AApFN,IAAM,EAAE,iBAAiB,IAAI,OAAQ,WAAY;AAGjD,IAAM,mCAAmC;AAQlC,SAAS,sBAAsB;AACrC,QAAM,kBAAkB,UAAW,CAAE,aAAc;AAClD,WAAO,SAAU,aAAc,EAAE,wBAAwB,KAAK;AAAA,EAC/D,GAAG,CAAC,CAAE;AAEN,QAAM,gBAAgB,mBAAoB,MAAM;AAC/C,UAAM,SAAS,OAAQ,gBAAiB,EAAE,UAAU;AACpD,WAAO,UAAW,MAAO;AAAA,EAC1B,CAAE;AACF,QAAM,CAAE,uBAAuB,wBAAyB,IACvD,SAAU,IAAK;AAChB,QAAM,mBAAmB,OAAQ,IAAK;AAGtC,QAAM,oBAAoB,OAAQ,KAAM;AAExC,YAAW,MAAM;AAChB,UAAM,SAAS,iBAAiB;AAGhC,QAAK,iBAAiB,SAAU;AAC/B,mBAAc,iBAAiB,OAAQ;AACvC,uBAAiB,UAAU;AAAA,IAC5B;AAEA,QAAK,WAAW,aAAc;AAC7B,wBAAkB,UAAU;AAC5B,+BAA0B,IAAK;AAAA,IAChC,WAAY,WAAW,gBAAiB;AACvC,YAAM,YAAY,MAAM;AACvB,0BAAkB,UAAU;AAC5B;AAAA,UACC,qBAAsB,gBAAgB,SAAS,CAAC,CAAE;AAAA,QACnD;AAAA,MACD;AAGA,UAAK,kBAAkB,SAAU;AAChC,kBAAU;AAAA,MACX,OAAO;AACN,yBAAiB,UAAU;AAAA,UAC1B;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAEA,WAAO,MAAM;AACZ,UAAK,iBAAiB,SAAU;AAC/B,qBAAc,iBAAiB,OAAQ;AAAA,MACxC;AAAA,IACD;AAAA,EACD,GAAG,CAAE,eAAgB,CAAE;AAEvB,MAAK,CAAE,uBAAwB;AAC9B,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,OAAO,YAAY,IAAI;AAE/B,SACC,oBAAC,iBAAiB,MAAjB,EACA;AAAA,IAAC;AAAA;AAAA,MACA,0BAAwB;AAAA,MACxB,MAAO;AAAA,MACP,eAAgB;AAAA,MAChB,cAAe;AAAA,MACf,gBAAiB,MAAM;AAAA,MAAC;AAAA,MACxB,2BAA4B;AAAA,MAC5B,kBAAmB;AAAA,MAEnB,8BAAC,SAAI,WAAU,2CACd,+BAAC,UAAO,WAAU,UAAS,SAAQ,UAAS,SAAU,GACrD;AAAA,4BAAC,QAAK,MAAK,QAAO,MAAO,WAAY,MAAO,IAAK;AAAA,QACjD,oBAAC,QAAK,iBAAO;AAAA,QACb,oBAAC,OAAE,WAAU,6CACV,uBACH;AAAA,QACA,qBAAC,UAAO,SAAU,GAAI,SAAQ,UAC7B;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,KAAM;AAAA,cACN,SAAQ;AAAA,cAEN,aAAI,mBAAoB;AAAA;AAAA,UAC3B;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,MAAK;AAAA,cACL,eAAa;AAAA,cACb,SAAQ;AAAA,cAEN,aAAI,mBAAoB;AAAA;AAAA,UAC3B;AAAA,WACD;AAAA,SACD,GACD;AAAA;AAAA,EACD,GACD;AAEF;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- export default function usePostContentBlocks(): any;
2
- //# sourceMappingURL=use-post-content-blocks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-post-content-blocks.d.ts","sourceRoot":"","sources":["../../../src/components/provider/use-post-content-blocks.js"],"names":[],"mappings":"AAmBA,oDAsBC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Sync connection modal that displays when any entity reports a disconnection.
3
- * Uses BlockCanvasCover.Fill to render in the block canvas.
4
- *
5
- * @return {Element|null} The modal component or null if not disconnected.
6
- */
7
- export function SyncConnectionModal(): Element | null;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-modal/index.js"],"names":[],"mappings":"AAiCA;;;;;GAKG;AACH,uCAFY,OAAO,GAAC,IAAI,CAsGvB"}
@@ -1,42 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect } from '@wordpress/data';
5
- import { useMemo } from '@wordpress/element';
6
- import { applyFilters } from '@wordpress/hooks';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editorStore } from '../../store';
12
- import { unlock } from '../../lock-unlock';
13
-
14
- const POST_CONTENT_BLOCK_TYPES = [
15
- 'core/post-title',
16
- 'core/post-featured-image',
17
- 'core/post-content',
18
- ];
19
-
20
- export default function usePostContentBlocks() {
21
- const contentOnlyBlockTypes = useMemo(
22
- () => [
23
- ...applyFilters(
24
- 'editor.postContentBlockTypes',
25
- POST_CONTENT_BLOCK_TYPES
26
- ),
27
- ],
28
- []
29
- );
30
-
31
- // Note that there are two separate subscriptions because the result for each
32
- // returns a new array.
33
- const contentOnlyIds = useSelect(
34
- ( select ) => {
35
- const { getPostBlocksByName } = unlock( select( editorStore ) );
36
- return getPostBlocksByName( contentOnlyBlockTypes );
37
- },
38
- [ contentOnlyBlockTypes ]
39
- );
40
-
41
- return contentOnlyIds;
42
- }
@@ -1,140 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect, select } from '@wordpress/data';
5
- import { useCopyToClipboard } from '@wordpress/compose';
6
- import { serialize } from '@wordpress/blocks';
7
- import { store as coreDataStore } from '@wordpress/core-data';
8
- import {
9
- privateApis,
10
- store as blockEditorStore,
11
- } from '@wordpress/block-editor';
12
- import {
13
- Button,
14
- Modal,
15
- Icon,
16
- __experimentalHStack as HStack,
17
- __experimentalVStack as VStack,
18
- } from '@wordpress/components';
19
- import { useState, useEffect, useRef } from '@wordpress/element';
20
- import { __ } from '@wordpress/i18n';
21
- import { error as errorIcon } from '@wordpress/icons';
22
-
23
- /**
24
- * Internal dependencies
25
- */
26
- import { getSyncErrorMessages } from '../../utils/sync-error-messages';
27
- import { unlock } from '../../lock-unlock';
28
-
29
- const { BlockCanvasCover } = unlock( privateApis );
30
-
31
- // Debounce time for initial disconnected status to allow connection to establish.
32
- const INITIAL_DISCONNECTED_DEBOUNCE_MS = 5000;
33
-
34
- /**
35
- * Sync connection modal that displays when any entity reports a disconnection.
36
- * Uses BlockCanvasCover.Fill to render in the block canvas.
37
- *
38
- * @return {Element|null} The modal component or null if not disconnected.
39
- */
40
- export function SyncConnectionModal() {
41
- const connectionState = useSelect( ( selectFn ) => {
42
- return selectFn( coreDataStore ).getSyncConnectionStatus() || null;
43
- }, [] );
44
-
45
- const copyButtonRef = useCopyToClipboard( () => {
46
- const blocks = select( blockEditorStore ).getBlocks();
47
- return serialize( blocks );
48
- } );
49
- const [ syncConnectionMessage, setSyncConnectionMessage ] =
50
- useState( null );
51
- const debounceTimerRef = useRef( null );
52
- // Track whether we've passed the initial load phase.
53
- // Once true, disconnected status will show immediately without debounce.
54
- const hasInitializedRef = useRef( false );
55
-
56
- useEffect( () => {
57
- const status = connectionState?.status;
58
-
59
- // Clear any pending debounce timer when status changes.
60
- if ( debounceTimerRef.current ) {
61
- clearTimeout( debounceTimerRef.current );
62
- debounceTimerRef.current = null;
63
- }
64
-
65
- if ( status === 'connected' ) {
66
- hasInitializedRef.current = true;
67
- setSyncConnectionMessage( null );
68
- } else if ( status === 'disconnected' ) {
69
- const showModal = () => {
70
- hasInitializedRef.current = true;
71
- setSyncConnectionMessage(
72
- getSyncErrorMessages( connectionState.error ?? {} )
73
- );
74
- };
75
-
76
- // Debounce only on first load to allow connection to establish.
77
- if ( hasInitializedRef.current ) {
78
- showModal();
79
- } else {
80
- debounceTimerRef.current = setTimeout(
81
- showModal,
82
- INITIAL_DISCONNECTED_DEBOUNCE_MS
83
- );
84
- }
85
- }
86
-
87
- return () => {
88
- if ( debounceTimerRef.current ) {
89
- clearTimeout( debounceTimerRef.current );
90
- }
91
- };
92
- }, [ connectionState ] );
93
-
94
- if ( ! syncConnectionMessage ) {
95
- return null;
96
- }
97
-
98
- const { title, description } = syncConnectionMessage;
99
-
100
- return (
101
- <BlockCanvasCover.Fill>
102
- <Modal
103
- __experimentalHideHeader
104
- icon={ errorIcon }
105
- isDismissible={ false }
106
- isFullScreen={ false }
107
- onRequestClose={ () => {} }
108
- shouldCloseOnClickOutside={ false }
109
- shouldCloseOnEsc={ false }
110
- >
111
- <div className="editor-sync-connection-modal__container">
112
- <VStack alignment="center" justify="center" spacing={ 2 }>
113
- <Icon fill="#ccc" icon={ errorIcon } size={ 64 } />
114
- <h1>{ title }</h1>
115
- <p className="editor-sync-connection-modal__description">
116
- { description }
117
- </p>
118
- <HStack spacing={ 2 } justify="center">
119
- <Button
120
- __next40pxDefaultSize
121
- ref={ copyButtonRef }
122
- variant="primary"
123
- >
124
- { __( 'Copy post content' ) }
125
- </Button>
126
- <Button
127
- __next40pxDefaultSize
128
- href="edit.php"
129
- isDestructive
130
- variant="secondary"
131
- >
132
- { __( 'Edit another post' ) }
133
- </Button>
134
- </HStack>
135
- </VStack>
136
- </div>
137
- </Modal>
138
- </BlockCanvasCover.Fill>
139
- );
140
- }
@@ -1,11 +0,0 @@
1
- .editor-sync-connection-modal__container {
2
- align-items: center;
3
- display: flex;
4
- margin: auto;
5
- max-width: 30rem;
6
- }
7
-
8
- .editor-sync-connection-modal__description {
9
- font-size: 1.3rem;
10
- text-align: center;
11
- }
@@ -1,53 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
-
6
- /**
7
- * Default error messages for known error codes.
8
- */
9
- const ERROR_MESSAGES = {
10
- 'authentication-failed': {
11
- title: __( 'Authentication Failed' ),
12
- description: __(
13
- 'Authentication with the collaborative editing server failed. ' +
14
- 'Please verify that you have the necessary permissions.'
15
- ),
16
- },
17
- 'connection-expired': {
18
- title: __( 'Connection Expired' ),
19
- description: __(
20
- 'The connection to the collaborative editing server has expired.'
21
- ),
22
- },
23
- 'connection-limit-exceeded': {
24
- title: __( 'Connection Limit Exceeded' ),
25
- description: __(
26
- 'The collaborative editing server has reached its maximum connection capacity. ' +
27
- 'Please try again later or contact your site administrator.'
28
- ),
29
- },
30
- 'unknown-error': {
31
- title: __( 'Disconnected' ),
32
- description: __(
33
- 'You are currently disconnected from the collaborative editing server. ' +
34
- 'Editing is temporarily disabled to prevent conflicts.'
35
- ),
36
- },
37
- };
38
-
39
- /**
40
- * Get user-facing title and description from a sync connection error.
41
- *
42
- * Provides default messages based on error.code.
43
- *
44
- * @param {Object} error - Connection error object.
45
- * @return {Object} Object with title and description strings.
46
- */
47
- export function getSyncErrorMessages( error ) {
48
- if ( ERROR_MESSAGES[ error?.code ] ) {
49
- return ERROR_MESSAGES[ error.code ];
50
- }
51
-
52
- return ERROR_MESSAGES[ 'unknown-error' ];
53
- }