@wordpress/edit-site 5.12.6 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +1 -7
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +2 -2
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/block-editor/inserter-media-categories.js +1 -22
  9. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  10. package/build/components/block-editor/site-editor-canvas.js +29 -32
  11. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  12. package/build/components/block-editor/use-site-editor-settings.js +9 -12
  13. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  14. package/build/components/canvas-spinner/index.js +1 -18
  15. package/build/components/canvas-spinner/index.js.map +1 -1
  16. package/build/components/create-pattern-modal/index.js +1 -1
  17. package/build/components/create-pattern-modal/index.js.map +1 -1
  18. package/build/components/editor/index.js +10 -1
  19. package/build/components/editor/index.js.map +1 -1
  20. package/build/components/global-styles/palette.js +1 -1
  21. package/build/components/global-styles/palette.js.map +1 -1
  22. package/build/components/header-edit-mode/index.js +6 -2
  23. package/build/components/header-edit-mode/index.js.map +1 -1
  24. package/build/components/layout/index.js +26 -23
  25. package/build/components/layout/index.js.map +1 -1
  26. package/build/components/page/header.js +1 -1
  27. package/build/components/page/header.js.map +1 -1
  28. package/build/components/page-actions/delete-page-menu-item.js +2 -1
  29. package/build/components/page-actions/delete-page-menu-item.js.map +1 -1
  30. package/build/components/page-patterns/grid-item.js +2 -3
  31. package/build/components/page-patterns/grid-item.js.map +1 -1
  32. package/build/components/page-patterns/patterns-list.js +3 -1
  33. package/build/components/page-patterns/patterns-list.js.map +1 -1
  34. package/build/components/page-patterns/use-patterns.js +1 -1
  35. package/build/components/page-patterns/use-patterns.js.map +1 -1
  36. package/build/components/page-template-parts/index.js +1 -0
  37. package/build/components/page-template-parts/index.js.map +1 -1
  38. package/build/components/page-templates/index.js +1 -0
  39. package/build/components/page-templates/index.js.map +1 -1
  40. package/build/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  41. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  42. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
  43. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  44. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
  45. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  46. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +3 -1
  47. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  48. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +9 -3
  49. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  50. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +29 -0
  51. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  52. package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
  53. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  54. package/build/components/sidebar-navigation-screen-page/status-label.js +1 -1
  55. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  56. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  57. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  58. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  59. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  60. package/build/components/site-hub/index.js +1 -1
  61. package/build/components/site-hub/index.js.map +1 -1
  62. package/build/components/template-actions/index.js +22 -6
  63. package/build/components/template-actions/index.js.map +1 -1
  64. package/build/components/welcome-guide/page.js +2 -2
  65. package/build/components/welcome-guide/page.js.map +1 -1
  66. package/build/components/welcome-guide/template.js +2 -2
  67. package/build/components/welcome-guide/template.js.map +1 -1
  68. package/build/hooks/commands/use-edit-mode-commands.js +1 -2
  69. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  70. package/build/index.js +6 -0
  71. package/build/index.js.map +1 -1
  72. package/build/utils/template-part-create.js +2 -2
  73. package/build/utils/template-part-create.js.map +1 -1
  74. package/build-module/components/add-new-page/index.js +1 -6
  75. package/build-module/components/add-new-page/index.js.map +1 -1
  76. package/build-module/components/add-new-pattern/index.js +3 -3
  77. package/build-module/components/add-new-pattern/index.js.map +1 -1
  78. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  79. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  80. package/build-module/components/block-editor/inserter-media-categories.js +1 -22
  81. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  82. package/build-module/components/block-editor/site-editor-canvas.js +29 -32
  83. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  84. package/build-module/components/block-editor/use-site-editor-settings.js +9 -12
  85. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  86. package/build-module/components/canvas-spinner/index.js +1 -15
  87. package/build-module/components/canvas-spinner/index.js.map +1 -1
  88. package/build-module/components/create-pattern-modal/index.js +1 -1
  89. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  90. package/build-module/components/editor/index.js +10 -1
  91. package/build-module/components/editor/index.js.map +1 -1
  92. package/build-module/components/global-styles/palette.js +1 -1
  93. package/build-module/components/global-styles/palette.js.map +1 -1
  94. package/build-module/components/header-edit-mode/index.js +6 -2
  95. package/build-module/components/header-edit-mode/index.js.map +1 -1
  96. package/build-module/components/layout/index.js +26 -23
  97. package/build-module/components/layout/index.js.map +1 -1
  98. package/build-module/components/page/header.js +1 -1
  99. package/build-module/components/page/header.js.map +1 -1
  100. package/build-module/components/page-actions/delete-page-menu-item.js +2 -1
  101. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -1
  102. package/build-module/components/page-patterns/grid-item.js +3 -4
  103. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  104. package/build-module/components/page-patterns/patterns-list.js +3 -1
  105. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  106. package/build-module/components/page-patterns/use-patterns.js +1 -1
  107. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  108. package/build-module/components/page-template-parts/index.js +1 -0
  109. package/build-module/components/page-template-parts/index.js.map +1 -1
  110. package/build-module/components/page-templates/index.js +1 -0
  111. package/build-module/components/page-templates/index.js.map +1 -1
  112. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  113. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  114. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
  115. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  116. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
  117. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  118. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +2 -1
  119. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  120. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +8 -4
  121. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  122. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +20 -0
  123. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  124. package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
  125. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  126. package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
  127. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  128. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  129. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  130. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  131. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  132. package/build-module/components/site-hub/index.js +1 -1
  133. package/build-module/components/site-hub/index.js.map +1 -1
  134. package/build-module/components/template-actions/index.js +24 -7
  135. package/build-module/components/template-actions/index.js.map +1 -1
  136. package/build-module/components/welcome-guide/page.js +2 -2
  137. package/build-module/components/welcome-guide/page.js.map +1 -1
  138. package/build-module/components/welcome-guide/template.js +2 -2
  139. package/build-module/components/welcome-guide/template.js.map +1 -1
  140. package/build-module/hooks/commands/use-edit-mode-commands.js +1 -2
  141. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  142. package/build-module/index.js +1 -0
  143. package/build-module/index.js.map +1 -1
  144. package/build-module/utils/template-part-create.js +1 -1
  145. package/build-module/utils/template-part-create.js.map +1 -1
  146. package/build-style/style-rtl.css +18 -7
  147. package/build-style/style.css +18 -7
  148. package/package.json +39 -39
  149. package/src/components/add-new-page/index.js +1 -6
  150. package/src/components/add-new-pattern/index.js +3 -3
  151. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  152. package/src/components/block-editor/inserter-media-categories.js +1 -21
  153. package/src/components/block-editor/site-editor-canvas.js +7 -1
  154. package/src/components/block-editor/use-site-editor-settings.js +8 -12
  155. package/src/components/canvas-spinner/index.js +1 -11
  156. package/src/components/canvas-spinner/style.scss +4 -0
  157. package/src/components/create-pattern-modal/index.js +1 -1
  158. package/src/components/editor/index.js +15 -1
  159. package/src/components/global-styles/palette.js +10 -9
  160. package/src/components/global-styles/stories/index.js +1 -0
  161. package/src/components/header-edit-mode/document-actions/style.scss +8 -0
  162. package/src/components/header-edit-mode/index.js +17 -9
  163. package/src/components/layout/index.js +39 -44
  164. package/src/components/layout/style.scss +0 -11
  165. package/src/components/page/header.js +1 -1
  166. package/src/components/page-actions/delete-page-menu-item.js +1 -0
  167. package/src/components/page-patterns/grid-item.js +7 -8
  168. package/src/components/page-patterns/patterns-list.js +7 -3
  169. package/src/components/page-patterns/style.scss +1 -1
  170. package/src/components/page-patterns/use-patterns.js +1 -1
  171. package/src/components/page-template-parts/index.js +1 -1
  172. package/src/components/page-templates/index.js +1 -1
  173. package/src/components/sidebar-navigation-screen/style.scss +5 -1
  174. package/src/components/sidebar-navigation-screen-global-styles/index.js +56 -39
  175. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
  176. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
  177. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  178. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
  179. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
  180. package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
  181. package/src/components/sidebar-navigation-screen-page/status-label.js +1 -1
  182. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  183. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  184. package/src/components/site-hub/index.js +1 -1
  185. package/src/components/template-actions/index.js +38 -8
  186. package/src/components/welcome-guide/page.js +2 -2
  187. package/src/components/welcome-guide/template.js +2 -2
  188. package/src/hooks/commands/use-edit-mode-commands.js +0 -1
  189. package/src/index.js +1 -0
  190. package/src/utils/template-part-create.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuidePage","toggle","isVisible","select","isPageActive","get","isEditorActive","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,i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,EAAC,KALP;AAMC,QAAA,MAAM,EAAC;AANR,SAQC;AACC,QAAA,GAAG,EAAC,2DADL;AAEC,QAAA,IAAI,EAAC;AAFN,QARD,CAFF;AAgBCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGF,OADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGZ,EAAE,CACH,iJADG,CADL,CAJD;AAjBF,KADO;AALT,IADD;AAuCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { hasPageContentFocus } = select( editSiteStore );\n\t\treturn isPageActive && ! isEditorActive && hasPageContentFocus();\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing 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'Weve 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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuidePage","toggle","isVisible","select","isPageActive","get","isEditorActive","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,gBAAT,GAA4B;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAaR,WAAW,CAAEK,gBAAF,CAA9B;AAEA,QAAMI,SAAS,GAAGR,SAAS,CAAIS,MAAF,IAAc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ch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { hasPageContentFocus } = select( editSiteStore );\n\t\treturn isPageActive && ! isEditorActive && hasPageContentFocus();\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Its now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
