@wordpress/edit-site 5.13.0 → 5.15.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 (646) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +2 -13
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +29 -15
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +69 -14
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/add-new-template/utils.js +10 -8
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/block-editor/constants.js +1 -1
  13. package/build/components/block-editor/constants.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +1 -1
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/index.js +0 -4
  17. package/build/components/block-editor/index.js.map +1 -1
  18. package/build/components/block-editor/inserter-media-categories.js +1 -22
  19. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +29 -32
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-site-editor-settings.js +90 -19
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-spinner/index.js +1 -18
  25. package/build/components/canvas-spinner/index.js.map +1 -1
  26. package/build/components/code-editor/index.js +60 -28
  27. package/build/components/code-editor/index.js.map +1 -1
  28. package/build/components/create-pattern-modal/index.js +15 -11
  29. package/build/components/create-pattern-modal/index.js.map +1 -1
  30. package/build/components/create-template-part-modal/index.js +1 -1
  31. package/build/components/create-template-part-modal/index.js.map +1 -1
  32. package/build/components/editor/index.js +11 -1
  33. package/build/components/editor/index.js.map +1 -1
  34. package/build/components/global-styles/palette.js +1 -1
  35. package/build/components/global-styles/palette.js.map +1 -1
  36. package/build/components/global-styles/ui.js +7 -2
  37. package/build/components/global-styles/ui.js.map +1 -1
  38. package/build/components/header-edit-mode/document-actions/index.js +9 -1
  39. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  40. package/build/components/header-edit-mode/index.js +49 -14
  41. package/build/components/header-edit-mode/index.js.map +1 -1
  42. package/build/components/header-edit-mode/more-menu/index.js +47 -17
  43. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  44. package/build/components/keyboard-shortcut-help-modal/index.js +17 -4
  45. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  46. package/build/components/keyboard-shortcuts/edit-mode.js +32 -1
  47. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  48. package/build/components/keyboard-shortcuts/register.js +9 -0
  49. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  50. package/build/components/layout/index.js +110 -28
  51. package/build/components/layout/index.js.map +1 -1
  52. package/build/components/page/header.js +1 -1
  53. package/build/components/page/header.js.map +1 -1
  54. package/build/components/page/index.js +3 -1
  55. package/build/components/page/index.js.map +1 -1
  56. package/build/components/page-actions/index.js +2 -2
  57. package/build/components/page-actions/index.js.map +1 -1
  58. package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -15
  59. package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
  60. package/build/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  61. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  62. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
  63. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  64. package/build/components/page-main/index.js +8 -4
  65. package/build/components/page-main/index.js.map +1 -1
  66. package/build/components/page-patterns/duplicate-menu-item.js +163 -0
  67. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -0
  68. package/build/components/page-patterns/grid-item.js +218 -0
  69. package/build/components/page-patterns/grid-item.js.map +1 -0
  70. package/build/components/{page-library → page-patterns}/grid.js +6 -19
  71. package/build/components/page-patterns/grid.js.map +1 -0
  72. package/build/components/page-patterns/header.js +69 -0
  73. package/build/components/page-patterns/header.js.map +1 -0
  74. package/build/components/{page-library → page-patterns}/index.js +9 -7
  75. package/build/components/page-patterns/index.js.map +1 -0
  76. package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
  77. package/build/components/page-patterns/no-patterns.js.map +1 -0
  78. package/build/components/page-patterns/pagination.js +63 -0
  79. package/build/components/page-patterns/pagination.js.map +1 -0
  80. package/build/components/page-patterns/patterns-list.js +175 -0
  81. package/build/components/page-patterns/patterns-list.js.map +1 -0
  82. package/build/components/page-patterns/rename-menu-item.js +109 -0
  83. package/build/components/page-patterns/rename-menu-item.js.map +1 -0
  84. package/build/components/page-patterns/search-items.js.map +1 -0
  85. package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
  86. package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
  87. package/build/components/page-patterns/use-patterns.js +185 -0
  88. package/build/components/page-patterns/use-patterns.js.map +1 -0
  89. package/build/components/{page-library → page-patterns}/utils.js +3 -3
  90. package/build/components/page-patterns/utils.js.map +1 -0
  91. package/build/components/page-template-parts/add-new-template-part.js +74 -0
  92. package/build/components/page-template-parts/add-new-template-part.js.map +1 -0
  93. package/build/components/page-template-parts/index.js +82 -0
  94. package/build/components/page-template-parts/index.js.map +1 -0
  95. package/build/components/page-templates/index.js +1 -0
  96. package/build/components/page-templates/index.js.map +1 -1
  97. package/build/components/preferences-modal/enable-feature.js +5 -1
  98. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  99. package/build/components/preferences-modal/index.js +43 -4
  100. package/build/components/preferences-modal/index.js.map +1 -1
  101. package/build/components/resizable-frame/index.js +78 -36
  102. package/build/components/resizable-frame/index.js.map +1 -1
  103. package/build/components/save-panel/index.js +5 -5
  104. package/build/components/save-panel/index.js.map +1 -1
  105. package/build/components/sidebar/index.js +6 -6
  106. package/build/components/sidebar/index.js.map +1 -1
  107. package/build/components/sidebar-edit-mode/index.js +4 -2
  108. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  109. package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
  110. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  111. package/build/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  112. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  113. package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
  114. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  115. package/build/components/sidebar-navigation-screen/index.js +21 -11
  116. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-global-styles/index.js +69 -5
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  119. package/build/components/sidebar-navigation-screen-main/index.js +5 -3
  120. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  121. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
  122. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  123. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
  124. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  125. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
  126. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  127. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -10
  128. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  129. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  130. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  131. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +10 -1
  132. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +9 -3
  134. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  135. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +9 -4
  136. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +29 -0
  138. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  139. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  140. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -4
  142. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  143. package/build/components/sidebar-navigation-screen-page/index.js +2 -3
  144. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
  146. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -35
  148. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-pages/index.js +33 -25
  150. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  151. package/build/components/sidebar-navigation-screen-pattern/index.js +20 -13
  152. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  153. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  154. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  155. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  156. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  157. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -3
  158. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  159. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +28 -2
  160. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  161. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  162. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  163. package/build/components/sidebar-navigation-screen-patterns/index.js +173 -0
  164. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  165. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  166. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +34 -0
  167. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  168. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -19
  169. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  170. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +52 -0
  171. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  172. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
  173. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  174. package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
  175. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  177. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  178. package/build/components/site-hub/index.js +25 -12
  179. package/build/components/site-hub/index.js.map +1 -1
  180. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -5
  181. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  182. package/build/components/sync-state-with-url/use-sync-path-with-url.js +16 -13
  183. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  184. package/build/components/template-actions/index.js +25 -7
  185. package/build/components/template-actions/index.js.map +1 -1
  186. package/build/components/template-actions/rename-menu-item.js +12 -8
  187. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  188. package/build/components/use-edited-entity-record/index.js +6 -1
  189. package/build/components/use-edited-entity-record/index.js.map +1 -1
  190. package/build/components/welcome-guide/editor.js +1 -1
  191. package/build/components/welcome-guide/editor.js.map +1 -1
  192. package/build/components/welcome-guide/index.js +5 -1
  193. package/build/components/welcome-guide/index.js.map +1 -1
  194. package/build/components/welcome-guide/page.js +70 -0
  195. package/build/components/welcome-guide/page.js.map +1 -0
  196. package/build/components/welcome-guide/styles.js +1 -1
  197. package/build/components/welcome-guide/styles.js.map +1 -1
  198. package/build/components/welcome-guide/template.js +71 -0
  199. package/build/components/welcome-guide/template.js.map +1 -0
  200. package/build/hooks/commands/use-common-commands.js +115 -20
  201. package/build/hooks/commands/use-common-commands.js.map +1 -1
  202. package/build/hooks/commands/use-edit-mode-commands.js +195 -44
  203. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  204. package/build/hooks/push-changes-to-global-styles/index.js +56 -10
  205. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  206. package/build/index.js +9 -0
  207. package/build/index.js.map +1 -1
  208. package/build/store/actions.js +5 -2
  209. package/build/store/actions.js.map +1 -1
  210. package/build/store/private-actions.js +7 -1
  211. package/build/store/private-actions.js.map +1 -1
  212. package/build/store/selectors.js +2 -1
  213. package/build/store/selectors.js.map +1 -1
  214. package/build/utils/get-is-list-page.js +2 -2
  215. package/build/utils/get-is-list-page.js.map +1 -1
  216. package/build/utils/normalize-record-key.js +19 -0
  217. package/build/utils/normalize-record-key.js.map +1 -0
  218. package/build/utils/template-part-create.js +2 -2
  219. package/build/utils/template-part-create.js.map +1 -1
  220. package/build/utils/use-activate-theme.js +1 -1
  221. package/build/utils/use-activate-theme.js.map +1 -1
  222. package/build-module/components/add-new-page/index.js +2 -12
  223. package/build-module/components/add-new-page/index.js.map +1 -1
  224. package/build-module/components/add-new-pattern/index.js +28 -16
  225. package/build-module/components/add-new-pattern/index.js.map +1 -1
  226. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  227. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  228. package/build-module/components/add-new-template/new-template.js +72 -17
  229. package/build-module/components/add-new-template/new-template.js.map +1 -1
  230. package/build-module/components/add-new-template/utils.js +9 -6
  231. package/build-module/components/add-new-template/utils.js.map +1 -1
  232. package/build-module/components/block-editor/constants.js +1 -1
  233. package/build-module/components/block-editor/constants.js.map +1 -1
  234. package/build-module/components/block-editor/editor-canvas.js +1 -1
  235. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  236. package/build-module/components/block-editor/index.js +0 -4
  237. package/build-module/components/block-editor/index.js.map +1 -1
  238. package/build-module/components/block-editor/inserter-media-categories.js +1 -22
  239. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  240. package/build-module/components/block-editor/site-editor-canvas.js +29 -32
  241. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  242. package/build-module/components/block-editor/use-site-editor-settings.js +92 -20
  243. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  244. package/build-module/components/canvas-spinner/index.js +1 -15
  245. package/build-module/components/canvas-spinner/index.js.map +1 -1
  246. package/build-module/components/code-editor/index.js +62 -30
  247. package/build-module/components/code-editor/index.js.map +1 -1
  248. package/build-module/components/create-pattern-modal/index.js +14 -11
  249. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  250. package/build-module/components/create-template-part-modal/index.js +1 -1
  251. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  252. package/build-module/components/editor/index.js +11 -1
  253. package/build-module/components/editor/index.js.map +1 -1
  254. package/build-module/components/global-styles/palette.js +1 -1
  255. package/build-module/components/global-styles/palette.js.map +1 -1
  256. package/build-module/components/global-styles/ui.js +8 -3
  257. package/build-module/components/global-styles/ui.js.map +1 -1
  258. package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
  259. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  260. package/build-module/components/header-edit-mode/index.js +51 -16
  261. package/build-module/components/header-edit-mode/index.js.map +1 -1
  262. package/build-module/components/header-edit-mode/more-menu/index.js +44 -20
  263. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  264. package/build-module/components/keyboard-shortcut-help-modal/index.js +15 -6
  265. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  266. package/build-module/components/keyboard-shortcuts/edit-mode.js +29 -1
  267. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  268. package/build-module/components/keyboard-shortcuts/register.js +9 -0
  269. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  270. package/build-module/components/layout/index.js +110 -28
  271. package/build-module/components/layout/index.js.map +1 -1
  272. package/build-module/components/page/header.js +1 -1
  273. package/build-module/components/page/header.js.map +1 -1
  274. package/build-module/components/page/index.js +2 -1
  275. package/build-module/components/page/index.js.map +1 -1
  276. package/build-module/components/page-actions/index.js +2 -2
  277. package/build-module/components/page-actions/index.js.map +1 -1
  278. package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -16
  279. package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
  280. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  281. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  282. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
  283. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  284. package/build-module/components/page-main/index.js +6 -3
  285. package/build-module/components/page-main/index.js.map +1 -1
  286. package/build-module/components/page-patterns/duplicate-menu-item.js +147 -0
  287. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -0
  288. package/build-module/components/page-patterns/grid-item.js +195 -0
  289. package/build-module/components/page-patterns/grid-item.js.map +1 -0
  290. package/build-module/components/page-patterns/grid.js +26 -0
  291. package/build-module/components/page-patterns/grid.js.map +1 -0
  292. package/build-module/components/page-patterns/header.js +54 -0
  293. package/build-module/components/page-patterns/header.js.map +1 -0
  294. package/build-module/components/{page-library → page-patterns}/index.js +8 -6
  295. package/build-module/components/page-patterns/index.js.map +1 -0
  296. package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
  297. package/build-module/components/page-patterns/no-patterns.js.map +1 -0
  298. package/build-module/components/page-patterns/pagination.js +54 -0
  299. package/build-module/components/page-patterns/pagination.js.map +1 -0
  300. package/build-module/components/page-patterns/patterns-list.js +152 -0
  301. package/build-module/components/page-patterns/patterns-list.js.map +1 -0
  302. package/build-module/components/page-patterns/rename-menu-item.js +97 -0
  303. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -0
  304. package/build-module/components/page-patterns/search-items.js.map +1 -0
  305. package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
  306. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
  307. package/build-module/components/page-patterns/use-patterns.js +167 -0
  308. package/build-module/components/page-patterns/use-patterns.js.map +1 -0
  309. package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
  310. package/build-module/components/page-patterns/utils.js.map +1 -0
  311. package/build-module/components/page-template-parts/add-new-template-part.js +58 -0
  312. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -0
  313. package/build-module/components/page-template-parts/index.js +63 -0
  314. package/build-module/components/page-template-parts/index.js.map +1 -0
  315. package/build-module/components/page-templates/index.js +1 -0
  316. package/build-module/components/page-templates/index.js.map +1 -1
  317. package/build-module/components/preferences-modal/enable-feature.js +5 -1
  318. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  319. package/build-module/components/preferences-modal/index.js +38 -5
  320. package/build-module/components/preferences-modal/index.js.map +1 -1
  321. package/build-module/components/resizable-frame/index.js +79 -39
  322. package/build-module/components/resizable-frame/index.js.map +1 -1
  323. package/build-module/components/save-panel/index.js +5 -5
  324. package/build-module/components/save-panel/index.js.map +1 -1
  325. package/build-module/components/sidebar/index.js +5 -5
  326. package/build-module/components/sidebar/index.js.map +1 -1
  327. package/build-module/components/sidebar-edit-mode/index.js +4 -2
  328. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  329. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
  330. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  331. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  332. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  333. package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
  334. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  335. package/build-module/components/sidebar-navigation-screen/index.js +22 -12
  336. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  337. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +67 -5
  338. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  339. package/build-module/components/sidebar-navigation-screen-main/index.js +5 -4
  340. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  341. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
  342. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  343. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
  344. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  345. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
  346. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  347. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +9 -10
  348. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  349. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  350. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  351. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +11 -1
  352. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  353. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +8 -4
  354. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  355. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +9 -4
  356. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  357. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +20 -0
  358. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  359. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  360. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  361. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +26 -6
  362. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  363. package/build-module/components/sidebar-navigation-screen-page/index.js +2 -3
  364. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  365. package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
  366. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  367. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -33
  368. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  369. package/build-module/components/sidebar-navigation-screen-pages/index.js +34 -26
  370. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  371. package/build-module/components/sidebar-navigation-screen-pattern/index.js +18 -12
  372. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  373. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  374. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  375. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  376. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  377. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -3
  378. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  379. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +25 -2
  380. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  381. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  382. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  383. package/build-module/components/sidebar-navigation-screen-patterns/index.js +148 -0
  384. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  385. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  386. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
  387. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  388. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -17
  389. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  390. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +43 -0
  391. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  392. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
  393. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  394. package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
  395. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  396. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  397. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  398. package/build-module/components/site-hub/index.js +25 -12
  399. package/build-module/components/site-hub/index.js.map +1 -1
  400. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -5
  401. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  402. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +17 -13
  403. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  404. package/build-module/components/template-actions/index.js +26 -8
  405. package/build-module/components/template-actions/index.js.map +1 -1
  406. package/build-module/components/template-actions/rename-menu-item.js +11 -8
  407. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  408. package/build-module/components/use-edited-entity-record/index.js +3 -1
  409. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  410. package/build-module/components/welcome-guide/editor.js +1 -1
  411. package/build-module/components/welcome-guide/editor.js.map +1 -1
  412. package/build-module/components/welcome-guide/index.js +3 -1
  413. package/build-module/components/welcome-guide/index.js.map +1 -1
  414. package/build-module/components/welcome-guide/page.js +59 -0
  415. package/build-module/components/welcome-guide/page.js.map +1 -0
  416. package/build-module/components/welcome-guide/styles.js +1 -1
  417. package/build-module/components/welcome-guide/styles.js.map +1 -1
  418. package/build-module/components/welcome-guide/template.js +60 -0
  419. package/build-module/components/welcome-guide/template.js.map +1 -0
  420. package/build-module/hooks/commands/use-common-commands.js +111 -21
  421. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  422. package/build-module/hooks/commands/use-edit-mode-commands.js +193 -46
  423. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  424. package/build-module/hooks/push-changes-to-global-styles/index.js +57 -10
  425. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  426. package/build-module/index.js +4 -0
  427. package/build-module/index.js.map +1 -1
  428. package/build-module/store/actions.js +5 -2
  429. package/build-module/store/actions.js.map +1 -1
  430. package/build-module/store/private-actions.js +7 -1
  431. package/build-module/store/private-actions.js.map +1 -1
  432. package/build-module/store/selectors.js +2 -1
  433. package/build-module/store/selectors.js.map +1 -1
  434. package/build-module/utils/get-is-list-page.js +2 -2
  435. package/build-module/utils/get-is-list-page.js.map +1 -1
  436. package/build-module/utils/normalize-record-key.js +12 -0
  437. package/build-module/utils/normalize-record-key.js.map +1 -0
  438. package/build-module/utils/template-part-create.js +1 -1
  439. package/build-module/utils/template-part-create.js.map +1 -1
  440. package/build-module/utils/use-activate-theme.js +1 -1
  441. package/build-module/utils/use-activate-theme.js.map +1 -1
  442. package/build-style/style-rtl.css +383 -109
  443. package/build-style/style.css +383 -109
  444. package/package.json +39 -40
  445. package/src/components/add-new-page/index.js +1 -9
  446. package/src/components/add-new-pattern/index.js +30 -21
  447. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  448. package/src/components/add-new-template/new-template.js +120 -24
  449. package/src/components/add-new-template/style.scss +30 -2
  450. package/src/components/add-new-template/utils.js +9 -6
  451. package/src/components/block-editor/constants.js +5 -1
  452. package/src/components/block-editor/editor-canvas.js +3 -1
  453. package/src/components/block-editor/index.js +0 -4
  454. package/src/components/block-editor/inserter-media-categories.js +1 -21
  455. package/src/components/block-editor/site-editor-canvas.js +7 -1
  456. package/src/components/block-editor/use-site-editor-settings.js +100 -25
  457. package/src/components/canvas-spinner/index.js +1 -11
  458. package/src/components/canvas-spinner/style.scss +18 -0
  459. package/src/components/code-editor/index.js +51 -33
  460. package/src/components/create-pattern-modal/index.js +15 -13
  461. package/src/components/create-template-part-modal/index.js +1 -1
  462. package/src/components/editor/index.js +16 -1
  463. package/src/components/editor/style.scss +4 -0
  464. package/src/components/global-styles/palette.js +10 -9
  465. package/src/components/global-styles/stories/index.js +1 -0
  466. package/src/components/global-styles/ui.js +34 -24
  467. package/src/components/header-edit-mode/document-actions/index.js +9 -1
  468. package/src/components/header-edit-mode/document-actions/style.scss +12 -0
  469. package/src/components/header-edit-mode/index.js +136 -79
  470. package/src/components/header-edit-mode/more-menu/index.js +74 -30
  471. package/src/components/keyboard-shortcut-help-modal/index.js +21 -7
  472. package/src/components/keyboard-shortcuts/edit-mode.js +35 -2
  473. package/src/components/keyboard-shortcuts/register.js +10 -0
  474. package/src/components/layout/index.js +156 -78
  475. package/src/components/layout/style.scss +49 -2
  476. package/src/components/page/header.js +1 -1
  477. package/src/components/page/index.js +5 -1
  478. package/src/components/page-actions/index.js +2 -2
  479. package/src/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +9 -21
  480. package/src/components/page-content-focus-manager/back-to-page-notification.js +7 -2
  481. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
  482. package/src/components/page-main/index.js +6 -3
  483. package/src/components/page-patterns/duplicate-menu-item.js +196 -0
  484. package/src/components/page-patterns/grid-item.js +284 -0
  485. package/src/components/page-patterns/grid.js +22 -0
  486. package/src/components/page-patterns/header.js +69 -0
  487. package/src/components/{page-library → page-patterns}/index.js +11 -6
  488. package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
  489. package/src/components/page-patterns/pagination.js +80 -0
  490. package/src/components/page-patterns/patterns-list.js +206 -0
  491. package/src/components/page-patterns/rename-menu-item.js +115 -0
  492. package/src/components/page-patterns/style.scss +219 -0
  493. package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
  494. package/src/components/page-patterns/use-patterns.js +177 -0
  495. package/src/components/{page-library → page-patterns}/utils.js +3 -3
  496. package/src/components/page-template-parts/add-new-template-part.js +57 -0
  497. package/src/components/page-template-parts/index.js +86 -0
  498. package/src/components/page-templates/index.js +1 -1
  499. package/src/components/preferences-modal/enable-feature.js +5 -2
  500. package/src/components/preferences-modal/index.js +35 -4
  501. package/src/components/resizable-frame/index.js +102 -34
  502. package/src/components/resizable-frame/style.scss +9 -9
  503. package/src/components/save-panel/index.js +10 -4
  504. package/src/components/sidebar/index.js +6 -6
  505. package/src/components/sidebar-button/style.scss +1 -1
  506. package/src/components/sidebar-edit-mode/index.js +4 -2
  507. package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  508. package/src/components/sidebar-edit-mode/page-panels/page-status.js +2 -5
  509. package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
  510. package/src/components/sidebar-navigation-item/style.scss +7 -13
  511. package/src/components/sidebar-navigation-screen/index.js +18 -9
  512. package/src/components/sidebar-navigation-screen/style.scss +21 -2
  513. package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -1
  514. package/src/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  515. package/src/components/sidebar-navigation-screen-main/index.js +44 -40
  516. package/src/components/sidebar-navigation-screen-main/template-part-hint.js +34 -0
  517. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
  518. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
  519. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +13 -11
  520. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  521. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +12 -1
  522. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
  523. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -7
  524. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -6
  525. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
  526. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  527. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +39 -8
  528. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  529. package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
  530. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -36
  531. package/src/components/sidebar-navigation-screen-pages/index.js +40 -30
  532. package/src/components/sidebar-navigation-screen-pattern/index.js +18 -8
  533. package/src/components/sidebar-navigation-screen-pattern/style.scss +29 -0
  534. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
  535. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
  536. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +12 -2
  537. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +48 -3
  538. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  539. package/src/components/sidebar-navigation-screen-patterns/index.js +194 -0
  540. package/src/components/sidebar-navigation-screen-patterns/style.scss +23 -0
  541. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
  542. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +9 -17
  543. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +55 -0
  544. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +3 -2
  545. package/src/components/sidebar-navigation-screen-template/style.scss +15 -15
  546. package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
  547. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
  548. package/src/components/site-hub/index.js +46 -29
  549. package/src/components/site-hub/style.scss +17 -3
  550. package/src/components/start-template-options/style.scss +0 -3
  551. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
  552. package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
  553. package/src/components/template-actions/index.js +40 -9
  554. package/src/components/template-actions/rename-menu-item.js +17 -10
  555. package/src/components/use-edited-entity-record/index.js +6 -1
  556. package/src/components/welcome-guide/editor.js +1 -1
  557. package/src/components/welcome-guide/index.js +4 -0
  558. package/src/components/welcome-guide/page.js +75 -0
  559. package/src/components/welcome-guide/style.scss +15 -1
  560. package/src/components/welcome-guide/styles.js +1 -1
  561. package/src/components/welcome-guide/template.js +82 -0
  562. package/src/hooks/commands/use-common-commands.js +88 -24
  563. package/src/hooks/commands/use-edit-mode-commands.js +182 -38
  564. package/src/hooks/push-changes-to-global-styles/index.js +63 -9
  565. package/src/index.js +4 -0
  566. package/src/store/actions.js +8 -1
  567. package/src/store/private-actions.js +5 -1
  568. package/src/store/selectors.js +5 -0
  569. package/src/store/test/selectors.js +2 -0
  570. package/src/style.scss +13 -14
  571. package/src/utils/get-is-list-page.js +4 -3
  572. package/src/utils/normalize-record-key.js +11 -0
  573. package/src/utils/template-part-create.js +1 -1
  574. package/src/utils/use-activate-theme.js +1 -1
  575. package/build/components/code-editor/code-editor-text-area.js +0 -96
  576. package/build/components/code-editor/code-editor-text-area.js.map +0 -1
  577. package/build/components/keyboard-shortcuts/index.js +0 -148
  578. package/build/components/keyboard-shortcuts/index.js.map +0 -1
  579. package/build/components/page-actions/delete-page-menu-item.js.map +0 -1
  580. package/build/components/page-content-focus-manager/constants.js +0 -9
  581. package/build/components/page-content-focus-manager/constants.js.map +0 -1
  582. package/build/components/page-library/grid-item.js +0 -165
  583. package/build/components/page-library/grid-item.js.map +0 -1
  584. package/build/components/page-library/grid.js.map +0 -1
  585. package/build/components/page-library/index.js.map +0 -1
  586. package/build/components/page-library/no-patterns.js.map +0 -1
  587. package/build/components/page-library/patterns-list.js +0 -108
  588. package/build/components/page-library/patterns-list.js.map +0 -1
  589. package/build/components/page-library/search-items.js.map +0 -1
  590. package/build/components/page-library/use-library-settings.js.map +0 -1
  591. package/build/components/page-library/use-patterns.js +0 -194
  592. package/build/components/page-library/use-patterns.js.map +0 -1
  593. package/build/components/page-library/utils.js.map +0 -1
  594. package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  595. package/build/components/sidebar-navigation-screen-library/index.js +0 -112
  596. package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
  597. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  598. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  599. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -41
  600. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  601. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  602. package/build-module/components/code-editor/code-editor-text-area.js +0 -84
  603. package/build-module/components/code-editor/code-editor-text-area.js.map +0 -1
  604. package/build-module/components/keyboard-shortcuts/index.js +0 -132
  605. package/build-module/components/keyboard-shortcuts/index.js.map +0 -1
  606. package/build-module/components/page-actions/delete-page-menu-item.js.map +0 -1
  607. package/build-module/components/page-content-focus-manager/constants.js +0 -2
  608. package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
  609. package/build-module/components/page-library/grid-item.js +0 -145
  610. package/build-module/components/page-library/grid-item.js.map +0 -1
  611. package/build-module/components/page-library/grid.js +0 -38
  612. package/build-module/components/page-library/grid.js.map +0 -1
  613. package/build-module/components/page-library/index.js.map +0 -1
  614. package/build-module/components/page-library/no-patterns.js.map +0 -1
  615. package/build-module/components/page-library/patterns-list.js +0 -87
  616. package/build-module/components/page-library/patterns-list.js.map +0 -1
  617. package/build-module/components/page-library/search-items.js.map +0 -1
  618. package/build-module/components/page-library/use-library-settings.js.map +0 -1
  619. package/build-module/components/page-library/use-patterns.js +0 -176
  620. package/build-module/components/page-library/use-patterns.js.map +0 -1
  621. package/build-module/components/page-library/utils.js.map +0 -1
  622. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  623. package/build-module/components/sidebar-navigation-screen-library/index.js +0 -87
  624. package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
  625. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  626. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  627. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -34
  628. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  629. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  630. package/src/components/code-editor/code-editor-text-area.js +0 -84
  631. package/src/components/keyboard-shortcuts/index.js +0 -137
  632. package/src/components/page-content-focus-manager/constants.js +0 -5
  633. package/src/components/page-library/grid-item.js +0 -179
  634. package/src/components/page-library/grid.js +0 -39
  635. package/src/components/page-library/patterns-list.js +0 -114
  636. package/src/components/page-library/style.scss +0 -105
  637. package/src/components/page-library/use-patterns.js +0 -238
  638. package/src/components/sidebar-navigation-screen-library/index.js +0 -136
  639. package/src/components/sidebar-navigation-screen-library/style.scss +0 -7
  640. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -33
  641. /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
  642. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  643. /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
  644. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  645. /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
  646. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/template-actions/index.js"],"names":["useDispatch","useSelect","store","coreStore","__","sprintf","DropdownMenu","MenuGroup","MenuItem","moreVertical","noticesStore","editSiteStore","isTemplateRemovable","isTemplateRevertable","RenameMenuItem","TemplateActions","postType","postId","className","toggleProps","onRemove","template","select","getEntityRecord","removeTemplate","revertTemplate","saveEditedEntityRecord","createSuccessNotice","createErrorNotice","isRemovable","isRevertable","revertAndSaveTemplate","allowUndo","type","id","title","rendered","error","errorMessage","message","code","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASP,KAAK,IAAIQ,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,SAASR,KAAK,IAAIS,aAAlB,QAAuC,aAAvC;AACA,OAAOC,mBAAP,MAAgC,mCAAhC;AACA,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,EAAE,UADP;AAECC,QAAAA,EAAE,EAAE;AAFL,OANkB,CAAnB;AAWA,KAnBD,CAmBE,OAAQG,KAAR,EAAgB;AACjB,YAAMC,YAAY,GACjBD,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,IAAN,KAAe,eAAhC,GACGH,KAAK,CAACE,OADT,GAEGnC,EAAE,CAAE,+CAAF,CAHN;AAKAwB,MAAAA,iBAAiB,CAAEU,YAAF,EAAgB;AAAEL,QAAAA,IAAI,EAAE;AAAR,OAAhB,CAAjB;AACA;AACD;;AAED,SACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGxB,YADR;AAEC,IAAA,KAAK,EAAGL,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,SAAS,EAAGc,SAHb;AAIC,IAAA,WAAW,EAAGC;AAJf,KAMG,CAAE;AAAEsB,IAAAA;AAAF,GAAF,KACD,cAAC,SAAD,QACGZ,WAAW,IACZ,8BACC,cAAC,cAAD;AACC,IAAA,QAAQ,EAAGR,QADZ;AAEC,IAAA,OAAO,EAAGoB;AAFX,IADD,EAKC,cAAC,QAAD;AACC,IAAA,aAAa,MADd;AAEC,IAAA,UAAU,MAFX;AAGC,IAAA,OAAO,EAAG,MAAM;AACfjB,MAAAA,cAAc,CAAEH,QAAF,CAAd;AACAD,MAAAA,QAAQ;AACRqB,MAAAA,OAAO;AACP;AAPF,KASGrC,EAAE,CAAE,QAAF,CATL,CALD,CAFF,EAoBG0B,YAAY,IACb,cAAC,QAAD;AACC,IAAA,IAAI,EAAG1B,EAAE,CACR,4CADQ,CADV;AAIC,IAAA,OAAO,EAAG,MAAM;AACf2B,MAAAA,qBAAqB;AACrBU,MAAAA,OAAO;AACP;AAPF,KASGrC,EAAE,CAAE,sBAAF,CATL,CArBF,CAPF,CADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport RenameMenuItem from './rename-menu-item';\n\nexport default function TemplateActions( {\n\tpostType,\n\tpostId,\n\tclassName,\n\ttoggleProps,\n\tonRemove,\n} ) {\n\tconst template = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'postType', postType, postId ),\n\t\t[ postType, postId ]\n\t);\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst { saveEditedEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst isRemovable = isTemplateRemovable( template );\n\tconst isRevertable = isTemplateRevertable( template );\n\n\tif ( ! isRemovable && ! isRevertable ) {\n\t\treturn null;\n\t}\n\n\tasync function revertAndSaveTemplate() {\n\t\ttry {\n\t\t\tawait revertTemplate( template, { allowUndo: false } );\n\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" reverted.' ),\n\t\t\t\t\ttemplate.title.rendered\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'edit-site-template-reverted',\n\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: __( 'An error occurred while reverting the entity.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Actions' ) }\n\t\t\tclassName={ className }\n\t\t\ttoggleProps={ toggleProps }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t{ isRemovable && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RenameMenuItem\n\t\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tisTertiary\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tremoveTemplate( template );\n\t\t\t\t\t\t\t\t\tonRemove?.();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRevertable && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t'Use the template as supplied by the theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\trevertAndSaveTemplate();\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/template-actions/index.js"],"names":["useDispatch","useSelect","store","coreStore","useState","__","sprintf","DropdownMenu","MenuGroup","MenuItem","__experimentalConfirmDialog","ConfirmDialog","moreVertical","noticesStore","decodeEntities","editSiteStore","isTemplateRemovable","isTemplateRevertable","RenameMenuItem","TemplateActions","postType","postId","className","toggleProps","onRemove","template","select","getEntityRecord","removeTemplate","revertTemplate","saveEditedEntityRecord","createSuccessNotice","createErrorNotice","isRemovable","isRevertable","revertAndSaveTemplate","allowUndo","type","id","title","rendered","error","errorMessage","message","code","onClose","DeleteMenuItem","isTemplate","isModalOpen","setIsModalOpen"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,YADD,EAECC,SAFD,EAGCC,QAHD,EAICC,2BAA2B,IAAIC,aAJhC,QAKO,uBALP;AAMA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASV,KAAK,IAAIW,YAAlB,QAAsC,oBAAtC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,SAASZ,KAAK,IAAIa,aAAlB,QAAuC,aAAvC;AACA,OAAOC,mBAAP,MAAgC,mCAAhC;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEA,eAAe,SAASC,eAAT,CAA0B;AACxCC,EAAAA,QADwC;AAExCC,EAAAA,MAFwC;AAGxCC,EAAAA,SAHwC;AAIxCC,EAAAA,WAJwC;AAKxCC,EAAAA;AALwC,CAA1B,EAMX;AACH,QAAMC,QAAQ,GAAGxB,SAAS,CACvByB,MAAF,IACCA,MAAM,CAAEvB,SAAF,CAAN,CAAoBwB,eAApB,CAAqC,UAArC,EAAiDP,QAAjD,EAA2DC,MAA3D,CAFwB,EAGzB,CAAED,QAAF,EAAYC,MAAZ,CAHyB,CAA1B;AAKA,QAAM;A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EAAE,CAAE,gDAAF,CADO,GAETA,EAAE,CACF,qDADE,CARN,CARD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport RenameMenuItem from './rename-menu-item';\n\nexport default function TemplateActions( {\n\tpostType,\n\tpostId,\n\tclassName,\n\ttoggleProps,\n\tonRemove,\n} ) {\n\tconst template = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'postType', postType, postId ),\n\t\t[ postType, postId ]\n\t);\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst { saveEditedEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst isRemovable = isTemplateRemovable( template );\n\tconst isRevertable = isTemplateRevertable( template );\n\n\tif ( ! isRemovable && ! isRevertable ) {\n\t\treturn null;\n\t}\n\n\tasync function revertAndSaveTemplate() {\n\t\ttry {\n\t\t\tawait revertTemplate( template, { allowUndo: false } );\n\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" reverted.' ),\n\t\t\t\t\tdecodeEntities( template.title.rendered )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'edit-site-template-reverted',\n\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: __( 'An error occurred while reverting the entity.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Actions' ) }\n\t\t\tclassName={ className }\n\t\t\ttoggleProps={ toggleProps }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t{ isRemovable && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RenameMenuItem\n\t\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<DeleteMenuItem\n\t\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\t\tremoveTemplate( template );\n\t\t\t\t\t\t\t\t\tonRemove?.();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tisTemplate={ template.type === 'wp_template' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRevertable && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t'Use the template as supplied by the theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\trevertAndSaveTemplate();\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction DeleteMenuItem( { onRemove, isTemplate } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tisDestructive\n\t\t\t\tisTertiary\n\t\t\t\tonClick={ () => setIsModalOpen( true ) }\n\t\t\t>\n\t\t\t\t{ __( 'Delete' ) }\n\t\t\t</MenuItem>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ isModalOpen }\n\t\t\t\tonConfirm={ onRemove }\n\t\t\t\tonCancel={ () => setIsModalOpen( false ) }\n\t\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\t>\n\t\t\t\t{ isTemplate\n\t\t\t\t\t? __( 'Are you sure you want to delete this template?' )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Are you sure you want to delete this template part?'\n\t\t\t\t\t ) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"]}
@@ -9,15 +9,17 @@ import { useDispatch } from '@wordpress/data';
9
9
  import { Button, MenuItem, Modal, TextControl, __experimentalHStack as HStack, __experimentalVStack as VStack } from '@wordpress/components';
10
10
  import { store as coreStore } from '@wordpress/core-data';
11
11
  import { store as noticesStore } from '@wordpress/notices';
12
+ import { decodeEntities } from '@wordpress/html-entities';
12
13
  export default function RenameMenuItem({
13
14
  template,
14
15
  onClose
15
16
  }) {
16
- const [title, setTitle] = useState(() => template.title.rendered);
17
+ const title = decodeEntities(template.title.rendered);
18
+ const [editedTitle, setEditedTitle] = useState(title);
17
19
  const [isModalOpen, setIsModalOpen] = useState(false);
18
20
  const {
19
21
  editEntityRecord,
20
- saveEditedEntityRecord
22
+ __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
21
23
  } = useDispatch(coreStore);
22
24
  const {
23
25
  createSuccessNotice,
@@ -33,14 +35,15 @@ export default function RenameMenuItem({
33
35
 
34
36
  try {
35
37
  await editEntityRecord('postType', template.type, template.id, {
36
- title
38
+ title: editedTitle
37
39
  }); // Update state before saving rerenders the list.
38
40
 
39
- setTitle('');
41
+ setEditedTitle('');
40
42
  setIsModalOpen(false);
41
43
  onClose(); // Persist edited entity.
42
44
 
43
- await saveEditedEntityRecord('postType', template.type, template.id, {
45
+ await saveSpecifiedEntityEdits('postType', template.type, template.id, ['title'], // Only save title to avoid persisting other edits.
46
+ {
44
47
  throwOnError: true
45
48
  });
46
49
  createSuccessNotice(__('Entity renamed.'), {
@@ -57,7 +60,7 @@ export default function RenameMenuItem({
57
60
  return createElement(Fragment, null, createElement(MenuItem, {
58
61
  onClick: () => {
59
62
  setIsModalOpen(true);
60
- setTitle(template.title.rendered);
63
+ setEditedTitle(title);
61
64
  }
62
65
  }, __('Rename')), isModalOpen && createElement(Modal, {
63
66
  title: __('Rename'),
@@ -72,8 +75,8 @@ export default function RenameMenuItem({
72
75
  }, createElement(TextControl, {
73
76
  __nextHasNoMarginBottom: true,
74
77
  label: __('Name'),
75
- value: title,
76
- onChange: setTitle,
78
+ value: editedTitle,
79
+ onChange: setEditedTitle,
77
80
  required: true
78
81
  }), createElement(HStack, {
79
82
  justify: "right"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/template-actions/rename-menu-item.js"],"names":["__","useState","useDispatch","Button","MenuItem","Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","store","coreStore","noticesStore","RenameMenuItem","template","onClose","title","setTitle","rendered","isModalOpen","setIsModalOpen","editEntityRecord","saveEditedEntityRecord","createSuccessNotice","createErrorNotice","type","is_custom","onTemplateRename","event","preventDefault","id","throwOnError","error","errorMessage","message","code"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,WAAT,QAA4B,iBAA5B;A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,MAAM;AACfG,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AAJF,KAMGrB,EAAE,CAAE,QAAF,CANL,CADD,EAUC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC,SAAhB;AAA0B,IAAA,IAAI,EAAC;AAA/B,KACGA,EAAE,CAAE,MAAF,CADL,CAVD,CATD,CADD,CAPD,CAVF,CADD;AAgDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tMenuItem,\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function RenameMenuItem( { template, onClose } ) {\n\tconst [ title, setTitle ] = useState( () => template.title.rendered );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\n\tconst { editEntityRecord, saveEditedEntityRecord } =\n\t\tuseDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tif ( template.type === 'wp_template' && ! template.is_custom ) {\n\t\treturn null;\n\t}\n\n\tasync function onTemplateRename( event ) {\n\t\tevent.preventDefault();\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\ttitle,\n\t\t\t} );\n\n\t\t\t// Update state before saving rerenders the list.\n\t\t\tsetTitle( '' );\n\t\t\tsetIsModalOpen( false );\n\t\t\tonClose();\n\n\t\t\t// Persist edited entity.\n\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tcreateSuccessNotice( __( 'Entity renamed.' ), {\n\t\t\t\ttype: 'snackbar',\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 renaming the entity.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\tsetTitle( template.title.rendered );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Rename' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"edit-site-list__rename-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ onTemplateRename }>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t\t\t<Button variant=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/template-actions/rename-menu-item.js"],"names":["__","useState","useDispatch","Button","MenuItem","Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","store","coreStore","noticesStore","decodeEntities","RenameMenuItem","template","onClose","title","rendered","editedTitle","setEditedTitle","isModalOpen","setIsModalOpen","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","createSuccessNotice","createErrorNotice","type","is_custom","onTemplateRename","event","preventDefault","id","throwOnError","error","errorMessage","message","code"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SACCC,MADD,EAECC,QAFD,EAGCC,KAHD,EAICC,WAJD,EAKCC,oBAAoB,IAAIC,MALzB,EAMCC,oBAAoB,IAAIC,MANzB,QAOO,uBAPP;AAQA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,YAAlB,QAAsC,oBAAtC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA,eAAe,SAASC,cAAT,CAAyB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAzB,EAAiD;AAC/D,QAAMC,KAAK,GAAGJ,cAAc,CAAEE,QAAQ,CAACE,KAAT,CAAeC,QAAjB,CAA5B;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkCpB,QAAQ,CAAEiB,KAAF,CAAhD;AACA,QAAM,CAAEI,WAAF,EAAeC,cAAf,IAAkCtB,QAAQ,CAAE,KAAF,CAAhD;AAEA,QAAM;AACLuB,IAAAA,gBADK;AAELC,IAAAA,sCAAsC,EAAEC;AAFnC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N,MAAAA,cAAc,CAAE,IAAF,CAAd;AACAF,MAAAA,cAAc,CAAEH,KAAF,CAAd;AACA;AAJF,KAMGlB,EAAE,CAAE,QAAF,CANL,CADD,EASGsB,WAAW,IACZ,cAAC,KAAD;AACC,IAAA,KAAK,EAAGtB,EAAE,CAAE,QAAF,CADX;AAEC,IAAA,cAAc,EAAG,MAAM;AACtBuB,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA,KAJF;AAKC,IAAA,gBAAgB,EAAC;AALlB,KAOC;AAAM,IAAA,QAAQ,EAAGQ;AAAjB,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,WAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAG/B,EAAE,CAAE,MAAF,CAFX;AAGC,IAAA,KAAK,EAAGoB,WAHT;AAIC,IAAA,QAAQ,EAAGC,cAJZ;AAKC,IAAA,QAAQ;AALT,IADD,EASC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,OAAO,EAAG,MAAM;AACfE,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AAJF,KAMGvB,EAAE,CAAE,QAAF,CANL,CADD,EAUC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC,SAAhB;AAA0B,IAAA,IAAI,EAAC;AAA/B,KACGA,EAAE,CAAE,MAAF,CADL,CAVD,CATD,CADD,CAPD,CAVF,CADD;AAgDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tMenuItem,\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\n\nexport default function RenameMenuItem( { template, onClose } ) {\n\tconst title = decodeEntities( template.title.rendered );\n\tconst [ editedTitle, setEditedTitle ] = useState( title );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tif ( template.type === 'wp_template' && ! template.is_custom ) {\n\t\treturn null;\n\t}\n\n\tasync function onTemplateRename( event ) {\n\t\tevent.preventDefault();\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\ttitle: editedTitle,\n\t\t\t} );\n\n\t\t\t// Update state before saving rerenders the list.\n\t\t\tsetEditedTitle( '' );\n\t\t\tsetIsModalOpen( false );\n\t\t\tonClose();\n\n\t\t\t// Persist edited entity.\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t[ 'title' ], // Only save title to avoid persisting other edits.\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tcreateSuccessNotice( __( 'Entity renamed.' ), {\n\t\t\t\ttype: 'snackbar',\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 renaming the entity.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\tsetEditedTitle( title );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Rename' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"edit-site-list__rename-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ onTemplateRename }>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ editedTitle }\n\t\t\t\t\t\t\t\tonChange={ setEditedTitle }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t\t\t<Button variant=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -10,6 +10,7 @@ import { decodeEntities } from '@wordpress/html-entities';
10
10
  */
11
11
 
12
12
  import { store as editSiteStore } from '../../store';
13
+ import normalizeRecordKey from '../../utils/normalize-record-key';
13
14
  export default function useEditedEntityRecord(postType, postId) {
14
15
  const {
15
16
  record,
@@ -30,7 +31,8 @@ export default function useEditedEntityRecord(postType, postId) {
30
31
  __experimentalGetTemplateInfo: getTemplateInfo
31
32
  } = select(editorStore);
32
33
  const usedPostType = postType !== null && postType !== void 0 ? postType : getEditedPostType();
33
- const usedPostId = postId !== null && postId !== void 0 ? postId : getEditedPostId();
34
+ let usedPostId = postId !== null && postId !== void 0 ? postId : getEditedPostId();
35
+ usedPostId = normalizeRecordKey(usedPostId, usedPostType);
34
36
 
35
37
  const _record = getEditedEntityRecord('postType', usedPostType, usedPostId);
36
38
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/use-edited-entity-record/index.js"],"names":["useSelect","store","coreStore","editorStore","decodeEntities","editSiteStore","useEditedEntityRecord","postType","postId","record","title","description","isLoaded","icon","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","hasFinishedResolution","__experimentalGetTemplateInfo","getTemplateInfo","usedPostType","usedPostId","_record","_isLoaded","templateInfo","getTitle","getDescription"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,mBAArC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,qBAAT,CAAgCC,QAAhC,EAA0CC,MAA1C,EAAmD;AACjE,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,WAAjB;AAA8BC,IAAAA,QAA9B;AAAwCC,IAAAA;AAAxC,MAAiDb,SAAS,CAC7Dc,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,QACLF,MAAM,CAAET,aAAF,CADP;AAEA,UAAM;AAAEY,MAAAA,qBAAF;AAAyBC,MAAAA;AAAzB,QACLJ,MAAM,CAAEZ,SAAF,CADP;AAEA,UAAM;AAAEiB,MAAAA,6BAA6B,EAAEC;AAAjC,QACLN,MAAM,CAAEX,WAAF,CADP;AAEA,UAAMkB,YAAY,GAAGd,QAAH,aAAGA,QAAH,cAAGA,QAAH,GAAeQ,iBAAiB,EAAlD;AACA,UAAMO,UAAU,GAAGd,MAAH,aAAGA,MAAH,cAAGA,MAAH,GAAaQ,eAAe,EAA5C;;AACA,UAAMO,OAAO,GAAGN,qBAAqB,CACpC,UADoC,EAEpCI,YAFoC,EAGpCC,UAHoC,CAArC;;AAKA,UAAME,SAAS,GACdF,UAAU,IACVJ,qBAAqB,CAAE,uBAAF,EAA2B,CAC/C,UAD+C,EAE/CG,YAF+C,EAG/CC,UAH+C,CAA3B,CAFtB;;AAOA,UAAMG,YAAY,GAAGL,eAAe,CAAEG,OAAF,CAApC;AAEA,WAAO;AACNd,MAAAA,MAAM,EAAEc,OADF;AAENb,MAAAA,KAAK,EAAEe,YAAY,CAACf,KAFd;AAGNC,MAAAA,WAAW,EAAEc,YAAY,CAACd,WAHpB;AAINC,MAAAA,QAAQ,EAAEY,SAJJ;AAKNX,MAAAA,IAAI,EAAEY,YAAY,CAACZ;AALb,KAAP;AAOA,GA/B8D,EAgC/D,CAAEN,QAAF,EAAYC,MAAZ,CAhC+D,CAAhE;AAmCA,SAAO;AACNI,IAAAA,QADM;AAENC,IAAAA,IAFM;AAGNJ,IAAAA,MAHM;AAINiB,IAAAA,QAAQ,EAAE,MAAQhB,KAAK,GAAGN,cAAc,CAAEM,KAAF,CAAjB,GAA6B,IAJ9C;AAKNiB,IAAAA,cAAc,EAAE,MACfhB,WAAW,GAAGP,cAAc,CAAEO,WAAF,CAAjB,GAAmC;AANzC,GAAP;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function useEditedEntityRecord( postType, postId ) {\n\tconst { record, title, description, isLoaded, icon } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst usedPostType = postType ?? getEditedPostType();\n\t\t\tconst usedPostId = postId ?? getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _isLoaded =\n\t\t\t\tusedPostId &&\n\t\t\t\thasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\tusedPostType,\n\t\t\t\t\tusedPostId,\n\t\t\t\t] );\n\t\t\tconst templateInfo = getTemplateInfo( _record );\n\n\t\t\treturn {\n\t\t\t\trecord: _record,\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tdescription: templateInfo.description,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t\ticon: templateInfo.icon,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\treturn {\n\t\tisLoaded,\n\t\ticon,\n\t\trecord,\n\t\tgetTitle: () => ( title ? decodeEntities( title ) : null ),\n\t\tgetDescription: () =>\n\t\t\tdescription ? decodeEntities( description ) : null,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/use-edited-entity-record/index.js"],"names":["useSelect","store","coreStore","editorStore","decodeEntities","editSiteStore","normalizeRecordKey","useEditedEntityRecord","postType","postId","record","title","description","isLoaded","icon","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","hasFinishedResolution","__experimentalGetTemplateInfo","getTemplateInfo","usedPostType","usedPostId","_record","_isLoaded","templateInfo","getTitle","getDescription"],"mappings":"A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AAF,CAApC;AAEA,WAAO;AACNd,MAAAA,MAAM,EAAEc,OADF;AAENb,MAAAA,KAAK,EAAEe,YAAY,CAACf,KAFd;AAGNC,MAAAA,WAAW,EAAEc,YAAY,CAACd,WAHpB;AAINC,MAAAA,QAAQ,EAAEY,SAJJ;AAKNX,MAAAA,IAAI,EAAEY,YAAY,CAACZ;AALb,KAAP;AAOA,GAnC8D,EAoC/D,CAAEN,QAAF,EAAYC,MAAZ,CApC+D,CAAhE;AAuCA,SAAO;AACNI,IAAAA,QADM;AAENC,IAAAA,IAFM;AAGNJ,IAAAA,MAHM;AAINiB,IAAAA,QAAQ,EAAE,MAAQhB,KAAK,GAAGP,cAAc,CAAEO,KAAF,CAAjB,GAA6B,IAJ9C;AAKNiB,IAAAA,cAAc,EAAE,MACfhB,WAAW,GAAGR,cAAc,CAAEQ,WAAF,CAAjB,GAAmC;AANzC,GAAP;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport normalizeRecordKey from '../../utils/normalize-record-key';\n\nexport default function useEditedEntityRecord( postType, postId ) {\n\tconst { record, title, description, isLoaded, icon } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst usedPostType = postType ?? getEditedPostType();\n\n\t\t\tlet usedPostId = postId ?? getEditedPostId();\n\n\t\t\tusedPostId = normalizeRecordKey( usedPostId, usedPostType );\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _isLoaded =\n\t\t\t\tusedPostId &&\n\t\t\t\thasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\tusedPostType,\n\t\t\t\t\tusedPostId,\n\t\t\t\t] );\n\t\t\tconst templateInfo = getTemplateInfo( _record );\n\n\t\t\treturn {\n\t\t\t\trecord: _record,\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tdescription: templateInfo.description,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t\ticon: templateInfo.icon,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\treturn {\n\t\tisLoaded,\n\t\ticon,\n\t\trecord,\n\t\tgetTitle: () => ( title ? decodeEntities( title ) : null ),\n\t\tgetDescription: () =>\n\t\t\tdescription ? decodeEntities( description ) : null,\n\t};\n}\n"]}
@@ -24,7 +24,7 @@ export default function WelcomeGuideEditor() {
24
24
  }
25
25
 
26
26
  return createElement(Guide, {
27
- className: "edit-site-welcome-guide",
27
+ className: "edit-site-welcome-guide guide-editor",
28
28
  contentLabel: __('Welcome to the site editor'),
29
29
  finishButtonText: __('Get started'),
30
30
  onFinish: () => toggle('core/edit-site', 'welcomeGuide'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/editor.js"],"names":["useDispatch","useSelect","Guide","__","createInterpolateElement","store","preferencesStore","WelcomeGuideImage","WelcomeGuideEditor","toggle","isActive","select","get","image","content","StylesIconImage"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,SAA9B;AAEA,eAAe,SAASC,kBAAT,GAA8B;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAaT,WAAW,CAAEM,gBAAF,CAA9B;AAEA,QAAMI,QAAQ,GAAGT,SAAS,CACvBU,MAAF,IACC,CAAC,CAAEA,MAAM,CAAEL,gBAAF,CAAN,CAA2BM,GAA3B,CACF,gBADE,EAEF,cAFE,CAFqB,EAMzB,EANyB,CAA1B;;AASA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,YAAY,EAAGP,EAAE,CAAE,4BAAF,CAFlB;AAGC,IAAA,gBAAgB,EAAGA,EAAE,CAAE,aAAF,CAHtB;AAIC,IAAA,QAAQ,EAAG,MAAMM,MAAM,CAAE,gBAAF,EAAoB,cAApB,CAJxB;AAKC,IAAA,KAAK,EAAG,CACP;AACCI,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,0DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGX,EAAE,CAAE,gBAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,2FADG,CADL,CAJD,EASC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGC,wBAAwB,CACzBD,EAAE,CACD,2GADC,CADuB,EAIzB;AACCY,QAAAA,eAAe,EACd;AACC,UAAA,GAAG,EAAGZ,EAAE,CAAE,QAAF,CADT;AAEC,UAAA,GAAG,EAAC;AAFL;AAFF,OAJyB,CAD3B,CATD;AARF,KADO;AALT,IADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site — from the header right down to the footer — using blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStylesIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'styles' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/editor.js"],"names":["useDispatch","useSelect","Guide","__","createInterpolateElement","store","preferencesStore","WelcomeGuideImage","WelcomeGuideEditor","toggle","isActive","select","get","image","content","StylesIconImage"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,SAA9B;AAEA,eAAe,SAASC,kBAAT,GAA8B;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAaT,WAAW,CAAEM,gBAAF,CAA9B;AAEA,QAAMI,QAAQ,GAAGT,SAAS,CACvBU,MAAF,IACC,CAAC,CAAEA,MAAM,CAAEL,gBAAF,CAAN,CAA2BM,GAA3B,CACF,gBADE,EAEF,cAFE,CAFqB,EAMzB,EANyB,CAA1B;;AASA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,YAAY,EAAGP,EAAE,CAAE,4BAAF,CAFlB;AAGC,IAAA,gBAAgB,EAAGA,EAAE,CAAE,aAAF,CAHtB;AAIC,IAAA,QAAQ,EAAG,MAAMM,MAAM,CAAE,gBAAF,EAAoB,cAApB,CAJxB;AAKC,IAAA,KAAK,EAAG,CACP;AACCI,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,0DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGX,EAAE,CAAE,gBAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,2FADG,CADL,CAJD,EASC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGC,wBAAwB,CACzBD,EAAE,CACD,2GADC,CADuB,EAIzB;AACCY,QAAAA,eAAe,EACd;AACC,UAAA,GAAG,EAAGZ,EAAE,CAAE,QAAF,CADT;AAEC,UAAA,GAAG,EAAC;AAFL;AAFF,OAJyB,CAD3B,CATD;AARF,KADO;AALT,IADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-editor\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site — from the header right down to the footer — using blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStylesIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'styles' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
@@ -5,7 +5,9 @@ import { createElement, Fragment } from "@wordpress/element";
5
5
  */
6
6
  import WelcomeGuideEditor from './editor';
7
7
  import WelcomeGuideStyles from './styles';
8
+ import WelcomeGuidePage from './page';
9
+ import WelcomeGuideTemplate from './template';
8
10
  export default function WelcomeGuide() {
9
- return createElement(Fragment, null, createElement(WelcomeGuideEditor, null), createElement(WelcomeGuideStyles, null));
11
+ return createElement(Fragment, null, createElement(WelcomeGuideEditor, null), createElement(WelcomeGuideStyles, null), createElement(WelcomeGuidePage, null), createElement(WelcomeGuideTemplate, null));
10
12
  }
11
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"names":["WelcomeGuideEditor","WelcomeGuideStyles","WelcomeGuide"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,kBAAP,MAA+B,UAA/B;AACA,OAAOC,kBAAP,MAA+B,UAA/B;AAEA,eAAe,SAASC,YAAT,GAAwB;AACtC,SACC,8BACC,cAAC,kBAAD,OADD,EAEC,cAAC,kBAAD,OAFD,CADD;AAMA","sourcesContent":["/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\n\nexport default function WelcomeGuide() {\n\treturn (\n\t\t<>\n\t\t\t<WelcomeGuideEditor />\n\t\t\t<WelcomeGuideStyles />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"names":["WelcomeGuideEditor","WelcomeGuideStyles","WelcomeGuidePage","WelcomeGuideTemplate","WelcomeGuide"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,kBAAP,MAA+B,UAA/B;AACA,OAAOC,kBAAP,MAA+B,UAA/B;AACA,OAAOC,gBAAP,MAA6B,QAA7B;AACA,OAAOC,oBAAP,MAAiC,YAAjC;AAEA,eAAe,SAASC,YAAT,GAAwB;AACtC,SACC,8BACC,cAAC,kBAAD,OADD,EAEC,cAAC,kBAAD,OAFD,EAGC,cAAC,gBAAD,OAHD,EAIC,cAAC,oBAAD,OAJD,CADD;AAQA","sourcesContent":["/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\nimport WelcomeGuidePage from './page';\nimport WelcomeGuideTemplate from './template';\n\nexport default function WelcomeGuide() {\n\treturn (\n\t\t<>\n\t\t\t<WelcomeGuideEditor />\n\t\t\t<WelcomeGuideStyles />\n\t\t\t<WelcomeGuidePage />\n\t\t\t<WelcomeGuideTemplate />\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,59 @@
1
+ import { createElement, Fragment } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { useDispatch, useSelect } from '@wordpress/data';
7
+ import { Guide } from '@wordpress/components';
8
+ import { __ } from '@wordpress/i18n';
9
+ import { store as preferencesStore } from '@wordpress/preferences';
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+
14
+ import { store as editSiteStore } from '../../store';
15
+ export default function WelcomeGuidePage() {
16
+ const {
17
+ toggle
18
+ } = useDispatch(preferencesStore);
19
+ const isVisible = useSelect(select => {
20
+ const isPageActive = !!select(preferencesStore).get('core/edit-site', 'welcomeGuidePage');
21
+ const isEditorActive = !!select(preferencesStore).get('core/edit-site', 'welcomeGuide');
22
+ const {
23
+ hasPageContentFocus
24
+ } = select(editSiteStore);
25
+ return isPageActive && !isEditorActive && hasPageContentFocus();
26
+ }, []);
27
+
28
+ if (!isVisible) {
29
+ return null;
30
+ }
31
+
32
+ const heading = __('Editing a page');
33
+
34
+ return createElement(Guide, {
35
+ className: "edit-site-welcome-guide guide-page",
36
+ contentLabel: heading,
37
+ finishButtonText: __('Continue'),
38
+ onFinish: () => toggle('core/edit-site', 'welcomeGuidePage'),
39
+ pages: [{
40
+ image: createElement("video", {
41
+ className: "edit-site-welcome-guide__video",
42
+ autoPlay: true,
43
+ loop: true,
44
+ muted: true,
45
+ width: "312",
46
+ height: "240"
47
+ }, createElement("source", {
48
+ src: "https://s.w.org/images/block-editor/editing-your-page.mp4",
49
+ type: "video/mp4"
50
+ })),
51
+ content: createElement(Fragment, null, createElement("h1", {
52
+ className: "edit-site-welcome-guide__heading"
53
+ }, heading), createElement("p", {
54
+ className: "edit-site-welcome-guide__text"
55
+ }, __('It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.')))
56
+ }]
57
+ });
58
+ }
59
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuidePage","toggle","isVisible","select","isPageActive","get","isEditorActive","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAA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AI,QAAA,SAAS,EAAC;AAAd,SACGF,OADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGZ,EAAE,CACH,uLADG,CADL,CAJD;AAjBF,KADO;AALT,IADD;AAuCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { hasPageContentFocus } = select( editSiteStore );\n\t\treturn isPageActive && ! isEditorActive && hasPageContentFocus();\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
@@ -36,7 +36,7 @@ export default function WelcomeGuideStyles() {
36
36
  const welcomeLabel = __('Welcome to Styles');
37
37
 
38
38
  return createElement(Guide, {
39
- className: "edit-site-welcome-guide",
39
+ className: "edit-site-welcome-guide guide-styles",
40
40
  contentLabel: welcomeLabel,
41
41
  finishButtonText: __('Get started'),
42
42
  onFinish: () => toggle('core/edit-site', 'welcomeGuideStyles'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/styles.js"],"names":["useDispatch","useSelect","ExternalLink","Guide","__","store","interfaceStore","preferencesStore","WelcomeGuideImage","editSiteStore","WelcomeGuideStyles","toggle","isActive","isStylesOpen","select","sidebar","getActiveComplementaryArea","name","get","welcomeLabel","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBA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,EAqBP;AACCgB,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,0DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGjB,EAAE,CAAE,gBAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,8JADG,CADL,CAJD;AARF,KArBO,EAyCP;AACCgB,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,8DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGjB,EAAE,CAAE,oBAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,qLADG,CADL,CAJD;AARF,KAzCO,EA6DP;AACCgB,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,+DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGjB,EAAE,CAAE,YAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,6CADG,CADL,EAIC,cAAC,YAAD;AACC,QAAA,IAAI,EAAGA,EAAE,CACR,8DADQ;AADV,SAKGA,EAAE,CACH,8DADG,CALL,CAJD,CAJD;AARF,KA7DO;AALT,IADD;AAmGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideStyles() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isStylesOpen } = useSelect( ( select ) => {\n\t\tconst sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditSiteStore.name\n\t\t);\n\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuideStyles'\n\t\t\t),\n\t\t\tisStylesOpen: sidebar === 'edit-site/global-styles',\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isStylesOpen ) {\n\t\treturn null;\n\t}\n\n\tconst welcomeLabel = __( 'Welcome to Styles' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide\"\n\t\t\tcontentLabel={ welcomeLabel }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuideStyles' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ welcomeLabel }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Set the design' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Personalize blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to block themes and styling your site? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/styles-overview/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Here’s a detailed guide to learn how to make the most of it.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/styles.js"],"names":["useDispatch","useSelect","ExternalLink","Guide","__","store","interfaceStore","preferencesStore","WelcomeGuideImage","editSiteStore","WelcomeGuideStyles","toggle","isActive","isStylesOpen","select","sidebar","getActiveComplementaryArea","name","get","welcomeLabel","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAA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EC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGF,YADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGf,EAAE,CACH,2KADG,CADL,CAJD;AARF,KADO,EAqBP;AACCgB,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,0DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGjB,EAAE,CAAE,gBAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,8JADG,CADL,CAJD;AARF,KArBO,EAyCP;AACCgB,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,8DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGjB,EAAE,CAAE,oBAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,qLADG,CADL,CAJD;AARF,KAzCO,EA6DP;AACCgB,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,+DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGjB,EAAE,CAAE,YAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,6CADG,CADL,EAIC,cAAC,YAAD;AACC,QAAA,IAAI,EAAGA,EAAE,CACR,8DADQ;AADV,SAKGA,EAAE,CACH,8DADG,CALL,CAJD,CAJD;AARF,KA7DO;AALT,IADD;AAmGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideStyles() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isStylesOpen } = useSelect( ( select ) => {\n\t\tconst sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditSiteStore.name\n\t\t);\n\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuideStyles'\n\t\t\t),\n\t\t\tisStylesOpen: sidebar === 'edit-site/global-styles',\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isStylesOpen ) {\n\t\treturn null;\n\t}\n\n\tconst welcomeLabel = __( 'Welcome to Styles' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-styles\"\n\t\t\tcontentLabel={ welcomeLabel }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuideStyles' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ welcomeLabel }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Set the design' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Personalize blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to block themes and styling your site? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/styles-overview/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Here’s a detailed guide to learn how to make the most of it.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
@@ -0,0 +1,60 @@
1
+ import { createElement, Fragment } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { useDispatch, useSelect } from '@wordpress/data';
7
+ import { Guide } from '@wordpress/components';
8
+ import { __ } from '@wordpress/i18n';
9
+ import { store as preferencesStore } from '@wordpress/preferences';
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+
14
+ import { store as editSiteStore } from '../../store';
15
+ export default function WelcomeGuideTemplate() {
16
+ const {
17
+ toggle
18
+ } = useDispatch(preferencesStore);
19
+ const isVisible = useSelect(select => {
20
+ const isTemplateActive = !!select(preferencesStore).get('core/edit-site', 'welcomeGuideTemplate');
21
+ const isEditorActive = !!select(preferencesStore).get('core/edit-site', 'welcomeGuide');
22
+ const {
23
+ isPage,
24
+ hasPageContentFocus
25
+ } = select(editSiteStore);
26
+ return isTemplateActive && !isEditorActive && isPage() && !hasPageContentFocus();
27
+ }, []);
28
+
29
+ if (!isVisible) {
30
+ return null;
31
+ }
32
+
33
+ const heading = __('Editing a template');
34
+
35
+ return createElement(Guide, {
36
+ className: "edit-site-welcome-guide guide-template",
37
+ contentLabel: heading,
38
+ finishButtonText: __('Continue'),
39
+ onFinish: () => toggle('core/edit-site', 'welcomeGuideTemplate'),
40
+ pages: [{
41
+ image: createElement("video", {
42
+ className: "edit-site-welcome-guide__video",
43
+ autoPlay: true,
44
+ loop: true,
45
+ muted: true,
46
+ width: "312",
47
+ height: "240"
48
+ }, createElement("source", {
49
+ src: "https://s.w.org/images/block-editor/editing-your-template.mp4",
50
+ type: "video/mp4"
51
+ })),
52
+ content: createElement(Fragment, null, createElement("h1", {
53
+ className: "edit-site-welcome-guide__heading"
54
+ }, heading), createElement("p", {
55
+ className: "edit-site-welcome-guide__text"
56
+ }, __('Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.')))
57
+ }]
58
+ });
59
+ }
60
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuideTemplate","toggle","isVisible","select","isTemplateActive","get","isEditorActive","isPage","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,oBAAT,GAAgC;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAaR,WAAW,CAAEK,gBAAF,CAA9B;AAEA,QAAMI,SAAS,GAAGR,SAAS,CAAIS,MAAF,IAAc;AAC1C,UAAMC,gBAAgB,GAAG,CAAC,CAAED,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CAC3B,gBAD2B,EAE3B,sBAF2B,CAA5B;AAIA,UAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACzB,gBADyB,EAEzB,cAFyB,CAA1B;AAIA,UAAM;AAAEE,MAAAA,MAAF;AAAUC,MAAAA;AAAV,QAAkCL,MAAM,CAAEJ,aAAF,CAA9C;AACA,WACCK,gBAAgB,IAChB,CAAEE,cADF,IAEAC,MAAM,EAFN,IAGA,CAAEC,mBAAmB,EAJtB;AAMA,GAhB0B,EAgBxB,EAhBwB,CAA3B;;AAkBA,MAAK,CAAEN,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMO,OAAO,GAAGb,EAAE,CAAE,oBAAF,CAAlB;;AAEA,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,YAAY,EAAGa,OAFhB;AAGC,IAAA,gBAAgB,EAAGb,EAAE,CAAE,UAAF,CAHtB;AAIC,IAAA,QAAQ,EAAG,MACVK,MAAM,CAAE,gBAAF,EAAoB,sBAApB,CALR;AAOC,IAAA,KAAK,EAAG,CACP;AACCS,MAAAA,KAAK,EACJ;AACC,QAAA,SAAS,EAAC,gCADX;AAEC,QAAA,QAAQ,MAFT;AAGC,QAAA,IAAI,MAHL;AAIC,QAAA,KAAK,MAJN;AAKC,QAAA,KAAK,EAAC,KALP;AAMC,QAAA,MAAM,EAAC;AANR,SAQC;AACC,QAAA,GAAG,EAAC,+DADL;AAEC,QAAA,IAAI,EAAC;AAFN,QARD,CAFF;AAgBCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGF,OADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGb,EAAE,CACH,4MADG,CADL,CAJD;AAjBF,KADO;AAPT,IADD;AAyCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isTemplateActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuideTemplate'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { isPage, hasPageContentFocus } = select( editSiteStore );\n\t\treturn (\n\t\t\tisTemplateActive &&\n\t\t\t! isEditorActive &&\n\t\t\tisPage() &&\n\t\t\t! hasPageContentFocus()\n\t\t);\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}