@wordpress/edit-site 5.12.4 → 5.12.6

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 (264) hide show
  1. package/build/components/add-new-template/new-template.js +1 -1
  2. package/build/components/add-new-template/new-template.js.map +1 -1
  3. package/build/components/block-editor/editor-canvas.js +1 -1
  4. package/build/components/block-editor/editor-canvas.js.map +1 -1
  5. package/build/components/create-pattern-modal/index.js +7 -7
  6. package/build/components/create-pattern-modal/index.js.map +1 -1
  7. package/build/components/header-edit-mode/document-actions/index.js +9 -1
  8. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  9. package/build/components/page/index.js +3 -1
  10. package/build/components/page/index.js.map +1 -1
  11. package/build/components/page-main/index.js +8 -4
  12. package/build/components/page-main/index.js.map +1 -1
  13. package/build/components/{page-library → page-patterns}/grid-item.js +52 -27
  14. package/build/components/page-patterns/grid-item.js.map +1 -0
  15. package/build/components/{page-library → page-patterns}/grid.js +1 -1
  16. package/build/components/page-patterns/grid.js.map +1 -0
  17. package/build/components/{page-library → page-patterns}/index.js +6 -6
  18. package/build/components/page-patterns/index.js.map +1 -0
  19. package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
  20. package/build/components/page-patterns/no-patterns.js.map +1 -0
  21. package/build/components/{page-library → page-patterns}/patterns-list.js +6 -6
  22. package/build/components/page-patterns/patterns-list.js.map +1 -0
  23. package/build/components/page-patterns/search-items.js.map +1 -0
  24. package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
  25. package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
  26. package/build/components/{page-library → page-patterns}/use-patterns.js +12 -2
  27. package/build/components/page-patterns/use-patterns.js.map +1 -0
  28. package/build/components/{page-library → page-patterns}/utils.js +3 -3
  29. package/build/components/page-patterns/utils.js.map +1 -0
  30. package/build/components/page-template-parts/index.js +102 -0
  31. package/build/components/page-template-parts/index.js.map +1 -0
  32. package/build/components/sidebar/index.js +6 -6
  33. package/build/components/sidebar/index.js.map +1 -1
  34. package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
  35. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  36. package/build/components/sidebar-navigation-screen-global-styles/index.js +20 -8
  37. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  38. package/build/components/sidebar-navigation-screen-main/index.js +2 -2
  39. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  40. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +2 -4
  41. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  42. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -4
  43. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  44. package/build/components/sidebar-navigation-screen-pages/index.js +1 -1
  45. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  46. package/build/components/sidebar-navigation-screen-pattern/index.js +13 -8
  47. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  48. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +23 -0
  49. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  50. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +3 -3
  51. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  52. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +55 -15
  53. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  54. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  55. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +30 -0
  56. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  57. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -20
  58. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  59. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  60. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
  61. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  62. package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
  63. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  64. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  65. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  66. package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  67. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  68. package/build/components/welcome-guide/editor.js +1 -1
  69. package/build/components/welcome-guide/editor.js.map +1 -1
  70. package/build/components/welcome-guide/index.js +5 -1
  71. package/build/components/welcome-guide/index.js.map +1 -1
  72. package/build/components/welcome-guide/page.js +70 -0
  73. package/build/components/welcome-guide/page.js.map +1 -0
  74. package/build/components/welcome-guide/styles.js +1 -1
  75. package/build/components/welcome-guide/styles.js.map +1 -1
  76. package/build/components/welcome-guide/template.js +71 -0
  77. package/build/components/welcome-guide/template.js.map +1 -0
  78. package/build/hooks/commands/use-common-commands.js +17 -2
  79. package/build/hooks/commands/use-common-commands.js.map +1 -1
  80. package/build/hooks/commands/use-edit-mode-commands.js +2 -1
  81. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  82. package/build/index.js +2 -0
  83. package/build/index.js.map +1 -1
  84. package/build/store/actions.js +5 -2
  85. package/build/store/actions.js.map +1 -1
  86. package/build/utils/get-is-list-page.js +2 -2
  87. package/build/utils/get-is-list-page.js.map +1 -1
  88. package/build-module/components/add-new-template/new-template.js +2 -2
  89. package/build-module/components/add-new-template/new-template.js.map +1 -1
  90. package/build-module/components/block-editor/editor-canvas.js +1 -1
  91. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  92. package/build-module/components/create-pattern-modal/index.js +7 -7
  93. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  94. package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
  95. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  96. package/build-module/components/page/index.js +2 -1
  97. package/build-module/components/page/index.js.map +1 -1
  98. package/build-module/components/page-main/index.js +6 -3
  99. package/build-module/components/page-main/index.js.map +1 -1
  100. package/build-module/components/{page-library → page-patterns}/grid-item.js +56 -29
  101. package/build-module/components/page-patterns/grid-item.js.map +1 -0
  102. package/build-module/components/{page-library → page-patterns}/grid.js +1 -1
  103. package/build-module/components/page-patterns/grid.js.map +1 -0
  104. package/build-module/components/{page-library → page-patterns}/index.js +5 -5
  105. package/build-module/components/page-patterns/index.js.map +1 -0
  106. package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
  107. package/build-module/components/page-patterns/no-patterns.js.map +1 -0
  108. package/build-module/components/{page-library → page-patterns}/patterns-list.js +6 -6
  109. package/build-module/components/page-patterns/patterns-list.js.map +1 -0
  110. package/build-module/components/page-patterns/search-items.js.map +1 -0
  111. package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
  112. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
  113. package/build-module/components/{page-library → page-patterns}/use-patterns.js +12 -2
  114. package/build-module/components/page-patterns/use-patterns.js.map +1 -0
  115. package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
  116. package/build-module/components/page-patterns/utils.js.map +1 -0
  117. package/build-module/components/page-template-parts/index.js +81 -0
  118. package/build-module/components/page-template-parts/index.js.map +1 -0
  119. package/build-module/components/sidebar/index.js +5 -5
  120. package/build-module/components/sidebar/index.js.map +1 -1
  121. package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
  122. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  123. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -8
  124. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  125. package/build-module/components/sidebar-navigation-screen-main/index.js +2 -2
  126. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  127. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +2 -4
  128. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  129. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +15 -5
  130. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  131. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -2
  132. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  133. package/build-module/components/sidebar-navigation-screen-pattern/index.js +12 -7
  134. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  135. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +21 -0
  136. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  137. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +3 -3
  138. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  139. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +54 -16
  140. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  141. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  142. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +20 -0
  143. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  144. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -17
  145. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  146. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  147. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
  148. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  149. package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
  150. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  151. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  152. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  153. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  154. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  155. package/build-module/components/welcome-guide/editor.js +1 -1
  156. package/build-module/components/welcome-guide/editor.js.map +1 -1
  157. package/build-module/components/welcome-guide/index.js +3 -1
  158. package/build-module/components/welcome-guide/index.js.map +1 -1
  159. package/build-module/components/welcome-guide/page.js +59 -0
  160. package/build-module/components/welcome-guide/page.js.map +1 -0
  161. package/build-module/components/welcome-guide/styles.js +1 -1
  162. package/build-module/components/welcome-guide/styles.js.map +1 -1
  163. package/build-module/components/welcome-guide/template.js +60 -0
  164. package/build-module/components/welcome-guide/template.js.map +1 -0
  165. package/build-module/hooks/commands/use-common-commands.js +16 -2
  166. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  167. package/build-module/hooks/commands/use-edit-mode-commands.js +2 -1
  168. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  169. package/build-module/index.js +2 -0
  170. package/build-module/index.js.map +1 -1
  171. package/build-module/store/actions.js +5 -2
  172. package/build-module/store/actions.js.map +1 -1
  173. package/build-module/utils/get-is-list-page.js +2 -2
  174. package/build-module/utils/get-is-list-page.js.map +1 -1
  175. package/build-style/style-rtl.css +43 -26
  176. package/build-style/style.css +43 -26
  177. package/package.json +19 -19
  178. package/src/components/add-new-template/new-template.js +2 -2
  179. package/src/components/block-editor/editor-canvas.js +3 -1
  180. package/src/components/create-pattern-modal/index.js +10 -11
  181. package/src/components/header-edit-mode/document-actions/index.js +9 -1
  182. package/src/components/page/index.js +5 -1
  183. package/src/components/page-main/index.js +6 -3
  184. package/src/components/{page-library → page-patterns}/grid-item.js +74 -24
  185. package/src/components/{page-library → page-patterns}/grid.js +1 -1
  186. package/src/components/{page-library → page-patterns}/index.js +5 -5
  187. package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
  188. package/src/components/{page-library → page-patterns}/patterns-list.js +6 -6
  189. package/src/components/{page-library → page-patterns}/style.scss +16 -12
  190. package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
  191. package/src/components/{page-library → page-patterns}/use-patterns.js +11 -2
  192. package/src/components/{page-library → page-patterns}/utils.js +3 -3
  193. package/src/components/page-template-parts/index.js +105 -0
  194. package/src/components/sidebar/index.js +6 -6
  195. package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
  196. package/src/components/sidebar-navigation-screen-global-styles/index.js +26 -15
  197. package/src/components/sidebar-navigation-screen-main/index.js +2 -2
  198. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +2 -6
  199. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +12 -4
  200. package/src/components/sidebar-navigation-screen-pages/index.js +2 -2
  201. package/src/components/sidebar-navigation-screen-pattern/index.js +13 -6
  202. package/src/components/sidebar-navigation-screen-pattern/style.scss +4 -0
  203. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +43 -1
  204. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +3 -3
  205. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +75 -22
  206. package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
  207. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +23 -0
  208. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +1 -18
  209. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
  210. package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
  211. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
  212. package/src/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  213. package/src/components/welcome-guide/editor.js +1 -1
  214. package/src/components/welcome-guide/index.js +4 -0
  215. package/src/components/welcome-guide/page.js +75 -0
  216. package/src/components/welcome-guide/style.scss +15 -1
  217. package/src/components/welcome-guide/styles.js +1 -1
  218. package/src/components/welcome-guide/template.js +82 -0
  219. package/src/hooks/commands/use-common-commands.js +13 -1
  220. package/src/hooks/commands/use-edit-mode-commands.js +5 -1
  221. package/src/index.js +2 -0
  222. package/src/store/actions.js +8 -1
  223. package/src/style.scss +2 -2
  224. package/src/utils/get-is-list-page.js +4 -3
  225. package/build/components/page-library/grid-item.js.map +0 -1
  226. package/build/components/page-library/grid.js.map +0 -1
  227. package/build/components/page-library/index.js.map +0 -1
  228. package/build/components/page-library/no-patterns.js.map +0 -1
  229. package/build/components/page-library/patterns-list.js.map +0 -1
  230. package/build/components/page-library/search-items.js.map +0 -1
  231. package/build/components/page-library/use-library-settings.js.map +0 -1
  232. package/build/components/page-library/use-patterns.js.map +0 -1
  233. package/build/components/page-library/utils.js.map +0 -1
  234. package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  235. package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
  236. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  237. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  238. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  239. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  240. package/build-module/components/page-library/grid-item.js.map +0 -1
  241. package/build-module/components/page-library/grid.js.map +0 -1
  242. package/build-module/components/page-library/index.js.map +0 -1
  243. package/build-module/components/page-library/no-patterns.js.map +0 -1
  244. package/build-module/components/page-library/patterns-list.js.map +0 -1
  245. package/build-module/components/page-library/search-items.js.map +0 -1
  246. package/build-module/components/page-library/use-library-settings.js.map +0 -1
  247. package/build-module/components/page-library/use-patterns.js.map +0 -1
  248. package/build-module/components/page-library/utils.js.map +0 -1
  249. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  250. package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
  251. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  252. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  253. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  254. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  255. package/src/components/sidebar-navigation-screen-library/style.scss +0 -3
  256. /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
  257. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  258. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
  259. /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
  260. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  261. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
  262. /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
  263. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  264. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = WelcomeGuidePage;
