@wordpress/edit-site 5.18.0 → 5.19.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 (427) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +62 -1
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/index.js +3 -2
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +6 -1
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +6 -1
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js +2 -7
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +3 -2
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +20 -16
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/site-editor-canvas.js +1 -3
  17. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  18. package/build/components/block-editor/use-site-editor-settings.js +8 -4
  19. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  20. package/build/components/canvas-loader/index.js +18 -1
  21. package/build/components/canvas-loader/index.js.map +1 -1
  22. package/build/components/editor/index.js +3 -8
  23. package/build/components/editor/index.js.map +1 -1
  24. package/build/components/global-styles/dimensions-panel.js +5 -4
  25. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  26. package/build/components/global-styles/font-families.js +68 -0
  27. package/build/components/global-styles/font-families.js.map +1 -0
  28. package/build/components/global-styles/font-family-item.js +47 -0
  29. package/build/components/global-styles/font-family-item.js.map +1 -0
  30. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +31 -0
  31. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  32. package/build/components/global-styles/font-library-modal/context.js +285 -0
  33. package/build/components/global-styles/font-library-modal/context.js.map +1 -0
  34. package/build/components/global-styles/font-library-modal/font-card.js +58 -0
  35. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -0
  36. package/build/components/global-styles/font-library-modal/font-demo.js +69 -0
  37. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  38. package/build/components/global-styles/font-library-modal/font-variant.js +51 -0
  39. package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  40. package/build/components/global-styles/font-library-modal/fonts-grid.js +54 -0
  41. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  42. package/build/components/global-styles/font-library-modal/index.js +47 -0
  43. package/build/components/global-styles/font-library-modal/index.js.map +1 -0
  44. package/build/components/global-styles/font-library-modal/installed-fonts.js +128 -0
  45. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  46. package/build/components/global-styles/font-library-modal/library-font-card.js +44 -0
  47. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  48. package/build/components/global-styles/font-library-modal/library-font-details.js +43 -0
  49. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  50. package/build/components/global-styles/font-library-modal/library-font-variant.js +59 -0
  51. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  52. package/build/components/global-styles/font-library-modal/local-fonts.js +143 -0
  53. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  54. package/build/components/global-styles/font-library-modal/resolvers.js +37 -0
  55. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  56. package/build/components/global-styles/font-library-modal/tab-layout.js +45 -0
  57. package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  58. package/build/components/global-styles/font-library-modal/utils/constants.js +37 -0
  59. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  60. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  61. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  62. package/build/components/global-styles/font-library-modal/utils/index.js +205 -0
  63. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  64. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +22 -0
  65. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  66. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +92 -0
  67. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  68. package/build/components/global-styles/global-styles-provider.js +7 -12
  69. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  70. package/build/components/global-styles/screen-block.js +34 -21
  71. package/build/components/global-styles/screen-block.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/index.js +1 -3
  73. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  74. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  75. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  76. package/build/components/global-styles/screen-typography.js +4 -72
  77. package/build/components/global-styles/screen-typography.js.map +1 -1
  78. package/build/components/global-styles/style-variations-container.js +3 -5
  79. package/build/components/global-styles/style-variations-container.js.map +1 -1
  80. package/build/components/global-styles/typogrphy-elements.js +96 -0
  81. package/build/components/global-styles/typogrphy-elements.js.map +1 -0
  82. package/build/components/page-patterns/duplicate-menu-item.js +52 -16
  83. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  84. package/build/components/page-patterns/grid-item.js +46 -20
  85. package/build/components/page-patterns/grid-item.js.map +1 -1
  86. package/build/components/page-patterns/header.js +3 -7
  87. package/build/components/page-patterns/header.js.map +1 -1
  88. package/build/components/page-patterns/index.js +3 -3
  89. package/build/components/page-patterns/index.js.map +1 -1
  90. package/build/components/page-patterns/patterns-list.js +7 -7
  91. package/build/components/page-patterns/patterns-list.js.map +1 -1
  92. package/build/components/page-patterns/rename-menu-item.js +6 -5
  93. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  94. package/build/components/page-patterns/search-items.js +8 -2
  95. package/build/components/page-patterns/search-items.js.map +1 -1
  96. package/build/components/page-patterns/use-patterns.js +53 -27
  97. package/build/components/page-patterns/use-patterns.js.map +1 -1
  98. package/build/components/page-patterns/utils.js +1 -20
  99. package/build/components/page-patterns/utils.js.map +1 -1
  100. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +33 -24
  101. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  102. package/build/components/sidebar-edit-mode/page-panels/hooks.js +64 -0
  103. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  104. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -4
  105. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  106. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  107. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  108. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +56 -0
  109. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  110. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +91 -0
  111. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  112. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -9
  113. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  114. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +6 -4
  115. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  116. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +211 -0
  117. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  118. package/build/components/sidebar-navigation-screen/index.js +6 -4
  119. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-details-footer/index.js +32 -4
  121. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  123. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  124. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -31
  125. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  126. package/build/components/sidebar-navigation-screen-page/index.js +3 -3
  127. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  128. package/build/components/sidebar-navigation-screen-pattern/index.js +18 -8
  129. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +34 -5
  131. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-patterns/index.js +7 -35
  133. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +38 -4
  135. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  137. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-template/index.js +2 -2
  139. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-templates/index.js +1 -1
  141. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  142. package/build/components/template-actions/index.js +7 -4
  143. package/build/components/template-actions/index.js.map +1 -1
  144. package/build/components/template-actions/rename-menu-item.js +3 -2
  145. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  146. package/build/components/welcome-guide/styles.js +2 -2
  147. package/build/components/welcome-guide/styles.js.map +1 -1
  148. package/build/hooks/push-changes-to-global-styles/index.js +5 -37
  149. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  150. package/build/store/actions.js +29 -6
  151. package/build/store/actions.js.map +1 -1
  152. package/build/utils/constants.js +45 -2
  153. package/build/utils/constants.js.map +1 -1
  154. package/build/utils/is-template-removable.js +6 -1
  155. package/build/utils/is-template-removable.js.map +1 -1
  156. package/build/utils/is-template-revertable.js +6 -1
  157. package/build/utils/is-template-revertable.js.map +1 -1
  158. package/build-module/components/add-new-pattern/index.js +66 -5
  159. package/build-module/components/add-new-pattern/index.js.map +1 -1
  160. package/build-module/components/add-new-template/index.js +3 -2
  161. package/build-module/components/add-new-template/index.js.map +1 -1
  162. package/build-module/components/add-new-template/new-template.js +6 -1
  163. package/build-module/components/add-new-template/new-template.js.map +1 -1
  164. package/build-module/components/add-new-template/utils.js +6 -1
  165. package/build-module/components/add-new-template/utils.js.map +1 -1
  166. package/build-module/components/app/index.js +2 -7
  167. package/build-module/components/app/index.js.map +1 -1
  168. package/build-module/components/block-editor/back-button.js +3 -2
  169. package/build-module/components/block-editor/back-button.js.map +1 -1
  170. package/build-module/components/block-editor/editor-canvas.js +21 -17
  171. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  172. package/build-module/components/block-editor/site-editor-canvas.js +3 -5
  173. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  174. package/build-module/components/block-editor/use-site-editor-settings.js +8 -4
  175. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  176. package/build-module/components/canvas-loader/index.js +18 -1
  177. package/build-module/components/canvas-loader/index.js.map +1 -1
  178. package/build-module/components/editor/index.js +3 -8
  179. package/build-module/components/editor/index.js.map +1 -1
  180. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  181. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  182. package/build-module/components/global-styles/font-families.js +58 -0
  183. package/build-module/components/global-styles/font-families.js.map +1 -0
  184. package/build-module/components/global-styles/font-family-item.js +40 -0
  185. package/build-module/components/global-styles/font-family-item.js.map +1 -0
  186. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +23 -0
  187. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  188. package/build-module/components/global-styles/font-library-modal/context.js +276 -0
  189. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -0
  190. package/build-module/components/global-styles/font-library-modal/font-card.js +49 -0
  191. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -0
  192. package/build-module/components/global-styles/font-library-modal/font-demo.js +62 -0
  193. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  194. package/build-module/components/global-styles/font-library-modal/font-variant.js +42 -0
  195. package/build-module/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  196. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +47 -0
  197. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  198. package/build-module/components/global-styles/font-library-modal/index.js +38 -0
  199. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -0
  200. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +120 -0
  201. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  202. package/build-module/components/global-styles/font-library-modal/library-font-card.js +36 -0
  203. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  204. package/build-module/components/global-styles/font-library-modal/library-font-details.js +34 -0
  205. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  206. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +50 -0
  207. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  208. package/build-module/components/global-styles/font-library-modal/local-fonts.js +135 -0
  209. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  210. package/build-module/components/global-styles/font-library-modal/resolvers.js +28 -0
  211. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  212. package/build-module/components/global-styles/font-library-modal/tab-layout.js +37 -0
  213. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  214. package/build-module/components/global-styles/font-library-modal/utils/constants.js +26 -0
  215. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  216. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +52 -0
  217. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  218. package/build-module/components/global-styles/font-library-modal/utils/index.js +190 -0
  219. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  220. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +16 -0
  221. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  222. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +86 -0
  223. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  224. package/build-module/components/global-styles/global-styles-provider.js +7 -12
  225. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  226. package/build-module/components/global-styles/screen-block.js +34 -21
  227. package/build-module/components/global-styles/screen-block.js.map +1 -1
  228. package/build-module/components/global-styles/screen-revisions/index.js +1 -3
  229. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  230. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  231. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  232. package/build-module/components/global-styles/screen-typography.js +6 -74
  233. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  234. package/build-module/components/global-styles/style-variations-container.js +3 -5
  235. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  236. package/build-module/components/global-styles/typogrphy-elements.js +87 -0
  237. package/build-module/components/global-styles/typogrphy-elements.js.map +1 -0
  238. package/build-module/components/page-patterns/duplicate-menu-item.js +51 -16
  239. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  240. package/build-module/components/page-patterns/grid-item.js +47 -21
  241. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  242. package/build-module/components/page-patterns/header.js +3 -7
  243. package/build-module/components/page-patterns/header.js.map +1 -1
  244. package/build-module/components/page-patterns/index.js +3 -3
  245. package/build-module/components/page-patterns/index.js.map +1 -1
  246. package/build-module/components/page-patterns/patterns-list.js +7 -7
  247. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  248. package/build-module/components/page-patterns/rename-menu-item.js +6 -5
  249. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
  250. package/build-module/components/page-patterns/search-items.js +8 -2
  251. package/build-module/components/page-patterns/search-items.js.map +1 -1
  252. package/build-module/components/page-patterns/use-patterns.js +54 -28
  253. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  254. package/build-module/components/page-patterns/utils.js +0 -11
  255. package/build-module/components/page-patterns/utils.js.map +1 -1
  256. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +34 -27
  257. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  258. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +54 -0
  259. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  260. package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -4
  261. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  262. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  263. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  264. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +49 -0
  265. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  266. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +85 -0
  267. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  268. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -10
  269. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  270. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +8 -6
  271. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  272. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +202 -0
  273. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  274. package/build-module/components/sidebar-navigation-screen/index.js +6 -4
  275. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  276. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +32 -5
  277. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  278. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  279. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  280. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -33
  281. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  282. package/build-module/components/sidebar-navigation-screen-page/index.js +3 -3
  283. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  284. package/build-module/components/sidebar-navigation-screen-pattern/index.js +19 -9
  285. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  286. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +34 -5
  287. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  288. package/build-module/components/sidebar-navigation-screen-patterns/index.js +10 -38
  289. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  290. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +38 -4
  291. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -2
  293. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-template/index.js +2 -2
  295. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -1
  297. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  298. package/build-module/components/template-actions/index.js +7 -4
  299. package/build-module/components/template-actions/index.js.map +1 -1
  300. package/build-module/components/template-actions/rename-menu-item.js +3 -2
  301. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  302. package/build-module/components/welcome-guide/styles.js +2 -2
  303. package/build-module/components/welcome-guide/styles.js.map +1 -1
  304. package/build-module/hooks/push-changes-to-global-styles/index.js +5 -37
  305. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  306. package/build-module/store/actions.js +30 -7
  307. package/build-module/store/actions.js.map +1 -1
  308. package/build-module/utils/constants.js +35 -1
  309. package/build-module/utils/constants.js.map +1 -1
  310. package/build-module/utils/is-template-removable.js +6 -1
  311. package/build-module/utils/is-template-removable.js.map +1 -1
  312. package/build-module/utils/is-template-revertable.js +6 -1
  313. package/build-module/utils/is-template-revertable.js.map +1 -1
  314. package/build-style/style-rtl.css +244 -37
  315. package/build-style/style.css +244 -37
  316. package/lib/inflate.js +4082 -0
  317. package/lib/lib-font.browser.js +3831 -0
  318. package/lib/unbrotli.js +2679 -0
  319. package/package.json +40 -40
  320. package/src/components/add-new-pattern/index.js +83 -5
  321. package/src/components/add-new-template/index.js +3 -2
  322. package/src/components/add-new-template/new-template.js +6 -1
  323. package/src/components/add-new-template/utils.js +12 -3
  324. package/src/components/app/index.js +9 -12
  325. package/src/components/block-editor/back-button.js +6 -2
  326. package/src/components/block-editor/editor-canvas.js +31 -19
  327. package/src/components/block-editor/site-editor-canvas.js +2 -10
  328. package/src/components/block-editor/style.scss +88 -1
  329. package/src/components/block-editor/use-site-editor-settings.js +26 -19
  330. package/src/components/canvas-loader/index.js +12 -1
  331. package/src/components/canvas-loader/style.scss +1 -1
  332. package/src/components/editor/index.js +3 -8
  333. package/src/components/global-styles/dimensions-panel.js +8 -4
  334. package/src/components/global-styles/font-families.js +71 -0
  335. package/src/components/global-styles/font-family-item.js +44 -0
  336. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +33 -0
  337. package/src/components/global-styles/font-library-modal/context.js +347 -0
  338. package/src/components/global-styles/font-library-modal/font-card.js +70 -0
  339. package/src/components/global-styles/font-library-modal/font-demo.js +57 -0
  340. package/src/components/global-styles/font-library-modal/font-variant.js +53 -0
  341. package/src/components/global-styles/font-library-modal/fonts-grid.js +55 -0
  342. package/src/components/global-styles/font-library-modal/index.js +42 -0
  343. package/src/components/global-styles/font-library-modal/installed-fonts.js +174 -0
  344. package/src/components/global-styles/font-library-modal/library-font-card.js +40 -0
  345. package/src/components/global-styles/font-library-modal/library-font-details.js +46 -0
  346. package/src/components/global-styles/font-library-modal/library-font-variant.js +54 -0
  347. package/src/components/global-styles/font-library-modal/local-fonts.js +160 -0
  348. package/src/components/global-styles/font-library-modal/resolvers.js +29 -0
  349. package/src/components/global-styles/font-library-modal/style.scss +113 -0
  350. package/src/components/global-styles/font-library-modal/tab-layout.js +50 -0
  351. package/src/components/global-styles/font-library-modal/utils/constants.js +31 -0
  352. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  353. package/src/components/global-styles/font-library-modal/utils/index.js +213 -0
  354. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +15 -0
  355. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +53 -0
  356. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +30 -0
  357. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +240 -0
  358. package/src/components/global-styles/font-library-modal/utils/test/getPreviewStyle.spec.js +121 -0
  359. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +31 -0
  360. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +57 -0
  361. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +62 -0
  362. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +56 -0
  363. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +108 -0
  364. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +41 -0
  365. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +141 -0
  366. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +90 -0
  367. package/src/components/global-styles/global-styles-provider.js +2 -7
  368. package/src/components/global-styles/screen-block.js +42 -20
  369. package/src/components/global-styles/screen-revisions/index.js +0 -2
  370. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  371. package/src/components/global-styles/screen-typography.js +7 -95
  372. package/src/components/global-styles/style-variations-container.js +0 -2
  373. package/src/components/global-styles/typogrphy-elements.js +110 -0
  374. package/src/components/list/style.scss +2 -0
  375. package/src/components/page-patterns/duplicate-menu-item.js +63 -20
  376. package/src/components/page-patterns/grid-item.js +77 -30
  377. package/src/components/page-patterns/header.js +3 -12
  378. package/src/components/page-patterns/index.js +3 -3
  379. package/src/components/page-patterns/patterns-list.js +7 -7
  380. package/src/components/page-patterns/rename-menu-item.js +18 -7
  381. package/src/components/page-patterns/search-items.js +14 -2
  382. package/src/components/page-patterns/style.scss +1 -5
  383. package/src/components/page-patterns/use-patterns.js +67 -33
  384. package/src/components/page-patterns/utils.js +0 -19
  385. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +47 -33
  386. package/src/components/sidebar-edit-mode/page-panels/hooks.js +83 -0
  387. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -4
  388. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  389. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +44 -0
  390. package/src/components/sidebar-edit-mode/page-panels/style.scss +41 -10
  391. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +82 -0
  392. package/src/components/sidebar-edit-mode/template-panel/index.js +28 -24
  393. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +19 -15
  394. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +270 -0
  395. package/src/components/sidebar-navigation-screen/index.js +4 -9
  396. package/src/components/sidebar-navigation-screen/style.scss +7 -1
  397. package/src/components/sidebar-navigation-screen-details-footer/index.js +38 -10
  398. package/src/components/sidebar-navigation-screen-details-footer/style.scss +10 -3
  399. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -0
  400. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -44
  401. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  402. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  403. package/src/components/sidebar-navigation-screen-pattern/index.js +20 -7
  404. package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -3
  405. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +46 -13
  406. package/src/components/sidebar-navigation-screen-patterns/index.js +14 -49
  407. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +48 -6
  408. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -5
  409. package/src/components/sidebar-navigation-screen-template/index.js +2 -4
  410. package/src/components/sidebar-navigation-screen-templates/index.js +1 -1
  411. package/src/components/template-actions/index.js +14 -8
  412. package/src/components/template-actions/rename-menu-item.js +15 -4
  413. package/src/components/welcome-guide/styles.js +2 -2
  414. package/src/hooks/push-changes-to-global-styles/index.js +6 -49
  415. package/src/store/actions.js +39 -13
  416. package/src/store/test/actions.js +0 -1
  417. package/src/store/test/reducer.js +0 -1
  418. package/src/style.scss +1 -1
  419. package/src/utils/constants.js +38 -3
  420. package/src/utils/is-template-removable.js +8 -1
  421. package/src/utils/is-template-revertable.js +8 -1
  422. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -30
  423. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  424. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -23
  425. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  426. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -12
  427. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -24
