@wordpress/editor 14.41.2-next.v.202603161435.0 → 14.43.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 (311) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/build/components/collaborators-overlay/compute-selection.cjs +10 -10
  3. package/build/components/collaborators-overlay/compute-selection.cjs.map +2 -2
  4. package/build/components/collaborators-overlay/cursor-registry.cjs +86 -0
  5. package/build/components/collaborators-overlay/cursor-registry.cjs.map +7 -0
  6. package/build/components/collaborators-overlay/index.cjs +7 -2
  7. package/build/components/collaborators-overlay/index.cjs.map +2 -2
  8. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
  9. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +2 -2
  10. package/build/components/collaborators-overlay/overlay.cjs +42 -1
  11. package/build/components/collaborators-overlay/overlay.cjs.map +2 -2
  12. package/build/components/collaborators-overlay/timing-utils.cjs +46 -0
  13. package/build/components/collaborators-overlay/timing-utils.cjs.map +7 -0
  14. package/build/components/collaborators-overlay/use-render-cursors.cjs +1 -1
  15. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +2 -2
  16. package/build/components/collaborators-presence/index.cjs +14 -4
  17. package/build/components/collaborators-presence/index.cjs.map +2 -2
  18. package/build/components/collaborators-presence/list.cjs +20 -4
  19. package/build/components/collaborators-presence/list.cjs.map +2 -2
  20. package/build/components/post-card-panel/index.cjs +4 -15
  21. package/build/components/post-card-panel/index.cjs.map +2 -2
  22. package/build/components/post-content-information/index.cjs +10 -13
  23. package/build/components/post-content-information/index.cjs.map +2 -2
  24. package/build/components/post-locked-modal/index.cjs +16 -3
  25. package/build/components/post-locked-modal/index.cjs.map +2 -2
  26. package/build/components/post-revisions-panel/index.cjs +164 -0
  27. package/build/components/post-revisions-panel/index.cjs.map +7 -0
  28. package/build/components/post-revisions-preview/block-diff.cjs +39 -11
  29. package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
  30. package/build/components/post-revisions-preview/diff-markers.cjs +2 -2
  31. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  32. package/build/components/post-revisions-preview/revisions-canvas.cjs +1 -1
  33. package/build/components/post-revisions-preview/revisions-canvas.cjs.map +2 -2
  34. package/build/components/post-revisions-preview/revisions-slider.cjs +24 -5
  35. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  36. package/build/components/post-template/block-theme.cjs +7 -4
  37. package/build/components/post-template/block-theme.cjs.map +2 -2
  38. package/build/components/post-template/create-new-template-modal.cjs +39 -46
  39. package/build/components/post-template/create-new-template-modal.cjs.map +2 -2
  40. package/build/components/post-template/hooks.cjs +91 -8
  41. package/build/components/post-template/hooks.cjs.map +2 -2
  42. package/build/components/post-template/panel.cjs +5 -42
  43. package/build/components/post-template/panel.cjs.map +3 -3
  44. package/build/components/post-template/swap-template-button.cjs +31 -20
  45. package/build/components/post-template/swap-template-button.cjs.map +2 -2
  46. package/build/components/preferences-modal/index.cjs +35 -27
  47. package/build/components/preferences-modal/index.cjs.map +2 -2
  48. package/build/components/provider/use-block-editor-settings.cjs +2 -0
  49. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  50. package/build/components/revision-block-diff/index.cjs +61 -0
  51. package/build/components/revision-block-diff/index.cjs.map +7 -0
  52. package/build/components/revision-diff-panel/index.cjs +68 -0
  53. package/build/components/revision-diff-panel/index.cjs.map +7 -0
  54. package/build/components/revision-fields-diff/index.cjs +96 -0
  55. package/build/components/revision-fields-diff/index.cjs.map +7 -0
  56. package/build/components/sidebar/dataform-post-summary.cjs +25 -55
  57. package/build/components/sidebar/dataform-post-summary.cjs.map +2 -2
  58. package/build/components/sidebar/index.cjs +30 -23
  59. package/build/components/sidebar/index.cjs.map +3 -3
  60. package/build/components/sidebar/post-revision-summary.cjs +74 -0
  61. package/build/components/sidebar/post-revision-summary.cjs.map +7 -0
  62. package/build/components/sidebar/post-summary.cjs +35 -42
  63. package/build/components/sidebar/post-summary.cjs.map +3 -3
  64. package/build/components/style-book/index.cjs +4 -3
  65. package/build/components/style-book/index.cjs.map +2 -2
  66. package/build/components/{sync-connection-modal → sync-connection-error-modal}/index.cjs +89 -80
  67. package/build/components/sync-connection-error-modal/index.cjs.map +7 -0
  68. package/build/components/{sync-connection-modal → sync-connection-error-modal}/use-retry-countdown.cjs +14 -27
  69. package/build/components/sync-connection-error-modal/use-retry-countdown.cjs.map +7 -0
  70. package/build/components/template-actions-panel/block-theme-content.cjs +188 -0
  71. package/build/components/template-actions-panel/block-theme-content.cjs.map +7 -0
  72. package/build/components/template-actions-panel/classic-theme-content.cjs +159 -0
  73. package/build/components/template-actions-panel/classic-theme-content.cjs.map +7 -0
  74. package/build/components/template-actions-panel/index.cjs +59 -0
  75. package/build/components/template-actions-panel/index.cjs.map +7 -0
  76. package/build/components/visual-editor/index.cjs +2 -2
  77. package/build/components/visual-editor/index.cjs.map +2 -2
  78. package/build/dataviews/store/private-actions.cjs +2 -0
  79. package/build/dataviews/store/private-actions.cjs.map +2 -2
  80. package/build/store/actions.cjs +1 -3
  81. package/build/store/actions.cjs.map +2 -2
  82. package/build/store/private-actions.cjs +21 -2
  83. package/build/store/private-actions.cjs.map +2 -2
  84. package/build/store/private-selectors.cjs +40 -15
  85. package/build/store/private-selectors.cjs.map +2 -2
  86. package/build/utils/media-finalize/index.cjs +43 -0
  87. package/build/utils/media-finalize/index.cjs.map +7 -0
  88. package/build/utils/sync-error-messages.cjs +29 -16
  89. package/build/utils/sync-error-messages.cjs.map +3 -3
  90. package/build-module/components/collaborators-overlay/compute-selection.mjs +10 -10
  91. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +2 -2
  92. package/build-module/components/collaborators-overlay/cursor-registry.mjs +61 -0
  93. package/build-module/components/collaborators-overlay/cursor-registry.mjs.map +7 -0
  94. package/build-module/components/collaborators-overlay/index.mjs +7 -2
  95. package/build-module/components/collaborators-overlay/index.mjs.map +2 -2
  96. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
  97. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +2 -2
  98. package/build-module/components/collaborators-overlay/overlay.mjs +43 -2
  99. package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
  100. package/build-module/components/collaborators-overlay/timing-utils.mjs +21 -0
  101. package/build-module/components/collaborators-overlay/timing-utils.mjs.map +7 -0
  102. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +1 -1
  103. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  104. package/build-module/components/collaborators-presence/index.mjs +14 -4
  105. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  106. package/build-module/components/collaborators-presence/list.mjs +20 -4
  107. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  108. package/build-module/components/post-card-panel/index.mjs +6 -17
  109. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  110. package/build-module/components/post-content-information/index.mjs +6 -13
  111. package/build-module/components/post-content-information/index.mjs.map +2 -2
  112. package/build-module/components/post-locked-modal/index.mjs +16 -3
  113. package/build-module/components/post-locked-modal/index.mjs.map +2 -2
  114. package/build-module/components/post-revisions-panel/index.mjs +139 -0
  115. package/build-module/components/post-revisions-panel/index.mjs.map +7 -0
  116. package/build-module/components/post-revisions-preview/block-diff.mjs +39 -11
  117. package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
  118. package/build-module/components/post-revisions-preview/diff-markers.mjs +2 -2
  119. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  120. package/build-module/components/post-revisions-preview/revisions-canvas.mjs +1 -1
  121. package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
  122. package/build-module/components/post-revisions-preview/revisions-slider.mjs +24 -5
  123. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  124. package/build-module/components/post-template/block-theme.mjs +7 -4
  125. package/build-module/components/post-template/block-theme.mjs.map +2 -2
  126. package/build-module/components/post-template/create-new-template-modal.mjs +39 -46
  127. package/build-module/components/post-template/create-new-template-modal.mjs.map +2 -2
  128. package/build-module/components/post-template/hooks.mjs +90 -8
  129. package/build-module/components/post-template/hooks.mjs.map +2 -2
  130. package/build-module/components/post-template/panel.mjs +5 -42
  131. package/build-module/components/post-template/panel.mjs.map +2 -2
  132. package/build-module/components/post-template/swap-template-button.mjs +27 -20
  133. package/build-module/components/post-template/swap-template-button.mjs.map +2 -2
  134. package/build-module/components/preferences-modal/index.mjs +35 -27
  135. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  136. package/build-module/components/provider/use-block-editor-settings.mjs +2 -0
  137. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  138. package/build-module/components/revision-block-diff/index.mjs +30 -0
  139. package/build-module/components/revision-block-diff/index.mjs.map +7 -0
  140. package/build-module/components/revision-diff-panel/index.mjs +37 -0
  141. package/build-module/components/revision-diff-panel/index.mjs.map +7 -0
  142. package/build-module/components/revision-fields-diff/index.mjs +65 -0
  143. package/build-module/components/revision-fields-diff/index.mjs.map +7 -0
  144. package/build-module/components/sidebar/dataform-post-summary.mjs +25 -55
  145. package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
  146. package/build-module/components/sidebar/index.mjs +30 -23
  147. package/build-module/components/sidebar/index.mjs.map +2 -2
  148. package/build-module/components/sidebar/post-revision-summary.mjs +43 -0
  149. package/build-module/components/sidebar/post-revision-summary.mjs.map +7 -0
  150. package/build-module/components/sidebar/post-summary.mjs +31 -42
  151. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  152. package/build-module/components/style-book/index.mjs +4 -3
  153. package/build-module/components/style-book/index.mjs.map +2 -2
  154. package/build-module/components/sync-connection-error-modal/index.mjs +177 -0
  155. package/build-module/components/sync-connection-error-modal/index.mjs.map +7 -0
  156. package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs +36 -0
  157. package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs.map +7 -0
  158. package/build-module/components/template-actions-panel/block-theme-content.mjs +167 -0
  159. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +7 -0
  160. package/build-module/components/template-actions-panel/classic-theme-content.mjs +138 -0
  161. package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +7 -0
  162. package/build-module/components/template-actions-panel/index.mjs +28 -0
  163. package/build-module/components/template-actions-panel/index.mjs.map +7 -0
  164. package/build-module/components/visual-editor/index.mjs +2 -2
  165. package/build-module/components/visual-editor/index.mjs.map +2 -2
  166. package/build-module/dataviews/store/private-actions.mjs +5 -1
  167. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  168. package/build-module/store/actions.mjs +1 -3
  169. package/build-module/store/actions.mjs.map +2 -2
  170. package/build-module/store/private-actions.mjs +21 -2
  171. package/build-module/store/private-actions.mjs.map +2 -2
  172. package/build-module/store/private-selectors.mjs +40 -15
  173. package/build-module/store/private-selectors.mjs.map +2 -2
  174. package/build-module/utils/media-finalize/index.mjs +12 -0
  175. package/build-module/utils/media-finalize/index.mjs.map +7 -0
  176. package/build-module/utils/sync-error-messages.mjs +24 -16
  177. package/build-module/utils/sync-error-messages.mjs.map +3 -3
  178. package/build-style/style-rtl.css +135 -50
  179. package/build-style/style.css +135 -50
  180. package/build-types/components/collaborators-overlay/cursor-registry.d.ts +36 -0
  181. package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -0
  182. package/build-types/components/collaborators-overlay/index.d.ts +7 -4
  183. package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
  184. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +1 -1
  185. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -1
  186. package/build-types/components/collaborators-overlay/overlay.d.ts +4 -1
  187. package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
  188. package/build-types/components/collaborators-overlay/timing-utils.d.ts +11 -0
  189. package/build-types/components/collaborators-overlay/timing-utils.d.ts.map +1 -0
  190. package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
  191. package/build-types/components/collaborators-presence/list.d.ts +4 -1
  192. package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
  193. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  194. package/build-types/components/post-content-information/index.d.ts +4 -1
  195. package/build-types/components/post-content-information/index.d.ts.map +1 -1
  196. package/build-types/components/post-locked-modal/index.d.ts +2 -2
  197. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  198. package/build-types/components/post-revisions-panel/index.d.ts +2 -0
  199. package/build-types/components/post-revisions-panel/index.d.ts.map +1 -0
  200. package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
  201. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  202. package/build-types/components/post-template/block-theme.d.ts +1 -3
  203. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  204. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  205. package/build-types/components/post-template/hooks.d.ts +2 -1
  206. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  207. package/build-types/components/post-template/panel.d.ts.map +1 -1
  208. package/build-types/components/post-template/swap-template-button.d.ts +4 -0
  209. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
  210. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  211. package/build-types/components/revision-block-diff/index.d.ts +6 -0
  212. package/build-types/components/revision-block-diff/index.d.ts.map +1 -0
  213. package/build-types/components/revision-diff-panel/index.d.ts +14 -0
  214. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -0
  215. package/build-types/components/revision-fields-diff/index.d.ts +6 -0
  216. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -0
  217. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  218. package/build-types/components/sidebar/index.d.ts.map +1 -1
  219. package/build-types/components/sidebar/post-revision-summary.d.ts +2 -0
  220. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -0
  221. package/build-types/components/sidebar/post-summary.d.ts +3 -0
  222. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  223. package/build-types/components/style-book/index.d.ts +2 -1
  224. package/build-types/components/style-book/index.d.ts.map +1 -1
  225. package/build-types/components/sync-connection-error-modal/index.d.ts +22 -0
  226. package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -0
  227. package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts +11 -0
  228. package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts.map +1 -0
  229. package/build-types/components/template-actions-panel/block-theme-content.d.ts +2 -0
  230. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -0
  231. package/build-types/components/template-actions-panel/classic-theme-content.d.ts +2 -0
  232. package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -0
  233. package/build-types/components/template-actions-panel/index.d.ts +2 -0
  234. package/build-types/components/template-actions-panel/index.d.ts.map +1 -0
  235. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  236. package/build-types/store/actions.d.ts.map +1 -1
  237. package/build-types/store/private-actions.d.ts.map +1 -1
  238. package/build-types/store/private-selectors.d.ts.map +1 -1
  239. package/build-types/utils/media-finalize/index.d.ts +2 -0
  240. package/build-types/utils/media-finalize/index.d.ts.map +1 -0
  241. package/build-types/utils/sync-error-messages.d.ts +17 -3
  242. package/build-types/utils/sync-error-messages.d.ts.map +1 -1
  243. package/package.json +45 -44
  244. package/src/components/collaborators-overlay/compute-selection.ts +13 -13
  245. package/src/components/collaborators-overlay/cursor-registry.ts +96 -0
  246. package/src/components/collaborators-overlay/index.tsx +12 -4
  247. package/src/components/collaborators-overlay/overlay-iframe-styles.ts +1 -1
  248. package/src/components/collaborators-overlay/overlay.tsx +64 -1
  249. package/src/components/collaborators-overlay/timing-utils.ts +30 -0
  250. package/src/components/collaborators-overlay/use-render-cursors.ts +1 -1
  251. package/src/components/collaborators-presence/index.tsx +9 -1
  252. package/src/components/collaborators-presence/list.tsx +25 -1
  253. package/src/components/post-card-panel/index.js +7 -21
  254. package/src/components/post-content-information/index.js +5 -16
  255. package/src/components/post-locked-modal/index.js +21 -3
  256. package/src/components/post-revisions-panel/index.js +151 -0
  257. package/src/components/post-revisions-panel/style.scss +16 -0
  258. package/src/components/post-revisions-preview/block-diff.js +59 -20
  259. package/src/components/post-revisions-preview/diff-markers.js +2 -2
  260. package/src/components/post-revisions-preview/revisions-canvas.js +1 -1
  261. package/src/components/post-revisions-preview/revisions-slider.js +29 -7
  262. package/src/components/post-revisions-preview/test/block-diff.js +69 -31
  263. package/src/components/post-template/block-theme.js +4 -1
  264. package/src/components/post-template/create-new-template-modal.js +1 -4
  265. package/src/components/post-template/hooks.js +107 -9
  266. package/src/components/post-template/panel.js +5 -59
  267. package/src/components/post-template/style.scss +0 -6
  268. package/src/components/post-template/swap-template-button.js +30 -21
  269. package/src/components/preferences-modal/index.js +37 -25
  270. package/src/components/provider/use-block-editor-settings.js +2 -0
  271. package/src/components/revision-block-diff/index.js +39 -0
  272. package/src/components/revision-diff-panel/index.js +59 -0
  273. package/src/components/revision-diff-panel/style.scss +13 -0
  274. package/src/components/revision-fields-diff/index.js +91 -0
  275. package/src/components/sidebar/dataform-post-summary.js +45 -68
  276. package/src/components/sidebar/index.js +35 -22
  277. package/src/components/sidebar/post-revision-summary.js +50 -0
  278. package/src/components/sidebar/post-summary.js +22 -40
  279. package/src/components/sidebar/style.scss +7 -0
  280. package/src/components/style-book/index.js +4 -2
  281. package/src/components/sync-connection-error-modal/index.tsx +265 -0
  282. package/src/components/sync-connection-error-modal/style.scss +14 -0
  283. package/src/components/sync-connection-error-modal/use-retry-countdown.ts +57 -0
  284. package/src/components/template-actions-panel/block-theme-content.js +196 -0
  285. package/src/components/template-actions-panel/classic-theme-content.js +170 -0
  286. package/src/components/template-actions-panel/index.js +32 -0
  287. package/src/components/template-actions-panel/style.scss +39 -0
  288. package/src/components/visual-editor/index.js +2 -2
  289. package/src/dataviews/store/private-actions.ts +6 -0
  290. package/src/store/actions.js +1 -4
  291. package/src/store/private-actions.js +24 -3
  292. package/src/store/private-selectors.js +46 -16
  293. package/src/style.scss +4 -1
  294. package/src/utils/media-finalize/index.js +11 -0
  295. package/src/utils/media-finalize/test/index.js +34 -0
  296. package/src/utils/sync-error-messages.ts +72 -0
  297. package/src/utils/test/sync-error-messages.js +9 -32
  298. package/build/components/sync-connection-modal/index.cjs.map +0 -7
  299. package/build/components/sync-connection-modal/use-retry-countdown.cjs.map +0 -7
  300. package/build-module/components/sync-connection-modal/index.mjs +0 -170
  301. package/build-module/components/sync-connection-modal/index.mjs.map +0 -7
  302. package/build-module/components/sync-connection-modal/use-retry-countdown.mjs +0 -49
  303. package/build-module/components/sync-connection-modal/use-retry-countdown.mjs.map +0 -7
  304. package/build-types/components/sync-connection-modal/index.d.ts +0 -8
  305. package/build-types/components/sync-connection-modal/index.d.ts.map +0 -1
  306. package/build-types/components/sync-connection-modal/use-retry-countdown.d.ts +0 -9
  307. package/build-types/components/sync-connection-modal/use-retry-countdown.d.ts.map +0 -1
  308. package/src/components/sync-connection-modal/index.js +0 -206
  309. package/src/components/sync-connection-modal/style.scss +0 -14
  310. package/src/components/sync-connection-modal/use-retry-countdown.js +0 -70
  311. package/src/utils/sync-error-messages.js +0 -58
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-selectors.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tpage as pageIcon,\n\tverse,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { getRenderingMode, getCurrentPost } from './selectors';\nimport {\n\tgetEntityActions as _getEntityActions,\n\tgetEntityFields as _getEntityFields,\n\tisEntityReady as _isEntityReady,\n} from '../dataviews/store/private-selectors';\nimport { getTemplatePartIcon } from '../utils';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\n\n/**\n * Get the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInserter = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\t\treturn state.blockInserterPanel;\n\t\t\t}\n\n\t\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlocksByName,\n\t\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t\tgetBlockParents,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst [ postContentClientId ] =\n\t\t\t\t\tgetBlocksByName( 'core/post-content' );\n\t\t\t\tif ( postContentClientId ) {\n\t\t\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\t\t\t// If a block inside Post Content is selected,\n\t\t\t\t\t// let the inserter use its default logic for determining the\n\t\t\t\t\t// insertion position by returning an empty insertion point.\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectedBlockClientId &&\n\t\t\t\t\t\tselectedBlockClientId !== postContentClientId &&\n\t\t\t\t\t\tgetBlockParents( selectedBlockClientId ).includes(\n\t\t\t\t\t\t\tpostContentClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise (no selection, or Post Content itself\n\t\t\t\t\t// is selected), insert at the end of Post Content.\n\t\t\t\t\treturn {\n\t\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\t\tinsertionIndex:\n\t\t\t\t\t\t\tgetBlockOrder( postContentClientId ).length,\n\t\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t},\n\t\t( state ) => {\n\t\t\tconst {\n\t\t\t\tgetBlocksByName,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tgetBlocksByName( 'core/post-content' );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\treturn [\n\t\t\t\tstate.blockInserterPanel,\n\t\t\t\tgetRenderingMode( state ),\n\t\t\t\tpostContentClientId,\n\t\t\t\tselectedBlockClientId,\n\t\t\t\tselectedBlockClientId\n\t\t\t\t\t? getBlockParents( selectedBlockClientId )\n\t\t\t\t\t: undefined,\n\t\t\t\tpostContentClientId\n\t\t\t\t\t? getBlockOrder( postContentClientId ).length\n\t\t\t\t\t: undefined,\n\t\t\t];\n\t\t}\n\t)\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n\tpage: pageIcon,\n\tpost: verse,\n};\n\nexport const getPostIcon = createRegistrySelector(\n\t( select ) => ( state, postType, options ) => {\n\t\t{\n\t\t\tif (\n\t\t\t\tpostType === 'wp_template_part' ||\n\t\t\t\tpostType === 'wp_template'\n\t\t\t) {\n\t\t\t\tconst templateAreas =\n\t\t\t\t\tselect( coreStore ).getCurrentTheme()\n\t\t\t\t\t\t?.default_template_part_areas || [];\n\n\t\t\t\tconst areaData = templateAreas.find(\n\t\t\t\t\t( item ) => options.area === item.area\n\t\t\t\t);\n\n\t\t\t\tif ( areaData?.icon ) {\n\t\t\t\t\treturn getTemplatePartIcon( areaData.icon );\n\t\t\t\t}\n\n\t\t\t\treturn layout;\n\t\t\t}\n\t\t\tif ( CARD_ICONS[ postType ] ) {\n\t\t\t\treturn CARD_ICONS[ postType ];\n\t\t\t}\n\t\t\tconst postTypeEntity = select( coreStore ).getPostType( postType );\n\t\t\t// `icon` is the `menu_icon` property of a post type. We\n\t\t\t// only handle `dashicons` for now, even if the `menu_icon`\n\t\t\t// also supports urls and svg as values.\n\t\t\tif (\n\t\t\t\ttypeof postTypeEntity?.icon === 'string' &&\n\t\t\t\tpostTypeEntity.icon.startsWith( 'dashicons-' )\n\t\t\t) {\n\t\t\t\treturn postTypeEntity.icon.slice( 10 );\n\t\t\t}\n\t\t\treturn pageIcon;\n\t\t}\n\t}\n);\n\n/**\n * Returns true if there are unsaved changes to the\n * post's meta fields, and false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} postType The post type of the post.\n * @param {number} postId The ID of the post.\n *\n * @return {boolean} Whether there are edits or not in the meta fields of the relevant post.\n */\nexport const hasPostMetaChanges = createRegistrySelector(\n\t( select ) => ( state, postType, postId ) => {\n\t\tconst { type: currentPostType, id: currentPostId } =\n\t\t\tgetCurrentPost( state );\n\t\t// If no postType or postId is passed, use the current post.\n\t\tconst edits = select( coreStore ).getEntityRecordNonTransientEdits(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t);\n\n\t\tif ( ! edits?.meta ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Compare if anything apart from `footnotes` has changed.\n\t\tconst originalPostMeta = select( coreStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t)?.meta;\n\n\t\treturn ! fastDeepEqual(\n\t\t\t{ ...originalPostMeta, footnotes: undefined },\n\t\t\t{ ...edits.meta, footnotes: undefined }\n\t\t);\n\t}\n);\n\nexport function getEntityActions( state, ...args ) {\n\treturn _getEntityActions( state.dataviews, ...args );\n}\n\nexport function isEntityReady( state, ...args ) {\n\treturn _isEntityReady( state.dataviews, ...args );\n}\n\nexport function getEntityFields( state, ...args ) {\n\treturn _getEntityFields( state.dataviews, ...args );\n}\n\n/**\n * Similar to getBlocksByName in @wordpress/block-editor, but only returns the top-most\n * blocks that aren't descendants of the query block.\n *\n * @param {Object} state Global application state.\n * @param {Array|string} blockNames Block names of the blocks to retrieve.\n *\n * @return {Array} Block client IDs.\n */\nexport const getPostBlocksByName = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, blockNames ) => {\n\t\t\tblockNames = Array.isArray( blockNames )\n\t\t\t\t? blockNames\n\t\t\t\t: [ blockNames ];\n\t\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn getBlocksByName( blockNames ).filter( ( clientId ) =>\n\t\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t\t! blockNames.includes( parentBlockName )\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t( state, blockNames ) => {\n\t\t\tblockNames = Array.isArray( blockNames )\n\t\t\t\t? blockNames\n\t\t\t\t: [ blockNames ];\n\t\t\tconst { getBlocksByName, getBlockParents } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientIds = getBlocksByName( blockNames );\n\t\t\tconst parentsOfClientIds = clientIds.map( ( id ) =>\n\t\t\t\tgetBlockParents( id )\n\t\t\t);\n\t\t\treturn [ clientIds, ...parentsOfClientIds ];\n\t\t}\n\t)\n);\n\n/**\n * Returns the default rendering mode for a post type by user preference or post type configuration.\n *\n * @param {Object} state Global application state.\n * @param {string} postType The post type.\n *\n * @return {string} The default rendering mode. Returns `undefined` while resolving value.\n */\nexport const getDefaultRenderingMode = createRegistrySelector(\n\t( select ) => ( state, postType ) => {\n\t\tconst { getPostType, getCurrentTheme, hasFinishedResolution } =\n\t\t\tselect( coreStore );\n\n\t\t// This needs to be called before `hasFinishedResolution`.\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst currentTheme = getCurrentTheme();\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst postTypeEntity = getPostType( postType );\n\n\t\t// Wait for the post type and theme resolution.\n\t\tif (\n\t\t\t! hasFinishedResolution( 'getPostType', [ postType ] ) ||\n\t\t\t! hasFinishedResolution( 'getCurrentTheme' )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst theme = currentTheme?.stylesheet;\n\t\tconst defaultModePreference = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'renderingModes'\n\t\t)?.[ theme ]?.[ postType ];\n\t\tconst postTypeDefaultMode = Array.isArray(\n\t\t\tpostTypeEntity?.supports?.editor\n\t\t)\n\t\t\t? postTypeEntity.supports.editor.find(\n\t\t\t\t\t( features ) => 'default-mode' in features\n\t\t\t )?.[ 'default-mode' ]\n\t\t\t: undefined;\n\n\t\tconst defaultMode = defaultModePreference || postTypeDefaultMode;\n\n\t\t// Fallback gracefully to 'post-only' when rendering mode is not supported.\n\t\tif ( ! RENDERING_MODES.includes( defaultMode ) ) {\n\t\t\treturn 'post-only';\n\t\t}\n\n\t\treturn defaultMode;\n\t}\n);\n\n/**\n * Get the current global styles navigation path.\n *\n * @param {Object} state Global application state.\n * @return {string} The current styles path.\n */\nexport function getStylesPath( state ) {\n\treturn state.stylesPath ?? '/';\n}\n\n/**\n * Get whether the stylebook is currently visible.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the stylebook is visible.\n */\nexport function getShowStylebook( state ) {\n\treturn state.showStylebook ?? false;\n}\n\n/**\n * Get the canvas minimum height.\n *\n * @param {Object} state Global application state.\n * @return {number} The canvas minimum height.\n */\nexport function getCanvasMinHeight( state ) {\n\treturn state.canvasMinHeight;\n}\n\n/**\n * Returns whether the editor is in revisions preview mode.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether revisions mode is active.\n */\nexport function isRevisionsMode( state ) {\n\treturn state.revisionId !== null;\n}\n\n/**\n * Returns whether the revision diff highlighting is shown.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether revision diff is being shown.\n */\nexport function isShowingRevisionDiff( state ) {\n\treturn state.showRevisionDiff;\n}\n\n/**\n * Returns the current revision ID in revisions mode.\n *\n * @param {Object} state Global application state.\n * @return {number|null} The revision ID, or null if not in revisions mode.\n */\nexport function getCurrentRevisionId( state ) {\n\treturn state.revisionId;\n}\n\n/**\n * Returns the current revision object in revisions mode.\n *\n * @param {Object} state Global application state.\n * @return {Object|null|undefined} The revision object, null if loading, or undefined if not in revisions mode.\n */\nexport const getCurrentRevision = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst revisionId = getCurrentRevisionId( state );\n\t\tif ( ! revisionId ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { type: postType, id: postId } = getCurrentPost( state );\n\t\t// - Use getRevisions (plural) instead of getRevision (singular) to\n\t\t// avoid a race condition where both API calls complete around the\n\t\t// same time and the single revision fetch overwrites the list in the\n\t\t// store.\n\t\t// - getRevision also needs to be updated to check if there's any\n\t\t// received revisions from the collection API call to avoid unnecessary\n\t\t// API calls.\n\t\tconst revisions = select( coreStore ).getRevisions(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'edit',\n\t\t\t\t_fields:\n\t\t\t\t\t'id,date,author,meta,title.raw,excerpt.raw,content.raw',\n\t\t\t}\n\t\t);\n\t\tif ( ! revisions ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst entityConfig = select( coreStore ).getEntityConfig(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tconst revKey = entityConfig?.revisionKey || 'id';\n\t\treturn revisions.find( ( r ) => r[ revKey ] === revisionId ) ?? null;\n\t}\n);\n\n/**\n * Returns the currently selected note ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {undefined|number|'new'} The selected note ID, 'new' for the new note form, or undefined if none.\n */\nexport function getSelectedNote( state ) {\n\treturn state.selectedNote?.noteId;\n}\n\n/**\n * Returns whether the selected note should be focused.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the selected note should be focused.\n */\nexport function isNoteFocused( state ) {\n\treturn !! state.selectedNote?.options?.focus;\n}\n\n/**\n * Returns the previous revision (the one before the current revision).\n * Used for diffing between revisions.\n *\n * @param {Object} state Global application state.\n * @return {Object|null|undefined} The previous revision object, null if loading or no previous revision, or undefined if not in revisions mode.\n */\nexport const getPreviousRevision = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst currentRevisionId = getCurrentRevisionId( state );\n\t\tif ( ! currentRevisionId ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { type: postType, id: postId } = getCurrentPost( state );\n\t\tconst revisions = select( coreStore ).getRevisions(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'edit',\n\t\t\t\t_fields:\n\t\t\t\t\t'id,date,author,meta,title.raw,excerpt.raw,content.raw',\n\t\t\t}\n\t\t);\n\t\tif ( ! revisions ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Sort by date ascending (oldest first).\n\t\tconst sortedRevisions = [ ...revisions ].sort(\n\t\t\t( a, b ) => new Date( a.date ) - new Date( b.date )\n\t\t);\n\n\t\t// Find current revision index.\n\t\tconst entityConfig = select( coreStore ).getEntityConfig(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tconst revKey = entityConfig?.revisionKey || 'id';\n\t\tconst currentIndex = sortedRevisions.findIndex(\n\t\t\t( r ) => r[ revKey ] === currentRevisionId\n\t\t);\n\n\t\t// Return the previous revision (older one) if it exists.\n\t\tif ( currentIndex > 0 ) {\n\t\t\treturn sortedRevisions[ currentIndex - 1 ];\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"],
5
- "mappings": ";AAGA,OAAO,mBAAmB;AAK1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,gBAAgB,8BAA8B;AACvD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,OACM;AACP,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,kBAAkB,sBAAsB;AACjD;AAAA,EACC,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,OACX;AACP,SAAS,2BAA2B;AAEpC,IAAM,wBAAwB;AAAA,EAC7B,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,aAAa;AACd;AAKA,IAAM,kBAAkB,CAAE,aAAa,iBAAkB;AASlD,IAAM,cAAc;AAAA,EAAwB,CAAE,WACpD;AAAA,IACC,CAAE,UAAW;AACZ,UAAK,OAAO,MAAM,uBAAuB,UAAW;AACnD,eAAO,MAAM;AAAA,MACd;AAEA,UAAK,iBAAkB,KAAM,MAAM,mBAAoB;AACtD,cAAM;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD,IAAI,OAAQ,gBAAiB;AAC7B,cAAM,CAAE,mBAAoB,IAC3B,gBAAiB,mBAAoB;AACtC,YAAK,qBAAsB;AAC1B,gBAAM,wBAAwB,yBAAyB;AAKvD,cACC,yBACA,0BAA0B,uBAC1B,gBAAiB,qBAAsB,EAAE;AAAA,YACxC;AAAA,UACD,GACC;AACD,mBAAO;AAAA,UACR;AAIA,iBAAO;AAAA,YACN,cAAc;AAAA,YACd,gBACC,cAAe,mBAAoB,EAAE;AAAA,YACtC,aAAa;AAAA,UACd;AAAA,QACD;AAAA,MACD;AAEA,aAAO;AAAA,IACR;AAAA,IACA,CAAE,UAAW;A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MAAO,IAAI,KAAM,EAAE,IAAK,IAAI,IAAI,KAAM,EAAE,IAAK;AAAA,IACnD;AAGA,UAAM,eAAe,OAAQ,SAAU,EAAE;AAAA,MACxC;AAAA,MACA;AAAA,IACD;AACA,UAAM,SAAS,cAAc,eAAe;AAC5C,UAAM,eAAe,gBAAgB;AAAA,MACpC,CAAE,MAAO,EAAG,MAAO,MAAM;AAAA,IAC1B;AAGA,QAAK,eAAe,GAAI;AACvB,aAAO,gBAAiB,eAAe,CAAE;AAAA,IAC1C;AAEA,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tpage as pageIcon,\n\tverse,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { getRenderingMode, getCurrentPost } from './selectors';\nimport {\n\tgetEntityActions as _getEntityActions,\n\tgetEntityFields as _getEntityFields,\n\tisEntityReady as _isEntityReady,\n} from '../dataviews/store/private-selectors';\nimport { getTemplatePartIcon } from '../utils';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\n\n/**\n * Get the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInserter = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\t\treturn state.blockInserterPanel;\n\t\t\t}\n\n\t\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlocksByName,\n\t\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t\tgetBlockParents,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst [ postContentClientId ] =\n\t\t\t\t\tgetBlocksByName( 'core/post-content' );\n\t\t\t\tif ( postContentClientId ) {\n\t\t\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\t\t\t// If a block inside Post Content is selected,\n\t\t\t\t\t// let the inserter use its default logic for determining the\n\t\t\t\t\t// insertion position by returning an empty insertion point.\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectedBlockClientId &&\n\t\t\t\t\t\tselectedBlockClientId !== postContentClientId &&\n\t\t\t\t\t\tgetBlockParents( selectedBlockClientId ).includes(\n\t\t\t\t\t\t\tpostContentClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise (no selection, or Post Content itself\n\t\t\t\t\t// is selected), insert at the end of Post Content.\n\t\t\t\t\treturn {\n\t\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\t\tinsertionIndex:\n\t\t\t\t\t\t\tgetBlockOrder( postContentClientId ).length,\n\t\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t},\n\t\t( state ) => {\n\t\t\tconst {\n\t\t\t\tgetBlocksByName,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tgetBlocksByName( 'core/post-content' );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\treturn [\n\t\t\t\tstate.blockInserterPanel,\n\t\t\t\tgetRenderingMode( state ),\n\t\t\t\tpostContentClientId,\n\t\t\t\tselectedBlockClientId,\n\t\t\t\tselectedBlockClientId\n\t\t\t\t\t? getBlockParents( selectedBlockClientId )\n\t\t\t\t\t: undefined,\n\t\t\t\tpostContentClientId\n\t\t\t\t\t? getBlockOrder( postContentClientId ).length\n\t\t\t\t\t: undefined,\n\t\t\t];\n\t\t}\n\t)\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n\tpage: pageIcon,\n\tpost: verse,\n};\n\nexport const getPostIcon = createRegistrySelector(\n\t( select ) => ( state, postType, options ) => {\n\t\t{\n\t\t\tif (\n\t\t\t\tpostType === 'wp_template_part' ||\n\t\t\t\tpostType === 'wp_template'\n\t\t\t) {\n\t\t\t\tconst templateAreas =\n\t\t\t\t\tselect( coreStore ).getCurrentTheme()\n\t\t\t\t\t\t?.default_template_part_areas || [];\n\n\t\t\t\tconst areaData = templateAreas.find(\n\t\t\t\t\t( item ) => options.area === item.area\n\t\t\t\t);\n\n\t\t\t\tif ( areaData?.icon ) {\n\t\t\t\t\treturn getTemplatePartIcon( areaData.icon );\n\t\t\t\t}\n\n\t\t\t\treturn layout;\n\t\t\t}\n\t\t\tif ( CARD_ICONS[ postType ] ) {\n\t\t\t\treturn CARD_ICONS[ postType ];\n\t\t\t}\n\t\t\tconst postTypeEntity = select( coreStore ).getPostType( postType );\n\t\t\t// `icon` is the `menu_icon` property of a post type. We\n\t\t\t// only handle `dashicons` for now, even if the `menu_icon`\n\t\t\t// also supports urls and svg as values.\n\t\t\tif (\n\t\t\t\ttypeof postTypeEntity?.icon === 'string' &&\n\t\t\t\tpostTypeEntity.icon.startsWith( 'dashicons-' )\n\t\t\t) {\n\t\t\t\treturn postTypeEntity.icon.slice( 10 );\n\t\t\t}\n\t\t\treturn pageIcon;\n\t\t}\n\t}\n);\n\n/**\n * Returns true if there are unsaved changes to the\n * post's meta fields, and false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} postType The post type of the post.\n * @param {number} postId The ID of the post.\n *\n * @return {boolean} Whether there are edits or not in the meta fields of the relevant post.\n */\nexport const hasPostMetaChanges = createRegistrySelector(\n\t( select ) => ( state, postType, postId ) => {\n\t\tconst { type: currentPostType, id: currentPostId } =\n\t\t\tgetCurrentPost( state );\n\t\t// If no postType or postId is passed, use the current post.\n\t\tconst edits = select( coreStore ).getEntityRecordNonTransientEdits(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t);\n\n\t\tif ( ! edits?.meta ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Compare if anything apart from `footnotes` has changed.\n\t\tconst originalPostMeta = select( coreStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType || currentPostType,\n\t\t\tpostId || currentPostId\n\t\t)?.meta;\n\n\t\treturn ! fastDeepEqual(\n\t\t\t{ ...originalPostMeta, footnotes: undefined },\n\t\t\t{ ...edits.meta, footnotes: undefined }\n\t\t);\n\t}\n);\n\nexport function getEntityActions( state, ...args ) {\n\treturn _getEntityActions( state.dataviews, ...args );\n}\n\nexport function isEntityReady( state, ...args ) {\n\treturn _isEntityReady( state.dataviews, ...args );\n}\n\nexport function getEntityFields( state, ...args ) {\n\treturn _getEntityFields( state.dataviews, ...args );\n}\n\n/**\n * Similar to getBlocksByName in @wordpress/block-editor, but only returns the top-most\n * blocks that aren't descendants of the query block.\n *\n * @param {Object} state Global application state.\n * @param {Array|string} blockNames Block names of the blocks to retrieve.\n *\n * @return {Array} Block client IDs.\n */\nexport const getPostBlocksByName = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, blockNames ) => {\n\t\t\tblockNames = Array.isArray( blockNames )\n\t\t\t\t? blockNames\n\t\t\t\t: [ blockNames ];\n\t\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn getBlocksByName( blockNames ).filter( ( clientId ) =>\n\t\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t\t! blockNames.includes( parentBlockName )\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t( state, blockNames ) => {\n\t\t\tblockNames = Array.isArray( blockNames )\n\t\t\t\t? blockNames\n\t\t\t\t: [ blockNames ];\n\t\t\tconst { getBlocksByName, getBlockParents } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientIds = getBlocksByName( blockNames );\n\t\t\tconst parentsOfClientIds = clientIds.map( ( id ) =>\n\t\t\t\tgetBlockParents( id )\n\t\t\t);\n\t\t\treturn [ clientIds, ...parentsOfClientIds ];\n\t\t}\n\t)\n);\n\n/**\n * Returns the default rendering mode for a post type by user preference or post type configuration.\n *\n * @param {Object} state Global application state.\n * @param {string} postType The post type.\n *\n * @return {string} The default rendering mode. Returns `undefined` while resolving value.\n */\nexport const getDefaultRenderingMode = createRegistrySelector(\n\t( select ) => ( state, postType ) => {\n\t\tconst { getPostType, getCurrentTheme, hasFinishedResolution } =\n\t\t\tselect( coreStore );\n\n\t\t// This needs to be called before `hasFinishedResolution`.\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst currentTheme = getCurrentTheme();\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst postTypeEntity = getPostType( postType );\n\n\t\t// Wait for the post type and theme resolution.\n\t\tif (\n\t\t\t! hasFinishedResolution( 'getPostType', [ postType ] ) ||\n\t\t\t! hasFinishedResolution( 'getCurrentTheme' )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst theme = currentTheme?.stylesheet;\n\t\tconst defaultModePreference = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'renderingModes'\n\t\t)?.[ theme ]?.[ postType ];\n\t\tconst postTypeDefaultMode = Array.isArray(\n\t\t\tpostTypeEntity?.supports?.editor\n\t\t)\n\t\t\t? postTypeEntity.supports.editor.find(\n\t\t\t\t\t( features ) => 'default-mode' in features\n\t\t\t )?.[ 'default-mode' ]\n\t\t\t: undefined;\n\n\t\tconst defaultMode = defaultModePreference || postTypeDefaultMode;\n\n\t\t// Fallback gracefully to 'post-only' when rendering mode is not supported.\n\t\tif ( ! RENDERING_MODES.includes( defaultMode ) ) {\n\t\t\treturn 'post-only';\n\t\t}\n\n\t\treturn defaultMode;\n\t}\n);\n\n/**\n * Get the current global styles navigation path.\n *\n * @param {Object} state Global application state.\n * @return {string} The current styles path.\n */\nexport function getStylesPath( state ) {\n\treturn state.stylesPath ?? '/';\n}\n\n/**\n * Get whether the stylebook is currently visible.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the stylebook is visible.\n */\nexport function getShowStylebook( state ) {\n\treturn state.showStylebook ?? false;\n}\n\n/**\n * Get the canvas minimum height.\n *\n * @param {Object} state Global application state.\n * @return {number} The canvas minimum height.\n */\nexport function getCanvasMinHeight( state ) {\n\treturn state.canvasMinHeight;\n}\n\n/**\n * Returns whether the editor is in revisions preview mode.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether revisions mode is active.\n */\nexport function isRevisionsMode( state ) {\n\treturn state.revisionId !== null;\n}\n\n/**\n * Returns whether the revision diff highlighting is shown.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether revision diff is being shown.\n */\nexport function isShowingRevisionDiff( state ) {\n\treturn state.showRevisionDiff;\n}\n\n/**\n * Returns the current revision ID in revisions mode.\n *\n * @param {Object} state Global application state.\n * @return {number|null} The revision ID, or null if not in revisions mode.\n */\nexport function getCurrentRevisionId( state ) {\n\treturn state.revisionId;\n}\n\n/**\n * Returns the current revision object in revisions mode.\n *\n * @param {Object} state Global application state.\n * @return {Object|null|undefined} The revision object, null if loading, or undefined if not in revisions mode.\n */\nexport const getCurrentRevision = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst revisionId = getCurrentRevisionId( state );\n\t\tif ( ! revisionId ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { type: postType, id: postId } = getCurrentPost( state );\n\t\tconst entityConfig = select( coreStore ).getEntityConfig(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tconst revisionKey = entityConfig?.revisionKey || 'id';\n\t\t// - Use getRevisions (plural) instead of getRevision (singular) to\n\t\t// avoid a race condition where both API calls complete around the\n\t\t// same time and the single revision fetch overwrites the list in the\n\t\t// store.\n\t\t// - getRevision also needs to be updated to check if there's any\n\t\t// received revisions from the collection API call to avoid unnecessary\n\t\t// API calls.\n\t\tconst revisions = select( coreStore ).getRevisions(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'edit',\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'modified',\n\t\t\t\t\t\t'author',\n\t\t\t\t\t\t'meta',\n\t\t\t\t\t\t'title.raw',\n\t\t\t\t\t\t'excerpt.raw',\n\t\t\t\t\t\t'content.raw',\n\t\t\t\t\t\trevisionKey,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t}\n\t\t);\n\t\tif ( ! revisions ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\trevisions.find( ( r ) => r[ revisionKey ] === revisionId ) ?? null\n\t\t);\n\t}\n);\n\n/**\n * Returns the currently selected note ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {undefined|number|'new'} The selected note ID, 'new' for the new note form, or undefined if none.\n */\nexport function getSelectedNote( state ) {\n\treturn state.selectedNote?.noteId;\n}\n\n/**\n * Returns whether the selected note should be focused.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the selected note should be focused.\n */\nexport function isNoteFocused( state ) {\n\treturn !! state.selectedNote?.options?.focus;\n}\n\n/**\n * Returns the previous revision (the one before the current revision).\n * Used for diffing between revisions.\n *\n * @param {Object} state Global application state.\n * @return {Object|null|undefined} The previous revision object, null if loading or no previous revision, or undefined if not in revisions mode.\n */\nexport const getPreviousRevision = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst currentRevisionId = getCurrentRevisionId( state );\n\t\tif ( ! currentRevisionId ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { type: postType, id: postId } = getCurrentPost( state );\n\t\tconst entityConfig = select( coreStore ).getEntityConfig(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tconst revisionKey = entityConfig?.revisionKey || 'id';\n\t\tconst revisions = select( coreStore ).getRevisions(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'edit',\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'modified',\n\t\t\t\t\t\t'author',\n\t\t\t\t\t\t'meta',\n\t\t\t\t\t\t'title.raw',\n\t\t\t\t\t\t'excerpt.raw',\n\t\t\t\t\t\t'content.raw',\n\t\t\t\t\t\trevisionKey,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t}\n\t\t);\n\t\tif ( ! revisions ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Template revisions use the template REST API format, which exposes\n\t\t// 'modified' instead of 'date'. Regular post revisions use 'date'.\n\t\tconst revisionDateField = revisionKey === 'wp_id' ? 'modified' : 'date';\n\n\t\t// Sort by date ascending (oldest first).\n\t\tconst sortedRevisions = [ ...revisions ].sort(\n\t\t\t( a, b ) =>\n\t\t\t\tnew Date( a[ revisionDateField ] ) -\n\t\t\t\tnew Date( b[ revisionDateField ] )\n\t\t);\n\n\t\t// Find current revision index.\n\t\tconst currentIndex = sortedRevisions.findIndex(\n\t\t\t( r ) => r[ revisionKey ] === currentRevisionId\n\t\t);\n\n\t\t// Return the previous revision (older one) if it exists.\n\t\tif ( currentIndex > 0 ) {\n\t\t\treturn sortedRevisions[ currentIndex - 1 ];\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"],
5
+ "mappings": ";AAGA,OAAO,mBAAmB;AAK1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,gBAAgB,8BAA8B;AACvD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,OACM;AACP,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,kBAAkB,sBAAsB;AACjD;AAAA,EACC,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,OACX;AACP,SAAS,2BAA2B;AAEpC,IAAM,wBAAwB;AAAA,EAC7B,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,aAAa;AACd;AAKA,IAAM,kBAAkB,CAAE,aAAa,iBAAkB;AASlD,IAAM,cAAc;AAAA,EAAwB,CAAE,WACpD;AAAA,IACC,CAAE,UAAW;AACZ,UAAK,OAAO,MAAM,uBAAuB,UAAW;AACnD,eAAO,MAAM;AAAA,MACd;AAEA,UAAK,iBAAkB,KAAM,MAAM,mBAAoB;AACtD,cAAM;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD,IAAI,OAAQ,gBAAiB;AAC7B,cAAM,CAAE,mBAAoB,IAC3B,gBAAiB,mBAAoB;AACtC,YAAK,qBAAsB;AAC1B,gBAAM,wBAAwB,yBAAyB;AAKvD,cACC,yBACA,0BAA0B,uBAC1B,gBAAiB,qBAAsB,EAAE;AAAA,YACxC;AAAA,UACD,GACC;AACD,m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B,aAAO;AAAA,IACR;AAEA,UAAM,EAAE,MAAM,UAAU,IAAI,OAAO,IAAI,eAAgB,KAAM;AAC7D,UAAM,eAAe,OAAQ,SAAU,EAAE;AAAA,MACxC;AAAA,MACA;AAAA,IACD;AACA,UAAM,cAAc,cAAc,eAAe;AACjD,UAAM,YAAY,OAAQ,SAAU,EAAE;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,SAAS;AAAA,UACR,GAAG,oBAAI,IAAK;AAAA,YACX;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACD,CAAE;AAAA,QACH,EAAE,KAAK;AAAA,MACR;AAAA,IACD;AACA,QAAK,CAAE,WAAY;AAClB,aAAO;AAAA,IACR;AAIA,UAAM,oBAAoB,gBAAgB,UAAU,aAAa;AAGjE,UAAM,kBAAkB,CAAE,GAAG,SAAU,EAAE;AAAA,MACxC,CAAE,GAAG,MACJ,IAAI,KAAM,EAAG,iBAAkB,CAAE,IACjC,IAAI,KAAM,EAAG,iBAAkB,CAAE;AAAA,IACnC;AAGA,UAAM,eAAe,gBAAgB;AAAA,MACpC,CAAE,MAAO,EAAG,WAAY,MAAM;AAAA,IAC/B;AAGA,QAAK,eAAe,GAAI;AACvB,aAAO,gBAAiB,eAAe,CAAE;AAAA,IAC1C;AAEA,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,12 @@
1
+ // packages/editor/src/utils/media-finalize/index.js
2
+ import apiFetch from "@wordpress/api-fetch";
3
+ async function mediaFinalize(id) {
4
+ await apiFetch({
5
+ path: `/wp/v2/media/${id}/finalize`,
6
+ method: "POST"
7
+ });
8
+ }
9
+ export {
10
+ mediaFinalize as default
11
+ };
12
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/utils/media-finalize/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\nexport default async function mediaFinalize( id ) {\n\tawait apiFetch( {\n\t\tpath: `/wp/v2/media/${ id }/finalize`,\n\t\tmethod: 'POST',\n\t} );\n}\n"],
5
+ "mappings": ";AAGA,OAAO,cAAc;AAErB,eAAO,cAAsC,IAAK;AACjD,QAAM,SAAU;AAAA,IACf,MAAM,gBAAiB,EAAG;AAAA,IAC1B,QAAQ;AAAA,EACT,CAAE;AACH;",
6
+ "names": []
7
+ }
@@ -1,42 +1,50 @@
1
- // packages/editor/src/utils/sync-error-messages.js
1
+ // packages/editor/src/utils/sync-error-messages.ts
2
2
  import { __ } from "@wordpress/i18n";
