@wordpress/edit-site 3.0.15 → 3.0.18
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/build/components/add-new-template/new-template-part.js +29 -18
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +30 -23
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +51 -0
- package/build/components/app/index.js.map +1 -0
- package/build/components/block-editor/back-button.js +8 -20
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/index.js +2 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +0 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +20 -8
- package/build/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build/components/editor/index.js +11 -30
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -10
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/screen-root.js +8 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/header/document-actions/index.js +3 -6
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/list/added-by.js +9 -3
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/index.js +17 -15
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +4 -4
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +12 -13
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +26 -24
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +11 -0
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build/components/routes/index.js +60 -0
- package/build/components/routes/index.js.map +1 -0
- package/build/components/routes/link.js +65 -0
- package/build/components/routes/link.js.map +1 -0
- package/build/components/routes/use-title.js +57 -0
- package/build/components/routes/use-title.js.map +1 -0
- package/build/components/sidebar/global-styles-sidebar.js +10 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/template-card/template-areas.js +7 -4
- package/build/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build/components/template-details/index.js +12 -10
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +27 -10
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +7 -12
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/url-query-controller/index.js +41 -50
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +6 -0
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -28
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/styles.js +18 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/index.js +29 -35
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +3 -23
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/site-export.js +67 -0
- package/build/plugins/site-export.js.map +1 -0
- package/build/plugins/welcome-guide-menu-item.js +1 -7
- package/build/plugins/welcome-guide-menu-item.js.map +1 -1
- package/build/store/actions.js +0 -27
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -14
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +7 -16
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -31
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +23 -0
- package/build/utils/get-is-list-page.js.map +1 -0
- package/build/utils/history.js +35 -0
- package/build/utils/history.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +27 -16
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +28 -18
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +35 -0
- package/build-module/components/app/index.js.map +1 -0
- package/build-module/components/block-editor/back-button.js +8 -19
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/index.js +2 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +0 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +17 -9
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build-module/components/editor/index.js +13 -33
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +12 -11
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +9 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +3 -6
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/list/added-by.js +10 -4
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/index.js +15 -15
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +4 -4
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +13 -13
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +24 -24
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +12 -0
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build-module/components/routes/index.js +47 -0
- package/build-module/components/routes/index.js.map +1 -0
- package/build-module/components/routes/link.js +51 -0
- package/build-module/components/routes/link.js.map +1 -0
- package/build-module/components/routes/use-title.js +44 -0
- package/build-module/components/routes/use-title.js.map +1 -0
- package/build-module/components/sidebar/global-styles-sidebar.js +8 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-areas.js +8 -4
- package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build-module/components/template-details/index.js +10 -9
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +24 -9
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +7 -12
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +40 -49
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +7 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -26
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +18 -2
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/index.js +28 -33
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +2 -18
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/site-export.js +51 -0
- package/build-module/plugins/site-export.js.map +1 -0
- package/build-module/plugins/welcome-guide-menu-item.js +2 -7
- package/build-module/plugins/welcome-guide-menu-item.js.map +1 -1
- package/build-module/store/actions.js +0 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -11
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +7 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +1 -27
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +16 -0
- package/build-module/utils/get-is-list-page.js.map +1 -0
- package/build-module/utils/history.js +25 -0
- package/build-module/utils/history.js.map +1 -0
- package/build-style/style-rtl.css +7 -6
- package/build-style/style.css +7 -6
- package/package.json +18 -17
- package/src/components/add-new-template/new-template-part.js +29 -11
- package/src/components/add-new-template/new-template.js +26 -12
- package/src/components/app/index.js +47 -0
- package/src/components/block-editor/back-button.js +6 -14
- package/src/components/block-editor/index.js +1 -0
- package/src/components/create-template-part-modal/index.js +0 -2
- package/src/components/edit-template-part-menu-button/index.js +16 -5
- package/src/components/editor/index.js +105 -131
- package/src/components/global-styles/gradients-palette-panel.js +13 -13
- package/src/components/global-styles/screen-root.js +17 -7
- package/src/components/global-styles/style.scss +6 -0
- package/src/components/global-styles/test/use-global-styles-output.js +7 -1
- package/src/components/global-styles/use-global-styles-output.js +0 -1
- package/src/components/header/document-actions/index.js +3 -9
- package/src/components/list/added-by.js +25 -9
- package/src/components/list/index.js +11 -12
- package/src/components/list/style.scss +6 -11
- package/src/components/list/table.js +5 -5
- package/src/components/navigation-sidebar/index.js +18 -17
- package/src/components/navigation-sidebar/navigation-panel/index.js +16 -22
- package/src/components/navigation-sidebar/navigation-toggle/index.js +14 -0
- package/src/components/routes/index.js +53 -0
- package/src/components/routes/link.js +44 -0
- package/src/components/routes/use-title.js +56 -0
- package/src/components/sidebar/global-styles-sidebar.js +8 -0
- package/src/components/sidebar/template-card/template-areas.js +16 -4
- package/src/components/template-details/index.js +8 -6
- package/src/components/template-details/template-areas.js +31 -8
- package/src/components/template-part-converter/convert-to-template-part.js +4 -2
- package/src/components/url-query-controller/index.js +34 -45
- package/src/components/welcome-guide/editor.js +10 -1
- package/src/components/welcome-guide/index.js +6 -25
- package/src/components/welcome-guide/styles.js +20 -2
- package/src/index.js +33 -36
- package/src/plugins/index.js +2 -32
- package/src/plugins/site-export.js +52 -0
- package/src/plugins/welcome-guide-menu-item.js +2 -16
- package/src/store/actions.js +0 -23
- package/src/store/constants.js +0 -12
- package/src/store/reducer.js +12 -26
- package/src/store/selectors.js +1 -27
- package/src/store/test/reducer.js +22 -39
- package/src/store/test/selectors.js +3 -34
- package/src/utils/get-is-list-page.js +11 -0
- package/src/utils/history.js +35 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/index.js"],"names":["classnames","__experimentalNavigation","Navigation","__experimentalNavigationBackButton","NavigationBackButton","__experimentalNavigationGroup","NavigationGroup","__experimentalNavigationItem","NavigationItem","__experimentalNavigationMenu","NavigationMenu","store","coreDataStore","useSelect","useDispatch","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/index.js"],"names":["classnames","__experimentalNavigation","Navigation","__experimentalNavigationBackButton","NavigationBackButton","__experimentalNavigationGroup","NavigationGroup","__experimentalNavigationItem","NavigationItem","__experimentalNavigationMenu","NavigationMenu","store","coreDataStore","useSelect","useDispatch","__","ESCAPE","decodeEntities","home","siteIcon","layout","templateIcon","symbolFilled","templatePartIcon","useLink","MainDashboardButton","editSiteStore","SITE_EDITOR_KEY","NavLink","params","replace","props","linkProps","NavigationPanel","activeItem","isNavigationOpen","siteTitle","select","getEntityRecord","siteData","undefined","name","isNavigationOpened","setIsNavigationPanelOpened","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","postId","postType"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,wBAAwB,IAAIC,UAD7B,EAECC,kCAAkC,IAAIC,oBAFvC,EAGCC,6BAA6B,IAAIC,eAHlC,EAICC,4BAA4B,IAAIC,cAJjC,EAKCC,4BAA4B,IAAIC,cALjC,QAMO,uBANP;AAOA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,QAAuB,qBAAvB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SACCC,IAAI,IAAIC,QADT,EAECC,MAAM,IAAIC,YAFX,EAGCC,YAAY,IAAIC,gBAHjB,QAIO,kBAJP;AAMA;AAC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EAAET,SADA;AAERU,QAAAA,QAAQ,EAAE;AAFF;AAJV,MAnBD,CADD,CATD,CADD,CAND,CAND;AAFD;AA4DA,CAjFD;;AAmFA,eAAejB,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigation as Navigation,\n\t__experimentalNavigationBackButton as NavigationBackButton,\n\t__experimentalNavigationGroup as NavigationGroup,\n\t__experimentalNavigationItem as NavigationItem,\n\t__experimentalNavigationMenu as NavigationMenu,\n} from '@wordpress/components';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\thome as siteIcon,\n\tlayout as templateIcon,\n\tsymbolFilled as templatePartIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../../routes/link';\nimport MainDashboardButton from '../../main-dashboard-button';\nimport { store as editSiteStore } from '../../../store';\n\nconst SITE_EDITOR_KEY = 'site-editor';\n\nfunction NavLink( { params, replace, ...props } ) {\n\tconst linkProps = useLink( params, replace );\n\n\treturn <NavigationItem { ...linkProps } { ...props } />;\n}\n\nconst NavigationPanel = ( { activeItem = SITE_EDITOR_KEY } ) => {\n\tconst { isNavigationOpen, siteTitle } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tsiteTitle: siteData.name,\n\t\t\tisNavigationOpen: select( editSiteStore ).isNavigationOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsNavigationPanelOpened } = useDispatch( editSiteStore );\n\n\tconst closeOnEscape = ( event ) => {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsNavigationPanelOpened( false );\n\t\t}\n\t};\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames( `edit-site-navigation-panel`, {\n\t\t\t\t'is-open': isNavigationOpen,\n\t\t\t} ) }\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-site-navigation-panel__inner\">\n\t\t\t\t<div className=\"edit-site-navigation-panel__site-title-container\">\n\t\t\t\t\t<div className=\"edit-site-navigation-panel__site-title\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-site-navigation-panel__scroll-container\">\n\t\t\t\t\t<Navigation activeItem={ activeItem }>\n\t\t\t\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t\t\t\t<NavigationBackButton\n\t\t\t\t\t\t\t\tbackButtonLabel={ __( 'Dashboard' ) }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-navigation-panel__back-to-dashboard\"\n\t\t\t\t\t\t\t\thref=\"index.php\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MainDashboardButton.Slot>\n\n\t\t\t\t\t\t<NavigationMenu>\n\t\t\t\t\t\t\t<NavigationGroup title={ __( 'Editor' ) }>\n\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\ticon={ siteIcon }\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Site' ) }\n\t\t\t\t\t\t\t\t\titem={ SITE_EDITOR_KEY }\n\t\t\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\t\t\t\tpostType: undefined,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\ticon={ templateIcon }\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Templates' ) }\n\t\t\t\t\t\t\t\t\titem=\"wp_template\"\n\t\t\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\ticon={ templatePartIcon }\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Template Parts' ) }\n\t\t\t\t\t\t\t\t\titem=\"wp_template_part\"\n\t\t\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</NavigationGroup>\n\t\t\t\t\t\t</NavigationMenu>\n\t\t\t\t\t</Navigation>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default NavigationPanel;\n"]}
|
|
@@ -4,6 +4,7 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
7
8
|
import { Button, Icon, __unstableMotion as motion } from '@wordpress/components';
|
|
8
9
|
import { __ } from '@wordpress/i18n';
|
|
9
10
|
import { wordpress } from '@wordpress/icons';
|
|
@@ -39,6 +40,14 @@ function NavigationToggle(_ref) {
|
|
|
39
40
|
setIsNavigationPanelOpened
|
|
40
41
|
} = useDispatch(editSiteStore);
|
|
41
42
|
const disableMotion = useReducedMotion();
|
|
43
|
+
const navigationToggleRef = useRef();
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
// TODO: Remove this effect when alternative solution is merged.
|
|
46
|
+
// See: https://github.com/WordPress/gutenberg/pull/37314
|
|
47
|
+
if (!isNavigationOpen) {
|
|
48
|
+
navigationToggleRef.current.focus();
|
|
49
|
+
}
|
|
50
|
+
}, [isNavigationOpen]);
|
|
42
51
|
|
|
43
52
|
const toggleNavigationPanel = () => setIsNavigationPanelOpened(!isNavigationOpen);
|
|
44
53
|
|
|
@@ -79,6 +88,9 @@ function NavigationToggle(_ref) {
|
|
|
79
88
|
}, createElement(Button, {
|
|
80
89
|
className: "edit-site-navigation-toggle__button has-icon",
|
|
81
90
|
label: __('Toggle navigation'),
|
|
91
|
+
ref: navigationToggleRef // isPressed will add unwanted styles.
|
|
92
|
+
,
|
|
93
|
+
"aria-pressed": isNavigationOpen,
|
|
82
94
|
onClick: toggleNavigationPanel,
|
|
83
95
|
showTooltip: true
|
|
84
96
|
}, buttonIcon));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-toggle/index.js"],"names":["useSelect","useDispatch","Button","Icon","__unstableMotion","motion","__","wordpress","store","coreDataStore","useReducedMotion","editSiteStore","NavigationToggle","icon","isNavigationOpen","isRequestingSiteIcon","siteIconUrl","select","getEntityRecord","isResolving","siteData","undefined","isNavigationOpened","site_icon_url","setIsNavigationPanelOpened","disableMotion","toggleNavigationPanel","buttonIcon","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,MADD,EAECC,IAFD,EAGCC,gBAAgB,IAAIC,MAHrB,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,gBAAT,OAAsC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACrC,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA,oBAApB;AAA0CC,IAAAA;AAA1C,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-toggle/index.js"],"names":["useSelect","useDispatch","useEffect","useRef","Button","Icon","__unstableMotion","motion","__","wordpress","store","coreDataStore","useReducedMotion","editSiteStore","NavigationToggle","icon","isNavigationOpen","isRequestingSiteIcon","siteIconUrl","select","getEntityRecord","isResolving","siteData","undefined","isNavigationOpened","site_icon_url","setIsNavigationPanelOpened","disableMotion","navigationToggleRef","current","focus","toggleNavigationPanel","buttonIcon","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SACCC,MADD,EAECC,IAFD,EAGCC,gBAAgB,IAAIC,MAHrB,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,gBAAT,OAAsC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACrC,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA,oBAApB;AAA0CC,IAAAA;AAA1C,MAA0DlB,SAAS,CACtEmB,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAER,aAAF,CAA/C;AACA,UAAMW,QAAQ,GACbF,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BG,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNP,MAAAA,gBAAgB,EAAEG,MAAM,CAAE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GU;AAJP,MADD;AAQA,GATD,MASO,IAAKD,oBAAL,EAA4B;AAClCe,IAAAA,UAAU,GAAG,IAAb;AACA,GAFM,MAEA,IAAKjB,IAAL,EAAY;AAClBiB,IAAAA,UAAU,GAAG,cAAC,IAAD;AAAM,MAAA,IAAI,EAAC,MAAX;AAAkB,MAAA,IAAI,EAAGjB;AAAzB,MAAb;AACA;;AAED,SACC,cAAC,MAAD,CAAQ,GAAR;AACC,IAAA,SAAS,EACR,iCACEC,gBAAgB,GAAG,UAAH,GAAgB,EADlC,CAFF;AAKC,IAAA,UAAU,EAAC;AALZ,KAOC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,mBAAF,CAFX;AAGC,IAAA,GAAG,EAAGoB,mBAHP,CAIC;AAJD;AAKC,oBAAeZ,gBALhB;AAMC,IAAA,OAAO,EAAGe,qBANX;AAOC,IAAA,WAAW;AAPZ,KASGC,UATH,CAPD,CADD;AAqBA;;AAED,eAAelB,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nfunction NavigationToggle( { icon } ) {\n\tconst { isNavigationOpen, isRequestingSiteIcon, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisNavigationOpen: select( editSiteStore ).isNavigationOpened(),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsNavigationPanelOpened } = useDispatch( editSiteStore );\n\n\tconst disableMotion = useReducedMotion();\n\n\tconst navigationToggleRef = useRef();\n\n\tuseEffect( () => {\n\t\t// TODO: Remove this effect when alternative solution is merged.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/37314\n\t\tif ( ! isNavigationOpen ) {\n\t\t\tnavigationToggleRef.current.focus();\n\t\t}\n\t}, [ isNavigationOpen ] );\n\n\tconst toggleNavigationPanel = () =>\n\t\tsetIsNavigationPanelOpened( ! isNavigationOpen );\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-site-navigation-toggle__site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else if ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t} else if ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName={\n\t\t\t\t'edit-site-navigation-toggle' +\n\t\t\t\t( isNavigationOpen ? ' is-open' : '' )\n\t\t\t}\n\t\t\twhileHover=\"expand\"\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-navigation-toggle__button has-icon\"\n\t\t\t\tlabel={ __( 'Toggle navigation' ) }\n\t\t\t\tref={ navigationToggleRef }\n\t\t\t\t// isPressed will add unwanted styles.\n\t\t\t\taria-pressed={ isNavigationOpen }\n\t\t\t\tonClick={ toggleNavigationPanel }\n\t\t\t\tshowTooltip\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default NavigationToggle;\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { createContext, useState, useEffect, useContext } from '@wordpress/element';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import history from '../../utils/history';
|
|
12
|
+
const RoutesContext = createContext();
|
|
13
|
+
const HistoryContext = createContext();
|
|
14
|
+
export function useLocation() {
|
|
15
|
+
return useContext(RoutesContext);
|
|
16
|
+
}
|
|
17
|
+
export function useHistory() {
|
|
18
|
+
return useContext(HistoryContext);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getLocationWithParams(location) {
|
|
22
|
+
const searchParams = new URLSearchParams(location.search);
|
|
23
|
+
return { ...location,
|
|
24
|
+
params: Object.fromEntries(searchParams.entries())
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function Routes(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
children
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [location, setLocation] = useState(() => getLocationWithParams(history.location));
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
return history.listen(_ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
location: updatedLocation
|
|
37
|
+
} = _ref2;
|
|
38
|
+
setLocation(getLocationWithParams(updatedLocation));
|
|
39
|
+
});
|
|
40
|
+
}, []);
|
|
41
|
+
return createElement(HistoryContext.Provider, {
|
|
42
|
+
value: history
|
|
43
|
+
}, createElement(RoutesContext.Provider, {
|
|
44
|
+
value: location
|
|
45
|
+
}, children(location)));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/index.js"],"names":["createContext","useState","useEffect","useContext","history","RoutesContext","HistoryContext","useLocation","useHistory","getLocationWithParams","location","searchParams","URLSearchParams","search","params","Object","fromEntries","entries","Routes","children","setLocation","listen","updatedLocation"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,QAFD,EAGCC,SAHD,EAICC,UAJD,QAKO,oBALP;AAOA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,qBAApB;AAEA,MAAMC,aAAa,GAAGL,aAAa,EAAnC;AACA,MAAMM,cAAc,GAAGN,aAAa,EAApC;AAEA,OAAO,SAASO,WAAT,GAAuB;AAC7B,SAAOJ,UAAU,CAAEE,aAAF,CAAjB;AACA;AAED,OAAO,SAASG,UAAT,GAAsB;AAC5B,SAAOL,UAAU,CAAEG,cAAF,CAAjB;AACA;;AAED,SAASG,qBAAT,CAAgCC,QAAhC,EAA2C;AAC1C,QAAMC,YAAY,GAAG,IAAIC,eAAJ,CAAqBF,QAAQ,CAACG,MAA9B,CAArB;AACA,SAAO,EACN,GAAGH,QADG;AAENI,IAAAA,MAAM,EAAEC,MAAM,CAACC,WAAP,CAAoBL,YAAY,CAACM,OAAb,EAApB;AAFF,GAAP;AAIA;;AAED,OAAO,SAASC,MAAT,OAAgC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACtC,QAAM,CAAET,QAAF,EAAYU,WAAZ,IAA4BnB,QAAQ,CAAE,MAC3CQ,qBAAqB,CAAEL,OAAO,CAACM,QAAV,CADoB,CAA1C;AAIAR,EAAAA,SAAS,CAAE,MAAM;AAChB,WAAOE,OAAO,CAACiB,MAAR,CAAgB,SAAqC;AAAA,UAAnC;AAAEX,QAAAA,QAAQ,EAAEY;AAAZ,OAAmC;AAC3DF,MAAAA,WAAW,CAAEX,qBAAqB,CAAEa,eAAF,CAAvB,CAAX;AACA,KAFM,CAAP;AAGA,GAJQ,EAIN,EAJM,CAAT;AAMA,SACC,cAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAGlB;AAAjC,KACC,cAAC,aAAD,CAAe,QAAf;AAAwB,IAAA,KAAK,EAAGM;AAAhC,KACGS,QAAQ,CAAET,QAAF,CADX,CADD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport history from '../../utils/history';\n\nconst RoutesContext = createContext();\nconst HistoryContext = createContext();\n\nexport function useLocation() {\n\treturn useContext( RoutesContext );\n}\n\nexport function useHistory() {\n\treturn useContext( HistoryContext );\n}\n\nfunction getLocationWithParams( location ) {\n\tconst searchParams = new URLSearchParams( location.search );\n\treturn {\n\t\t...location,\n\t\tparams: Object.fromEntries( searchParams.entries() ),\n\t};\n}\n\nexport function Routes( { children } ) {\n\tconst [ location, setLocation ] = useState( () =>\n\t\tgetLocationWithParams( history.location )\n\t);\n\n\tuseEffect( () => {\n\t\treturn history.listen( ( { location: updatedLocation } ) => {\n\t\t\tsetLocation( getLocationWithParams( updatedLocation ) );\n\t\t} );\n\t}, [] );\n\n\treturn (\n\t\t<HistoryContext.Provider value={ history }>\n\t\t\t<RoutesContext.Provider value={ location }>\n\t\t\t\t{ children( location ) }\n\t\t\t</RoutesContext.Provider>\n\t\t</HistoryContext.Provider>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WordPress dependencies
|
|
6
|
+
*/
|
|
7
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useHistory } from './index';
|
|
13
|
+
export function useLink() {
|
|
14
|
+
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
let state = arguments.length > 1 ? arguments[1] : undefined;
|
|
16
|
+
let shouldReplace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
17
|
+
const history = useHistory();
|
|
18
|
+
|
|
19
|
+
function onClick(event) {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
|
|
22
|
+
if (shouldReplace) {
|
|
23
|
+
history.replace(params, state);
|
|
24
|
+
} else {
|
|
25
|
+
history.push(params, state);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
href: addQueryArgs(window.location.href, params),
|
|
31
|
+
onClick
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export default function Link(_ref) {
|
|
35
|
+
let {
|
|
36
|
+
params = {},
|
|
37
|
+
state,
|
|
38
|
+
replace: shouldReplace = false,
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
} = _ref;
|
|
42
|
+
const {
|
|
43
|
+
href,
|
|
44
|
+
onClick
|
|
45
|
+
} = useLink(params, state, shouldReplace);
|
|
46
|
+
return createElement("a", _extends({
|
|
47
|
+
href: href,
|
|
48
|
+
onClick: onClick
|
|
49
|
+
}, props), children);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/link.js"],"names":["addQueryArgs","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","href","window","location","Link","children","props"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,SAA3B;AAEA,OAAO,SAASC,OAAT,GAA8D;AAAA,MAA5CC,MAA4C,uEAAnC,EAAmC;AAAA,MAA/BC,KAA+B;AAAA,MAAxBC,aAAwB,uEAAR,KAAQ;AACpE,QAAMC,OAAO,GAAGL,UAAU,EAA1B;;AAEA,WAASM,OAAT,CAAkBC,KAAlB,EAA0B;AACzBA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKJ,aAAL,EAAqB;AACpBC,MAAAA,OAAO,CAACI,OAAR,CAAiBP,MAAjB,EAAyBC,KAAzB;AACA,KAFD,MAEO;AACNE,MAAAA,OAAO,CAACK,IAAR,CAAcR,MAAd,EAAsBC,KAAtB;AACA;AACD;;AAED,SAAO;AACNQ,IAAAA,IAAI,EAAEZ,YAAY,CAAEa,MAAM,CAACC,QAAP,CAAgBF,IAAlB,EAAwBT,MAAxB,CADZ;AAENI,IAAAA;AAFM,GAAP;AAIA;AAED,eAAe,SAASQ,IAAT,OAMX;AAAA,MAN0B;AAC7BZ,IAAAA,MAAM,GAAG,EADoB;AAE7BC,IAAAA,KAF6B;AAG7BM,IAAAA,OAAO,EAAEL,aAAa,GAAG,KAHI;AAI7BW,IAAAA,QAJ6B;AAK7B,OAAGC;AAL0B,GAM1B;AACH,QAAM;AAAEL,IAAAA,IAAF;AAAQL,IAAAA;AAAR,MAAoBL,OAAO,CAAEC,MAAF,EAAUC,KAAV,EAAiBC,aAAjB,CAAjC;AAEA,SACC;AAAG,IAAA,IAAI,EAAGO,IAAV;AAAiB,IAAA,OAAO,EAAGL;AAA3B,KAA0CU,KAA1C,GACGD,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { useHistory } from './index';\n\nexport function useLink( params = {}, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\n\tfunction onClick( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\treturn {\n\t\thref: addQueryArgs( window.location.href, params ),\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
8
|
+
import { speak } from '@wordpress/a11y';
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useLocation } from './index';
|
|
14
|
+
export default function useTitle(title) {
|
|
15
|
+
const location = useLocation();
|
|
16
|
+
const siteTitle = useSelect(select => {
|
|
17
|
+
var _select$getEntityReco;
|
|
18
|
+
|
|
19
|
+
return (_select$getEntityReco = select(coreStore).getEntityRecord('root', 'site')) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco.title;
|
|
20
|
+
}, []);
|
|
21
|
+
const isInitialLocationRef = useRef(true);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
isInitialLocationRef.current = false;
|
|
24
|
+
}, [location]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
// Don't update or announce the title for initial page load.
|
|
27
|
+
if (isInitialLocationRef.current) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (title && siteTitle) {
|
|
32
|
+
// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68
|
|
33
|
+
const formattedTitle = sprintf(
|
|
34
|
+
/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */
|
|
35
|
+
__('%1$s ‹ %2$s — WordPress'), title, siteTitle);
|
|
36
|
+
document.title = formattedTitle; // Announce title on route change for screen readers.
|
|
37
|
+
|
|
38
|
+
speak(sprintf(
|
|
39
|
+
/* translators: The page title that is currently displaying. */
|
|
40
|
+
__('Now displaying: %s'), document.title), 'assertive');
|
|
41
|
+
}
|
|
42
|
+
}, [title, siteTitle, location]);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=use-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"names":["useEffect","useRef","useSelect","store","coreStore","__","sprintf","speak","useLocation","useTitle","title","location","siteTitle","select","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,KAAT,QAAsB,iBAAtB;AAEA;AACA;AACA;;AACA,SAASC,WAAT,QAA4B,SAA5B;AAEA,eAAe,SAASC,QAAT,CAAmBC,KAAnB,EAA2B;AACzC,QAAMC,QAAQ,GAAGH,WAAW,EAA5B;AACA,QAAMI,SAAS,GAAGV,SAAS,CACxBW,MAAF;AAAA;;AAAA,oCACCA,MAAM,CAAET,SAAF,CAAN,CAAoBU,eAApB,CAAqC,MAArC,EAA6C,MAA7C,CADD,0DACC,sBAAuDJ,KADxD;AAAA,GAD0B,EAG1B,EAH0B,CAA3B;AAKA,QAAMK,oBAAoB,GAAGd,MAAM,CAAE,IAAF,CAAnC;AAEAD,EAAAA,SAAS,CAAE,MAAM;AAChBe,IAAAA,oBAAoB,CAACC,OAArB,GAA+B,KAA/B;AACA,GAFQ,EAEN,CAAEL,QAAF,CAFM,CAAT;AAIAX,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA,QAAKe,oBAAoB,CAACC,OAA1B,EAAoC;AACnC;AACA;;AAED,QAAKN,KAAK,IAAIE,SAAd,EAA0B;AACzB;AACA,YAAMK,cAAc,GAAGX,OAAO;AAC7B;AACAD,MAAAA,EAAE,CAAE,yBAAF,CAF2B,EAG7BK,KAH6B,EAI7BE,SAJ6B,CAA9B;AAOAM,MAAAA,QAAQ,CAACR,KAAT,GAAiBO,cAAjB,CATyB,CAWzB;;AACAV,MAAAA,KAAK,CACJD,OAAO;AACN;AACAD,MAAAA,EAAE,CAAE,oBAAF,CAFI,EAGNa,QAAQ,CAACR,KAHH,CADH,EAMJ,WANI,CAAL;AAQA;AACD,GA3BQ,EA2BN,CAAEA,KAAF,EAASE,SAAT,EAAoBD,QAApB,CA3BM,CAAT;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useLocation } from './index';\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s — WordPress' ),\n\t\t\t\ttitle,\n\t\t\t\tsiteTitle\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The page title that is currently displaying. */\n\t\t\t\t\t__( 'Now displaying: %s' ),\n\t\t\t\t\tdocument.title\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"]}
|
|
@@ -6,14 +6,19 @@ import { createElement } from "@wordpress/element";
|
|
|
6
6
|
import { DropdownMenu, FlexItem, FlexBlock, Flex } from '@wordpress/components';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { styles, moreVertical } from '@wordpress/icons';
|
|
9
|
+
import { useDispatch } from '@wordpress/data';
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import DefaultSidebar from './default-sidebar';
|
|
14
15
|
import { GlobalStylesUI, useGlobalStylesReset } from '../global-styles';
|
|
16
|
+
import { store as editSiteStore } from '../../store';
|
|
15
17
|
export default function GlobalStylesSidebar() {
|
|
16
18
|
const [canReset, onReset] = useGlobalStylesReset();
|
|
19
|
+
const {
|
|
20
|
+
toggleFeature
|
|
21
|
+
} = useDispatch(editSiteStore);
|
|
17
22
|
return createElement(DefaultSidebar, {
|
|
18
23
|
className: "edit-site-global-styles-sidebar",
|
|
19
24
|
identifier: "edit-site/global-styles",
|
|
@@ -31,6 +36,9 @@ export default function GlobalStylesSidebar() {
|
|
|
31
36
|
controls: [{
|
|
32
37
|
title: __('Reset to defaults'),
|
|
33
38
|
onClick: onReset
|
|
39
|
+
}, {
|
|
40
|
+
title: __('Welcome Guide'),
|
|
41
|
+
onClick: () => toggleFeature('welcomeGuideStyles')
|
|
34
42
|
}]
|
|
35
43
|
})))
|
|
36
44
|
}, createElement(GlobalStylesUI, null));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["DropdownMenu","FlexItem","FlexBlock","Flex","__","styles","moreVertical","DefaultSidebar","GlobalStylesUI","useGlobalStylesReset","GlobalStylesSidebar","canReset","onReset","disabled","title","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,EAA4CC,IAA5C,QAAwD,uBAAxD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,YAAjB,QAAqC,kBAArC;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,SAASC,cAAT,EAAyBC,oBAAzB,QAAqD,kBAArD;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,QAAF,EAAYC,OAAZ,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["DropdownMenu","FlexItem","FlexBlock","Flex","__","styles","moreVertical","useDispatch","DefaultSidebar","GlobalStylesUI","useGlobalStylesReset","store","editSiteStore","GlobalStylesSidebar","canReset","onReset","toggleFeature","disabled","title","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,EAA4CC,IAA5C,QAAwD,uBAAxD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,YAAjB,QAAqC,kBAArC;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,SAASC,cAAT,EAAyBC,oBAAzB,QAAqD,kBAArD;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,QAAF,EAAYC,OAAZ,IAAwBL,oBAAoB,EAAlD;AACA,QAAM;AAAEM,IAAAA;AAAF,MAAoBT,WAAW,CAAEK,aAAF,CAArC;AAEA,SACC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAGR,EAAE,CAAE,QAAF,CAHX;AAIC,IAAA,IAAI,EAAGC,MAJR;AAKC,IAAA,UAAU,EAAGD,EAAE,CAAE,6BAAF,CALhB;AAMC,IAAA,MAAM,EACL,cAAC,IAAD,QACC,cAAC,SAAD,QACC,8BAAUA,EAAE,CAAE,QAAF,CAAZ,CADD,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGA,EAAE,CAAE,MAAF,CADL,CAFD,CADD,EAOC,cAAC,QAAD,QACC,cAAC,YAAD;AACC,MAAA,IAAI,EAAGE,YADR;AAEC,MAAA,KAAK,EAAGF,EAAE,CAAE,4BAAF,CAFX;AAGC,MAAA,WAAW,EAAG;AAAEa,QAAAA,QAAQ,EAAE,CAAEH;AAAd,OAHf;AAIC,MAAA,QAAQ,EAAG,CACV;AACCI,QAAAA,KAAK,EAAEd,EAAE,CAAE,mBAAF,CADV;AAECe,QAAAA,OAAO,EAAEJ;AAFV,OADU,EAKV;AACCG,QAAAA,KAAK,EAAEd,EAAE,CAAE,eAAF,CADV;AAECe,QAAAA,OAAO,EAAE,MACRH,aAAa,CAAE,oBAAF;AAHf,OALU;AAJZ,MADD,CAPD;AAPF,KAmCC,cAAC,cAAD,OAnCD,CADD;AAuCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, FlexItem, FlexBlock, Flex } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, moreVertical } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI, useGlobalStylesReset } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggleFeature } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close global styles sidebar' ) }\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t\t<span className=\"edit-site-global-styles-sidebar__beta\">\n\t\t\t\t\t\t\t{ __( 'Beta' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'More Global Styles Actions' ) }\n\t\t\t\t\t\t\ttoggleProps={ { disabled: ! canReset } }\n\t\t\t\t\t\t\tcontrols={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\ttoggleFeature( 'welcomeGuideStyles' ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
7
|
import { Button, __experimentalHeading as Heading } from '@wordpress/components';
|
|
8
|
-
import {
|
|
8
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
9
9
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
/**
|
|
@@ -13,7 +13,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { store as editSiteStore } from '../../../store';
|
|
16
|
-
import { TEMPLATE_PART_AREA_TO_NAME } from '../../../store/constants';
|
|
17
16
|
|
|
18
17
|
function TemplateAreaItem(_ref) {
|
|
19
18
|
let {
|
|
@@ -24,6 +23,11 @@ function TemplateAreaItem(_ref) {
|
|
|
24
23
|
selectBlock,
|
|
25
24
|
toggleBlockHighlight
|
|
26
25
|
} = useDispatch(blockEditorStore);
|
|
26
|
+
const templatePartArea = useSelect(select => {
|
|
27
|
+
const defaultAreas = select(editorStore).__experimentalGetDefaultTemplatePartAreas();
|
|
28
|
+
|
|
29
|
+
return defaultAreas.find(defaultArea => defaultArea.area === area);
|
|
30
|
+
}, [area]);
|
|
27
31
|
|
|
28
32
|
const highlightBlock = () => toggleBlockHighlight(clientId, true);
|
|
29
33
|
|
|
@@ -31,7 +35,7 @@ function TemplateAreaItem(_ref) {
|
|
|
31
35
|
|
|
32
36
|
return createElement(Button, {
|
|
33
37
|
className: "edit-site-template-card__template-areas-item",
|
|
34
|
-
icon:
|
|
38
|
+
icon: templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.icon,
|
|
35
39
|
onMouseOver: highlightBlock,
|
|
36
40
|
onMouseLeave: cancelHighlightBlock,
|
|
37
41
|
onFocus: highlightBlock,
|
|
@@ -39,7 +43,7 @@ function TemplateAreaItem(_ref) {
|
|
|
39
43
|
onClick: () => {
|
|
40
44
|
selectBlock(clientId);
|
|
41
45
|
}
|
|
42
|
-
},
|
|
46
|
+
}, templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.label);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
export default function TemplateAreas() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/template-card/template-areas.js"],"names":["useSelect","useDispatch","Button","__experimentalHeading","Heading","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/template-card/template-areas.js"],"names":["useSelect","useDispatch","Button","__experimentalHeading","Heading","store","editorStore","blockEditorStore","__","editSiteStore","TemplateAreaItem","area","clientId","selectBlock","toggleBlockHighlight","templatePartArea","select","defaultAreas","__experimentalGetDefaultTemplatePartAreas","find","defaultArea","highlightBlock","cancelHighlightBlock","icon","label","TemplateAreas","templateParts","getCurrentTemplateTemplateParts","length","map","templatePart","block","slug"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,MADD,EAECC,qBAAqB,IAAIC,OAF1B,QAGO,uBAHP;AAIA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,gBAAT,OAAgD;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAqB;AAC/C,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAwCb,WAAW,CACxDM,gBADwD,CAAzD;AAGA,QAAMQ,gBAAgB,GAAGf,SAAS,CAC/BgB,MAAF,IAAc;AACb,UAAMC,YAAY,GAAGD,MAAM,CAC1BV,WAD0B,CAAN,CAEnBY,yCAFmB,EAArB;;AAIA,WAAOD,YAAY,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AACE;AAAvB,OACC,cAAC,gBAAD;AACC,MAAA,IAAI,EAAGF,YAAY,CAACnB,IADrB;AAEC,MAAA,QAAQ,EAAGoB,KAAK,CAACnB;AAFlB,MADD,CADoB;AAAA,GAAnB,CADH,CARD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nfunction TemplateAreaItem( { area, clientId } ) {\n\tconst { selectBlock, toggleBlockHighlight } = useDispatch(\n\t\tblockEditorStore\n\t);\n\tconst templatePartArea = useSelect(\n\t\t( select ) => {\n\t\t\tconst defaultAreas = select(\n\t\t\t\teditorStore\n\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\treturn defaultAreas.find(\n\t\t\t\t( defaultArea ) => defaultArea.area === area\n\t\t\t);\n\t\t},\n\t\t[ area ]\n\t);\n\n\tconst highlightBlock = () => toggleBlockHighlight( clientId, true );\n\tconst cancelHighlightBlock = () => toggleBlockHighlight( clientId, false );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-template-card__template-areas-item\"\n\t\t\ticon={ templatePartArea?.icon }\n\t\t\tonMouseOver={ highlightBlock }\n\t\t\tonMouseLeave={ cancelHighlightBlock }\n\t\t\tonFocus={ highlightBlock }\n\t\t\tonBlur={ cancelHighlightBlock }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t>\n\t\t\t{ templatePartArea?.label }\n\t\t</Button>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst templateParts = useSelect(\n\t\t( select ) => select( editSiteStore ).getCurrentTemplateTemplateParts(),\n\t\t[]\n\t);\n\n\tif ( ! templateParts.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<section className=\"edit-site-template-card__template-areas\">\n\t\t\t<Heading\n\t\t\t\tlevel={ 3 }\n\t\t\t\tclassName=\"edit-site-template-card__template-areas-title\"\n\t\t\t>\n\t\t\t\t{ __( 'Areas' ) }\n\t\t\t</Heading>\n\n\t\t\t<ul className=\"edit-site-template-card__template-areas-list\">\n\t\t\t\t{ templateParts.map( ( { templatePart, block } ) => (\n\t\t\t\t\t<li key={ templatePart.slug }>\n\t\t\t\t\t\t<TemplateAreaItem\n\t\t\t\t\t\t\tarea={ templatePart.area }\n\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</section>\n\t);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { createElement } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -8,7 +9,6 @@ import { sprintf, __ } from '@wordpress/i18n';
|
|
|
8
9
|
import { Button, MenuGroup, MenuItem, __experimentalHeading as Heading, __experimentalText as Text } from '@wordpress/components';
|
|
9
10
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
11
|
import { store as editorStore } from '@wordpress/editor';
|
|
11
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
@@ -18,6 +18,7 @@ import { MENU_TEMPLATES, TEMPLATE_PARTS_SUB_MENUS } from '../navigation-sidebar/
|
|
|
18
18
|
import { store as editSiteStore } from '../../store';
|
|
19
19
|
import TemplateAreas from './template-areas';
|
|
20
20
|
import EditTemplateTitle from './edit-template-title';
|
|
21
|
+
import { useLink } from '../routes/link';
|
|
21
22
|
export default function TemplateDetails(_ref) {
|
|
22
23
|
let {
|
|
23
24
|
template,
|
|
@@ -45,6 +46,11 @@ export default function TemplateDetails(_ref) {
|
|
|
45
46
|
return area === (template === null || template === void 0 ? void 0 : template.area);
|
|
46
47
|
});
|
|
47
48
|
}, [template]);
|
|
49
|
+
const browseAllLinkProps = useLink({
|
|
50
|
+
// TODO: We should update this to filter by template part's areas as well.
|
|
51
|
+
postType: template.type,
|
|
52
|
+
postId: undefined
|
|
53
|
+
});
|
|
48
54
|
|
|
49
55
|
if (!template) {
|
|
50
56
|
return null;
|
|
@@ -77,14 +83,9 @@ export default function TemplateDetails(_ref) {
|
|
|
77
83
|
className: "edit-site-template-details__revert-button",
|
|
78
84
|
info: __('Restore template to default state'),
|
|
79
85
|
onClick: revert
|
|
80
|
-
}, __('Clear customizations'))), createElement(Button, {
|
|
81
|
-
className: "edit-site-template-details__show-all-button"
|
|
82
|
-
|
|
83
|
-
// TODO: We should update this to filter by template part's areas as well.
|
|
84
|
-
postId: undefined,
|
|
85
|
-
postType: template.type
|
|
86
|
-
})
|
|
87
|
-
}, sprintf(
|
|
86
|
+
}, __('Clear customizations'))), createElement(Button, _extends({
|
|
87
|
+
className: "edit-site-template-details__show-all-button"
|
|
88
|
+
}, browseAllLinkProps), sprintf(
|
|
88
89
|
/* translators: the template part's area name ("Headers", "Sidebars") or "templates". */
|
|
89
90
|
__('Browse all %s'), templateSubMenu.title)));
|
|
90
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["useMemo","sprintf","__","Button","MenuGroup","MenuItem","__experimentalHeading","Heading","__experimentalText","Text","useDispatch","useSelect","store","editorStore","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["useMemo","sprintf","__","Button","MenuGroup","MenuItem","__experimentalHeading","Heading","__experimentalText","Text","useDispatch","useSelect","store","editorStore","isTemplateRevertable","MENU_TEMPLATES","TEMPLATE_PARTS_SUB_MENUS","editSiteStore","TemplateAreas","EditTemplateTitle","useLink","TemplateDetails","template","onClose","title","description","select","__experimentalGetTemplateInfo","revertTemplate","templateSubMenu","type","menu","find","area","browseAllLinkProps","postType","postId","undefined","revert","is_custom"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,QAHD,EAICC,qBAAqB,IAAIC,OAJ1B,EAKCC,kBAAkB,IAAIC,IALvB,QAMO,uBANP;AAOA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,SACCC,cADD,EAECC,wBAFD,QAGO,kDAHP;AAIA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,OAAT,QAAwB,gBAAxB;AAEA,eAAe,SAASC,eAAT,OAAkD;AAAA,MAAxB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAwB;AAChE,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyBd,SAAS,CACrCe,MAAF,IACCA,MAAM,CAAEb,WAAF,CAAN,CAAsBc,6BAAtB,CAAqDL,QAArD,CAFsC,EAGvC,EAHuC,CAAxC;AAKA,QAAM;AAAEM,IAAAA;AAAF,MAAqBlB,WAAW,CAAEO,aAAF,CAAtC;AAEA,QAAMY,eAAe,GAAG7B,OAAO,CAAE,MAAM;AACtC,QAAK,CAAAsB,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEQ,IAAV,MAAmB,aAAxB,EAAwC;AACvC,aAAO;AAAEN,QAAAA,KAAK,EAAEtB,EAAE,CAAE,WAAF,CAAX;AAA4B6B,QAAAA,IAAI,EAAEhB;AAAlC,OA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EAAGoC;AAHX,KAKGpC,EAAE,CAAE,sBAAF,CALL,CADD,CA5BF,EAuCC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC;AADX,KAEMgC,kBAFN,GAIGjC,OAAO;AACR;AACAC,EAAAA,EAAE,CAAE,eAAF,CAFM,EAGR2B,eAAe,CAACL,KAHR,CAJV,CAvCD,CADD;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport {\n\tMENU_TEMPLATES,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../navigation-sidebar/navigation-panel/constants';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\nimport EditTemplateTitle from './edit-template-title';\nimport { useLink } from '../routes/link';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\n\tconst templateSubMenu = useMemo( () => {\n\t\tif ( template?.type === 'wp_template' ) {\n\t\t\treturn { title: __( 'templates' ), menu: MENU_TEMPLATES };\n\t\t}\n\n\t\treturn TEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t( { area } ) => area === template?.area\n\t\t);\n\t}, [ template ] );\n\n\tconst browseAllLinkProps = useLink( {\n\t\t// TODO: We should update this to filter by template part's areas as well.\n\t\tpostType: template.type,\n\t\tpostId: undefined,\n\t} );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t{ template.is_custom ? (\n\t\t\t\t\t<EditTemplateTitle template={ template } />\n\t\t\t\t) : (\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\t\tweight={ 600 }\n\t\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Heading>\n\t\t\t\t) }\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<TemplateAreas closeTemplateDetailsDropdown={ onClose } />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group edit-site-template-details__revert\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __( 'Restore template to default state' ) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\t{ ...browseAllLinkProps }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: the template part's area name (\"Headers\", \"Sidebars\") or \"templates\". */\n\t\t\t\t\t__( 'Browse all %s' ),\n\t\t\t\t\ttemplateSubMenu.title\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { createElement, Fragment } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -6,7 +7,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
6
7
|
import { sprintf, __ } from '@wordpress/i18n';
|
|
7
8
|
import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
|
|
8
9
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
-
import {
|
|
10
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
10
11
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
11
12
|
import { moreVertical } from '@wordpress/icons';
|
|
12
13
|
/**
|
|
@@ -14,8 +15,9 @@ import { moreVertical } from '@wordpress/icons';
|
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
import { store as editSiteStore } from '../../store';
|
|
17
|
-
import { TEMPLATE_PART_AREA_TO_NAME } from '../../store/constants';
|
|
18
18
|
import isTemplateRevertable from '../../utils/is-template-revertable';
|
|
19
|
+
import { useLocation } from '../routes';
|
|
20
|
+
import { useLink } from '../routes/link';
|
|
19
21
|
|
|
20
22
|
function TemplatePartItemMore(_ref) {
|
|
21
23
|
var _templatePart$title;
|
|
@@ -26,12 +28,20 @@ function TemplatePartItemMore(_ref) {
|
|
|
26
28
|
closeTemplateDetailsDropdown
|
|
27
29
|
} = _ref;
|
|
28
30
|
const {
|
|
29
|
-
pushTemplatePart,
|
|
30
31
|
revertTemplate
|
|
31
32
|
} = useDispatch(editSiteStore);
|
|
33
|
+
const {
|
|
34
|
+
params
|
|
35
|
+
} = useLocation();
|
|
36
|
+
const editLinkProps = useLink({
|
|
37
|
+
postId: templatePart.id,
|
|
38
|
+
postType: templatePart.type
|
|
39
|
+
}, {
|
|
40
|
+
fromTemplateId: params.postId
|
|
41
|
+
});
|
|
32
42
|
|
|
33
|
-
function editTemplatePart() {
|
|
34
|
-
|
|
43
|
+
function editTemplatePart(event) {
|
|
44
|
+
editLinkProps.onClick(event);
|
|
35
45
|
onClose();
|
|
36
46
|
closeTemplateDetailsDropdown();
|
|
37
47
|
}
|
|
@@ -42,9 +52,9 @@ function TemplatePartItemMore(_ref) {
|
|
|
42
52
|
closeTemplateDetailsDropdown();
|
|
43
53
|
}
|
|
44
54
|
|
|
45
|
-
return createElement(Fragment, null, createElement(MenuGroup, null, createElement(MenuItem, {
|
|
55
|
+
return createElement(Fragment, null, createElement(MenuGroup, null, createElement(MenuItem, _extends({}, editLinkProps, {
|
|
46
56
|
onClick: editTemplatePart
|
|
47
|
-
}, sprintf(
|
|
57
|
+
}), sprintf(
|
|
48
58
|
/* translators: %s: template part title */
|
|
49
59
|
__('Edit %s'), (_templatePart$title = templatePart.title) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title.rendered))), isTemplateRevertable(templatePart) && createElement(MenuGroup, null, createElement(MenuItem, {
|
|
50
60
|
info: __('Restore template to default state'),
|
|
@@ -62,6 +72,11 @@ function TemplatePartItem(_ref2) {
|
|
|
62
72
|
selectBlock,
|
|
63
73
|
toggleBlockHighlight
|
|
64
74
|
} = useDispatch(blockEditorStore);
|
|
75
|
+
const templatePartArea = useSelect(select => {
|
|
76
|
+
const defaultAreas = select(editorStore).__experimentalGetDefaultTemplatePartAreas();
|
|
77
|
+
|
|
78
|
+
return defaultAreas.find(defaultArea => defaultArea.area === templatePart.area);
|
|
79
|
+
}, [templatePart.area]);
|
|
65
80
|
|
|
66
81
|
const highlightBlock = () => toggleBlockHighlight(clientId, true);
|
|
67
82
|
|
|
@@ -72,7 +87,7 @@ function TemplatePartItem(_ref2) {
|
|
|
72
87
|
className: "edit-site-template-details__template-areas-item"
|
|
73
88
|
}, createElement(MenuItem, {
|
|
74
89
|
role: "button",
|
|
75
|
-
icon:
|
|
90
|
+
icon: templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.icon,
|
|
76
91
|
iconPosition: "left",
|
|
77
92
|
onClick: () => {
|
|
78
93
|
selectBlock(clientId);
|
|
@@ -81,7 +96,7 @@ function TemplatePartItem(_ref2) {
|
|
|
81
96
|
onMouseLeave: cancelHighlightBlock,
|
|
82
97
|
onFocus: highlightBlock,
|
|
83
98
|
onBlur: cancelHighlightBlock
|
|
84
|
-
},
|
|
99
|
+
}, templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea.label), createElement(DropdownMenu, {
|
|
85
100
|
icon: moreVertical,
|
|
86
101
|
label: __('More options'),
|
|
87
102
|
className: "edit-site-template-details__template-areas-item-more"
|