@@ -1 +1 @@
1
- {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","getPathAndQueryString","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","path","entity","link","__experimentalGetTemplateForLink","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs, getPathAndQueryString } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_template_part',\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_navigation',\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! page.path && page.context?.postId ) {\n\t\t\tconst entity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context.postType || 'post',\n\t\t\t\t\tpage.context.postId\n\t\t\t\t);\n\t\t\t// If the entity is undefined for some reason, path will resolve to \"/\"\n\t\t\tpage.path = getPathAndQueryString( entity?.link );\n\t\t}\n\n\t\tconst template = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.__experimentalGetTemplateForLink( page.path );\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core/edit-site', 'fixedToolbar', false );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/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E,MAAM;MACrBlG,QAAQ,CACNG,QAAQ,CAAEV,gBAAiB,CAAC,CAC5BqG,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,KAAM,CAAC;MAChD3F,QAAQ,CAACuD,mBAAmB,CAAE,KAAM,CAAC;MACrCvD,QAAQ,CAAC2D,mBAAmB,CAAE,KAAM,CAAC;MACrC3D,QAAQ,CAACuF,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACA1F,QAAQ,CAACkG,KAAK,CAAE,MAAM;IACrBlG,QAAQ,CACNG,QAAQ,CAAEV,gBAAiB,CAAC,CAC5BqG,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAE9B,iBACH,CAAC;IACFhE,QAAQ,CACNG,QAAQ,CAAEf,YAAa,CAAC,CACxB+G,gBAAgB,CAChBnC,iBAAiB,GACd/E,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCgC,EAAE,EAAE,6CAA6C;MACjDV,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","getDefaultTemplate","path","__experimentalGetTemplateForLink","editedEntity","getEditedEntityRecord","currentTemplateSlug","currentTemplate","getEntityRecords","per_page","find","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_template_part',\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_navigation',\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tlet template;\n\t\tconst getDefaultTemplate = async ( slug ) =>\n\t\t\tapiFetch( {\n\t\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', {\n\t\t\t\t\tslug: `page-${ slug }`,\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\tif ( page.path ) {\n\t\t\ttemplate = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.__experimentalGetTemplateForLink( page.path );\n\t\t} else {\n\t\t\tconst editedEntity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context?.postType || 'post',\n\t\t\t\t\tpage.context?.postId\n\t\t\t\t);\n\t\t\tconst currentTemplateSlug = editedEntity?.template;\n\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\tconst currentTemplate = (\n\t\t\t\t\tawait registry\n\t\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t\t.getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t} )\n\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\ttemplate = currentTemplate;\n\t\t\t\t} else {\n\t\t\t\t\t// If a page has a `template` set and is not included in the list\n\t\t\t\t\t// of the current theme's templates, query for current theme's default template.\n\t\t\t\t\ttemplate = await getDefaultTemplate( editedEntity?.slug );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Page's `template` is empty, that indicates we need to use the default template for the page.\n\t\t\t\ttemplate = await getDefaultTemplate( editedEntity?.slug );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core/edit-site', 'fixedToolbar', false );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;;AAElE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChCjB,UAAU,CAAE,yDAAyD,EAAE;MACtEkB,KAAK,EAAE,KAAK;MACZC,WAAW,EAC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AAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACA/F,QAAQ,CAACuG,KAAK,CAAE,MAAM;IACrBvG,QAAQ,CACNG,QAAQ,CAAEV,gBAAiB,CAAC,CAC5B0G,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAE7B,iBACH,CAAC;IACFtE,QAAQ,CACNG,QAAQ,CAAEf,YAAa,CAAC,CACxBoH,gBAAgB,CAChBlC,iBAAiB,GACdrF,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCgC,EAAE,EAAE,6CAA6C;MACjDV,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
@@ -1,2 +1,36 @@
1
- export const FOCUSABLE_ENTITIES = ['wp_template_part', 'wp_navigation', 'wp_block'];
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { privateApis as patternPrivateApis } from '@wordpress/patterns';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { unlock } from '../lock-unlock';
11
+
12
+ // Navigation
13
+ export const NAVIGATION_POST_TYPE = 'wp_navigation';
14
+
15
+ // Templates.
16
+ export const TEMPLATE_POST_TYPE = 'wp_template';
17
+ export const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
18
+ export const TEMPLATE_CUSTOM_SOURCE = 'custom';
19
+
20
+ // Patterns.
21
+ export const {
22
+ PATTERN_TYPES,
23
+ PATTERN_DEFAULT_CATEGORY,
24
+ PATTERN_CORE_SOURCES,
25
+ PATTERN_SYNC_TYPES
26
+ } = unlock(patternPrivateApis);
27
+
28
+ // Entities that are editable in focus mode.
29
+ export const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
30
+ export const POST_TYPE_LABELS = {
31
+ [TEMPLATE_POST_TYPE]: __('Template'),
32
+ [TEMPLATE_PART_POST_TYPE]: __('Template Part'),
33
+ [PATTERN_TYPES.user]: __('Pattern'),
34
+ [NAVIGATION_POST_TYPE]: __('Navigation')
35
+ };
2
36
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FOCUSABLE_ENTITIES"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["export const FOCUSABLE_ENTITIES = [\n\t'wp_template_part',\n\t'wp_navigation',\n\t'wp_block',\n];\n"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,CACjC,kBAAkB,EAClB,eAAe,EACf,UAAU,CACV"}
1
+ {"version":3,"names":["__","privateApis","patternPrivateApis","unlock","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_CUSTOM_SOURCE","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_CORE_SOURCES","PATTERN_SYNC_TYPES","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_CUSTOM_SOURCE = 'custom';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_CORE_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template Part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,kBAAkB,QAAQ,qBAAqB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA,OAAO,MAAMC,oBAAoB,GAAG,eAAe;;AAEnD;AACA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,sBAAsB,GAAG,QAAQ;;AAE9C;AACA,OAAO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,oBAAoB;EACpBC;AACD,CAAC,GAAGR,MAAM,CAAED,kBAAmB,CAAC;;AAEhC;AACA,OAAO,MAAMU,kBAAkB,GAAG,CACjCN,uBAAuB,EACvBF,oBAAoB,EACpBI,aAAa,CAACK,IAAI,CAClB;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC/B,CAAET,kBAAkB,GAAIL,EAAE,CAAE,UAAW,CAAC;EACxC,CAAEM,uBAAuB,GAAIN,EAAE,CAAE,eAAgB,CAAC;EAClD,CAAEQ,aAAa,CAACK,IAAI,GAAIb,EAAE,CAAE,SAAU,CAAC;EACvC,CAAEI,oBAAoB,GAAIJ,EAAE,CAAE,YAAa;AAC5C,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { TEMPLATE_CUSTOM_SOURCE } from './constants';
5
+
1
6
  /**
2
7
  * Check if a template is removable.
3
8
  *
@@ -8,6 +13,6 @@ export default function isTemplateRemovable(template) {
8
13
  if (!template) {
9
14
  return false;
10
15
  }
11
- return template.source === 'custom' && !template.has_theme_file;
16
+ return template.source === TEMPLATE_CUSTOM_SOURCE && !template.has_theme_file;
12
17
  }
13
18
  //# sourceMappingURL=is-template-removable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTemplateRemovable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Check if a template is removable.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRemovable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\n\treturn template.source === 'custom' && ! template.has_theme_file;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OAAOA,QAAQ,CAACC,MAAM,KAAK,QAAQ,IAAI,CAAED,QAAQ,CAACE,cAAc;AACjE"}
1
+ {"version":3,"names":["TEMPLATE_CUSTOM_SOURCE","isTemplateRemovable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_CUSTOM_SOURCE } from './constants';\n\n/**\n * Check if a template is removable.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRemovable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\ttemplate.source === TEMPLATE_CUSTOM_SOURCE && ! template.has_theme_file\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,aAAa;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OACCA,QAAQ,CAACC,MAAM,KAAKH,sBAAsB,IAAI,CAAEE,QAAQ,CAACE,cAAc;AAEzE"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { TEMPLATE_CUSTOM_SOURCE } from './constants';
5
+
1
6
  /**
2
7
  * Check if a template is revertable to its original theme-provided template file.
3
8
  *
@@ -9,7 +14,7 @@ export default function isTemplateRevertable(template) {
9
14
  return false;
10
15
  }
11
16
  /* eslint-disable camelcase */
12
- return template?.source === 'custom' && template?.has_theme_file;
17
+ return template?.source === TEMPLATE_CUSTOM_SOURCE && template?.has_theme_file;
13
18
  /* eslint-enable camelcase */
14
19
  }
15
20
  //# sourceMappingURL=is-template-revertable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTemplateRevertable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn template?.source === 'custom' && template?.has_theme_file;\n\t/* eslint-enable camelcase */\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OAAOA,QAAQ,EAAEC,MAAM,KAAK,QAAQ,IAAID,QAAQ,EAAEE,cAAc;EAChE;AACD"}
1
+ {"version":3,"names":["TEMPLATE_CUSTOM_SOURCE","isTemplateRevertable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_CUSTOM_SOURCE } from './constants';\n\n/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn (\n\t\ttemplate?.source === TEMPLATE_CUSTOM_SOURCE && template?.has_theme_file\n\t);\n\t/* eslint-enable camelcase */\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,aAAa;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OACCA,QAAQ,EAAEC,MAAM,KAAKH,sBAAsB,IAAIE,QAAQ,EAAEE,cAAc;EAExE;AACD"}
@@ -475,7 +475,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
475
475
  display: none;
476
476
  margin: 0;
477
477
  }
478
- .interface-pinned-items .components-button:nth-last-child(1), .interface-pinned-items .components-button:nth-last-child(2) {
478
+ .interface-pinned-items .components-button[aria-controls="edit-post:document"], .interface-pinned-items .components-button[aria-controls="edit-post:block"], .interface-pinned-items .components-button[aria-controls="edit-site:template"], .interface-pinned-items .components-button[aria-controls="edit-site:block-inspector"], .interface-pinned-items .components-button[aria-controls="edit-site:global-styles"] {
479
479
  display: flex;
480
480
  }
481
481
  .interface-pinned-items .components-button svg {
@@ -787,6 +787,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
787
787
  display: block;
788
788
  width: 100%;
789
789
  height: 100%;
790
+ background: #fff;
790
791
  }
791
792
  .edit-site-visual-editor .edit-site-visual-editor__editor-canvas {
792
793
  height: 100%;
@@ -819,7 +820,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
819
820
  See: https://github.com/WordPress/gutenberg/issues/40450
820
821
  */
821
822
  }
822
- .edit-site-visual-editor.is-view-mode .block-editor-block-contextual-toolbar {
823
+ .edit-site-visual-editor.is-view-mode .block-editor-block-contextual-toolbar.is-fixed {
823
824
  display: none;
824
825
  }
825
826
 
@@ -908,6 +909,98 @@ body.is-fullscreen-mode .interface-interface-skeleton {
908
909
  box-shadow: inset 0 0 0 2px var(--wp-admin-theme-color);
909
910
  }
910
911
 
912
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
913
+ /* Set left position when auto-fold is not on the body element. */
914
+ right: 0;
915
+ }
916
+ @media (min-width: 783px) {
917
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
918
+ right: 160px;
919
+ }
920
+ }
921
+
922
+ .auto-fold .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
923
+ /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
924
+ }
925
+ @media (min-width: 783px) {
926
+ .auto-fold .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
927
+ right: 36px;
928
+ }
929
+ }
930
+ @media (min-width: 961px) {
931
+ .auto-fold .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
932
+ right: 160px;
933
+ }
934
+ }
935
+
936
+ /* Sidebar manually collapsed. */
937
+ .folded .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
938
+ right: 0;
939
+ }
940
+ @media (min-width: 783px) {
941
+ .folded .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
942
+ right: 36px;
943
+ }
944
+ }
945
+
946
+ body.is-fullscreen-mode .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
947
+ right: 0 !important;
948
+ }
949
+
950
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
951
+ position: sticky;
952
+ top: 0;
953
+ z-index: 31;
954
+ display: block;
955
+ width: 100%;
956
+ }
957
+ @media (min-width: 782px) {
958
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
959
+ margin-right: 180px;
960
+ position: fixed;
961
+ top: 32px;
962
+ min-height: initial;
963
+ display: flex;
964
+ height: 60px;
965
+ align-items: center;
966
+ width: calc(100% - 180px);
967
+ }
968
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
969
+ width: initial;
970
+ }
971
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed:empty {
972
+ width: initial;
973
+ }
974
+ .is-fullscreen-mode .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
975
+ margin-right: 240px;
976
+ top: 0;
977
+ }
978
+ .is-fullscreen-mode .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
979
+ width: initial;
980
+ }
981
+ .is-fullscreen-mode .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed:empty {
982
+ width: initial;
983
+ }
984
+ .show-icon-labels .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
985
+ margin-right: 80px;
986
+ width: calc(100% + 40px - 180px);
987
+ }
988
+ .is-fullscreen-mode .show-icon-labels .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
989
+ margin-right: 144px;
990
+ }
991
+ }
992
+ @media (min-width: 960px) {
993
+ .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
994
+ width: auto;
995
+ }
996
+ .show-icon-labels .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
997
+ width: auto;
998
+ }
999
+ .is-fullscreen-mode .edit-site-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
1000
+ width: calc(100% - 280px - 256px);
1001
+ }
1002
+ }
1003
+
911
1004
  .edit-site-canvas-loader {
912
1005
  width: 100%;
913
1006
  height: 100%;
@@ -918,7 +1011,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
918
1011
  opacity: 0;
919
1012
  align-items: center;
920
1013
  justify-content: center;
921
- animation: 0.5s ease 1s edit-site-canvas-loader__fade-in-animation;
1014
+ animation: 0.5s ease 0.2s edit-site-canvas-loader__fade-in-animation;
922
1015
  animation-fill-mode: forwards;
923
1016
  }
