@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
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/template-actions-panel/block-theme-content.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tButton,\n\tTooltip,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from '../post-template/create-new-template-modal';\nimport { SwapTemplateModal } from '../post-template/swap-template-button';\nimport { useAvailableTemplates } from '../post-template/hooks';\n\nexport default function TemplateActionsPanelContent() {\n\tconst templateId = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentTemplateId(),\n\t\t[]\n\t);\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\tconst [ isSwapModalOpen, setIsSwapModalOpen ] = useState( false );\n\n\tconst availableTemplates = useAvailableTemplates();\n\tconst hasSwapTargets = !! availableTemplates?.length;\n\n\tconst {\n\t\tonNavigateToEntityRecord,\n\t\tcanCreateTemplate,\n\t\thasGoBack,\n\t\tgetEditorSettings,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings: _getEditorSettings } = select( editorStore );\n\t\tconst editorSettings = _getEditorSettings();\n\t\treturn {\n\t\t\tonNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,\n\t\t\tcanCreateTemplate: !! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t\thasGoBack: editorSettings.hasOwnProperty(\n\t\t\t\t'onNavigateToPreviousEntityRecord'\n\t\t\t),\n\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t};\n\t}, [] );\n\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { editedRecord: template, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplateId\n\t);\n\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_template', {\n\t\tid: templateId,\n\t} );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\t// The site editor does not have a `onNavigateToPreviousEntityRecord` setting as it uses its own routing\n\t// and assigns its own backlink to focusMode pages.\n\tconst notificationAction = hasGoBack\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t},\n\t\t ]\n\t\t: undefined;\n\n\tconst mayShowTemplateEditNotice = () => {\n\t\tif ( ! getPreference( 'core/edit-site', 'welcomeGuideTemplate' ) ) {\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', actions: notificationAction }\n\t\t\t);\n\t\t}\n\t};\n\n\tconst templateName = decodeEntities( template.title );\n\n\tconst previewContent = !! blocks?.length && (\n\t\t<BlockPreview.Async>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t</BlockPreview.Async>\n\t);\n\n\tconst renderPreview = () => {\n\t\tif ( ! previewContent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( hasSwapTargets ) {\n\t\t\tconst tooltipText = __( 'Change template' );\n\t\t\treturn (\n\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"editor-template-actions-panel__preview\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\taria-label={ tooltipText }\n\t\t\t\t\t\tonClick={ () => setIsSwapModalOpen( true ) }\n\t\t\t\t\t\tonKeyPress={ () => setIsSwapModalOpen( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ previewContent }\n\t\t\t\t\t</div>\n\t\t\t\t</Tooltip>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"editor-template-actions-panel__preview\">\n\t\t\t\t{ previewContent }\n\t\t\t</div>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t/* translators: %s: template name */\n\t\t\t\t\t__( 'Template: %s' ),\n\t\t\t\t\ttemplateName\n\t\t\t\t) }\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t<VStack>\n\t\t\t\t\t{ renderPreview() }\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t{ onNavigateToEntityRecord && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tmayShowTemplateEditNotice();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ canCreateTemplate && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => setIsCreateModalOpen( true ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Create new' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</PanelBody>\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isSwapModalOpen && (\n\t\t\t\t<SwapTemplateModal\n\t\t\t\t\tonRequestClose={ () => setIsSwapModalOpen( false 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ACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA;AAAA,UAEP,GAAI,cAAe;AAAA,UACnB;AAAA,QACD;AAAA,QACA,aAAc;AAAA,QAEd,+BAAC,UACE;AAAA,wBAAc;AAAA,UAChB,qBAAC,UACE;AAAA,wCACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM;AACf,2CAA0B;AAAA,oBACzB,QAAQ,SAAS;AAAA,oBACjB,UAAU;AAAA,kBACX,CAAE;AACF,4CAA0B;AAAA,gBAC3B;AAAA,gBAEE,aAAI,MAAO;AAAA;AAAA,YACd;AAAA,YAEC,qBACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM,qBAAsB,IAAK;AAAA,gBAEzC,aAAI,YAAa;AAAA;AAAA,YACpB;AAAA,aAEF;AAAA,WACD;AAAA;AAAA,IACD;AAAA,IACE,qBACD;AAAA,MAAC;AAAA;AAAA,QACA,SAAU,MAAM,qBAAsB,KAAM;AAAA;AAAA,IAC7C;AAAA,IAEC,mBACD;AAAA,MAAC;AAAA;AAAA,QACA,gBAAiB,MAAM,mBAAoB,KAAM;AAAA;AAAA,IAClD;AAAA,KAEF;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,138 @@
1
+ // packages/editor/src/components/template-actions-panel/classic-theme-content.js
2
+ import { useSelect, useDispatch } from "@wordpress/data";
3
+ import {
4
+ useEntityRecord,
5
+ useEntityBlockEditor,
6
+ store as coreStore
7
+ } from "@wordpress/core-data";
8
+ import { BlockPreview } from "@wordpress/block-editor";
9
+ import {
10
+ PanelBody,
11
+ Button,
12
+ __experimentalText as Text,
13
+ __experimentalHStack as HStack,
14
+ __experimentalVStack as VStack
15
+ } from "@wordpress/components";
16
+ import { useState } from "@wordpress/element";
17
+ import { __, sprintf } from "@wordpress/i18n";
18
+ import { decodeEntities } from "@wordpress/html-entities";
19
+ import { store as noticesStore } from "@wordpress/notices";
20
+ import { store as preferencesStore } from "@wordpress/preferences";
21
+ import { store as editorStore } from "../../store/index.mjs";
22
+ import CreateNewTemplateModal from "../post-template/create-new-template-modal.mjs";
23
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
24
+ function ClassicThemeContent() {
25
+ const templateId = useSelect(
26
+ (select) => select(editorStore).getCurrentTemplateId(),
27
+ []
28
+ );
29
+ const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
30
+ const {
31
+ onNavigateToEntityRecord,
32
+ canCreateTemplate,
33
+ hasGoBack,
34
+ getEditorSettings
35
+ } = useSelect((select) => {
36
+ const { getEditorSettings: _getEditorSettings } = select(editorStore);
37
+ const editorSettings = _getEditorSettings();
38
+ return {
39
+ onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
40
+ canCreateTemplate: !!select(coreStore).canUser("create", {
41
+ kind: "postType",
42
+ name: "wp_template"
43
+ }) && editorSettings.supportsTemplateMode,
44
+ hasGoBack: editorSettings.hasOwnProperty(
45
+ "onNavigateToPreviousEntityRecord"
46
+ ),
47
+ getEditorSettings: _getEditorSettings
48
+ };
49
+ }, []);
50
+ const { get: getPreference } = useSelect(preferencesStore);
51
+ const { createSuccessNotice } = useDispatch(noticesStore);
52
+ const { editedRecord: template } = useEntityRecord(
53
+ "postType",
54
+ "wp_template",
55
+ templateId
56
+ );
57
+ const [blocks] = useEntityBlockEditor("postType", "wp_template", {
58
+ id: templateId
59
+ });
60
+ if (!templateId && !canCreateTemplate) {
61
+ return null;
62
+ }
63
+ const notificationAction = hasGoBack ? [
64
+ {
65
+ label: __("Go back"),
66
+ onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
67
+ }
68
+ ] : void 0;
69
+ const mayShowTemplateEditNotice = () => {
70
+ if (!getPreference("core/edit-site", "welcomeGuideTemplate")) {
71
+ createSuccessNotice(
72
+ __(
73
+ "Editing template. Changes made here affect all posts and pages that use the template."
74
+ ),
75
+ { type: "snackbar", actions: notificationAction }
76
+ );
77
+ }
78
+ };
79
+ const templateName = template ? decodeEntities(template.title) : void 0;
80
+ const previewContent = !!blocks?.length && /* @__PURE__ */ jsx(BlockPreview.Async, { children: /* @__PURE__ */ jsx(BlockPreview, { blocks }) });
81
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
82
+ /* @__PURE__ */ jsx(
83
+ PanelBody,
84
+ {
85
+ title: template ? sprintf(
86
+ /* translators: %s: template name */
87
+ __("Template: %s"),
88
+ templateName
89
+ ) : __("Template"),
90
+ initialOpen: false,
91
+ children: /* @__PURE__ */ jsxs(VStack, { children: [
92
+ !templateId && /* @__PURE__ */ jsx(Text, { children: __(
93
+ "This page uses a classic template. To edit this template with blocks, create a block template."
94
+ ) }),
95
+ template && previewContent && /* @__PURE__ */ jsx("div", { className: "editor-template-actions-panel__preview", children: previewContent }),
96
+ /* @__PURE__ */ jsxs(HStack, { children: [
97
+ template && onNavigateToEntityRecord && /* @__PURE__ */ jsx(
98
+ Button,
99
+ {
100
+ className: "editor-template-actions-panel__action",
101
+ __next40pxDefaultSize: true,
102
+ variant: "secondary",
103
+ onClick: () => {
104
+ onNavigateToEntityRecord({
105
+ postId: template.id,
106
+ postType: "wp_template"
107
+ });
108
+ mayShowTemplateEditNotice();
109
+ },
110
+ children: __("Edit")
111
+ }
112
+ ),
113
+ canCreateTemplate && /* @__PURE__ */ jsx(
114
+ Button,
115
+ {
116
+ className: "editor-template-actions-panel__action",
117
+ __next40pxDefaultSize: true,
118
+ variant: "secondary",
119
+ onClick: () => setIsCreateModalOpen(true),
120
+ children: !templateId ? __("Create block template") : __("Create new")
121
+ }
122
+ )
123
+ ] })
124
+ ] })
125
+ }
126
+ ),
127
+ isCreateModalOpen && /* @__PURE__ */ jsx(
128
+ CreateNewTemplateModal,
129
+ {
130
+ onClose: () => setIsCreateModalOpen(false)
131
+ }
132
+ )
133
+ ] });
134
+ }
135
+ export {
136
+ ClassicThemeContent as default
137
+ };
138
+ //# sourceMappingURL=classic-theme-content.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/template-actions-panel/classic-theme-content.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from '../post-template/create-new-template-modal';\n\nexport default function ClassicThemeContent() {\n\tconst templateId = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentTemplateId(),\n\t\t[]\n\t);\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\tconst {\n\t\tonNavigateToEntityRecord,\n\t\tcanCreateTemplate,\n\t\thasGoBack,\n\t\tgetEditorSettings,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings: _getEditorSettings } = select( editorStore );\n\t\tconst editorSettings = _getEditorSettings();\n\t\treturn {\n\t\t\tonNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,\n\t\t\tcanCreateTemplate:\n\t\t\t\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template',\n\t\t\t\t} ) && editorSettings.supportsTemplateMode,\n\t\t\thasGoBack: editorSettings.hasOwnProperty(\n\t\t\t\t'onNavigateToPreviousEntityRecord'\n\t\t\t),\n\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t};\n\t}, [] );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { editedRecord: template } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplateId\n\t);\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_template', {\n\t\tid: templateId,\n\t} );\n\n\t// Path A: No block template and cannot create templates.\n\tif ( ! templateId && ! canCreateTemplate ) {\n\t\treturn null;\n\t}\n\n\tconst notificationAction = hasGoBack\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t},\n\t\t ]\n\t\t: undefined;\n\n\tconst mayShowTemplateEditNotice = () => {\n\t\tif ( ! getPreference( 'core/edit-site', 'welcomeGuideTemplate' ) ) {\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', actions: notificationAction }\n\t\t\t);\n\t\t}\n\t};\n\n\tconst templateName = template\n\t\t? decodeEntities( template.title )\n\t\t: undefined;\n\n\tconst previewContent = !! blocks?.length && (\n\t\t<BlockPreview.Async>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t</BlockPreview.Async>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\ttemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: template name */\n\t\t\t\t\t\t\t\t__( 'Template: %s' ),\n\t\t\t\t\t\t\t\ttemplateName\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Template' )\n\t\t\t\t}\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t<VStack>\n\t\t\t\t\t{ ! templateId && (\n\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'This page uses a classic template. To edit this template with blocks, create a block template.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) }\n\t\t\t\t\t{ template && previewContent && (\n\t\t\t\t\t\t<div className=\"editor-template-actions-panel__preview\">\n\t\t\t\t\t\t\t{ previewContent }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t{ template && onNavigateToEntityRecord && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tmayShowTemplateEditNotice();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ canCreateTemplate && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => setIsCreateModalOpen( true ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! templateId\n\t\t\t\t\t\t\t\t\t? __( 'Create block template' )\n\t\t\t\t\t\t\t\t\t: __( 'Create new' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</PanelBody>\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AACP,SAAS,gBAAgB;AACzB,SAAS,IAAI,eAAe;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,SAAS,mBAAmB;AACrC,OAAO,4BAA4B;AAwEhC,SAKD,UALC,KA+BE,YA/BF;AAtEY,SAAR,sBAAuC;AAC7C,QAAM,aAAa;AAAA,IAClB,CAAE,WAAY,OAAQ,WAAY,EAAE,qBAAqB;AAAA,IACzD,CAAC;AAAA,EACF;AACA,QAAM,CAAE,mBAAmB,oBAAqB,IAAI,SAAU,KAAM;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,mBAAmB,mBAAmB,IAAI,OAAQ,WAAY;AACtE,UAAM,iBAAiB,mBAAmB;AAC1C,WAAO;AAAA,MACN,0BAA0B,eAAe;AAAA,MACzC,mBACC,CAAC,CAAE,OAAQ,SAAU,EAAE,QAAS,UAAU;AAAA,QACzC,MAAM;AAAA,QACN,MAAM;AAAA,MACP,CAAE,KAAK,eAAe;AAAA,MACvB,WAAW,eAAe;AAAA,QACzB;AAAA,MACD;AAAA,MACA,mBAAmB;AAAA,IACpB;AAAA,EACD,GAAG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AAU,MAAM;AACf,2CAA0B;AAAA,oBACzB,QAAQ,SAAS;AAAA,oBACjB,UAAU;AAAA,kBACX,CAAE;AACF,4CAA0B;AAAA,gBAC3B;AAAA,gBAEE,aAAI,MAAO;AAAA;AAAA,YACd;AAAA,YAEC,qBACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM,qBAAsB,IAAK;AAAA,gBAEzC,WAAE,aACD,GAAI,uBAAwB,IAC5B,GAAI,YAAa;AAAA;AAAA,YACrB;AAAA,aAEF;AAAA,WACD;AAAA;AAAA,IACD;AAAA,IACE,qBACD;AAAA,MAAC;AAAA;AAAA,QACA,SAAU,MAAM,qBAAsB,KAAM;AAAA;AAAA,IAC7C;AAAA,KAEF;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ // packages/editor/src/components/template-actions-panel/index.js
2
+ import { useSelect } from "@wordpress/data";
3
+ import { store as editorStore } from "../../store/index.mjs";
4
+ import { usePostTemplatePanelMode } from "../post-template/hooks.mjs";
5
+ import BlockThemeContent from "./block-theme-content.mjs";
6
+ import ClassicThemeContent from "./classic-theme-content.mjs";
7
+ import { jsx } from "react/jsx-runtime";
8
+ function TemplateActionsPanel() {
9
+ const postType = useSelect(
10
+ (select) => select(editorStore).getCurrentPostType(),
11
+ []
12
+ );
13
+ const mode = usePostTemplatePanelMode();
14
+ if (!["page", "post"].includes(postType)) {
15
+ return null;
16
+ }
17
+ if (mode === "classic") {
18
+ return /* @__PURE__ */ jsx(ClassicThemeContent, {});
19
+ }
20
+ if (mode === "block-theme") {
21
+ return /* @__PURE__ */ jsx(BlockThemeContent, {});
22
+ }
23
+ return null;
24
+ }
25
+ export {
26
+ TemplateActionsPanel as default
27
+ };
28
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/template-actions-panel/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { usePostTemplatePanelMode } from '../post-template/hooks';\nimport BlockThemeContent from './block-theme-content';\nimport ClassicThemeContent from './classic-theme-content';\n\nexport default function TemplateActionsPanel() {\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\tconst mode = usePostTemplatePanelMode();\n\t// This check is because the experiment is gated for these post\n\t// types for now. Later we should use `postType.viewable`.\n\tif ( ! [ 'page', 'post' ].includes( postType ) ) {\n\t\treturn null;\n\t}\n\tif ( mode === 'classic' ) {\n\t\treturn <ClassicThemeContent />;\n\t}\n\tif ( mode === 'block-theme' ) {\n\t\treturn <BlockThemeContent />;\n\t}\n\treturn null;\n}\n"],
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AACrC,SAAS,gCAAgC;AACzC,OAAO,uBAAuB;AAC9B,OAAO,yBAAyB;AAcvB;AAZM,SAAR,uBAAwC;AAC9C,QAAM,WAAW;AAAA,IAChB,CAAE,WAAY,OAAQ,WAAY,EAAE,mBAAmB;AAAA,IACvD,CAAC;AAAA,EACF;AACA,QAAM,OAAO,yBAAyB;AAGtC,MAAK,CAAE,CAAE,QAAQ,MAAO,EAAE,SAAU,QAAS,GAAI;AAChD,WAAO;AAAA,EACR;AACA,MAAK,SAAS,WAAY;AACzB,WAAO,oBAAC,uBAAoB;AAAA,EAC7B;AACA,MAAK,SAAS,eAAgB;AAC7B,WAAO,oBAAC,qBAAkB;AAAA,EAC3B;AACA,SAAO;AACR;",
6
+ "names": []
7
+ }
@@ -31,7 +31,7 @@ import {
31
31
  import { useZoomOutModeExit } from "./use-zoom-out-mode-exit.mjs";
32
32
  import { usePaddingAppender } from "./use-padding-appender.mjs";
33
33
  import { useEditContentOnlySectionExit } from "./use-edit-content-only-section-exit.mjs";
34
- import { SyncConnectionModal } from "../sync-connection-modal/index.mjs";
34
+ import { SyncConnectionErrorModal } from "../sync-connection-error-modal/index.mjs";
35
35
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
36
36
  var {
37
37
  LayoutStyle,
@@ -304,7 +304,7 @@ function VisualEditor({
304
304
  }
305
305
  ),
306
306
  children: [
307
- /* @__PURE__ */ jsx(SyncConnectionModal, {}),
307
+ /* @__PURE__ */ jsx(SyncConnectionErrorModal, {}),
308
308
  /* @__PURE__ */ jsx(ResizableEditor, { enableResizing, height: "100%", children: /* @__PURE__ */ jsxs(
309
309
  BlockCanvas,
310
310
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/visual-editor/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs, useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tDESIGN_POST_TYPES,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useEditContentOnlySectionExit } from './use-edit-content-only-section-exit';\nimport { SyncConnectionModal } from '../sync-connection-modal';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t\tstyles,\n\t\tcanvasMinHeight,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t\tgetCanvasMinHeight,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable && supportsTemplateMode\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t\tstyles: editorSettings.styles,\n\t\t\tcanvasMinHeight: getCanvasMinHeight(),\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst localRef = useRef();\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst isNavigationPreview = postType === NAVIGATION_POST_TYPE && isPreview;\n\n\t// Calculate the minimum height including scroll offset to fit all notes.\n\tconst calculatedMinHeight = useMemo( () => {\n\t\tif ( ! localRef.current ) {\n\t\t\treturn canvasMinHeight;\n\t\t}\n\n\t\tconst { ownerDocument } = localRef.current;\n\t\tconst scrollTop =\n\t\t\townerDocument.documentElement.scrollTop ||\n\t\t\townerDocument.body.scrollTop;\n\n\t\treturn canvasMinHeight + scrollTop;\n\t}, [ canvasMinHeight ] );\n\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\t! isPreview && renderingMode === 'post-only' && ! isDesignPostType\n\t);\n\n\tconst centerContentCSS = `display:flex;align-items:center;justify-content:center;`;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It's\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;${\n\t\t\t\t\tcalculatedMinHeight\n\t\t\t\t\t\t? `min-height:${ calculatedMinHeight }px;`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing || isNavigationPreview\n\t\t\t\t\t\t? 'min-height:0!important;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}\n\t\t\t\t${ paddingStyle ? paddingStyle : '' }\n\t\t\t\t${\n\t\t\t\t\tenableResizing\n\t\t\t\t\t\t? `.block-editor-iframe__html{background:var(--wp-editor-canvas-background);min-height:100vh;${ centerContentCSS }}.block-editor-iframe__body{width:100%;}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}${\n\t\t\t\t\tisNavigationPreview\n\t\t\t\t\t\t? `.block-editor-iframe__body{${ centerContentCSS }padding:var(--wp--style--block-gap,2em);}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}`,\n\t\t\t\t// The CSS for enableResizing centers the body content vertically when resizing is enabled and applies a background\n\t\t\t\t// color to the iframe HTML element to match the background color of the editor canvas.\n\t\t\t\t// The CSS for isNavigationPreview centers the body content vertically and horizontally when the navigation is in preview mode.\n\t\t\t},\n\t\t];\n\t}, [\n\t\tstyles,\n\t\tenableResizing,\n\t\tisNavigationPreview,\n\t\tcalculatedMinHeight,\n\t\tpaddingStyle,\n\t] );\n\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseZoomOutModeExit(),\n\t\tpaddingAppenderRef,\n\t\tuseEditContentOnlySectionExit(),\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SyncConnectionModal />\n\t\t\t<ResizableEditor enableResizing={ enableResizing } height=\"100%\">\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward compatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content`, // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t\t\t\t\t! isDesignPostType &&\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,iCAAiC;AAAA,OAC3B;AACP,SAAS,WAAW,QAAQ,eAAe;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,SAAS,iBAAiB;AACnC,SAAS,cAAc,wBAAwB;AAK/C,OAAO,eAAe;AACtB,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AACvB,OAAO,oCAAoC;AAC3C,OAAO,qBAAqB;AAC5B,OAAO,mCAAmC;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,qCAAqC;AAC9C,SAAS,2BAA2B;AAkYjC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A,oBACE,kBAAkB,qBACnB;AAAA,sBAAC;AAAA;AAAA,wBACA,YAAa;AAAA;AAAA,oBACd;AAAA;AAAA;AAAA,cAEF;AAAA;AAAA;AAAA,QACD,GACD;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,wBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs, useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tDESIGN_POST_TYPES,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useEditContentOnlySectionExit } from './use-edit-content-only-section-exit';\nimport { SyncConnectionErrorModal } from '../sync-connection-error-modal';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t\tstyles,\n\t\tcanvasMinHeight,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t\tgetCanvasMinHeight,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable && supportsTemplateMode\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t\tstyles: editorSettings.styles,\n\t\t\tcanvasMinHeight: getCanvasMinHeight(),\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst localRef = useRef();\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst isNavigationPreview = postType === NAVIGATION_POST_TYPE && isPreview;\n\n\t// Calculate the minimum height including scroll offset to fit all notes.\n\tconst calculatedMinHeight = useMemo( () => {\n\t\tif ( ! localRef.current ) {\n\t\t\treturn canvasMinHeight;\n\t\t}\n\n\t\tconst { ownerDocument } = localRef.current;\n\t\tconst scrollTop =\n\t\t\townerDocument.documentElement.scrollTop ||\n\t\t\townerDocument.body.scrollTop;\n\n\t\treturn canvasMinHeight + scrollTop;\n\t}, [ canvasMinHeight ] );\n\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\t! isPreview && renderingMode === 'post-only' && ! isDesignPostType\n\t);\n\n\tconst centerContentCSS = `display:flex;align-items:center;justify-content:center;`;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It's\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;${\n\t\t\t\t\tcalculatedMinHeight\n\t\t\t\t\t\t? `min-height:${ calculatedMinHeight }px;`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing || isNavigationPreview\n\t\t\t\t\t\t? 'min-height:0!important;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}\n\t\t\t\t${ paddingStyle ? paddingStyle : '' }\n\t\t\t\t${\n\t\t\t\t\tenableResizing\n\t\t\t\t\t\t? `.block-editor-iframe__html{background:var(--wp-editor-canvas-background);min-height:100vh;${ centerContentCSS }}.block-editor-iframe__body{width:100%;}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}${\n\t\t\t\t\tisNavigationPreview\n\t\t\t\t\t\t? `.block-editor-iframe__body{${ centerContentCSS }padding:var(--wp--style--block-gap,2em);}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}`,\n\t\t\t\t// The CSS for enableResizing centers the body content vertically when resizing is enabled and applies a background\n\t\t\t\t// color to the iframe HTML element to match the background color of the editor canvas.\n\t\t\t\t// The CSS for isNavigationPreview centers the body content vertically and horizontally when the navigation is in preview mode.\n\t\t\t},\n\t\t];\n\t}, [\n\t\tstyles,\n\t\tenableResizing,\n\t\tisNavigationPreview,\n\t\tcalculatedMinHeight,\n\t\tpaddingStyle,\n\t] );\n\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseZoomOutModeExit(),\n\t\tpaddingAppenderRef,\n\t\tuseEditContentOnlySectionExit(),\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SyncConnectionErrorModal />\n\t\t\t<ResizableEditor enableResizing={ enableResizing } height=\"100%\">\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward compatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content`, // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t\t\t\t\t! isDesignPostType &&\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,iCAAiC;AAAA,OAC3B;AACP,SAAS,WAAW,QAAQ,eAAe;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,SAAS,iBAAiB;AACnC,SAAS,cAAc,wBAAwB;AAK/C,OAAO,eAAe;AACtB,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AACvB,OAAO,oCAAoC;AAC3C,OAAO,qBAAqB;AAC5B,OAAO,mCAAmC;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,qCAAqC;AAC9C,SAAS,gCAAgC;AAkYtC,SAmBI,UAnBJ,KAmBI,YAnBJ;AAhYH,IAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA,yBAAyB;AAAA,EACzB;AACD,IAAI,OAAQ,sBAAuB;AAgBnC,SAAS,yBAA0B,QAAS;AAC3C,WAAU,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAM;AACzC,QAAK,OAAQ,CAAE,EAAE,SAAS,qBAAsB;AAC/C,aAAO,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18
+ excerptField,
18
19
  featuredImageField,
19
20
  dateField,
20
21
  parentField,
@@ -33,7 +34,8 @@ import {
33
34
  notesField,
34
35
  scheduledDateField,
35
36
  formatField,
36
- postContentInfoField
37
+ postContentInfoField,
38
+ stickyField
37
39
  } from "@wordpress/fields";
38
40
  import {
39
41
  altTextField,
@@ -169,6 +171,7 @@ var registerPostTypeSchema = (postType) => async ({ registry }) => {
169
171
  !DESIGN_POST_TYPES.includes(postTypeConfig.slug) && dateField,
170
172
  !DESIGN_POST_TYPES.includes(postTypeConfig.slug) && scheduledDateField,
171
173
  slugField,
174
+ !DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.excerpt && excerptField,
172
175
  postTypeConfig.supports?.["page-attributes"] && parentField,
173
176
  postTypeConfig.supports?.comments && commentStatusField,
174
177
  postTypeConfig.supports?.trackbacks && pingStatusField,
@@ -177,6 +180,7 @@ var registerPostTypeSchema = (postType) => async ({ registry }) => {
177
180
  postTypeConfig.supports?.["post-formats"] && !disablePostFormats && formatField,
178
181
  !DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.editor && postContentInfoField,
179
182
  passwordField,
183
+ postTypeConfig.slug === "post" && stickyField,
180
184
  postTypeConfig.supports?.editor && postTypeConfig.viewable && postPreviewField,
181
185
  hasEditorNotesSupport(postTypeConfig.supports) && notesField
182
186
  ].filter(Boolean);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/dataviews/store/private-actions.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n\tnotesField,\n\tscheduledDateField,\n\tformatField,\n\tpostContentInfoField,\n} from '@wordpress/fields';\nimport {\n\taltTextField,\n\tattachedToField,\n\tauthorField as mediaAuthorField,\n\tcaptionField,\n\tdateAddedField,\n\tdescriptionField,\n\tfilenameField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tmimeTypeField,\n} from '@wordpress/media-fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE, DESIGN_POST_TYPES } from '../../store/constants';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalTemplateActivate?: boolean;\n\t\t__experimentalMediaEditor?: boolean;\n\t}\n}\n\n/**\n * Check if a post type supports editor notes.\n *\n * @param supports The post type supports object.\n * @return Whether editor notes are supported.\n */\nfunction hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {\n\tconst editor = supports?.editor;\n\tif ( Array.isArray( editor ) ) {\n\t\treturn !! editor[ 0 ]?.notes;\n\t}\n\treturn false;\n}\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\n/*\n * Media fields for the attachment post type.\n *\n * Field order follows a logical grouping:\n * 1. Metadata fields in panels (date, author, file info)\n * 2. Core editable fields (title, alt text, caption, description)\n *\n * Note: media_thumbnail is not included as it's shown in the canvas preview\n */\nconst ORDERED_MEDIA_FIELDS = [\n\t// Metadata in panels (collapsed by default).\n\tdateAddedField,\n\tmediaAuthorField,\n\tfilenameField,\n\tmimeTypeField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tattachedToField,\n\t// Regular layout fields (always visible).\n\ttitleField,\n\taltTextField,\n\tcaptionField,\n\tdescriptionField,\n];\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\t\tconst { disablePostFormats } = registry\n\t\t\t.select( editorStore )\n\t\t\t.getEditorSettings();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// When template activation experiment is disabled, templates cannot be duplicated.\n\t\t// @ts-ignore\n\t\tif (\n\t\t\tpostTypeConfig.slug === 'wp_template' &&\n\t\t\t! window?.__experimentalTemplateActivate\n\t\t) {\n\t\t\tcanDuplicate = undefined;\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\t// Handle attachment post type separately with media-specific fields\n\t\tlet fields;\n\n\t\tif ( postType === ATTACHMENT_POST_TYPE ) {\n\t\t\tfields = ORDERED_MEDIA_FIELDS;\n\t\t} else {\n\t\t\tfields = [\n\t\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\t\tfeaturedImageField,\n\t\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\t\tstatusField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tdateField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tscheduledDateField,\n\t\t\t\tslugField,\n\t\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\t\tdiscussionField,\n\t\t\t\ttemplateField,\n\t\t\t\tpostTypeConfig.supports?.[ 'post-formats' ] &&\n\t\t\t\t\t! disablePostFormats &&\n\t\t\t\t\tformatField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostContentInfoField,\n\t\t\t\tpasswordField,\n\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\t\tpostPreviewField,\n\t\t\t\thasEditorNotesSupport( postTypeConfig.supports ) && notesField,\n\t\t\t].filter( Boolean );\n\t\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\t\tlet _titleField;\n\t\t\t\tif ( postType === 'page' ) {\n\t\t\t\t\t_titleField = pageTitleField;\n\t\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t\t_titleField = templateTitleField;\n\t\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t\t_titleField = patternTitleField;\n\t\t\t\t} else {\n\t\t\t\t\t_titleField = titleField;\n\t\t\t\t}\n\t\t\t\tfields.push( _titleField );\n\t\t\t}\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],
5
- "mappings": ";AAGA,SAAS,SAAS,iBAAiB;AAEnC,SAAS,gBAAgB;AAEzB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,SAAS,mBAAmB;AACrC,SAAS,sBAAsB,yBAAyB;AACxD,OAAO,sBAAsB;AAC7B,SAAS,cAAc;AAevB,SAAS,sBAAuB,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,eAAe,UAAU,YAC1B,eAAe,UAAU,eACzB;AAAA,MACD;AAAA,MACA,eAAe,WAAY,cAAe,KACzC,CAAE,sBACF;AAAA,MACD,CAAE,kBAAkB,SAAU,eAAe,IAAK,KACjD,eAAe,UAAU,UACzB;AAAA,MACD;AAAA,MACA,eAAe,UAAU,UACxB,eAAe,YACf;AAAA,MACD,sBAAuB,eAAe,QAAS,KAAK;AAAA,IACrD,EAAE,OAAQ,OAAQ;AAClB,QAAK,eAAe,UAAU,OAAQ;AACrC,UAAI;AACJ,UAAK,aAAa,QAAS;AAC1B,sBAAc;AAAA,MACf,WAAY,aAAa,eAAgB;AACxC,sBAAc;AAAA,MACf,WAAY,aAAa,YAAa;AACrC,sBAAc;AAAA,MACf,OAAO;AACN,sBAAc;AAAA,MACf;AACA,aAAO,KAAM,WAAY;AAAA,IAC1B;AAAA,EACD;AAEA,WAAS,MAAO,MAAM;AACrB,YAAQ,QAAS,CAAE,WAAY;AAC9B,aAAQ,SAAS,SAAU,WAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AACF,WAAO,QAAS,CAAE,UAAW;AAC5B,aAAQ,SAAS,SAAU,WAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,WAAU,+BAA+B,QAAS;AACnD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\texcerptField,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n\tnotesField,\n\tscheduledDateField,\n\tformatField,\n\tpostContentInfoField,\n\tstickyField,\n} from '@wordpress/fields';\nimport {\n\taltTextField,\n\tattachedToField,\n\tauthorField as mediaAuthorField,\n\tcaptionField,\n\tdateAddedField,\n\tdescriptionField,\n\tfilenameField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tmimeTypeField,\n} from '@wordpress/media-fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE, DESIGN_POST_TYPES } from '../../store/constants';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalTemplateActivate?: boolean;\n\t\t__experimentalMediaEditor?: boolean;\n\t}\n}\n\n/**\n * Check if a post type supports editor notes.\n *\n * @param supports The post type supports object.\n * @return Whether editor notes are supported.\n */\nfunction hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {\n\tconst editor = supports?.editor;\n\tif ( Array.isArray( editor ) ) {\n\t\treturn !! editor[ 0 ]?.notes;\n\t}\n\treturn false;\n}\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\n/*\n * Media fields for the attachment post type.\n *\n * Field order follows a logical grouping:\n * 1. Metadata fields in panels (date, author, file info)\n * 2. Core editable fields (title, alt text, caption, description)\n *\n * Note: media_thumbnail is not included as it's shown in the canvas preview\n */\nconst ORDERED_MEDIA_FIELDS = [\n\t// Metadata in panels (collapsed by default).\n\tdateAddedField,\n\tmediaAuthorField,\n\tfilenameField,\n\tmimeTypeField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tattachedToField,\n\t// Regular layout fields (always visible).\n\ttitleField,\n\taltTextField,\n\tcaptionField,\n\tdescriptionField,\n];\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\t\tconst { disablePostFormats } = registry\n\t\t\t.select( editorStore )\n\t\t\t.getEditorSettings();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// When template activation experiment is disabled, templates cannot be duplicated.\n\t\t// @ts-ignore\n\t\tif (\n\t\t\tpostTypeConfig.slug === 'wp_template' &&\n\t\t\t! window?.__experimentalTemplateActivate\n\t\t) {\n\t\t\tcanDuplicate = undefined;\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\t// Handle attachment post type separately with media-specific fields\n\t\tlet fields;\n\n\t\tif ( postType === ATTACHMENT_POST_TYPE ) {\n\t\t\tfields = ORDERED_MEDIA_FIELDS;\n\t\t} else {\n\t\t\tfields = [\n\t\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\t\tfeaturedImageField,\n\t\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\t\tstatusField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tdateField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tscheduledDateField,\n\t\t\t\tslugField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tpostTypeConfig.supports?.excerpt &&\n\t\t\t\t\texcerptField,\n\t\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\t\tdiscussionField,\n\t\t\t\ttemplateField,\n\t\t\t\tpostTypeConfig.supports?.[ 'post-formats' ] &&\n\t\t\t\t\t! disablePostFormats &&\n\t\t\t\t\tformatField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostContentInfoField,\n\t\t\t\tpasswordField,\n\t\t\t\tpostTypeConfig.slug === 'post' && stickyField,\n\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\t\tpostPreviewField,\n\t\t\t\thasEditorNotesSupport( postTypeConfig.supports ) && notesField,\n\t\t\t].filter( Boolean );\n\t\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\t\tlet _titleField;\n\t\t\t\tif ( postType === 'page' ) {\n\t\t\t\t\t_titleField = pageTitleField;\n\t\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t\t_titleField = templateTitleField;\n\t\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t\t_titleField = patternTitleField;\n\t\t\t\t} else {\n\t\t\t\t\t_titleField = titleField;\n\t\t\t\t}\n\t\t\t\tfields.push( _titleField );\n\t\t\t}\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],
5
+ "mappings": ";AAGA,SAAS,SAAS,iBAAiB;AAEnC,SAAS,gBAAgB;AAEzB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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Ae,IAAK,KACjD;AAAA,MACD;AAAA,MACA,CAAE,kBAAkB,SAAU,eAAe,IAAK,KACjD,eAAe,UAAU,WACzB;AAAA,MACD,eAAe,WAAY,iBAAkB,KAAK;AAAA,MAClD,eAAe,UAAU,YAAY;AAAA,MACrC,eAAe,UAAU,cAAc;AAAA,OACrC,eAAe,UAAU,YAC1B,eAAe,UAAU,eACzB;AAAA,MACD;AAAA,MACA,eAAe,WAAY,cAAe,KACzC,CAAE,sBACF;AAAA,MACD,CAAE,kBAAkB,SAAU,eAAe,IAAK,KACjD,eAAe,UAAU,UACzB;AAAA,MACD;AAAA,MACA,eAAe,SAAS,UAAU;AAAA,MAClC,eAAe,UAAU,UACxB,eAAe,YACf;AAAA,MACD,sBAAuB,eAAe,QAAS,KAAK;AAAA,IACrD,EAAE,OAAQ,OAAQ;AAClB,QAAK,eAAe,UAAU,OAAQ;AACrC,UAAI;AACJ,UAAK,aAAa,QAAS;AAC1B,sBAAc;AAAA,MACf,WAAY,aAAa,eAAgB;AACxC,sBAAc;AAAA,MACf,WAAY,aAAa,YAAa;AACrC,sBAAc;AAAA,MACf,OAAO;AACN,sBAAc;AAAA,MACf;AACA,aAAO,KAAM,WAAY;AAAA,IAC1B;AAAA,EACD;AAEA,WAAS,MAAO,MAAM;AACrB,YAAQ,QAAS,CAAE,WAAY;AAC9B,aAAQ,SAAS,SAAU,WAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AACF,WAAO,QAAS,CAAE,UAAW;AAC5B,aAAQ,SAAS,SAAU,WAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,WAAU,+BAA+B,QAAS;AACnD;",
6
6
  "names": []
7
7
  }
@@ -95,9 +95,7 @@ var savePost = (options = {}) => async ({ select, dispatch, registry }) => {
95
95
  return;
96
96
  }
97
97
  const content = select.getEditedPostContent();
98
- if (!options.isAutosave) {
99
- dispatch.editPost({ content }, { undoIgnore: true });
100
- }
98
+ dispatch.editPost({ content }, { undoIgnore: true });
101
99
  const previousRecord = select.getCurrentPost();
102
100
  let edits = {
103
101
  id: previousRecord.id,