3
+ var AUTHENTICATION_FAILED = "authentication-failed";
4
+ var CONNECTION_EXPIRED = "connection-expired";
5
+ var CONNECTION_LIMIT_EXCEEDED = "connection-limit-exceeded";
6
+ var DOCUMENT_SIZE_LIMIT_EXCEEDED = "document-size-limit-exceeded";
7
+ var UNKNOWN_ERROR = "unknown-error";
3
8
  var ERROR_MESSAGES = {
4
- "authentication-failed": {
9
+ [AUTHENTICATION_FAILED]: {
5
10
  title: __("Unable to connect"),
6
11
  description: __(
7
- "Real-time collaboration couldn't verify your permissions. Check that you have access to edit this post, or contact your site administrator."
8
- ),
9
- canRetry: false
12
+ "Real-time collaboration couldn't verify your permissions. Check that you have access to edit this post or contact your site administrator."
13
+ )
10
14
  },
11
- "connection-expired": {
15
+ [CONNECTION_EXPIRED]: {
12
16
  title: __("Connection expired"),
13
17
  description: __(
14
18
  "Your connection to real-time collaboration has timed out. Editing is paused to prevent conflicts with other editors."
15
- ),
16
- canRetry: true
19
+ )
17
20
  },
18
- "connection-limit-exceeded": {
21
+ [CONNECTION_LIMIT_EXCEEDED]: {
19
22
  title: __("Too many editors connected"),
20
23
  description: __(
21
24
  "Real-time collaboration has reached its connection limit. Try again later or contact your site administrator."
22
- ),
23
- canRetry: true
25
+ )
24
26
  },
25
- "unknown-error": {
27
+ // DOCUMENT_SIZE_LIMIT_EXCEEDED is not included here because it results in
28
+ // collaboration being disabled entirely.
29
+ [UNKNOWN_ERROR]: {
26
30
  title: __("Connection lost"),
27
31
  description: __(
28
32
  "The connection to real-time collaboration was interrupted. Editing is paused to prevent conflicts with other editors."
29
- ),
30
- canRetry: true
33
+ )
31
34
  }
32
35
  };