924
1017
  @media (prefers-reduced-motion: reduce) {
@@ -1728,6 +1821,9 @@ body.is-fullscreen-mode .edit-site-list-header {
1728
1821
  }
1729
1822
  }
1730
1823
 
1824
+ .edit-site-list__rename-modal {
1825
+ z-index: 1000001;
1826
+ }
1731
1827
  @media (min-width: 782px) {
1732
1828
  .edit-site-list__rename-modal .components-base-control {
1733
1829
  width: 320px;
@@ -2020,9 +2116,6 @@ body.is-fullscreen-mode .edit-site-list-header {
2020
2116
  fill: #fff;
2021
2117
  }
2022
2118
  .edit-site-patterns__pattern-title .edit-site-patterns__pattern-lock-icon {
2023
- display: inline-flex;
2024
- }
2025
- .edit-site-patterns__pattern-title .edit-site-patterns__pattern-lock-icon svg {
2026
2119
  fill: currentcolor;
2027
2120
  }
2028
2121
 
@@ -2167,15 +2260,34 @@ body.is-fullscreen-mode .edit-site-list-header {
2167
2260
  box-sizing: content-box;
2168
2261
  }
2169
2262
 
2170
- .edit-site-page-panels__edit-template-preview {
2171
- border: 1px solid #e0e0e0;
2172
- height: 200px;
2173
- max-height: 200px;
2174
- overflow: hidden;
2263
+ .edit-site-swap-template-modal {
2264
+ z-index: 1000001;
2175
2265
  }
2176
2266
 
2177
- .edit-site-page-panels__edit-template-button {
2178
- justify-content: center;
2267
+ .edit-site-page-panels__swap-template__confirm-modal__actions {
2268
+ margin-top: 24px;
2269
+ }
2270
+
2271
+ .edit-site-page-panels__swap-template__modal-content .block-editor-block-patterns-list {
2272
+ column-count: 2;
2273
+ column-gap: 24px;
2274
+ padding-top: 2px;
2275
+ }
2276
+ @media (min-width: 782px) {
2277
+ .edit-site-page-panels__swap-template__modal-content .block-editor-block-patterns-list {
2278
+ column-count: 3;
2279
+ }
2280
+ }
2281
+ @media (min-width: 1280px) {
2282
+ .edit-site-page-panels__swap-template__modal-content .block-editor-block-patterns-list {
2283
+ column-count: 4;
2284
+ }
2285
+ }
2286
+ .edit-site-page-panels__swap-template__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
2287
+ break-inside: avoid-column;
2288
+ }
2289
+ .edit-site-page-panels__swap-template__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__item:not(:focus):not(:hover) .block-editor-block-preview__container {
2290
+ box-shadow: 0 0 0 1px #ddd;
2179
2291
  }
2180
2292
 
2181
2293
  .edit-site-change-status__content .components-popover__content {
@@ -2195,10 +2307,15 @@ body.is-fullscreen-mode .edit-site-list-header {
2195
2307
  }
2196
2308
 
2197
2309
  .edit-site-summary-field .components-dropdown {
2198
- flex-grow: 1;
2310
+ width: 70%;
2199
2311
  }
2200
2312
  .edit-site-summary-field .edit-site-summary-field__trigger {
2201
- width: 100%;
2313
+ max-width: 100%;
2314
+ display: block;
2315
+ text-align: right;
2316
+ white-space: nowrap;
2317
+ overflow: hidden;
2318
+ text-overflow: ellipsis;
2202
2319
  }
2203
2320
  .edit-site-summary-field .edit-site-summary-field__label {
2204
2321
  width: 30%;
@@ -3187,10 +3304,13 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3187
3304
  .edit-site-sidebar__notice.is-dismissible {
3188
3305
  padding-left: 8px;
3189
3306
  }
3307
+ .edit-site-sidebar__notice .components-notice__dismiss:not(:disabled):not([aria-disabled=true]) {
3308
+ color: #ccc;
3309
+ }
3190
3310
  .edit-site-sidebar__notice .components-notice__dismiss:not(:disabled):not([aria-disabled=true]):focus,
3191
3311
  .edit-site-sidebar__notice .components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):active,
3192
3312
  .edit-site-sidebar__notice .components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover {
3193
- color: #f0f0f0;
3313
+ color: #fff;
3194
3314
  }
3195
3315
 
3196
3316
  /* In general style overrides are discouraged.
@@ -3211,6 +3331,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3211
3331
  .edit-site-sidebar-navigation-screen__input-control .components-input-control__input {
3212
3332
  color: #e0e0e0 !important;
3213
3333
  background: #2f2f2f !important;
3334
+ border-radius: 2px;
3214
3335
  }
3215
3336
  .edit-site-sidebar-navigation-screen__input-control .components-input-control__backdrop {
3216
3337
  border: 4px !important;
@@ -3219,20 +3340,14 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3219
3340
  color: #949494;
3220
3341
  }
3221
3342
 
3222
- .edit-site-sidebar-navigation-screen-details-footer {
3223
- padding-top: 8px;
3224
- padding-bottom: 8px;
3225
- padding-right: 16px;
3226
- }
3227
-
3228
- .edit-site-sidebar-navigation-screen-global-styles__revisions {
3229
- border-radius: 2px;
3230
- }
3231
- .edit-site-sidebar-navigation-screen-global-styles__revisions:not(:hover) {
3232
- color: #e0e0e0;
3343
+ .edit-site-sidebar-navigation-screen-details-footer div.edit-site-sidebar-navigation-item.components-item:focus,
3344
+ .edit-site-sidebar-navigation-screen-details-footer div.edit-site-sidebar-navigation-item.components-item:hover,
3345
+ .edit-site-sidebar-navigation-screen-details-footer div.edit-site-sidebar-navigation-item.components-item[aria-current] {
3346
+ background: none;
3233
3347
  }
3234
- .edit-site-sidebar-navigation-screen-global-styles__revisions:not(:hover) .edit-site-sidebar-navigation-screen-global-styles__revisions__label {
3235
- color: #949494;
3348
+ .edit-site-sidebar-navigation-screen-details-footer .edit-site-sidebar-navigation-screen-details-footer__icon {
3349
+ margin-right: auto;
3350
+ fill: #949494;
3236
3351
  }
3237
3352
 
3238
3353
  .sidebar-navigation__more-menu .components-button {
@@ -3351,10 +3466,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3351
3466
  margin-left: 8px;
3352
3467
  }
3353
3468
 
3354
- .edit-site-sidebar-navigation-screen-pattern__lock-icon {
3355
- display: inline-flex;
3356
- }
3357
-
3358
3469
  .edit-site-sidebar-navigation-screen-patterns__group {
3359
3470
  margin-bottom: 24px;
3360
3471
  }
@@ -3559,10 +3670,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3559
3670
  color: #fff;
3560
3671
  }
3561
3672
 
3562
- .edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
3563
- display: none;
3564
- }
3565
-
3566
3673
  .edit-site-sidebar-navigation-screen-navigation-menus__loading.components-spinner {
3567
3674
  margin-right: auto;
3568
3675
  margin-left: auto;
@@ -3700,6 +3807,106 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
3700
3807
  width: 100%;
3701
3808
  }
3702
3809
 
3810
+ .font-library-modal .components-modal__header {
3811
+ border-bottom: none;
3812
+ }
3813
+ .font-library-modal .components-modal__content {
3814
+ padding-top: 0;
3815
+ }
3816
+ .font-library-modal .font-library-modal__subtitle {
3817
+ text-transform: uppercase;
3818
+ font-weight: 500;
3819
+ font-size: 11px;
3820
+ }
3821
+
3822
+ .font-library-modal__tab-layout main {
3823
+ padding-bottom: 4rem;
3824
+ }
3825
+ .font-library-modal__tab-layout footer {
3826
+ border-top: 1px solid #e5e5e5;
3827
+ margin: 0 -32px -32px;
3828
+ padding: 16px 32px;
3829
+ position: absolute;
3830
+ bottom: 32px;
3831
+ width: 100%;
3832
+ background-color: #fff;
3833
+ }
3834
+
3835
+ .font-library-modal__fonts-grid .font-library-modal__fonts-grid__main {
3836
+ display: flex;
3837
+ flex-direction: column;
3838
+ }
3839
+
3840
+ .font-library-modal__font-card {
3841
+ border: 1px solid #e5e5e5;
3842
+ height: auto;
3843
+ padding: 1rem;
3844
+ margin-top: -1px;
3845
+ /* To collapse the margin with the previous element */
3846
+ }
3847
+ .font-library-modal__font-card .font-library-modal__font-card__name {
3848
+ font-weight: bold;
3849
+ }
3850
+ .font-library-modal__font-card .font-library-modal__font-card__count {
3851
+ color: #6e6e6e;
3852
+ }
3853
+
3854
+ .font-library-modal__library-font-variant {
3855
+ border: 1px solid #e5e5e5;
3856
+ padding: 1rem;
3857
+ margin-top: -1px;
3858
+ /* To collapse the margin with the previous element */
3859
+ }
3860
+
3861
+ .font-library-modal__font-variant {
3862
+ border-bottom: 1px solid #e5e5e5;
3863
+ padding-bottom: 1rem;
3864
+ }
3865
+
3866
+ .font-library-modal__tab-panel [role=tablist] {
3867
+ position: sticky;
3868
+ top: 0;
3869
+ width: calc(100% + 64px);
3870
+ border-bottom: 1px solid #e6e6e6;
3871
+ background: #fff;
3872
+ margin: 0 -32px;
3873
+ padding: 0 16px;
3874
+ z-index: 1;
3875
+ }
3876
+
3877
+ .font-library-modal__upload-area {
3878
+ align-items: center;
3879
+ display: flex;
3880
+ justify-content: center;
3881
+ height: 100px;
3882
+ width: 100%;
3883
+ background-color: #f0f0f0;
3884
+ }
3885
+
3886
+ .font-library-modal__font-name {
3887
+ font-weight: bold;
3888
+ }
3889
+
3890
+ .font-library-modal__font-filename {
3891
+ color: #6e6e6e;
3892
+ }
3893
+
3894
+ .font-library-modal__font-variant_demo-wrapper {
3895
+ white-space: nowrap;
3896
+ overflow: hidden;
3897
+ width: 100%;
3898
+ position: relative;
3899
+ }
3900
+ .font-library-modal__font-variant_demo-wrapper::after {
3901
+ content: "";
3902
+ position: absolute;
3903
+ bottom: 0;
3904
+ left: 0;
3905
+ width: 30vw;
3906
+ height: 100%;
3907
+ background: linear-gradient(to left, rgba(255, 255, 255, 0), white);
3908
+ }
3909
+
3703
3910
  body.js #wpadminbar {
3704
3911
  display: none;
3705
3912
  }