@@ -30,7 +30,7 @@ export default function WelcomeGuideTemplate() {
30
30
  return null;
31
31
  }
32
32
 
33
- const heading = __('Editing your template');
33
+ const heading = __('Editing a template');
34
34
 
35
35
  return createElement(Guide, {
36
36
  className: "edit-site-welcome-guide guide-template",
@@ -53,7 +53,7 @@ export default function WelcomeGuideTemplate() {
53
53
  className: "edit-site-welcome-guide__heading"
54
54
  }, heading), createElement("p", {
55
55
  className: "edit-site-welcome-guide__text"
56
- }, __('You’re now editing your page’s template. To switch back to editing your page you can click the back button in the toolbar.')))
56
+ }, __('Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.')))
57
57
  }]
58
58
  });
59
59
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuideTemplate","toggle","isVisible","select","isTemplateActive","get","isEditorActive","isPage","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,eA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ACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGF,OADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGb,EAAE,CACH,4HADG,CADL,CAJD;AAjBF,KADO;AAPT,IADD;AAyCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isTemplateActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuideTemplate'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { isPage, hasPageContentFocus } = select( editSiteStore );\n\t\treturn (\n\t\t\tisTemplateActive &&\n\t\t\t! isEditorActive &&\n\t\t\tisPage() &&\n\t\t\t! hasPageContentFocus()\n\t\t);\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing 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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuideTemplate","toggle","isVisible","select","isTemplateActive","get","isEditorActive","isPage","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,oBAAT,GAAgC;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAaR,WAAW,CAAEK,gBAAF,CAA9B;AAEA,QAAMI,SAAS,GAAGR,SAAS,CAAIS,MAAF,IAAc;AAC1C,UAAMC,gBAAgB,GAAG,CAAC,CAAED,MAA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ch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isTemplateActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuideTemplate'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { isPage, hasPageContentFocus } = select( editSiteStore );\n\t\treturn (\n\t\t\tisTemplateActive &&\n\t\t\t! isEditorActive &&\n\t\t\tisPage() &&\n\t\t\t! hasPageContentFocus()\n\t\t);\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
@@ -265,8 +265,7 @@ export function useEditModeCommands() {
265
265
  });
