@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.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-page/index.js +1 -7
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +2 -2
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +1 -22
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +29 -32
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +9 -12
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-spinner/index.js +1 -18
- package/build/components/canvas-spinner/index.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +1 -1
- package/build/components/create-pattern-modal/index.js.map +1 -1
- package/build/components/editor/index.js +10 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/header-edit-mode/index.js +6 -2
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/layout/index.js +26 -23
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +1 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page-actions/delete-page-menu-item.js +2 -1
- package/build/components/page-actions/delete-page-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +2 -3
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +3 -1
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +1 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-template-parts/index.js +1 -0
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +1 -0
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +57 -17
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +9 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +29 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/site-hub/index.js +1 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/template-actions/index.js +22 -6
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +2 -2
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +2 -2
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +1 -2
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/utils/template-part-create.js +2 -2
- package/build/utils/template-part-create.js.map +1 -1
- package/build-module/components/add-new-page/index.js +1 -6
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +3 -3
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +1 -22
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +29 -32
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +9 -12
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-spinner/index.js +1 -15
- package/build-module/components/canvas-spinner/index.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +1 -1
- package/build-module/components/create-pattern-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +10 -1
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +6 -2
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/layout/index.js +26 -23
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page-actions/delete-page-menu-item.js +2 -1
- package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +3 -4
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +3 -1
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +1 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-template-parts/index.js +1 -0
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +1 -0
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +57 -17
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +8 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +20 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/site-hub/index.js +1 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/template-actions/index.js +24 -7
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +2 -2
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +2 -2
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +1 -2
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/utils/template-part-create.js +1 -1
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-style/style-rtl.css +18 -7
- package/build-style/style.css +18 -7
- package/package.json +39 -39
- package/src/components/add-new-page/index.js +1 -6
- package/src/components/add-new-pattern/index.js +3 -3
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
- package/src/components/block-editor/inserter-media-categories.js +1 -21
- package/src/components/block-editor/site-editor-canvas.js +7 -1
- package/src/components/block-editor/use-site-editor-settings.js +8 -12
- package/src/components/canvas-spinner/index.js +1 -11
- package/src/components/canvas-spinner/style.scss +4 -0
- package/src/components/create-pattern-modal/index.js +1 -1
- package/src/components/editor/index.js +15 -1
- package/src/components/global-styles/palette.js +10 -9
- package/src/components/global-styles/stories/index.js +1 -0
- package/src/components/header-edit-mode/document-actions/style.scss +8 -0
- package/src/components/header-edit-mode/index.js +17 -9
- package/src/components/layout/index.js +39 -44
- package/src/components/layout/style.scss +0 -11
- package/src/components/page/header.js +1 -1
- package/src/components/page-actions/delete-page-menu-item.js +1 -0
- package/src/components/page-patterns/grid-item.js +7 -8
- package/src/components/page-patterns/patterns-list.js +7 -3
- package/src/components/page-patterns/style.scss +1 -1
- package/src/components/page-patterns/use-patterns.js +1 -1
- package/src/components/page-template-parts/index.js +1 -1
- package/src/components/page-templates/index.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +5 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +56 -39
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
- package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
- package/src/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/site-hub/index.js +1 -1
- package/src/components/template-actions/index.js +38 -8
- package/src/components/welcome-guide/page.js +2 -2
- package/src/components/welcome-guide/template.js +2 -2
- package/src/hooks/commands/use-edit-mode-commands.js +0 -1
- package/src/index.js +1 -0
- 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,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;AAC1C,UAAMC,YAAY,GAAG,CAAC,CAAED,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACvB,gBADuB,EAEvB,kBAFuB,CAAxB;AAIA,UAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACzB,gBADyB,EAEzB,cAFyB,CAA1B;AAIA,UAAM;AAAEE,MAAAA;AAAF,QAA0BJ,MAAM,CAAEJ,aAAF,CAAtC;AACA,WAAOK,YAAY,IAAI,CAAEE,cAAlB,IAAoCC,mBAAmB,EAA9D;AACA,GAX0B,EAWxB,EAXwB,CAA3B;;AAaA,MAAK,CAAEL,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMM,OAAO,GAAGZ,EAAE,CAAE,
|
|
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;AAC1C,UAAMC,YAAY,GAAG,CAAC,CAAED,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACvB,gBADuB,EAEvB,kBAFuB,CAAxB;AAIA,UAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACzB,gBADyB,EAEzB,cAFyB,CAA1B;AAIA,UAAM;AAAEE,MAAAA;AAAF,QAA0BJ,MAAM,CAAEJ,aAAF,CAAtC;AACA,WAAOK,YAAY,IAAI,CAAEE,cAAlB,IAAoCC,mBAAmB,EAA9D;AACA,GAX0B,EAWxB,EAXwB,CAA3B;;AAaA,MAAK,CAAEL,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMM,OAAO,GAAGZ,EAAE,CAAE,gBAAF,CAAlB;;AAEA,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,YAAY,EAAGY,OAFhB;AAGC,IAAA,gBAAgB,EAAGZ,EAAE,CAAE,UAAF,CAHtB;AAIC,IAAA,QAAQ,EAAG,MAAMK,MAAM,CAAE,gBAAF,EAAoB,kBAApB,CAJxB;AAKC,IAAA,KAAK,EAAG,CACP;AACCQ,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,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,uLADG,CADL,CAJD;AAjBF,KADO;AALT,IADD;AAuCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { hasPageContentFocus } = select( editSiteStore );\n\t\treturn isPageActive && ! isEditorActive && hasPageContentFocus();\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -30,7 +30,7 @@ export default function WelcomeGuideTemplate() {
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const heading = __('Editing
|
|
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
|
-
}, __('
|
|
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,eAAe,SAASC,oBAAT,GAAgC;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAaR,WAAW,CAAEK,gBAAF,CAA9B;AAEA,QAAMI,SAAS,GAAGR,SAAS,CAAIS,MAAF,IAAc;AAC1C,UAAMC,gBAAgB,GAAG,CAAC,CAAED,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CAC3B,gBAD2B,EAE3B,sBAF2B,CAA5B;AAIA,UAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACzB,gBADyB,EAEzB,cAFyB,CAA1B;AAIA,UAAM;AAAEE,MAAAA,MAAF;AAAUC,MAAAA;AAAV,QAAkCL,MAAM,CAAEJ,aAAF,CAA9C;AACA,WACCK,gBAAgB,IAChB,CAAEE,cADF,IAEAC,MAAM,EAFN,IAGA,CAAEC,mBAAmB,EAJtB;AAMA,GAhB0B,EAgBxB,EAhBwB,CAA3B;;AAkBA,MAAK,CAAEN,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMO,OAAO,GAAGb,EAAE,CAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","WelcomeGuideTemplate","toggle","isVisible","select","isTemplateActive","get","isEditorActive","isPage","hasPageContentFocus","heading","image","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,oBAAT,GAAgC;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAaR,WAAW,CAAEK,gBAAF,CAA9B;AAEA,QAAMI,SAAS,GAAGR,SAAS,CAAIS,MAAF,IAAc;AAC1C,UAAMC,gBAAgB,GAAG,CAAC,CAAED,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CAC3B,gBAD2B,EAE3B,sBAF2B,CAA5B;AAIA,UAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEL,gBAAF,CAAN,CAA2BO,GAA3B,CACzB,gBADyB,EAEzB,cAFyB,CAA1B;AAIA,UAAM;AAAEE,MAAAA,MAAF;AAAUC,MAAAA;AAAV,QAAkCL,MAAM,CAAEJ,aAAF,CAA9C;AACA,WACCK,gBAAgB,IAChB,CAAEE,cADF,IAEAC,MAAM,EAFN,IAGA,CAAEC,mBAAmB,EAJtB;AAMA,GAhB0B,EAgBxB,EAhBwB,CAA3B;;AAkBA,MAAK,CAAEN,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMO,OAAO,GAAGb,EAAE,CAAE,oBAAF,CAAlB;;AAEA,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,YAAY,EAAGa,OAFhB;AAGC,IAAA,gBAAgB,EAAGb,EAAE,CAAE,UAAF,CAHtB;AAIC,IAAA,QAAQ,EAAG,MACVK,MAAM,CAAE,gBAAF,EAAoB,sBAApB,CALR;AAOC,IAAA,KAAK,EAAG,CACP;AACCS,MAAAA,KAAK,EACJ;AACC,QAAA,SAAS,EAAC,gCADX;AAEC,QAAA,QAAQ,MAFT;AAGC,QAAA,IAAI,MAHL;AAIC,QAAA,KAAK,MAJN;AAKC,QAAA,KAAK,EAAC,KALP;AAMC,QAAA,MAAM,EAAC;AANR,SAQC;AACC,QAAA,GAAG,EAAC,+DADL;AAEC,QAAA,IAAI,EAAC;AAFN,QARD,CAFF;AAgBCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGF,OADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGb,EAAE,CACH,4MADG,CADL,CAJD;AAjBF,KADO;AAPT,IADD;AAyCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isTemplateActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuideTemplate'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { isPage, hasPageContentFocus } = select( editSiteStore );\n\t\treturn (\n\t\t\tisTemplateActive &&\n\t\t\t! isEditorActive &&\n\t\t\tisPage() &&\n\t\t\t! hasPageContentFocus()\n\t\t);\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -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":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC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AI,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,oCAAjC;AACA,SAASC,iCAAT,QAAkD,+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Q;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"]}
|
package/build-module/index.js
CHANGED
|
@@ -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;A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C;AAS3DC,IAAAA,oBAAoB,EAAE,IATqC;AAU3DC,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,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cesContent":["/**\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';\nexport { store } from './store';\n"]}
|
|
@@ -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,
|
|
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: #
|
|
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:
|
|
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;
|
package/build-style/style.css
CHANGED
|
@@ -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: #
|
|
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:
|
|
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.
|
|
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.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^25.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/date": "^4.
|
|
42
|
-
"@wordpress/deprecated": "^3.
|
|
43
|
-
"@wordpress/dom": "^3.
|
|
44
|
-
"@wordpress/editor": "^13.
|
|
45
|
-
"@wordpress/element": "^5.
|
|
46
|
-
"@wordpress/escape-html": "^2.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/interface": "^5.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/media-utils": "^4.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/plugins": "^6.
|
|
57
|
-
"@wordpress/preferences": "^3.
|
|
58
|
-
"@wordpress/primitives": "^3.
|
|
59
|
-
"@wordpress/private-apis": "^0.
|
|
60
|
-
"@wordpress/reusable-blocks": "^4.
|
|
61
|
-
"@wordpress/router": "^0.
|
|
62
|
-
"@wordpress/style-engine": "^1.
|
|
63
|
-
"@wordpress/url": "^3.
|
|
64
|
-
"@wordpress/viewport": "^5.
|
|
65
|
-
"@wordpress/widgets": "^3.
|
|
66
|
-
"@wordpress/wordcount": "^3.
|
|
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": "
|
|
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:
|
|
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,
|
|
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:
|
|
59
|
+
icon: symbolFilled,
|
|
60
60
|
onClick: () => setShowTemplatePartModal( true ),
|
|
61
61
|
title: __( 'Create template part' ),
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
icon:
|
|
64
|
+
icon: symbol,
|
|
65
65
|
onClick: () => setShowPatternModal( true ),
|
|
66
66
|
title: __( 'Create pattern' ),
|
|
67
67
|
},
|
|
@@ -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={
|
|
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(
|
|
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
|
-
|
|
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
|
|
9
|
+
<Spinner />
|
|
20
10
|
</div>
|
|
21
11
|
);
|
|
22
12
|
}
|