33
36
  function getSyncErrorMessages(error) {
34
- if (ERROR_MESSAGES[error?.code]) {
37
+ if (error?.code && ERROR_MESSAGES[error?.code]) {
35
38
  return ERROR_MESSAGES[error.code];
36
39
  }
37
- return ERROR_MESSAGES["unknown-error"];
40
+ return ERROR_MESSAGES[UNKNOWN_ERROR];
38
41
  }
39
42
  export {
43
+ AUTHENTICATION_FAILED,
44
+ CONNECTION_EXPIRED,
45
+ CONNECTION_LIMIT_EXCEEDED,
46
+ DOCUMENT_SIZE_LIMIT_EXCEEDED,
47
+ UNKNOWN_ERROR,
40
48
  getSyncErrorMessages
41
49
  };
42
50
  //# sourceMappingURL=sync-error-messages.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/utils/sync-error-messages.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Default error messages for known error codes.\n */\nconst ERROR_MESSAGES = {\n\t'authentication-failed': {\n\t\ttitle: __( 'Unable to connect' ),\n\t\tdescription: __(\n\t\t\t\"Real-time collaboration couldn't verify your permissions. \" +\n\t\t\t\t'Check that you have access to edit this post, or contact your site administrator.'\n\t\t),\n\t\tcanRetry: false,\n\t},\n\t'connection-expired': {\n\t\ttitle: __( 'Connection expired' ),\n\t\tdescription: __(\n\t\t\t'Your connection to real-time collaboration has timed out. ' +\n\t\t\t\t'Editing is paused to prevent conflicts with other editors.'\n\t\t),\n\t\tcanRetry: true,\n\t},\n\t'connection-limit-exceeded': {\n\t\ttitle: __( 'Too many editors connected' ),\n\t\tdescription: __(\n\t\t\t'Real-time collaboration has reached its connection limit. ' +\n\t\t\t\t'Try again later or contact your site administrator.'\n\t\t),\n\t\tcanRetry: true,\n\t},\n\t'unknown-error': {\n\t\ttitle: __( 'Connection lost' ),\n\t\tdescription: __(\n\t\t\t'The connection to real-time collaboration was interrupted. ' +\n\t\t\t\t'Editing is paused to prevent conflicts with other editors.'\n\t\t),\n\t\tcanRetry: true,\n\t},\n};\n\n/**\n * Get user-facing title and description from a sync connection error.\n *\n * Provides default messages based on error.code.\n *\n * @param {Object} error - Connection error object.\n * @return {Object} Object with title, description, and canRetry flag.\n */\nexport function getSyncErrorMessages( error ) {\n\tif ( ERROR_MESSAGES[ error?.code ] ) {\n\t\treturn ERROR_MESSAGES[ error.code ];\n\t}\n\n\treturn ERROR_MESSAGES[ 'unknown-error' ];\n}\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AAKnB,IAAM,iBAAiB;AAAA,EACtB,yBAAyB;AAAA,IACxB,OAAO,GAAI,mBAAoB;AAAA,IAC/B,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,IACA,UAAU;AAAA,EACX;AAAA,EACA,sBAAsB;AAAA,IACrB,OAAO,GAAI,oBAAqB;AAAA,IAChC,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,IACA,UAAU;AAAA,EACX;AAAA,EACA,6BAA6B;AAAA,IAC5B,OAAO,GAAI,4BAA6B;AAAA,IACxC,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,IACA,UAAU;AAAA,EACX;AAAA,EACA,iBAAiB;AAAA,IAChB,OAAO,GAAI,iBAAkB;AAAA,IAC7B,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,IACA,UAAU;AAAA,EACX;AACD;AAUO,SAAS,qBAAsB,OAAQ;AAC7C,MAAK,eAAgB,OAAO,IAAK,GAAI;AACpC,WAAO,eAAgB,MAAM,IAAK;AAAA,EACnC;AAEA,SAAO,eAAgB,eAAgB;AACxC;",
3
+ "sources": ["../../src/utils/sync-error-messages.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { type ConnectionError } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n// These error codes are defined in the sync package:\n// packages/sync/src/errors.ts\nexport const AUTHENTICATION_FAILED = 'authentication-failed';\nexport const CONNECTION_EXPIRED = 'connection-expired';\nexport const CONNECTION_LIMIT_EXCEEDED = 'connection-limit-exceeded';\nexport const DOCUMENT_SIZE_LIMIT_EXCEEDED = 'document-size-limit-exceeded';\nexport const UNKNOWN_ERROR = 'unknown-error';\n\ninterface ConnectionErrorMessages {\n\tdescription: string;\n\ttitle: string;\n}\n\n/**\n * Default error messages for known error codes.\n */\nconst ERROR_MESSAGES: Record< string, ConnectionErrorMessages > = {\n\t[ AUTHENTICATION_FAILED ]: {\n\t\ttitle: __( 'Unable to connect' ),\n\t\tdescription: __(\n\t\t\t\"Real-time collaboration couldn't verify your permissions. \" +\n\t\t\t\t'Check that you have access to edit this post or contact your site administrator.'\n\t\t),\n\t},\n\t[ CONNECTION_EXPIRED ]: {\n\t\ttitle: __( 'Connection expired' ),\n\t\tdescription: __(\n\t\t\t'Your connection to real-time collaboration has timed out. ' +\n\t\t\t\t'Editing is paused to prevent conflicts with other editors.'\n\t\t),\n\t},\n\t[ CONNECTION_LIMIT_EXCEEDED ]: {\n\t\ttitle: __( 'Too many editors connected' ),\n\t\tdescription: __(\n\t\t\t'Real-time collaboration has reached its connection limit. ' +\n\t\t\t\t'Try again later or contact your site administrator.'\n\t\t),\n\t},\n\t// DOCUMENT_SIZE_LIMIT_EXCEEDED is not included here because it results in\n\t// collaboration being disabled entirely.\n\t[ UNKNOWN_ERROR ]: {\n\t\ttitle: __( 'Connection lost' ),\n\t\tdescription: __(\n\t\t\t'The connection to real-time collaboration was interrupted. ' +\n\t\t\t\t'Editing is paused to prevent conflicts with other editors.'\n\t\t),\n\t},\n};\n\n/**\n * Get user-facing title and description from a sync connection error.\n *\n * Provides default messages based on error.code.\n *\n * @param error - Connection error.\n * @return Object with title, description, and canRetry flag.\n */\nexport function getSyncErrorMessages(\n\terror?: ConnectionError\n): ConnectionErrorMessages {\n\tif ( error?.code && ERROR_MESSAGES[ error?.code ] ) {\n\t\treturn ERROR_MESSAGES[ error.code ];\n\t}\n\n\treturn ERROR_MESSAGES[ UNKNOWN_ERROR ];\n}\n"],
5
+ "mappings": ";AAIA,SAAS,UAAU;AAIZ,IAAM,wBAAwB;AAC9B,IAAM,qBAAqB;AAC3B,IAAM,4BAA4B;AAClC,IAAM,+BAA+B;AACrC,IAAM,gBAAgB;AAU7B,IAAM,iBAA4D;AAAA,EACjE,CAAE,qBAAsB,GAAG;AAAA,IAC1B,OAAO,GAAI,mBAAoB;AAAA,IAC/B,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,EACD;AAAA,EACA,CAAE,kBAAmB,GAAG;AAAA,IACvB,OAAO,GAAI,oBAAqB;AAAA,IAChC,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,EACD;AAAA,EACA,CAAE,yBAA0B,GAAG;AAAA,IAC9B,OAAO,GAAI,4BAA6B;AAAA,IACxC,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,EACD;AAAA;AAAA;AAAA,EAGA,CAAE,aAAc,GAAG;AAAA,IAClB,OAAO,GAAI,iBAAkB;AAAA,IAC7B,aAAa;AAAA,MACZ;AAAA,IAED;AAAA,EACD;AACD;AAUO,SAAS,qBACf,OAC0B;AAC1B,MAAK,OAAO,QAAQ,eAAgB,OAAO,IAAK,GAAI;AACnD,WAAO,eAAgB,MAAM,IAAK;AAAA,EACnC;AAEA,SAAO,eAAgB,aAAc;AACtC;",
6
6
  "names": []
7
7
  }