266
266
  useCommandLoader({
267
267
  name: 'core/edit-site/manipulate-document',
268
- hook: useManipulateDocumentCommands,
269
- context: 'site-editor-edit'
268
+ hook: useManipulateDocumentCommands
270
269
  });
271
270
  useCommandLoader({
272
271
  name: 'core/edit-site/edit-ui',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"names":["useSelect","useDispatch","__","isRTL","trash","backup","layout","page","drawerLeft","drawerRight","blockDefault","cog","code","keyboardClose","useCommandLoader","privateApis","routerPrivateApis","store","preferencesStore","interfaceStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","unlock","useHistory","usePageContentFocusCommands","isPage","canvasMode","hasPageContentFocus","select","getCanvasMode","setHasPageContentFocus","isLoading","commands","push","name","label","icon","callback","close","useManipulateDocumentCommands","isLoaded","record","template","removeTemplate","revertTemplate","history","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","editorMode","activeSidebar","getEditorMode","getActiveComplementaryArea","openModal","toggle","useEditModeCommands","hook","context"],"mappings":"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EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,oCADW;AAEjByB,IAAAA,IAAI,EAAEpB,6BAFW;AAGjBqB,IAAAA,OAAO,EAAE;AAHQ,GAAF,CAAhB;AAMAlD,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,wBADW;AAEjByB,IAAAA,IAAI,EAAEX;AAFW,GAAF,CAAhB;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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"names":["useSelect","useDispatch","__","isRTL","trash","backup","layout","page","drawerLeft","drawerRight","blockDefault","cog","code","keyboardClose","useCommandLoader","privateApis","routerPrivateApis","store","preferencesStore","interfaceStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","unlock","useHistory","usePageContentFocusCommands","isPage","canvasMode","hasPageContentFocus","select","getCanvasMode","setHasPageContentFocus","isLoading","commands","push","name","label","icon","callback","close","useManipulateDocumentCommands","isLoaded","record","template","removeTemplate","revertTemplate","history","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","editorMode","activeSidebar","getEditorMode","getActiveComplementaryArea","openModal","toggle","useEditModeCommands","hook","context"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SACCC,KADD,EAECC,MAFD,EAGCC,MAHD,EAICC,IAJD,EAKCC,UALD,EAMCC,WAND,EAOCC,YAPD,EAQCC,GARD,EASCC,IATD,EAUCC,aAVD,QAWO,kBAXP;AAYA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AACA,SAASD,KAAK,IAAIE,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AACA,OAAOC,qBAAP,MAAkC,2CAAlC;AACA,OAAOC,mBAAP,MAAgC,mCAAhC;AACA,OAAOC,oBAAP,MAAiC,oC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AGdsC,IAAAA,IAAI,EAAE7B,GAHQ;AAId8B,IAAAA,QAAQ,EAAE,MAAM;AACfmB,MAAAA,SAAS,CAAEnC,sBAAF,CAAT;AACA;AANa,GAAf;AASAW,EAAAA,QAAQ,CAACC,IAAT,CAAe;AACdC,IAAAA,IAAI,EAAE,yBADQ;AAEdC,IAAAA,KAAK,EAAErC,EAAE,CAAE,yBAAF,CAFK;AAGdsC,IAAAA,IAAI,EAAE3B,aAHQ;AAId4B,IAAAA,QAAQ,EAAE,MAAM;AACfmB,MAAAA,SAAS,CAAEpC,iCAAF,CAAT;AACA;AANa,GAAf;AASA,SAAO;AACNW,IAAAA,SAAS,EAAE,KADL;AAENC,IAAAA;AAFM,GAAP;AAIA;;AAED,OAAO,SAAS0B,mBAAT,GAA+B;AACrChD,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,mCADW;AAEjByB,IAAAA,IAAI,EAAEnC,2BAFW;AAGjBoC,IAAAA,OAAO,EAAE;AAHQ,GAAF,CAAhB;AAMAlD,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,oCADW;AAEjByB,IAAAA,IAAI,EAAEpB;AAFW,GAAF,CAAhB;AAKA7B,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,wBADW;AAEjByB,IAAAA,IAAI,EAAEX;AAFW,GAAF,CAAhB;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} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"]}