7
+
8
+ var _element = require("@wordpress/element");
9
+
10
+ var _data = require("@wordpress/data");
11
+
12
+ var _components = require("@wordpress/components");
13
+
14
+ var _i18n = require("@wordpress/i18n");
15
+
16
+ var _preferences = require("@wordpress/preferences");
17
+
18
+ var _store = require("../../store");
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ function WelcomeGuidePage() {
28
+ const {
29
+ toggle
30
+ } = (0, _data.useDispatch)(_preferences.store);
31
+ const isVisible = (0, _data.useSelect)(select => {
32
+ const isPageActive = !!select(_preferences.store).get('core/edit-site', 'welcomeGuidePage');
33
+ const isEditorActive = !!select(_preferences.store).get('core/edit-site', 'welcomeGuide');
34
+ const {
35
+ hasPageContentFocus
36
+ } = select(_store.store);
37
+ return isPageActive && !isEditorActive && hasPageContentFocus();
38
+ }, []);
39
+
40
+ if (!isVisible) {
41
+ return null;
42
+ }
43
+
44
+ const heading = (0, _i18n.__)('Editing your page');
45
+ return (0, _element.createElement)(_components.Guide, {
46
+ className: "edit-site-welcome-guide guide-page",
47
+ contentLabel: heading,
48
+ finishButtonText: (0, _i18n.__)('Continue'),
49
+ onFinish: () => toggle('core/edit-site', 'welcomeGuidePage'),
50
+ pages: [{
51
+ image: (0, _element.createElement)("video", {
52
+ className: "edit-site-welcome-guide__video",
53
+ autoPlay: true,
54
+ loop: true,
55
+ muted: true,
56
+ width: "312",
57
+ height: "240"
58
+ }, (0, _element.createElement)("source", {
59
+ src: "https://s.w.org/images/block-editor/editing-your-page.mp4",
60
+ type: "video/mp4"
61
+ })),
62
+ content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
63
+ className: "edit-site-welcome-guide__heading"
64
+ }, heading), (0, _element.createElement)("p", {
65
+ className: "edit-site-welcome-guide__text"
66
+ }, (0, _i18n.__)('We’ve recently introduced the ability to edit pages within the site editor. You can switch to editing your template using the settings sidebar.')))
67
+ }]
68
+ });
69
+ }
70
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"names":["WelcomeGuidePage","toggle","preferencesStore","isVisible","select","isPageActive","get","isEditorActive","hasPageContentFocus","editSiteStore","heading","image","content"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;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AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,iJADC,CADH,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 your 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'We’ve recently introduced the ability to edit pages within the site editor. You can switch to editing your 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"]}
@@ -51,7 +51,7 @@ function WelcomeGuideStyles() {
51
51
 
52
52
  const welcomeLabel = (0, _i18n.__)('Welcome to Styles');
53
53
  return (0, _element.createElement)(_components.Guide, {
54
- className: "edit-site-welcome-guide",
54
+ className: "edit-site-welcome-guide guide-styles",
55
55
  contentLabel: welcomeLabel,
56
56
  finishButtonText: (0, _i18n.__)('Get started'),
57
57
  onFinish: () => toggle('core/edit-site', 'welcomeGuideStyles'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/styles.js"],"names":["WelcomeGuideStyles","toggle","preferencesStore","isActive","isStylesOpen","select","sidebar","interfaceStore","getActiveComplementaryArea","editSiteStore","name","get","welcomeLabel","image","content"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,kBAAT,GAA8B;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AAEA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA6B,qBAAaC,MAAF,IAAc;AAC3D,UAAMC,OAAO,GAAGD,MAAM,CAAEE,gBAAF,CAAN,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AW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,oBAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,qLADC,CADH,CAJD;AARF,KAzCO,EA6DP;AACCD,MAAAA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,+DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,YAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,6CADC,CADH,EAIC,4BAAC,wBAAD;AACC,QAAA,IAAI,EAAG,cACN,8DADM;AADR,SAKG,cACD,8DADC,CALH,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":["WelcomeGuideStyles","toggle","preferencesStore","isActive","isStylesOpen","select","sidebar","interfaceStore","getActiveComplementaryArea","editSiteStore","name","get","welcomeLabel","image","content"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,kBAAT,GAA8B;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AAEA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA6B,qBAAaC,MAAF,IAAc;AAC3D,UAAMC,OAAO,GAAGD,MAAM,CAAEE,gBAAF,CAAN,CAAyBC,0BAAzB,CACfC,aAAcC,IADC,CAAhB;AAIA,WAAO;AACNP,MAAAA,QAAQ,EAAE,CAAC,CAAEE,MAAM,CAAEH,kBAAF,CAAN,CAA2BS,GAA3B,CACZ,gBADY,EAEZ,oBAFY,CADP;AAKNP,MAAAA,YAAY,EAAEE,OAAO,KA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AA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,+DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,YAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,6CADC,CADH,EAIC,4BAAC,wBAAD;AACC,QAAA,IAAI,EAAG,cACN,8DADM;AADR,SAKG,cACD,8DADC,CALH,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,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = WelcomeGuideTemplate;
7
+
8
+ var _element = require("@wordpress/element");
9
+
10
+ var _data = require("@wordpress/data");
11
+
12
+ var _components = require("@wordpress/components");
13
+
14
+ var _i18n = require("@wordpress/i18n");
15
+
16
+ var _preferences = require("@wordpress/preferences");
17
+
18
+ var _store = require("../../store");
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ function WelcomeGuideTemplate() {
28
+ const {
29
+ toggle
30
+ } = (0, _data.useDispatch)(_preferences.store);
31
+ const isVisible = (0, _data.useSelect)(select => {
32
+ const isTemplateActive = !!select(_preferences.store).get('core/edit-site', 'welcomeGuideTemplate');
33
+ const isEditorActive = !!select(_preferences.store).get('core/edit-site', 'welcomeGuide');
34
+ const {
35
+ isPage,
36
+ hasPageContentFocus
37
+ } = select(_store.store);
38
+ return isTemplateActive && !isEditorActive && isPage() && !hasPageContentFocus();
39
+ }, []);
40
+
41
+ if (!isVisible) {
42
+ return null;
43
+ }
44
+
45
+ const heading = (0, _i18n.__)('Editing your template');
46
+ return (0, _element.createElement)(_components.Guide, {
47
+ className: "edit-site-welcome-guide guide-template",
48
+ contentLabel: heading,
49
+ finishButtonText: (0, _i18n.__)('Continue'),
50
+ onFinish: () => toggle('core/edit-site', 'welcomeGuideTemplate'),
51
+ pages: [{
52
+ image: (0, _element.createElement)("video", {
53
+ className: "edit-site-welcome-guide__video",
54
+ autoPlay: true,
55
+ loop: true,
56
+ muted: true,
57
+ width: "312",
58
+ height: "240"
59
+ }, (0, _element.createElement)("source", {
60
+ src: "https://s.w.org/images/block-editor/editing-your-template.mp4",
61
+ type: "video/mp4"
62
+ })),
63
+ content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
64
+ className: "edit-site-welcome-guide__heading"
65
+ }, heading), (0, _element.createElement)("p", {
66
+ className: "edit-site-welcome-guide__text"
67
+ }, (0, _i18n.__)('You’re now editing your page’s template. To switch back to editing your page you can click the back button in the toolbar.')))
68
+ }]
69
+ });
70
+ }
71
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"names":["WelcomeGuideTemplate","toggle","preferencesStore","isVisible","select","isTemplateActive","get","isEditorActive","isPage","hasPageContentFocus","editSiteStore","heading","image","content"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGe,SAASA,oBAAT,GAAgC;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AAEA,QAAMC,SAAS,GAAG,qBAAaC,MAAF,IAAc;AAC1C,UAAMC,gBAAgB,GAAG,CAAC,CAAED,MAAM,CAAEF,kBAAF,CAAN,CAA2BI,GAA3B,CAC3B,gBAD2B,EAE3B,sBAF2B,CAA5B;AAIA,UAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEF,kBAAF,CAAN,CAA2BI,GAA3B,CACzB,gBADyB,EAEzB,cAFyB,CAA1B;AAIA,UAAM;AAAEE,MAAAA,MAAF;AAAUC,MAAAA;AAAV,QAAkCL,MAAM,CAAEM,YAAF,CAA9C;AACA,WACCL,gBAAgB,IAChB,CAAEE,cADF,IAEAC,MAAM,EAFN,IAGA,CAAEC,mBAAmB,EAJtB;AAMA,GAhBiB,EAgBf,EAhBe,CAAlB;;AAkBA,MAAK,CAAEN,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMQ,OAAO,GAAG,cAAI,uBAAJ,CAAhB;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,YAAY,EAAGA,OAFhB;AAGC,IAAA,gBAAgB,EAAG,cAAI,UAAJ,CAHpB;AAIC,IAAA,QAAQ,EAAG,MACVV,MAAM,CAAE,gBAAF,EAAoB,sBAApB,CALR;AAOC,IAAA,KAAK,EAAG,CACP;AACCW,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,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGF,OADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,4HADC,CADH,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 your 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'You’re now editing your page’s template. To switch back to editing your page you can 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"]}
@@ -23,6 +23,8 @@ var _preferences = require("@wordpress/preferences");
23
23
 
24
24
  var _coreData = require("@wordpress/core-data");
25
25
 
26
+ var _notices = require("@wordpress/notices");
27
+
26
28
  var _lockUnlock = require("../../lock-unlock");
27
29
 
28
30
  var _store = require("../../store");
@@ -125,16 +127,21 @@ function useCommonCommands() {
125
127
  const {
126
128
  set
127
129
  } = (0, _data.useDispatch)(_preferences.store);
130
+ const {
131
+ createInfoNotice
132
+ } = (0, _data.useDispatch)(_notices.store);
128
133
  const history = useHistory();
129
134
  const {
130
- homeUrl
135
+ homeUrl,
136
+ isDistractionFree
131
137
  } = (0, _data.useSelect)(select => {
132
138
  const {
133
139
  getUnstableBase // Site index.
134
140
 
135
141
  } = select(_coreData.store);
136
142
  return {
137
- homeUrl: getUnstableBase()?.home
143
+ homeUrl: getUnstableBase()?.home,
144
+ isDistractionFree: select(_preferences.store).get(_store.store.name, 'distractionFree')
138
145
  };
139
146
  }, []);
140
147
  (0, _commands.useCommand)({
@@ -164,6 +171,14 @@ function useCommonCommands() {
164
171
  path: '/wp_global_styles',
165
172
  canvas: 'edit'
166
173
  });
174
+
175
+ if (isDistractionFree) {
176
+ set(_store.store.name, 'distractionFree', false);
177
+ createInfoNotice((0, _i18n.__)('Distraction free mode turned off.'), {
178
+ type: 'snackbar'
179
+ });
180
+ }
181
+
167
182
  openGeneralSidebar('edit-site/global-styles');
168
183
  },
169
184
  icon: _icons.styles
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"names":["useGlobalStylesReset","blockEditorPrivateApis","useHistory","routerPrivateApis","useGlobalStylesResetCommands","canReset","onReset","commands","name","label","icon","trash","callback","close","isLoading","useGlobalStylesOpenCssCommands","openGeneralSidebar","setEditorCanvasContainerView","editSiteStore","history","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","styles","push","path","canvas","useCommonCommands","set","preferencesStore","homeUrl","getUnstableBase","home","backup","setTimeout","help","window","open","external","hook"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAWA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAA2B,wBAAQC,wBAAR,CAAjC;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAiB,wBAAQC,mBAAR,CAAvB;;AAEA,SAASC,4BAAT,GAAwC;AACvC,QAAM,CAAEC,QAAF,EAAYC,OAAZ,IAAwBN,oBAAoB,EAAlD;AACA,QAAMO,QAAQ,GAAG,sBAAS,MAAM;AAC/B,QAAK,CAAEF,QAAP,EAAkB;AACjB,aAAO,EAAP;AACA;;AAED,WAAO,CACN;AACCG,MAAAA,IAAI,EAAE,oCADP;AAECC,MAAAA,KAAK,EAAE,cAAI,0BAAJ,CAFR;AAGCC,MAAAA,IAAI,EAAEC,YAHP;AAICC,MAAAA,QAAQ,EAAE,CAAE;AAAEC,QAAAA;AAAF,OAAF,KAAiB;AAC1BA,QAAAA,KAAK;AACLP,QAAAA,OAAO;AACP;AAPF,KADM,CAAP;AAWA,GAhBgB,EAgBd,CAAED,QAAF,EAAYC,OAAZ,CAhBc,CAAjB;AAkBA,SAAO;AACNQ,IAAAA,SAAS,EAAE,KADL;AAENP,IAAAA;AAFM,GAAP;AAIA;;AAED,SAASQ,8BAAT,GAA0C;AACzC,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MAAuD,wBAC5D,uBAAaC,YAAb,CAD4D,CAA7D;AAGA,QAAMC,OAAO,GAAGjB,UAAU,EAA1B;AACA,QAAM;AAAEkB,IAAAA;AAAF,MAAiB,qBAAaC,MAAF,IAAc;AAAA;;AAC/C,UAAM;AAAEC,MAAAA,eAAF;AAAmB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AF,KAAiB;AAC1BA,MAAAA,KAAK;AACLM,MAAAA,OAAO,CAACW,IAAR,CAAc;AACbC,QAAAA,IAAI,EAAE,mBADO;AAEbC,QAAAA,MAAM,EAAE;AAFK,OAAd;AAIAhB,MAAAA,kBAAkB,CAAE,yBAAF,CAAlB;AACAkB,MAAAA,GAAG,CAAE,gBAAF,EAAoB,oBAApB,EAA0C,IAA1C,CAAH,CAP0B,CAQ1B;AACA;;AACAM,MAAAA,UAAU,CAAE,MAAM;AACjBN,QAAAA,GAAG,CAAE,gBAAF,EAAoB,oBAApB,EAA0C,IAA1C,CAAH;AACA,OAFS,EAEP,GAFO,CAAV;AAGA,KAhBU;AAiBXxB,IAAAA,IAAI,EAAE+B;AAjBK,GAAZ;AAoBA,4BAAY;AACXjC,IAAAA,IAAI,EAAE,0BADK;AAEXC,IAAAA,KAAK,EAAE,cAAI,WAAJ,CAFI;AAGXG,IAAAA,QAAQ,EAAE,CAAE;AAAEC,MAAAA;AAAF,KAAF,KAAiB;AAC1BA,MAAAA,KAAK;AACL6B,MAAAA,MAAM,CAACC,IAAP,CAAaP,OAAb,EAAsB,QAAtB;AACA,KANU;AAOX1B,IAAAA,IAAI,EAAEkC;AAPK,GAAZ;AAUA,kCAAkB;AACjBpC,IAAAA,IAAI,EAAE,oCADW;AAEjBqC,IAAAA,IAAI,EAAEzC;AAFW,GAAlB;AAKA,kCAAkB;AACjBI,IAAAA,IAAI,EAAE,gCADW;AAEjBqC,IAAAA,IAAI,EAAE9B;AAFW,GAAlB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { trash, backup, help, styles, external } from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles to defaults' ),\n\t\t\t\ticon: trash,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Open CSS' ),\n\t\t\t\ticon: styles,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\thistory.push( {\n\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t} );\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { set } = useDispatch( preferencesStore );\n\tconst history = useHistory();\n\tconst { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\tlabel: __( 'Open styles revisions' ),\n\t\ticon: backup,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\thistory.push( {\n\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/open-styles',\n\t\tlabel: __( 'Open styles' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\thistory.push( {\n\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t},\n\t\ticon: styles,\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\tlabel: __( 'Learn about styles' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\thistory.push( {\n\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\tsetTimeout( () => {\n\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t}, 500 );\n\t\t},\n\t\ticon: help,\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"names":["useGlobalStylesReset","blockEditorPrivateApis","useHistory","routerPrivateApis","useGlobalStylesResetCommands","canReset","onReset","commands","name","label","icon","trash","callback","close","isLoading","useGlobalStylesOpenCssCommands","openGeneralSidebar","setEditorCanvasContainerView","editSiteStore","history","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","styles","push","path","canvas","useCommonCommands","set","preferencesStore","createInfoNotice","noticesStore","homeUrl","isDistractionFree","getUnstableBase","home","get","backup","type","setTimeout","help","window","open","external","hook"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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atch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { trash, backup, help, styles, external } from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles to defaults' ),\n\t\t\t\ticon: trash,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Open CSS' ),\n\t\t\t\ticon: styles,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\thistory.push( {\n\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t} );\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { set } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst { homeUrl, isDistractionFree } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\tlabel: __( 'Open styles revisions' ),\n\t\ticon: backup,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\thistory.push( {\n\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/open-styles',\n\t\tlabel: __( 'Open styles' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\thistory.push( {\n\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tset( editSiteStore.name, 'distractionFree', false );\n\t\t\t\tcreateInfoNotice( __( 'Distraction free mode turned off.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t}\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t},\n\t\ticon: styles,\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\tlabel: __( 'Learn about styles' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\thistory.push( {\n\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\tsetTimeout( () => {\n\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t}, 500 );\n\t\t},\n\t\ticon: help,\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n}\n"]}
@@ -139,6 +139,7 @@ function useManipulateDocumentCommands() {
139
139
 
140
140
  if ((0, _isTemplateRemovable.default)(template) && !hasPageContentFocus) {
141
141
  const label = template.type === 'wp_template' ? (0, _i18n.__)('Delete template') : (0, _i18n.__)('Delete template part');
142
+ const path = template.type === 'wp_template' ? '/wp_template' : '/wp_template_part/all';
142
143
  commands.push({
143
144
  name: 'core/remove-template',
144
145
  label,
@@ -149,7 +150,7 @@ function useManipulateDocumentCommands() {
149
150
  removeTemplate(template); // Navigate to the template list
150
151
 
151
152
  history.push({
152
- path: '/' + template.type
153
+ path
153
154
  });
154
155
  close();
155
156
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"names":["useHistory","routerPrivateApis","usePageContentFocusCommands","isPage","canvasMode","hasPageContentFocus","select","editSiteStore","getCanvasMode","setHasPageContentFocus","isLoading","commands","push","name","label","icon","layout","callback","close","page","useManipulateDocumentCommands","isLoaded","record","template","removeTemplate","revertTemplate","history","type","backup","trash","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","editorMode","activeSidebar","getEditorMode","interfaceStore","getActiveComplementaryArea","openModal","toggle","preferencesStore","drawerLeft","drawerRight","blockDefault","cog","code","PREFERENCES_MODAL_NAME","keyboardClose","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","useEditModeCommands","hook","context"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAYA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA/BA;AACA;AACA;;AAoBA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAiB,wBAAQC,mBAAR,CAAvB;;AAEA,SAASC,2BAAT,GAAuC;AACtC,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,UAAV;AAAsBC,IAAA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W;AAGjBmD,IAAAA,OAAO,EAAE;AAHQ,GAAlB;AAMA,kCAAkB;AACjBxC,IAAAA,IAAI,EAAE,oCADW;AAEjBuC,IAAAA,IAAI,EAAEhC,6BAFW;AAGjBiC,IAAAA,OAAO,EAAE;AAHQ,GAAlB;AAMA,kCAAkB;AACjBxC,IAAAA,IAAI,EAAE,wBADW;AAEjBuC,IAAAA,IAAI,EAAErB;AAFW,GAAlB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\ttrash,\n\tbackup,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcog,\n\tcode,\n\tkeyboardClose,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { isPage, canvasMode, hasPageContentFocus } = useSelect(\n\t\t( select ) => ( {\n\t\t\tisPage: select( editSiteStore ).isPage(),\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( hasPageContentFocus ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: __( 'Edit template' ),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( false );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( true );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst hasPageContentFocus = useSelect(\n\t\t( select ) => select( editSiteStore ).hasPageContentFocus(),\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Reset template' )\n\t\t\t\t: __( 'Reset template part' );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: backup,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Delete template' )\n\t\t\t\t: __( 'Delete template part' );\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath: '/' + template.type,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst { openGeneralSidebar, closeGeneralSidebar, switchEditorMode } =\n\t\tuseDispatch( editSiteStore );\n\tconst { canvasMode, editorMode, activeSidebar } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboardClose,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"names":["useHistory","routerPrivateApis","usePageContentFocusCommands","isPage","canvasMode","hasPageContentFocus","select","editSiteStore","getCanvasMode","setHasPageContentFocus","isLoading","commands","push","name","label","icon","layout","callback","close","page","useManipulateDocumentCommands","isLoaded","record","template","removeTemplate","revertTemplate","history","type","backup","path","trash","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","editorMode","activeSidebar","getEditorMode","interfaceStore","getActiveComplementaryArea","openModal","toggle","preferencesStore","drawerLeft","drawerRight","blockDefault","cog","code","PREFERENCES_MODAL_NAME","keyboardClose","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","useEditModeCommands","hook","context"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAYA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA/BA;AACA;AACA;;AAoBA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAiB,wBAAQC,mBAAR,CAAvB;;AAEA,SAASC,2BAAT,GAAuC;AACtC,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,UAAV;AAAsBC,IAAAA;AAAtB,MAA8C,qBACjDC,MAAF,KAAgB;AACfH,IAAAA,MAAM,EAAEG,MAAM,CAAEC,YAAF,CAAN,CAAwBJ,MAAxB,EADO;AAEfC,IAAAA,UAAU,EAAE,wBAAQE,MAAM,CAAEC,YAAF,CAAd,EAAkCC,aAAlC,EAFG;AAGfH,IAAAA,mBAAmB,EAAEC,MAAM,CAAEC,YAAF,CAAN,CAAwBF,mBAAxB;AAHN,GAAhB,CADmD,EAMnD,EANmD,CAApD;AAQA,QAAM;AAAEI,IAAAA;AAAF,MAA6B,uBAAaF,YAAb,CAAnC;;AAEA,MAAK,CAAEJ,MAAF,IAAYC,UAAU,KAAK,MAAhC,EAAyC;AACxC,WAAO;AAAEM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AAAEC,MAAAA;AAAF,KAAF,KAAiB;AAC1BgB,MAAAA,gBAAgB,CAAEC,UAAU,KAAK,QAAf,GAA0B,MAA1B,GAAmC,QAArC,CAAhB;AACAjB,MAAAA,KAAK;AACL;AAPa,GAAf;AAUAP,EAAAA,QAAQ,CAACC,IAAT,CAAe;AACdC,IAAAA,IAAI,EAAE,uBADQ;AAEdC,IAAAA,KAAK,EAAE,cAAI,yBAAJ,CAFO;AAGdC,IAAAA,IAAI,EAAE+B,UAHQ;AAId7B,IAAAA,QAAQ,EAAE,MAAM;AACfuB,MAAAA,SAAS,CAAEQ,wCAAF,CAAT;AACA;AANa,GAAf;AASArC,EAAAA,QAAQ,CAACC,IAAT,CAAe;AACdC,IAAAA,IAAI,EAAE,yBADQ;AAEdC,IAAAA,KAAK,EAAE,cAAI,yBAAJ,CAFO;AAGdC,IAAAA,IAAI,EAAEkC,oBAHQ;AAIdhC,IAAAA,QAAQ,EAAE,MAAM;AACfuB,MAAAA,SAAS,CAAEU,4DAAF,CAAT;AACA;AANa,GAAf;AASA,SAAO;AACNxC,IAAAA,SAAS,EAAE,KADL;AAENC,IAAAA;AAFM,GAAP;AAIA;;AAEM,SAASwC,mBAAT,GAA+B;AACrC,kCAAkB;AACjBtC,IAAAA,IAAI,EAAE,mCADW;AAEjBuC,IAAAA,IAAI,EAAElD,2BAFW;AAGjBmD,IAAAA,OAAO,EAAE;AAHQ,GAAlB;AAMA,kCAAkB;AACjBxC,IAAAA,IAAI,EAAE,oCADW;AAEjBuC,IAAAA,IAAI,EAAEhC,6BAFW;AAGjBiC,IAAAA,OAAO,EAAE;AAHQ,GAAlB;AAMA,kCAAkB;AACjBxC,IAAAA,IAAI,EAAE,wBADW;AAEjBuC,IAAAA,IAAI,EAAErB;AAFW,GAAlB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\ttrash,\n\tbackup,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcog,\n\tcode,\n\tkeyboardClose,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { isPage, canvasMode, hasPageContentFocus } = useSelect(\n\t\t( select ) => ( {\n\t\t\tisPage: select( editSiteStore ).isPage(),\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( hasPageContentFocus ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: __( 'Edit template' ),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( false );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetHasPageContentFocus( true );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst hasPageContentFocus = useSelect(\n\t\t( select ) => select( editSiteStore ).hasPageContentFocus(),\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Reset template' )\n\t\t\t\t: __( 'Reset template part' );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: backup,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! hasPageContentFocus ) {\n\t\tconst label =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? __( 'Delete template' )\n\t\t\t\t: __( 'Delete template part' );\n\t\tconst path =\n\t\t\ttemplate.type === 'wp_template'\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst { openGeneralSidebar, closeGeneralSidebar, switchEditorMode } =\n\t\tuseDispatch( editSiteStore );\n\tconst { canvasMode, editorMode, activeSidebar } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboardClose,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"]}
package/build/index.js CHANGED
@@ -118,6 +118,8 @@ function initializeEditor(id, settings) {
118
118
  keepCaretInsideBlock: false,
119
119
  welcomeGuide: true,
120
120
  welcomeGuideStyles: true,
121
+ welcomeGuidePage: true,
122
+ welcomeGuideTemplate: true,
121
123
  showListViewByDefault: false,
122
124
  showBlockBreadcrumbs: true
123
125
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["initializeEditor","id","settings","target","document","getElementById","root","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","blocksStore","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","preferencesStore","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","showBlockBreadcrumbs","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;;AARA;;AACA;;AAKA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AA4EA;;AACA;;AACA;;AACA;;AA5GA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,QAAMK,IAAI,GAAG,yBAAYH,MAAZ,CAAb;;AAEAD,EAAAA,QAAQ,CAACK,kCAAT,GAA8C,CAAEC,MAAF,EAAUC,aAAV,KAC7C,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6CP,QAA7C,CADD;;AAEAA,EAAAA,QAAQ,CAACQ,8BAAT,GAA0CC,oCAA1C;;AAEA,sBAAUC,aAAV,EAAwBC,qCAAxB;;AACA,QAAMC,UAAU,GAAG,iDAA8BC,MAA9B,CAClB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAgBA,IAAI,KAAK,eADP,CAAnB;AAGA,wCAAoBF,UAApB;AACA,sBAAUF,aAAV,EAAwBK,4BAAxB,CAAsD,WAAtD;AACA,0CAA2B;AAAEC,IAAA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AACA;;AAEM,SAASyC,kBAAT,GAA8B;AACpC,2BAAY,gCAAZ,EAA8C;AAC7CC,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAA9C;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tdistractionFree: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["initializeEditor","id","settings","target","document","getElementById","root","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","blocksStore","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","preferencesStore","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","showListViewByDefault","showBlockBreadcrumbs","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;;AARA;;AACA;;AAKA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AA8EA;;AACA;;AACA;;AACA;;AA9GA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,QAAMK,IAAI,GAAG,yBAAYH,MAAZ,CAAb;;AAEAD,EAAAA,QAAQ,CAACK,kCAAT,GAA8C,CAAEC,MAAF,EAAUC,aAAV,KAC7C,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6CP,QAA7C,CADD;;AAEAA,EAAAA,QAAQ,CAACQ,8BAAT,GAA0CC,oCAA1C;;AAEA,sBAAUC,aAAV,EAAwBC,qCAAxB;;AACA,QAAMC,UAAU,GAAG,iDAA8BC,MAA9B,CAClB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAgBA,IAAI,KAAK,eADP,CAAnB;AAGA,wCAAoBF,UAApB;AACA,sBA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EAAmCC,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEAzC,EAAAA,IAAI,CAAC0C,MAAL,CAAa,4BAAC,YAAD,OAAb;AAEA,SAAO1C,IAAP;AACA;;AAEM,SAAS2C,kBAAT,GAA8B;AACpC,2BAAY,gCAAZ,EAA8C;AAC7CC,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAA9C;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tdistractionFree: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\n"]}
@@ -175,11 +175,14 @@ const removeTemplate = template => async ({
175
175
 
176
176
  if (lastError) {
177
177
  throw lastError;
178
- }
178
+ } // Depending on how the entity was retrieved it's title might be
179
+ // an object or simple string.
180
+
179
181
 
182
+ const templateTitle = typeof template.title === 'string' ? template.title : template.title?.rendered;
180
183
  registry.dispatch(_notices.store).createSuccessNotice((0, _i18n.sprintf)(
181
184
  /* translators: The template/part's name. */
182
- (0, _i18n.__)('"%s" deleted.'), (0, _htmlEntities.decodeEntities)(template.title.rendered)), {
185
+ (0, _i18n.__)('"%s" deleted.'), (0, _htmlEntities.decodeEntities)(templateTitle)), {
183
186
  type: 'snackbar',
184
187
  id: 'site-editor-template-deleted-success'
185
188
  });