@@ -119,7 +119,7 @@
119
119
  }
120
120
 
121
121
  .admin-ui-page__header {
122
- padding: var(--wpds-dimension-padding-lg, 16px) var(--wpds-dimension-padding-2xl, 24px);
122
+ padding: var(--wpds-dimension-padding-md, 12px) var(--wpds-dimension-padding-2xl, 24px);
123
123
  border-bottom: var(--wpds-border-width-xs, 1px) solid var(--wpds-color-stroke-surface-neutral-weak, #e0e0e0);
124
124
  background: var(--wpds-color-bg-surface-neutral-strong, #ffffff);
125
125
  position: sticky;
@@ -129,9 +129,9 @@
129
129
 
130
130
  .admin-ui-page__header-title {
131
131
  font-family: var(--wpds-font-family-heading, -apple-system, system-ui, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif);
132
- font-size: var(--wpds-font-size-xl, 20px);
132
+ font-size: var(--wpds-font-size-lg, 15px);
133
133
  font-weight: var(--wpds-font-weight-medium, 499);
134
- line-height: var(--wpds-font-line-height-xl, 32px);
134
+ line-height: var(--wpds-font-line-height-lg, 28px);
135
135
  margin: 0;
136
136
  overflow: hidden;
137
137
  text-overflow: ellipsis;
@@ -221,13 +221,15 @@
221
221
  * These variables do not appear to be used anywhere else.
222
222
  */
223
223
  .admin-ui-breadcrumbs__list {
224
+ font-family: var(--wpds-font-family-heading, -apple-system, system-ui, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif);
225
+ font-size: var(--wpds-font-size-lg, 15px);
226
+ font-weight: var(--wpds-font-weight-medium, 499);
227
+ line-height: var(--wpds-font-line-height-lg, 28px);
224
228
  list-style: none;
225
229
  padding: 0;
226
230
  margin: 0;
227
231
  gap: 0;
228
- font-size: 15px;
229
232
  min-height: 32px;
230
- font-weight: 500;
231
233
  }
232
234
 
233
235
  .admin-ui-breadcrumbs__list li:not(:last-child)::after {
@@ -1663,13 +1665,11 @@ button.font-library__upload-area {
1663
1665
  border-radius: 2px;
1664
1666
  }
1665
1667
 
1666
- /**
1667
- * When DataViews are placed within cards, apply a consistent top padding.
1668
- */
1669
- .components-card__body:has(> .dataviews-wrapper),
1670
- .components-card__body:has(> .dataviews-picker-wrapper) {
1671
- padding: 8px 0 0;
1672
- overflow: hidden;
1668
+ .dataviews__view-actions--infinite-scroll {
1669
+ position: sticky;
1670
+ top: 0;
1671
+ z-index: 2;
1672
+ background-color: #fff;
1673
1673
  }
1674
1674
 
1675
1675
  .dataviews-bulk-actions-footer__item-count {
@@ -2503,45 +2503,55 @@ button.font-library__upload-area {
2503
2503
  outline: 2px solid transparent;
2504
2504
  }
2505
2505
 
2506
- .dataviews-view-grid .dataviews-view-grid__card {
2506
+ .dataviews-view-grid .dataviews-view-grid__card,
2507
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card {
2507
2508
  height: 100%;
2508
2509
  justify-content: flex-start;
2509
2510
  position: relative;
2510
2511
  }
2511
2512
 
2512
- .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title {
2513
+ .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title,
2514
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__title {
2513
2515
  padding: 8px 0 4px;
2514
2516
  }
2515
2517
 
2516
- .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field {
2518
+ .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field,
2519
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__title-field {
2517
2520
  min-height: 24px;
2518
2521
  overflow: hidden;
2519
2522
  align-content: center;
2520
2523
  text-align: start;
2521
2524
  }
2522
2525
 
2523
- .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable {
2526
+ .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable,
2527
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable {
2524
2528
  width: fit-content;
2525
2529
  }
2526
2530
 
2527
- .dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value {
2531
+ .dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value,
2532
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value {
2528
2533
  color: #1e1e1e;
2529
2534
  }
2530
2535
 
2531
2536
  .dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media::after,
2532
- .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus::after {
2537
+ .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus::after,
2538
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card.is-selected .dataviews-view-grid__media::after,
2539
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__media:focus::after {
2533
2540
  background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
2534
2541
  }
2535
2542
 
2536
- .dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media::after {
2543
+ .dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media::after,
2544
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card.is-selected .dataviews-view-grid__media::after {
2537
2545
  box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
2538
2546
  }
2539
2547
 
2540
- .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus::after {
2548
+ .dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus::after,
2549
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__media:focus::after {
2541
2550
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
2542
2551
  }
2543
2552
 
2544
- .dataviews-view-grid .dataviews-view-grid__media {
2553
+ .dataviews-view-grid .dataviews-view-grid__media,
2554
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__media {
2545
2555
  width: 100%;
2546
2556
  aspect-ratio: 1/1;
2547
2557
  background-color: #fff;
@@ -2550,17 +2560,20 @@ button.font-library__upload-area {
2550
2560
  position: relative;
2551
2561
  }
2552
2562
 
2553
- .dataviews-view-grid .dataviews-view-grid__media.dataviews-view-grid__media--placeholder {
2563
+ .dataviews-view-grid .dataviews-view-grid__media.dataviews-view-grid__media--placeholder,
2564
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__media.dataviews-view-grid__media--placeholder {
2554
2565
  aspect-ratio: 3/1;
2555
2566
  }
2556
2567
 
2557
- .dataviews-view-grid .dataviews-view-grid__media img {
2568
+ .dataviews-view-grid .dataviews-view-grid__media img,
2569
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__media img {
2558
2570
  object-fit: cover;
2559
2571
  width: 100%;
2560
2572
  height: 100%;
2561
2573
  }
2562
2574
 
2563
- .dataviews-view-grid .dataviews-view-grid__media::after {
2575
+ .dataviews-view-grid .dataviews-view-grid__media::after,
2576
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__media::after {
2564
2577
  content: "";
2565
2578
  position: absolute;
2566
2579
  top: 0;
@@ -2572,7 +2585,8 @@ button.font-library__upload-area {
2572
2585
  pointer-events: none;
2573
2586
  }
2574
2587
 
2575
- .dataviews-view-grid .dataviews-view-grid__media .dataviews-view-grid__media-placeholder {
2588
+ .dataviews-view-grid .dataviews-view-grid__media .dataviews-view-grid__media-placeholder,
2589
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__media .dataviews-view-grid__media-placeholder {
2576
2590
  width: 100%;
2577
2591
  height: 100%;
2578
2592
  display: block;
@@ -2581,28 +2595,33 @@ button.font-library__upload-area {
2581
2595
  background: #f0f0f0;
2582
2596
  }
2583
2597
 
2584
- .dataviews-view-grid .dataviews-view-grid__fields {
2598
+ .dataviews-view-grid .dataviews-view-grid__fields,
2599
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields {
2585
2600
  position: relative;
2586
2601
  font-size: 12px;
2587
2602
  line-height: 16px;
2588
2603
  }
2589
2604
 
2590
- .dataviews-view-grid .dataviews-view-grid__fields:not(:empty) {
2605
+ .dataviews-view-grid .dataviews-view-grid__fields:not(:empty),
2606
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields:not(:empty) {
2591
2607
  padding: 0 0 12px;
2592
2608
  }
2593
2609
 
2594
- .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty) {
2610
+ .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty),
2611
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty) {
2595
2612
  min-height: 24px;
2596
2613
  line-height: 20px;
2597
2614
  padding-top: 2px;
2598
2615
  }
2599
2616
 
2600
- .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field {
2617
+ .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field,
2618
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field {
2601
2619
  min-height: 24px;
2602
2620
  align-items: center;
2603
2621
  }
2604
2622
 
2605
- .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name {
2623
+ .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name,
2624
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name {
2606
2625
  width: 35%;
2607
2626
  color: #757575;
2608
2627
  overflow: hidden;
@@ -2610,28 +2629,33 @@ button.font-library__upload-area {
2610
2629
  white-space: nowrap;
2611
2630
  }
2612
2631
 
2613
- .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value {
2632
+ .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value,
2633
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value {
2614
2634
  width: 65%;
2615
2635
  overflow: hidden;
2616
2636
  text-overflow: ellipsis;
2617
2637
  white-space: nowrap;
2618
2638
  }
2619
2639
 
2620
- .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))) {
2640
+ .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))),
2641
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))) {
2621
2642
  display: none;
2622
2643
  }
2623
2644
 
2624
- .dataviews-view-grid .dataviews-view-grid__badge-fields:not(:empty) {
2645
+ .dataviews-view-grid .dataviews-view-grid__badge-fields:not(:empty),
2646
+ .dataviews-view-grid-infinite-scroll .dataviews-view-grid__badge-fields:not(:empty) {
2625
2647
  padding-bottom: 12px;
2626
2648
  }
2627
2649
 
2628
- .dataviews-view-grid.is-refreshing {
2650
+ .dataviews-view-grid.is-refreshing,
2651
+ .dataviews-view-grid-infinite-scroll.is-refreshing {
2629
2652
  opacity: 0.5;
2630
2653
  pointer-events: none;
2631
2654
  }
2632
2655
 
2633
2656
  @media not (prefers-reduced-motion) {
2634
- .dataviews-view-grid.is-refreshing {
2657
+ .dataviews-view-grid.is-refreshing,
2658
+ .dataviews-view-grid-infinite-scroll.is-refreshing {
2635
2659
  opacity: 1;
2636
2660
  animation: dataviews-pulse 1s ease-in-out infinite;
2637
2661
  }
@@ -3954,17 +3978,18 @@ div.dataviews-view-list {
3954
3978
  align-items: center;
3955
3979
  }
3956
3980
 
3957
- .dataforms-layouts-card__field-header-label {
3958
- font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
3959
- font-weight: 499;
3960
- font-size: 15px;
3961
- line-height: 20px;
3962
- }
3963
-
3964
3981
  .dataforms-layouts-card__field {
3965
3982
  width: 100%;
3966
3983
  }
3967
3984
 
3985
+ .dataforms-layouts-card__field-header-content {
3986
+ min-height: 24px;
3987
+ }
3988
+
3989
+ .dataforms-layouts-card__field-header-content-description {
3990
+ display: contents;
3991
+ }
3992
+
3968
3993
  .dataforms-layouts-card__field-description {
3969
3994
  color: #757575;
3970
3995
  display: block;
@@ -6639,6 +6664,20 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
6639
6664
  transform: translateX(0%);
6640
6665
  }
6641
6666
  }
6667
+ .editor-post-revisions-panel .editor-post-revisions-panel__view-all {
6668
+ justify-content: center;
6669
+ }
6670
+ .editor-post-revisions-panel .editor-post-revisions-panel__revision-date {
6671
+ text-transform: uppercase;
6672
+ font-weight: 600;
6673
+ font-size: 12px;
6674
+ }
6675
+
6676
+ .editor-post-revisions-panel__revisions-count {
6677
+ margin-top: -4.5px;
6678
+ margin-bottom: -4.5px;
6679
+ }
6680
+
6642
6681
  .editor-revisions-header__slider {
6643
6682
  width: 100%;
6644
6683
  }
@@ -6699,6 +6738,20 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
6699
6738
  outline-offset: -2px;
6700
6739
  }
6701
6740
 
6741
+ .editor-revision-fields-diff__value {
6742
+ word-break: break-word;
6743
+ }
6744
+
6745
+ .editor-revision-fields-diff__added {
6746
+ background-color: color-mix(in srgb, currentColor 5%, #00a32a 15%);
6747
+ text-decoration: none;
6748
+ }
6749
+
6750
+ .editor-revision-fields-diff__removed {
6751
+ text-decoration: line-through;
6752
+ color: #d63638;
6753
+ }
6754
+
6702
6755
  .editor-post-saved-state {
6703
6756
  display: flex;
6704
6757
  align-items: center;
@@ -6813,15 +6866,15 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
6813
6866
  margin-left: 8px;
6814
6867
  }
6815
6868
 
6816
- .editor-sync-connection-modal {
6869
+ .editor-sync-connection-error-modal {
6817
6870
  z-index: 1000001;
6818
6871
  }
6819
6872
 
6820
- .editor-sync-connection-modal p {
6873
+ .editor-sync-connection-error-modal p {
6821
6874
  margin: 0;
6822
6875
  }
6823
6876
 
6824
- .editor-sync-connection-modal__retry-countdown {
6877
+ .editor-sync-connection-error-modal__retry-countdown {
6825
6878
  color: #757575;
6826
6879
  }
6827
6880
 
@@ -6870,14 +6923,41 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
6870
6923
  color: inherit;
6871
6924
  }
6872
6925
 
6873
- @media (min-width: 782px) {
6874
- .editor-post-template__create-form {
6875
- width: 320px;
6926
+ .editor-post-template__classic-theme-dropdown {
6927
+ padding: 8px;
6928
+ }
6929
+
6930
+ .editor-template-actions-panel__preview .block-editor-block-preview__container {
6931
+ display: flex;
6932
+ aspect-ratio: 4/3;
6933
+ overflow: hidden;
6934
+ border-radius: 4px;
6935
+ }
6936
+ .editor-template-actions-panel__preview .block-editor-block-preview__container::after {
6937
+ outline: 1px solid rgba(0, 0, 0, 0.1);
6938
+ outline-offset: -1px;
6939
+ border-radius: 4px;
6940
+ }
6941
+ @media not (prefers-reduced-motion) {
6942
+ .editor-template-actions-panel__preview .block-editor-block-preview__container::after {
6943
+ transition: outline 0.1s linear;
6876
6944
  }
6877
6945
  }
6946
+ .editor-template-actions-panel__preview[role=button] {
6947
+ cursor: pointer;
6948
+ }
6949
+ .editor-template-actions-panel__preview[role=button]:hover .block-editor-block-preview__container::after {
6950
+ outline-color: rgba(0, 0, 0, 0.3);
6951
+ }
6952
+ .editor-template-actions-panel__preview[role=button]:focus-visible .block-editor-block-preview__container::after {
6953
+ outline-color: var(--wp-admin-theme-color);
6954
+ outline-width: var(--wp-admin-border-width-focus);
6955
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
6956
+ }
6878
6957
 
6879
- .editor-post-template__classic-theme-dropdown {
6880
- padding: 8px;
6958
+ .editor-template-actions-panel__action {
6959
+ flex: 1;
6960
+ justify-content: center;
6881
6961
  }
6882
6962
 
6883
6963
  textarea.editor-post-text-editor {
@@ -7185,6 +7265,11 @@ textarea.editor-post-text-editor::placeholder {
7185
7265
  font-size: 13px;
7186
7266
  }
7187
7267
 
7268
+ .fields-controls__password {
7269
+ border-top: 1px solid #e0e0e0;
7270
+ padding-top: 16px;
7271
+ }
7272
+
7188
7273
  .editor-site-discussion-dropdown__content .components-popover__content {
7189
7274
  min-width: 320px;
7190
7275
  padding: 16px;