@@ -97,4 +97,5 @@ export { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-
97
97
  export { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';
98
98
  export { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';
99
99
  export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
100
+ export { store } from './store';
100
101
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","search","searchOptions","__experimentalFetchRichUrlData","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","showListViewByDefault","showBlockBreadcrumbs","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem","PluginTemplateSettingPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,2BAFD,EAGCC,4CAHD,QAIO,0BAJP;AAKA,SAASC,QAAT,QAAyB,iBAAzB;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SACCC,kCAAkC,IAAIC,oBADvC,EAECC,0BAA0B,IAAIC,YAF/B,QAGO,sBAHP;AAIA,SAASX,KAAK,IAAIY,WAAlB,QAAqC,mBAArC;AACA,SAASZ,KAAK,IAAIa,cAAlB,QAAwC,sBAAxC;AACA,SAASb,KAAK,IAAIc,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,SAAShB,KAAK,IAAIiB,aAAlB,QAAuC,SAAvC;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,QAAMK,IAAI,GAAGlB,UAAU,CAAEe,MA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U3DC,IAAAA,qBAAqB,EAAE,KAVoC;AAW3DC,IAAAA,oBAAoB,EAAE;AAXqC,GAA5D;AAcA7C,EAAAA,QAAQ,CAAEQ,cAAF,CAAR,CAA2BsC,2BAA3B,CACC,gBADD,EAEC,oBAFD;AAKA9C,EAAAA,QAAQ,CAAEY,aAAF,CAAR,CAA0BmC,cAA1B,CAA0C/B,QAA1C,EA3CgD,CA6ChD;AACA;AACA;AACA;;AACAhB,EAAAA,QAAQ,CAAEO,WAAF,CAAR,CAAwByC,oBAAxB,CAA8C;AAC7CC,IAAAA,oBAAoB,EAAEjC,QAAQ,CAACiC,oBADc;AAE7CC,IAAAA,wBAAwB,EAAElC,QAAQ,CAACkC;AAFU,GAA9C,EAjDgD,CAsDhD;;AACAC,EAAAA,MAAM,CAACC,gBAAP,CAAyB,UAAzB,EAAuCC,CAAF,IAASA,CAAC,CAACC,cAAF,EAA9C,EAAkE,KAAlE;AACAH,EAAAA,MAAM,CAACC,gBAAP,CAAyB,MAAzB,EAAmCC,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEAlC,EAAAA,IAAI,CAACmC,MAAL,CAAa,cAAC,GAAD,OAAb;AAEA,SAAOnC,IAAP;AACA;AAED,OAAO,SAASoC,kBAAT,GAA8B;AACpCvD,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CwD,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,aAApB,QAAyC,+CAAzC;AACA,SAASD,OAAO,IAAIE,yBAApB,QAAqD,6DAArD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,qDAA9C;AACA,SAASH,OAAO,IAAII,0BAApB,QAAsD,4CAAtD","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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","search","searchOptions","__experimentalFetchRichUrlData","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","showListViewByDefault","showBlockBreadcrumbs","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem","PluginTemplateSettingPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,2BAFD,EAGCC,4CAHD,QAIO,0BAJP;AAKA,SAASC,QAAT,QAAyB,iBAAzB;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SACCC,kCAAkC,IAAIC,oBADvC,EAECC,0BAA0B,IAAIC,YAF/B,QAGO,sBAHP;AAIA,SAASX,KAAK,IAAIY,WAAlB,QAAqC,mBAArC;AACA,SAASZ,KAAK,IAAIa,cAAlB,QAAwC,sBAAxC;AACA,SAASb,KAAK,IAAIc,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,SAAShB,KAAK,IAAIiB,aAAlB,QAAuC,SAAvC;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,Q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press/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';\nexport { store } from './store';\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { kebabCase } from 'lodash';
4
+ import { paramCase as kebabCase } from 'change-case';
5
5
  /**
6
6
  * WordPress dependencies
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/utils/template-part-create.js"],"names":["kebabCase","useSelect","store","coreStore","useExistingTemplateParts","select","getEntityRecords","per_page","getUniqueTemplatePartTitle","title","templateParts","lowercaseTitle","toLowerCase","existingTitles","map","templatePart","rendered","includes","suffix","getCleanTemplatePartSlug","replace"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,OAAO,MAAMC,wBAAwB,GAAG,MAAM;AAC7C,SAAOH,SAAS,CACbI,MAAF,IACCA,MAAM,CAAEF,SAAF,CAAN,CAAoBG,gBAApB,CACC,UADD,EAEC,kBAFD,EAGC;AACCC,IAAAA,QAAQ,EAAE,CAAC;AADZ,GAHD,CAFc,EASf,EATe,CAAhB;AAWA,CAZM;AAcP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,0BAA0B,GAAG,CAAEC,KAAF,EAASC,aAAT,KAA4B;AACrE,QAAMC,cAAc,GAAGF,KAAK,CAACG,WAAN,EAAvB;AACA,QAAMC,cAAc,GAAGH,aAAa,CAACI,GAAd,CAAqBC,YAAF,IACzCA,YAAY,CAACN,KAAb,CAAmBO,QAAnB,CAA4BJ,WAA5B,EADsB,CAAvB;;AAIA,MAAK,CAAEC,cAAc,CAACI,QAAf,CAAyBN,cAAzB,CAAP,EAAmD;AAClD,WAAOF,KAAP;AACA;;AAED,MAAIS,MAAM,GAAG,CAAb;;AACA,SAAQL,cAAc,CAACI,QAAf,CAA0B,GAAGN,cAAgB,IAAIO,MAAQ,EAAzD,CAAR,EAAuE;AACtEA,IAAAA,MAAM;AACN;;AAED,SAAQ,GAAGT,KAAO,IAAIS,MAAQ,EAA9B;AACA,CAhBM;AAkBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,wBAAwB,GAAKV,KAAF,IAAa;AACpD,SAAOT,SAAS,CAAES,KAAF,CAAT,CAAmBW,OAAnB,CAA4B,UAA5B,EAAwC,EAAxC,KAAgD,gBAAvD;AACA,CAFM","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport const useExistingTemplateParts = () => {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t),\n\t\t[]\n\t);\n};\n\n/**\n * Return a unique template part title based on\n * the given title and existing template parts.\n *\n * @param {string} title The original template part title.\n * @param {Object} templateParts The array of template part entities.\n * @return {string} A unique template part title.\n */\nexport const getUniqueTemplatePartTitle = ( title, templateParts ) => {\n\tconst lowercaseTitle = title.toLowerCase();\n\tconst existingTitles = templateParts.map( ( templatePart ) =>\n\t\ttemplatePart.title.rendered.toLowerCase()\n\t);\n\n\tif ( ! existingTitles.includes( lowercaseTitle ) ) {\n\t\treturn title;\n\t}\n\n\tlet suffix = 2;\n\twhile ( existingTitles.includes( `${ lowercaseTitle } ${ suffix }` ) ) {\n\t\tsuffix++;\n\t}\n\n\treturn `${ title } ${ suffix }`;\n};\n\n/**\n * Get a valid slug for a template part.\n * Currently template parts only allow latin chars.\n * The fallback slug will receive suffix by default.\n *\n * @param {string} title The template part title.\n * @return {string} A valid template part slug.\n */\nexport const getCleanTemplatePartSlug = ( title ) => {\n\treturn kebabCase( title ).replace( /[^\\w-]+/g, '' ) || 'wp-custom-part';\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/utils/template-part-create.js"],"names":["paramCase","kebabCase","useSelect","store","coreStore","useExistingTemplateParts","select","getEntityRecords","per_page","getUniqueTemplatePartTitle","title","templateParts","lowercaseTitle","toLowerCase","existingTitles","map","templatePart","rendered","includes","suffix","getCleanTemplatePartSlug","replace"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,IAAIC,SAAtB,QAAuC,aAAvC;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,OAAO,MAAMC,wBAAwB,GAAG,MAAM;AAC7C,SAAOH,SAAS,CACbI,MAAF,IACCA,MAAM,CAAEF,SAAF,CAAN,CAAoBG,gBAApB,CACC,UADD,EAEC,kBAFD,EAGC;AACCC,IAAAA,QAAQ,EAAE,CAAC;AADZ,GAHD,CAFc,EASf,EATe,CAAhB;AAWA,CAZM;AAcP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,0BAA0B,GAAG,CAAEC,KAAF,EAASC,aAAT,KAA4B;AACrE,QAAMC,cAAc,GAAGF,KAAK,CAACG,WAAN,EAAvB;AACA,QAAMC,cAAc,GAAGH,aAAa,CAACI,GAAd,CAAqBC,YAAF,IACzCA,YAAY,CAACN,KAAb,CAAmBO,QAAnB,CAA4BJ,WAA5B,EADsB,CAAvB;;AAIA,MAAK,CAAEC,cAAc,CAACI,QAAf,CAAyBN,cAAzB,CAAP,EAAmD;AAClD,WAAOF,KAAP;AACA;;AAED,MAAIS,MAAM,GAAG,CAAb;;AACA,SAAQL,cAAc,CAACI,QAAf,CAA0B,GAAGN,cAAgB,IAAIO,MAAQ,EAAzD,CAAR,EAAuE;AACtEA,IAAAA,MAAM;AACN;;AAED,SAAQ,GAAGT,KAAO,IAAIS,MAAQ,EAA9B;AACA,CAhBM;AAkBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,wBAAwB,GAAKV,KAAF,IAAa;AACpD,SAAOT,SAAS,CAAES,KAAF,CAAT,CAAmBW,OAAnB,CAA4B,UAA5B,EAAwC,EAAxC,KAAgD,gBAAvD;AACA,CAFM","sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport const useExistingTemplateParts = () => {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t),\n\t\t[]\n\t);\n};\n\n/**\n * Return a unique template part title based on\n * the given title and existing template parts.\n *\n * @param {string} title The original template part title.\n * @param {Object} templateParts The array of template part entities.\n * @return {string} A unique template part title.\n */\nexport const getUniqueTemplatePartTitle = ( title, templateParts ) => {\n\tconst lowercaseTitle = title.toLowerCase();\n\tconst existingTitles = templateParts.map( ( templatePart ) =>\n\t\ttemplatePart.title.rendered.toLowerCase()\n\t);\n\n\tif ( ! existingTitles.includes( lowercaseTitle ) ) {\n\t\treturn title;\n\t}\n\n\tlet suffix = 2;\n\twhile ( existingTitles.includes( `${ lowercaseTitle } ${ suffix }` ) ) {\n\t\tsuffix++;\n\t}\n\n\treturn `${ title } ${ suffix }`;\n};\n\n/**\n * Get a valid slug for a template part.\n * Currently template parts only allow latin chars.\n * The fallback slug will receive suffix by default.\n *\n * @param {string} title The template part title.\n * @return {string} A valid template part slug.\n */\nexport const getCleanTemplatePartSlug = ( title ) => {\n\treturn kebabCase( title ).replace( /[^\\w-]+/g, '' ) || 'wp-custom-part';\n};\n"]}
@@ -909,6 +909,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
909
909
  align-items: center;
910
910
  justify-content: center;
911
911
  }
912
+ .edit-site-canvas-spinner circle {
913
+ stroke: rgba(0, 0, 0, 0.3);
914
+ }
912
915
 
913
916
  .edit-site-code-editor {
914
917
  position: relative;
@@ -1459,6 +1462,16 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1459
1462
  color: currentColor;
1460
1463
  background: #e0e0e0;
1461
1464
  }
1465
+ @media (min-width: 782px) {
1466
+ .edit-site-document-actions {
1467
+ width: 50%;
1468
+ }
1469
+ }
1470
+ @media (min-width: 960px) {
1471
+ .edit-site-document-actions {
1472
+ width: min(100%, 450px);
1473
+ }
1474
+ }
1462
1475
 
1463
1476
  .edit-site-document-actions__command {
1464
1477
  grid-column: 1/-1;
@@ -1846,7 +1859,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1846
1859
  }
1847
1860
 
1848
1861
  .edit-site-patterns__pattern-title {
1849
- color: #949494;
1862
+ color: #e0e0e0;
1850
1863
  }
1851
1864
  .edit-site-patterns__pattern-title .edit-site-patterns__pattern-icon {
1852
1865
  border-radius: 4px;
@@ -2533,11 +2546,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2533
2546
  display: flex;
2534
2547
  flex-direction: column;
2535
2548
  }
2536
- @media (min-width: 782px) {
2537
- .edit-site-layout .block-editor-block-contextual-toolbar.is-fixed {
2538
- width: calc(100% - 240px - 64px - 56px);
2539
- }
2540
- }
2541
2549
 
2542
2550
  .edit-site-layout__hub {
2543
2551
  position: fixed;
@@ -3025,7 +3033,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3025
3033
  width: 100%;
3026
3034
  }
3027
3035
  .edit-site-sidebar-navigation-screen__input-control .components-input-control__container {
3028
- background: transparent;
3036
+ background: #2f2f2f;
3037
+ }
3038
+ .edit-site-sidebar-navigation-screen__input-control .components-input-control__container .components-button {
3039
+ color: #e0e0e0 !important;
3029
3040
  }
3030
3041
  .edit-site-sidebar-navigation-screen__input-control .components-input-control__input {
3031
3042
  color: #e0e0e0 !important;
@@ -909,6 +909,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
909
909
  align-items: center;
910
910
  justify-content: center;
911
911
  }
912
+ .edit-site-canvas-spinner circle {
913
+ stroke: rgba(0, 0, 0, 0.3);
914
+ }
912
915
 
913
916
  .edit-site-code-editor {
914
917
  position: relative;
@@ -1460,6 +1463,16 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1460
1463
  color: currentColor;
1461
1464
  background: #e0e0e0;
1462
1465
  }
1466
+ @media (min-width: 782px) {
1467
+ .edit-site-document-actions {
1468
+ width: 50%;
1469
+ }
1470
+ }
1471
+ @media (min-width: 960px) {
1472
+ .edit-site-document-actions {
1473
+ width: min(100%, 450px);
1474
+ }
1475
+ }
1463
1476
 
1464
1477
  .edit-site-document-actions__command {
1465
1478
  grid-column: 1/-1;
@@ -1847,7 +1860,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1847
1860
  }
1848
1861
 
1849
1862
  .edit-site-patterns__pattern-title {
1850
- color: #949494;
1863
+ color: #e0e0e0;
1851
1864
  }
1852
1865
  .edit-site-patterns__pattern-title .edit-site-patterns__pattern-icon {
1853
1866
  border-radius: 4px;
@@ -2534,11 +2547,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2534
2547
  display: flex;
2535
2548
  flex-direction: column;
2536
2549
  }
2537
- @media (min-width: 782px) {
2538
- .edit-site-layout .block-editor-block-contextual-toolbar.is-fixed {
2539
- width: calc(100% - 240px - 64px - 56px);
2540
- }
2541
- }
2542
2550
 
2543
2551
  .edit-site-layout__hub {
2544
2552
  position: fixed;
@@ -3026,7 +3034,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3026
3034
  width: 100%;
3027
3035
  }
3028
3036
  .edit-site-sidebar-navigation-screen__input-control .components-input-control__container {
3029
- background: transparent;
3037
+ background: #2f2f2f;
3038
+ }
3039
+ .edit-site-sidebar-navigation-screen__input-control .components-input-control__container .components-button {
3040
+ color: #e0e0e0 !important;
3030
3041
  }
3031
3042
  .edit-site-sidebar-navigation-screen__input-control .components-input-control__input {
3032
3043
  color: #e0e0e0 !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.12.6",
3
+ "version": "5.14.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,43 +27,43 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.35.1",
31
- "@wordpress/api-fetch": "^6.32.1",
32
- "@wordpress/block-editor": "^12.3.4",
33
- "@wordpress/block-library": "^8.12.6",
34
- "@wordpress/blocks": "^12.12.2",
35
- "@wordpress/commands": "^0.6.4",
36
- "@wordpress/components": "^25.1.4",
37
- "@wordpress/compose": "^6.12.1",
38
- "@wordpress/core-commands": "^0.4.4",
39
- "@wordpress/core-data": "^6.12.4",
40
- "@wordpress/data": "^9.5.2",
41
- "@wordpress/date": "^4.35.1",
42
- "@wordpress/deprecated": "^3.35.1",
43
- "@wordpress/dom": "^3.35.1",
44
- "@wordpress/editor": "^13.12.4",
45
- "@wordpress/element": "^5.12.1",
46
- "@wordpress/escape-html": "^2.35.1",
47
- "@wordpress/hooks": "^3.35.1",
48
- "@wordpress/html-entities": "^3.35.1",
49
- "@wordpress/i18n": "^4.35.1",
50
- "@wordpress/icons": "^9.26.2",
51
- "@wordpress/interface": "^5.12.4",
52
- "@wordpress/keyboard-shortcuts": "^4.12.2",
53
- "@wordpress/keycodes": "^3.35.1",
54
- "@wordpress/media-utils": "^4.26.1",
55
- "@wordpress/notices": "^4.3.2",
56
- "@wordpress/plugins": "^6.3.4",
57
- "@wordpress/preferences": "^3.12.4",
58
- "@wordpress/primitives": "^3.33.1",
59
- "@wordpress/private-apis": "^0.17.1",
60
- "@wordpress/reusable-blocks": "^4.12.4",
61
- "@wordpress/router": "^0.4.1",
62
- "@wordpress/style-engine": "^1.18.1",
63
- "@wordpress/url": "^3.36.1",
64
- "@wordpress/viewport": "^5.12.2",
65
- "@wordpress/widgets": "^3.12.4",
66
- "@wordpress/wordcount": "^3.35.1",
30
+ "@wordpress/a11y": "^3.37.0",
31
+ "@wordpress/api-fetch": "^6.34.0",
32
+ "@wordpress/block-editor": "^12.5.0",
33
+ "@wordpress/block-library": "^8.14.0",
34
+ "@wordpress/blocks": "^12.14.0",
35
+ "@wordpress/commands": "^0.8.0",
36
+ "@wordpress/components": "^25.3.0",
37
+ "@wordpress/compose": "^6.14.0",
38
+ "@wordpress/core-commands": "^0.6.0",
39
+ "@wordpress/core-data": "^6.14.0",
40
+ "@wordpress/data": "^9.7.0",
41
+ "@wordpress/date": "^4.37.0",
42
+ "@wordpress/deprecated": "^3.37.0",
43
+ "@wordpress/dom": "^3.37.0",
44
+ "@wordpress/editor": "^13.14.0",
45
+ "@wordpress/element": "^5.14.0",
46
+ "@wordpress/escape-html": "^2.37.0",
47
+ "@wordpress/hooks": "^3.37.0",
48
+ "@wordpress/html-entities": "^3.37.0",
49
+ "@wordpress/i18n": "^4.37.0",
50
+ "@wordpress/icons": "^9.28.0",
51
+ "@wordpress/interface": "^5.14.0",
52
+ "@wordpress/keyboard-shortcuts": "^4.14.0",
53
+ "@wordpress/keycodes": "^3.37.0",
54
+ "@wordpress/media-utils": "^4.28.0",
55
+ "@wordpress/notices": "^4.5.0",
56
+ "@wordpress/plugins": "^6.5.0",
57
+ "@wordpress/preferences": "^3.14.0",
58
+ "@wordpress/primitives": "^3.35.0",
59
+ "@wordpress/private-apis": "^0.19.0",
60
+ "@wordpress/reusable-blocks": "^4.14.0",
61
+ "@wordpress/router": "^0.6.0",
62
+ "@wordpress/style-engine": "^1.20.0",
63
+ "@wordpress/url": "^3.38.0",
64
+ "@wordpress/viewport": "^5.14.0",
65
+ "@wordpress/widgets": "^3.14.0",
66
+ "@wordpress/wordcount": "^3.37.0",
67
67
  "change-case": "^4.1.2",
68
68
  "classnames": "^2.3.1",
69
69
  "colord": "^2.9.2",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "65fb4cd5187a47ca274c24c04a220bcdb2ddfa67"
87
+ "gitHead": "bcd13d59b22553b3c9dc5869077bff1e864cf9f5"
88
88
  }
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { kebabCase } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -41,7 +36,7 @@ export default function AddNewPageModal( { onSave, onClose } ) {
41
36
  {
42
37
  status: 'draft',
43
38
  title,
44
- slug: kebabCase( title || __( 'No title' ) ),
39
+ slug: title || __( 'No title' ),
45
40
  },
46
41
  { throwOnError: true }
47
42
  );
@@ -4,7 +4,7 @@
4
4
  import { DropdownMenu } from '@wordpress/components';
5
5
  import { useState } from '@wordpress/element';
6
6
  import { __ } from '@wordpress/i18n';
7
- import { plus, header, file } from '@wordpress/icons';
7
+ import { plus, symbol, symbolFilled } from '@wordpress/icons';
8
8
  import { privateApis as routerPrivateApis } from '@wordpress/router';
9
9
 
10
10
  /**
@@ -56,12 +56,12 @@ export default function AddNewPattern() {
56
56
  <DropdownMenu
57
57
  controls={ [
58
58
  {
59
- icon: header,
59
+ icon: symbolFilled,
60
60
  onClick: () => setShowTemplatePartModal( true ),
61
61
  title: __( 'Create template part' ),
62
62
  },
63
63
  {
64
- icon: file,
64
+ icon: symbol,
65
65
  onClick: () => setShowPatternModal( true ),
66
66
  title: __( 'Create pattern' ),
67
67
  },
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { kebabCase } from 'lodash';
4
+ import { paramCase as kebabCase } from 'change-case';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -20,27 +20,7 @@ import { store as coreStore } from '@wordpress/core-data';
20
20
 
21
21
  /** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */
22
22
  /** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */
23
- /**
24
- * Interface for inserter media category labels.
25
- *
26
- * @typedef {Object} InserterMediaCategoryLabels
27
- * @property {string} name General name of the media category. It's used in the inserter media items list.
28
- * @property {string} [search_items='Search'] Label for searching items. Default is ‘Search Posts’ / ‘Search Pages’.
29
- */
30
- /**
31
- * Interface for inserter media category.
32
- *
33
- * @typedef {Object} InserterMediaCategory
34
- * @property {string} name The name of the media category, that should be unique among all media categories.
35
- * @property {InserterMediaCategoryLabels} labels Labels for the media category.
36
- * @property {('image'|'audio'|'video')} mediaType The media type of the media category.
37
- * @property {(InserterMediaRequest) => Promise<InserterMediaItem[]>} fetch The function to fetch media items for the category.
38
- * @property {(InserterMediaItem) => string} [getReportUrl] If the media category supports reporting media items, this function should return
39
- * the report url for the media item. It accepts the `InserterMediaItem` as an argument.
40
- * @property {boolean} [isExternalResource] If the media category is an external resource, this should be set to true.
41
- * This is used to avoid making a request to the external resource when the user
42
- * opens the inserter for the first time.
43
- */
23
+ /** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */
44
24
 
45
25
  const getExternalLink = ( url, text ) =>
46
26
  `<a ${ getExternalLinkAttributes( url ) }>${ text }</a>`;
@@ -96,6 +96,8 @@ export default function SiteEditorCanvas() {
96
96
  ? false
97
97
  : undefined;
98
98
 
99
+ const forceFullHeight = isNavigationFocusMode;
100
+
99
101
  return (
100
102
  <>
101
103
  <EditorCanvasContainer.Slot>
@@ -123,7 +125,11 @@ export default function SiteEditorCanvas() {
123
125
  <BackButton />
124
126
  <ResizableEditor
125
127
  enableResizing={ enableResizing }
126
- height={ sizes.height ?? '100%' }
128
+ height={
129
+ sizes.height && ! forceFullHeight
130
+ ? sizes.height
131
+ : '100%'
132
+ }
127
133
  >
128
134
  <EditorCanvas
129
135
  enableResizing={ enableResizing }
@@ -12,11 +12,13 @@ import { unlock } from '../../lock-unlock';
12
12
  import inserterMediaCategories from './inserter-media-categories';
13
13
 
14
14
  export default function useSiteEditorSettings( templateType ) {
15
- const { storedSettings } = useSelect( ( select ) => {
16
- const { getSettings } = unlock( select( editSiteStore ) );
17
-
15
+ const { storedSettings, canvasMode } = useSelect( ( select ) => {
16
+ const { getSettings, getCanvasMode } = unlock(
17
+ select( editSiteStore )
18
+ );
18
19
  return {
19
20
  storedSettings: getSettings(),
21
+ canvasMode: getCanvasMode(),
20
22
  };
21
23
  }, [] );
22
24
 
@@ -70,6 +72,7 @@ export default function useSiteEditorSettings( templateType ) {
70
72
  const {
71
73
  __experimentalAdditionalBlockPatterns,
72
74
  __experimentalAdditionalBlockPatternCategories,
75
+ focusMode,
73
76
  ...restStoredSettings
74
77
  } = storedSettings;
75
78
 
@@ -78,14 +81,7 @@ export default function useSiteEditorSettings( templateType ) {
78
81
  inserterMediaCategories,
79
82
  __experimentalBlockPatterns: blockPatterns,
80
83
  __experimentalBlockPatternCategories: blockPatternCategories,
81
- // Temporary fix for bug in Block Editor Provider:
82
- // see: https://github.com/WordPress/gutenberg/issues/51489.
83
- // Some Site Editor entities (e.g. `wp_navigation`) may utilise
84
- // template locking in their settings. Therefore this must be
85
- // explicitly "unset" to avoid the template locking UI remaining
86
- // active for all entities.
87
- templateLock: false,
88
- template: false,
84
+ focusMode: canvasMode === 'view' && focusMode ? false : focusMode,
89
85
  };
90
- }, [ storedSettings, blockPatterns, blockPatternCategories ] );
86
+ }, [ storedSettings, blockPatterns, blockPatternCategories, canvasMode ] );
91
87
  }
@@ -2,21 +2,11 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { Spinner } from '@wordpress/components';
5
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import { unlock } from '../../lock-unlock';
11
-
12
- const { useGlobalStyle } = unlock( blockEditorPrivateApis );
13
5
 
14
6
  export default function CanvasSpinner() {
15
- const [ textColor ] = useGlobalStyle( 'color.text' );
16
-
17
7
  return (
18
8
  <div className="edit-site-canvas-spinner">
19
- <Spinner style={ { color: textColor } } />
9
+ <Spinner />
20
10
  </div>
21
11
  );
22
12
  }