@wordpress/edit-site 3.0.1-next.253d9b6e21.0 → 3.0.3
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/README.md +1 -1
- package/build/components/block-editor/back-button.js +60 -0
- package/build/components/block-editor/back-button.js.map +1 -0
- package/build/components/block-editor/index.js +20 -5
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +63 -0
- package/build/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build/components/editor/global-styles-provider.js +15 -2
- package/build/components/editor/global-styles-provider.js.map +1 -1
- package/build/components/editor/global-styles-renderer.js +8 -8
- package/build/components/editor/global-styles-renderer.js.map +1 -1
- package/build/components/editor/index.js +7 -7
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/utils.js +4 -9
- package/build/components/editor/utils.js.map +1 -1
- package/build/components/{sidebar → global-styles}/border-panel.js +2 -2
- package/build/components/global-styles/border-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-panel.js +24 -21
- package/build/components/global-styles/color-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +58 -0
- package/build/components/global-styles/context-menu.js.map +1 -0
- package/build/components/{sidebar → global-styles}/dimensions-panel.js +58 -8
- package/build/components/global-styles/dimensions-panel.js.map +1 -0
- package/build/components/global-styles/header.js +54 -0
- package/build/components/global-styles/header.js.map +1 -0
- package/build/components/global-styles/index.js +89 -0
- package/build/components/global-styles/index.js.map +1 -0
- package/build/components/global-styles/navigation-button.js +43 -0
- package/build/components/global-styles/navigation-button.js.map +1 -0
- package/build/components/global-styles/palette.js +57 -0
- package/build/components/global-styles/palette.js.map +1 -0
- package/build/components/global-styles/preview.js +59 -0
- package/build/components/global-styles/preview.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +76 -0
- package/build/components/global-styles/screen-block-list.js.map +1 -0
- package/build/components/global-styles/screen-block.js +45 -0
- package/build/components/global-styles/screen-block.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +48 -0
- package/build/components/global-styles/screen-color-palette.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +51 -0
- package/build/components/global-styles/screen-colors.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +60 -0
- package/build/components/global-styles/screen-layout.js.map +1 -0
- package/build/components/global-styles/screen-root.js +44 -0
- package/build/components/global-styles/screen-root.js.map +1 -0
- package/build/components/global-styles/screen-typography.js +50 -0
- package/build/components/global-styles/screen-typography.js.map +1 -0
- package/build/components/global-styles/subtitle.js +25 -0
- package/build/components/global-styles/subtitle.js.map +1 -0
- package/build/components/{sidebar → global-styles}/typography-panel.js +1 -3
- package/build/components/global-styles/typography-panel.js.map +1 -0
- package/build/components/header/document-actions/index.js +1 -1
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +82 -0
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +75 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/header/undo-redo/redo.js +1 -1
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +1 -1
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -10
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +1 -1
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +10 -10
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -3
- package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
- package/build/components/save-button/index.js +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +11 -161
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +95 -0
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build/components/template-details/index.js +12 -6
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +73 -0
- package/build/components/template-details/template-areas.js.map +1 -0
- package/build/components/template-part-converter/convert-to-regular.js +3 -3
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/index.js +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -1
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +24 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +60 -7
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +19 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +16 -7
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +91 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +48 -0
- package/build-module/components/block-editor/back-button.js.map +1 -0
- package/build-module/components/block-editor/index.js +17 -5
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +49 -0
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build-module/components/editor/global-styles-provider.js +16 -3
- package/build-module/components/editor/global-styles-provider.js.map +1 -1
- package/build-module/components/editor/global-styles-renderer.js +8 -8
- package/build-module/components/editor/global-styles-renderer.js.map +1 -1
- package/build-module/components/editor/index.js +4 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/utils.js +2 -7
- package/build-module/components/editor/utils.js.map +1 -1
- package/build-module/components/{sidebar → global-styles}/border-panel.js +2 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-panel.js +25 -22
- package/build-module/components/global-styles/color-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +41 -0
- package/build-module/components/global-styles/context-menu.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/dimensions-panel.js +58 -9
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
- package/build-module/components/global-styles/header.js +41 -0
- package/build-module/components/global-styles/header.js.map +1 -0
- package/build-module/components/global-styles/index.js +70 -0
- package/build-module/components/global-styles/index.js.map +1 -0
- package/build-module/components/global-styles/navigation-button.js +31 -0
- package/build-module/components/global-styles/navigation-button.js.map +1 -0
- package/build-module/components/global-styles/palette.js +43 -0
- package/build-module/components/global-styles/palette.js.map +1 -0
- package/build-module/components/global-styles/preview.js +50 -0
- package/build-module/components/global-styles/preview.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +58 -0
- package/build-module/components/global-styles/screen-block-list.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +32 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +35 -0
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +38 -0
- package/build-module/components/global-styles/screen-colors.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +44 -0
- package/build-module/components/global-styles/screen-layout.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +29 -0
- package/build-module/components/global-styles/screen-root.js.map +1 -0
- package/build-module/components/global-styles/screen-typography.js +37 -0
- package/build-module/components/global-styles/screen-typography.js.map +1 -0
- package/build-module/components/global-styles/subtitle.js +17 -0
- package/build-module/components/global-styles/subtitle.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -0
- package/build-module/components/header/document-actions/index.js +1 -1
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +70 -0
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/undo-redo/redo.js +1 -1
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +1 -1
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +3 -11
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +1 -1
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +5 -3
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -3
- package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +13 -159
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +2 -7
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +84 -0
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/template-details/index.js +13 -8
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +60 -0
- package/build-module/components/template-details/template-areas.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-regular.js +3 -3
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +1 -1
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +3 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +51 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +13 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +16 -7
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +85 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +158 -19
- package/build-style/style.css +158 -19
- package/package.json +26 -26
- package/src/components/block-editor/back-button.js +44 -0
- package/src/components/block-editor/index.js +18 -2
- package/src/components/block-editor/style.scss +26 -0
- package/src/components/edit-template-part-menu-button/index.js +57 -0
- package/src/components/editor/global-styles-provider.js +19 -3
- package/src/components/editor/global-styles-renderer.js +8 -5
- package/src/components/editor/index.js +5 -8
- package/src/components/editor/test/global-styles-provider.js +131 -0
- package/src/components/editor/test/global-styles-renderer.js +1 -1
- package/src/components/editor/test/utils.js +146 -0
- package/src/components/editor/utils.js +2 -7
- package/src/components/{sidebar → global-styles}/border-panel.js +2 -2
- package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
- package/src/components/{sidebar → global-styles}/color-panel.js +43 -28
- package/src/components/global-styles/context-menu.js +54 -0
- package/src/components/{sidebar → global-styles}/dimensions-panel.js +60 -9
- package/src/components/global-styles/header.js +50 -0
- package/src/components/global-styles/index.js +81 -0
- package/src/components/global-styles/navigation-button.js +35 -0
- package/src/components/global-styles/palette.js +67 -0
- package/src/components/global-styles/preview.js +41 -0
- package/src/components/global-styles/screen-block-list.js +59 -0
- package/src/components/global-styles/screen-block.js +28 -0
- package/src/components/global-styles/screen-color-palette.js +33 -0
- package/src/components/global-styles/screen-colors.js +36 -0
- package/src/components/global-styles/screen-layout.js +45 -0
- package/src/components/global-styles/screen-root.js +43 -0
- package/src/components/global-styles/screen-typography.js +33 -0
- package/src/components/global-styles/style.scss +35 -0
- package/src/components/global-styles/subtitle.js +10 -0
- package/src/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/src/components/header/document-actions/index.js +1 -1
- package/src/components/header/plugin-more-menu-item/index.js +71 -0
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/header/undo-redo/redo.js +4 -1
- package/src/components/header/undo-redo/undo.js +4 -1
- package/src/components/keyboard-shortcuts/index.js +25 -40
- package/src/components/navigation-sidebar/index.js +1 -1
- package/src/components/navigation-sidebar/navigation-panel/constants.js +9 -4
- package/src/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -1
- package/src/components/navigation-sidebar/navigation-panel/style.scss +1 -0
- package/src/components/navigation-sidebar/navigation-toggle/style.scss +3 -2
- package/src/components/save-button/index.js +1 -1
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
- package/src/components/sidebar/global-styles-sidebar.js +14 -187
- package/src/components/sidebar/index.js +2 -7
- package/src/components/sidebar/plugin-sidebar/index.js +80 -0
- package/src/components/sidebar/style.scss +40 -0
- package/src/components/template-details/index.js +17 -7
- package/src/components/template-details/style.scss +36 -27
- package/src/components/template-details/template-areas.js +66 -0
- package/src/components/template-part-converter/convert-to-regular.js +2 -8
- package/src/components/template-part-converter/index.js +1 -1
- package/src/components/url-query-controller/index.js +1 -1
- package/src/index.js +3 -0
- package/src/store/actions.js +59 -7
- package/src/store/constants.js +15 -0
- package/src/store/reducer.js +26 -12
- package/src/store/selectors.js +96 -9
- package/src/store/test/reducer.js +40 -23
- package/src/store/test/selectors.js +34 -3
- package/src/style.scss +1 -0
- package/build/components/sidebar/border-panel.js.map +0 -1
- package/build/components/sidebar/color-palette-panel.js.map +0 -1
- package/build/components/sidebar/color-panel.js.map +0 -1
- package/build/components/sidebar/dimensions-panel.js.map +0 -1
- package/build/components/sidebar/typography-panel.js.map +0 -1
- package/build-module/components/sidebar/border-panel.js.map +0 -1
- package/build-module/components/sidebar/color-palette-panel.js.map +0 -1
- package/build-module/components/sidebar/color-panel.js.map +0 -1
- package/build-module/components/sidebar/dimensions-panel.js.map +0 -1
- package/build-module/components/sidebar/typography-panel.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
12
|
+
import ColorPalettePanel from './color-palette-panel';
|
|
13
|
+
import ScreenHeader from './header';
|
|
14
|
+
|
|
15
|
+
function ScreenColorPalette({
|
|
16
|
+
name
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
getSetting,
|
|
20
|
+
setSetting
|
|
21
|
+
} = useGlobalStylesContext();
|
|
22
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
23
|
+
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
24
|
+
back: parentMenu + '/colors',
|
|
25
|
+
title: __('Color Palette'),
|
|
26
|
+
description: __('Edit the color palette.')
|
|
27
|
+
}), createElement(ColorPalettePanel, {
|
|
28
|
+
contextName: name,
|
|
29
|
+
getSetting: getSetting,
|
|
30
|
+
setSetting: setSetting
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default ScreenColorPalette;
|
|
35
|
+
//# sourceMappingURL=screen-color-palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-color-palette.js"],"names":["__","useGlobalStylesContext","ColorPalettePanel","ScreenHeader","ScreenColorPalette","name","getSetting","setSetting","parentMenu","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,kBAAT,CAA6B;AAAEC,EAAAA;AAAF,CAA7B,EAAwC;AACvC,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6BN,sBAAsB,EAAzD;AACA,QAAMO,UAAU,GAAGH,IAAI,KAAKI,SAAT,GAAqB,EAArB,GAA0B,aAAaJ,IAA1D;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGG,UAAU,GAAG,SADrB;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,eAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CAAE,yBAAF;AAHjB,IADD,EAMC,cAAC,iBAAD;AACC,IAAA,WAAW,EAAGK,IADf;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,UAAU,EAAGC;AAHd,IAND,CADD;AAcA;;AAED,eAAeH,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ColorPalettePanel from './color-palette-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenColorPalette( { name } ) {\n\tconst { getSetting, setSetting } = useGlobalStylesContext();\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Color Palette' ) }\n\t\t\t\tdescription={ __( 'Edit the color palette.' ) }\n\t\t\t/>\n\t\t\t<ColorPalettePanel\n\t\t\t\tcontextName={ name }\n\t\t\t\tgetSetting={ getSetting }\n\t\t\t\tsetSetting={ setSetting }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenColorPalette;\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
12
|
+
import ColorPanel from './color-panel';
|
|
13
|
+
import ScreenHeader from './header';
|
|
14
|
+
|
|
15
|
+
function ScreenColors({
|
|
16
|
+
name
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
root,
|
|
20
|
+
blocks,
|
|
21
|
+
getStyle,
|
|
22
|
+
setStyle
|
|
23
|
+
} = useGlobalStylesContext();
|
|
24
|
+
const context = name === undefined ? root : blocks[name];
|
|
25
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
26
|
+
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
27
|
+
back: parentMenu ? parentMenu : '/',
|
|
28
|
+
title: __('Colors'),
|
|
29
|
+
description: __('Manage color palettes and how they affect the different elements of the site.')
|
|
30
|
+
}), createElement(ColorPanel, {
|
|
31
|
+
context: context,
|
|
32
|
+
getStyle: getStyle,
|
|
33
|
+
setStyle: setStyle
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default ScreenColors;
|
|
38
|
+
//# sourceMappingURL=screen-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["__","useGlobalStylesContext","ColorPanel","ScreenHeader","ScreenColors","name","root","blocks","getStyle","setStyle","context","undefined","parentMenu"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAAkC;AACjC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA;AAA1B,MAAuCR,sBAAsB,EAAnE;AACA,QAAMS,OAAO,GAAGL,IAAI,KAAKM,SAAT,GAAqBL,IAArB,GAA4BC,MAAM,CAAEF,IAAF,CAAlD;AACA,QAAMO,UAAU,GAAGP,IAAI,KAAKM,SAAT,GAAqB,EAArB,GAA0B,aAAaN,IAA1D;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGO,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAGZ,EAAE,CAAE,QAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,+EADe;AAHjB,IADD,EAQC,cAAC,UAAD;AACC,IAAA,OAAO,EAAGU,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IARD,CADD;AAgBA;;AAED,eAAeL,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ColorPanel from './color-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenColors( { name } ) {\n\tconst { root, blocks, getStyle, setStyle } = useGlobalStylesContext();\n\tconst context = name === undefined ? root : blocks[ name ];\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Colors' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage color palettes and how they affect the different elements of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorPanel\n\t\t\t\tcontext={ context }\n\t\t\t\tgetStyle={ getStyle }\n\t\t\t\tsetStyle={ setStyle }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenColors;\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
12
|
+
import BorderPanel, { useHasBorderPanel } from './border-panel';
|
|
13
|
+
import DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';
|
|
14
|
+
import ScreenHeader from './header';
|
|
15
|
+
|
|
16
|
+
function ScreenLayout({
|
|
17
|
+
name
|
|
18
|
+
}) {
|
|
19
|
+
const {
|
|
20
|
+
root,
|
|
21
|
+
blocks,
|
|
22
|
+
getStyle,
|
|
23
|
+
setStyle
|
|
24
|
+
} = useGlobalStylesContext();
|
|
25
|
+
const context = name === undefined ? root : blocks[name];
|
|
26
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
27
|
+
const hasBorderPanel = useHasBorderPanel(context);
|
|
28
|
+
const hasDimensionsPanel = useHasDimensionsPanel(context);
|
|
29
|
+
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
30
|
+
back: parentMenu ? parentMenu : '/',
|
|
31
|
+
title: __('Layout')
|
|
32
|
+
}), hasDimensionsPanel && createElement(DimensionsPanel, {
|
|
33
|
+
context: context,
|
|
34
|
+
getStyle: getStyle,
|
|
35
|
+
setStyle: setStyle
|
|
36
|
+
}), hasBorderPanel && createElement(BorderPanel, {
|
|
37
|
+
context: context,
|
|
38
|
+
getStyle: getStyle,
|
|
39
|
+
setStyle: setStyle
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default ScreenLayout;
|
|
44
|
+
//# sourceMappingURL=screen-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["__","useGlobalStylesContext","BorderPanel","useHasBorderPanel","DimensionsPanel","useHasDimensionsPanel","ScreenHeader","ScreenLayout","name","root","blocks","getStyle","setStyle","context","undefined","parentMenu","hasBorderPanel","hasDimensionsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,WAAP,IAAsBC,iBAAtB,QAA+C,gBAA/C;AACA,OAAOC,eAAP,IAA0BC,qBAA1B,QAAuD,oBAAvD;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAAkC;AACjC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA;AAA1B,MAAuCX,sBAAsB,EAAnE;AACA,QAAMY,OAAO,GAAGL,IAAI,KAAKM,SAAT,GAAqBL,IAArB,GAA4BC,MAAM,CAAEF,IAAF,CAAlD;AACA,QAAMO,UAAU,GAAGP,IAAI,KAAKM,SAAT,GAAqB,EAArB,GAA0B,aAAaN,IAA1D;AACA,QAAMQ,cAAc,GAAGb,iBAAiB,CAAEU,OAAF,CAAxC;AACA,QAAMI,kBAAkB,GAAGZ,qBAAqB,CAAEQ,OAAF,CAAhD;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGE,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAGf,EAAE,CAAE,QAAF;AAFX,IADD,EAKGiB,kBAAkB,IACnB,cAAC,eAAD;AACC,IAAA,OAAO,EAAGJ,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IANF,EAYGI,cAAc,IACf,cAAC,WAAD;AACC,IAAA,OAAO,EAAGH,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAbF,CADD;AAsBA;;AAED,eAAeL,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport BorderPanel, { useHasBorderPanel } from './border-panel';\nimport DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenLayout( { name } ) {\n\tconst { root, blocks, getStyle, setStyle } = useGlobalStylesContext();\n\tconst context = name === undefined ? root : blocks[ name ];\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst hasBorderPanel = useHasBorderPanel( context );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( context );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Layout' ) }\n\t\t\t/>\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<DimensionsPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<BorderPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __experimentalItemGroup as ItemGroup, __experimentalItem as Item } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import StylesPreview from './preview';
|
|
13
|
+
import NavigationButton from './navigation-button';
|
|
14
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
15
|
+
import ContextMenu from './context-menu';
|
|
16
|
+
|
|
17
|
+
function ScreenRoot() {
|
|
18
|
+
const {
|
|
19
|
+
root
|
|
20
|
+
} = useGlobalStylesContext();
|
|
21
|
+
return createElement(Fragment, null, createElement(StylesPreview, null), createElement(ContextMenu, {
|
|
22
|
+
context: root
|
|
23
|
+
}), createElement(ItemGroup, null, createElement(Item, null, createElement("p", null, __('Customize the appearance of specific blocks for the whole site.'))), createElement(NavigationButton, {
|
|
24
|
+
path: "/blocks"
|
|
25
|
+
}, __('Blocks'))));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default ScreenRoot;
|
|
29
|
+
//# sourceMappingURL=screen-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__","StylesPreview","NavigationButton","useGlobalStylesContext","ContextMenu","ScreenRoot","root"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,kBAAkB,IAAIC,IAFvB,QAGO,uBAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,WAAP,MAAwB,gBAAxB;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAWH,sBAAsB,EAAvC;AAEA,SACC,8BACC,cAAC,aAAD,OADD,EAGC,cAAC,WAAD;AAAa,IAAA,OAAO,EAAGG;AAAvB,IAHD,EAKC,cAAC,SAAD,QACC,cAAC,IAAD,QACC,yBACGN,EAAE,CACH,iEADG,CADL,CADD,CADD,EAQC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACGA,EAAE,CAAE,QAAF,CADL,CARD,CALD,CADD;AAoBA;;AAED,eAAeK,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport StylesPreview from './preview';\nimport NavigationButton from './navigation-button';\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ContextMenu from './context-menu';\n\nfunction ScreenRoot() {\n\tconst { root } = useGlobalStylesContext();\n\n\treturn (\n\t\t<>\n\t\t\t<StylesPreview />\n\n\t\t\t<ContextMenu context={ root } />\n\n\t\t\t<ItemGroup>\n\t\t\t\t<Item>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Item>\n\t\t\t\t<NavigationButton path=\"/blocks\">\n\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
12
|
+
import TypographyPanel from './typography-panel';
|
|
13
|
+
import ScreenHeader from './header';
|
|
14
|
+
|
|
15
|
+
function ScreenTypography({
|
|
16
|
+
name
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
root,
|
|
20
|
+
blocks,
|
|
21
|
+
getStyle,
|
|
22
|
+
setStyle
|
|
23
|
+
} = useGlobalStylesContext();
|
|
24
|
+
const context = name === undefined ? root : blocks[name];
|
|
25
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
26
|
+
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
27
|
+
back: parentMenu ? parentMenu : '/',
|
|
28
|
+
title: __('Typography')
|
|
29
|
+
}), createElement(TypographyPanel, {
|
|
30
|
+
context: context,
|
|
31
|
+
getStyle: getStyle,
|
|
32
|
+
setStyle: setStyle
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default ScreenTypography;
|
|
37
|
+
//# sourceMappingURL=screen-typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["__","useGlobalStylesContext","TypographyPanel","ScreenHeader","ScreenTypography","name","root","blocks","getStyle","setStyle","context","undefined","parentMenu"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,gBAAT,CAA2B;AAAEC,EAAAA;AAAF,CAA3B,EAAsC;AACrC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA;AAA1B,MAAuCR,sBAAsB,EAAnE;AACA,QAAMS,OAAO,GAAGL,IAAI,KAAKM,SAAT,GAAqBL,IAArB,GAA4BC,MAAM,CAAEF,IAAF,CAAlD;AACA,QAAMO,UAAU,GAAGP,IAAI,KAAKM,SAAT,GAAqB,EAArB,GAA0B,aAAaN,IAA1D;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGO,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAGZ,EAAE,CAAE,YAAF;AAFX,IADD,EAKC,cAAC,eAAD;AACC,IAAA,OAAO,EAAGU,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IALD,CADD;AAaA;;AAED,eAAeL,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenTypography( { name } ) {\n\tconst { root, blocks, getStyle, setStyle } = useGlobalStylesContext();\n\tconst context = name === undefined ? root : blocks[ name ];\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<TypographyPanel\n\t\t\t\tcontext={ context }\n\t\t\t\tgetStyle={ getStyle }\n\t\t\t\tsetStyle={ setStyle }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __experimentalHeading as Heading } from '@wordpress/components';
|
|
7
|
+
|
|
8
|
+
function Subtitle({
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
11
|
+
return createElement(Heading, {
|
|
12
|
+
level: 2
|
|
13
|
+
}, children);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default Subtitle;
|
|
17
|
+
//# sourceMappingURL=subtitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["__experimentalHeading","Heading","Subtitle","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,qBAAqB,IAAIC,OAAlC,QAAiD,uBAAjD;;AAEA,SAASC,QAAT,CAAmB;AAAEC,EAAAA;AAAF,CAAnB,EAAkC;AACjC,SAAO,cAAC,OAAD;AAAS,IAAA,KAAK,EAAG;AAAjB,KAAuBA,QAAvB,CAAP;AACA;;AAED,eAAeD,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children } ) {\n\treturn <Heading level={ 2 }>{ children }</Heading>;\n}\n\nexport default Subtitle;\n"]}
|
|
@@ -5,7 +5,6 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { LineHeightControl, __experimentalFontFamilyControl as FontFamilyControl, __experimentalFontAppearanceControl as FontAppearanceControl, __experimentalLetterSpacingControl as LetterSpacingControl } from '@wordpress/block-editor';
|
|
7
7
|
import { PanelBody, FontSizePicker } from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
@@ -79,7 +78,7 @@ export default function TypographyPanel({
|
|
|
79
78
|
name
|
|
80
79
|
});
|
|
81
80
|
return createElement(PanelBody, {
|
|
82
|
-
|
|
81
|
+
className: "edit-site-typography-panel",
|
|
83
82
|
initialOpen: true
|
|
84
83
|
}, supports.includes('fontFamily') && createElement(FontFamilyControl, {
|
|
85
84
|
fontFamilies: fontFamilies,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["LineHeightControl","__experimentalFontFamilyControl","FontFamilyControl","__experimentalFontAppearanceControl","FontAppearanceControl","__experimentalLetterSpacingControl","LetterSpacingControl","PanelBody","FontSizePicker","useSetting","useHasTypographyPanel","supports","name","hasLineHeight","useHasLineHeightControl","hasFontAppearance","useHasAppearanceControl","hasLetterSpacing","useHasLetterSpacingControl","includes","hasFontStyles","hasFontWeights","TypographyPanel","context","getStyle","setStyle","fontSizes","disableCustomFontSizes","fontFamilies","hasLineHeightEnabled","hasAppearanceControl","hasLetterSpacingControl","value","fontStyle","fontWeight"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tLineHeightControl,\n\t__experimentalFontFamilyControl as FontFamilyControl,\n\t__experimentalFontAppearanceControl as FontAppearanceControl,\n\t__experimentalLetterSpacingControl as LetterSpacingControl,\n} from '@wordpress/block-editor';\nimport { PanelBody, FontSizePicker } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useSetting } from '../editor/utils';\n\nexport function useHasTypographyPanel( { supports, name } ) {\n\tconst hasLineHeight = useHasLineHeightControl( { supports, name } );\n\tconst hasFontAppearance = useHasAppearanceControl( { supports, name } );\n\tconst hasLetterSpacing = useHasLetterSpacingControl( { supports, name } );\n\treturn (\n\t\thasLineHeight ||\n\t\thasFontAppearance ||\n\t\thasLetterSpacing ||\n\t\tsupports.includes( 'fontSize' )\n\t);\n}\n\nfunction useHasLineHeightControl( { supports, name } ) {\n\treturn (\n\t\tuseSetting( 'typography.customLineHeight', name ) &&\n\t\tsupports.includes( 'lineHeight' )\n\t);\n}\n\nfunction useHasAppearanceControl( { supports, name } ) {\n\tconst hasFontStyles =\n\t\tuseSetting( 'typography.customFontStyle', name ) &&\n\t\tsupports.includes( 'fontStyle' );\n\tconst hasFontWeights =\n\t\tuseSetting( 'typography.customFontWeight', name ) &&\n\t\tsupports.includes( 'fontWeight' );\n\treturn hasFontStyles || hasFontWeights;\n}\n\nfunction useHasLetterSpacingControl( { supports, name } ) {\n\treturn (\n\t\tuseSetting( 'typography.customLetterSpacing', name ) &&\n\t\tsupports.includes( 'letterSpacing' )\n\t);\n}\n\nexport default function TypographyPanel( {\n\tcontext: { supports, name },\n\tgetStyle,\n\tsetStyle,\n} ) {\n\tconst fontSizes = useSetting( 'typography.fontSizes', name );\n\tconst disableCustomFontSizes = ! useSetting(\n\t\t'typography.customFontSize',\n\t\tname\n\t);\n\tconst fontFamilies = useSetting( 'typography.fontFamilies', name );\n\tconst hasFontStyles =\n\t\tuseSetting( 'typography.customFontStyle', name ) &&\n\t\tsupports.includes( 'fontStyle' );\n\tconst hasFontWeights =\n\t\tuseSetting( 'typography.customFontWeight', name ) &&\n\t\tsupports.includes( 'fontWeight' );\n\tconst hasLineHeightEnabled = useHasLineHeightControl( { supports, name } );\n\tconst hasAppearanceControl = useHasAppearanceControl( { supports, name } );\n\tconst hasLetterSpacingControl = useHasLetterSpacingControl( {\n\t\tsupports,\n\t\tname,\n\t} );\n\n\treturn (\n\t\t<PanelBody className=\"edit-site-typography-panel\" initialOpen={ true }>\n\t\t\t{ supports.includes( 'fontFamily' ) && (\n\t\t\t\t<FontFamilyControl\n\t\t\t\t\tfontFamilies={ fontFamilies }\n\t\t\t\t\tvalue={ getStyle( name, 'fontFamily' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'fontFamily', value )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ supports.includes( 'fontSize' ) && (\n\t\t\t\t<FontSizePicker\n\t\t\t\t\tvalue={ getStyle( name, 'fontSize' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'fontSize', value )\n\t\t\t\t\t}\n\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasLineHeightEnabled && (\n\t\t\t\t<LineHeightControl\n\t\t\t\t\tvalue={ getStyle( name, 'lineHeight' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'lineHeight', value )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasAppearanceControl && (\n\t\t\t\t<FontAppearanceControl\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\tfontStyle: getStyle( name, 'fontStyle' ),\n\t\t\t\t\t\tfontWeight: getStyle( name, 'fontWeight' ),\n\t\t\t\t\t} }\n\t\t\t\t\tonChange={ ( { fontStyle, fontWeight } ) => {\n\t\t\t\t\t\tsetStyle( name, 'fontStyle', fontStyle );\n\t\t\t\t\t\tsetStyle( name, 'fontWeight', fontWeight );\n\t\t\t\t\t} }\n\t\t\t\t\thasFontStyles={ hasFontStyles }\n\t\t\t\t\thasFontWeights={ hasFontWeights }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasLetterSpacingControl && (\n\t\t\t\t<LetterSpacingControl\n\t\t\t\t\tvalue={ getStyle( name, 'letterSpacing' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'letterSpacing', value )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PanelBody>\n\t);\n}\n"]}
|
|
@@ -23,7 +23,7 @@ function getBlockDisplayText(block) {
|
|
|
23
23
|
function useSecondaryText() {
|
|
24
24
|
const {
|
|
25
25
|
getBlock
|
|
26
|
-
} = useSelect(
|
|
26
|
+
} = useSelect(blockEditorStore);
|
|
27
27
|
const activeEntityBlockId = useSelect(select => select(blockEditorStore).__experimentalGetActiveBlockIdByBlockNames(['core/template-part']), []);
|
|
28
28
|
|
|
29
29
|
if (activeEntityBlockId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/document-actions/index.js"],"names":["classnames","sprintf","__","__experimentalGetBlockLabel","getBlockLabel","getBlockType","useSelect","Dropdown","Button","VisuallyHidden","__experimentalText","Text","chevronDown","useRef","store","blockEditorStore","getBlockDisplayText","block","name","attributes","useSecondaryText","getBlock","activeEntityBlockId","select","__experimentalGetActiveBlockIdByBlockNames","label","isActive","DocumentActions","entityTitle","entityLabel","isLoaded","children","dropdownContent","titleRef","anchorRef","current","isOpen","onToggle"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SACCC,2BAA2B,IAAIC,aADhC,EAECC,YAFD,QAGO,mBAHP;AAIA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,QADD,EAECC,MAFD,EAGCC,cAHD,EAICC,kBAAkB,IAAIC,IAJvB,QAKO,uBALP;AAMA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,mBAAT,CAA8BC,KAA9B,EAAsC;AACrC,SAAOA,KAAK,GACTb,aAAa,CAAEC,YAAY,CAAEY,KAAK,CAACC,IAAR,CAAd,EAA8BD,KAAK,CAACE,UAApC,CADJ,GAET,IAFH;AAGA;;AAED,SAASC,gBAAT,GAA4B;AAC3B,QAAM;AAAEC,IAAAA;AAAF,MAAef,SAAS,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/document-actions/index.js"],"names":["classnames","sprintf","__","__experimentalGetBlockLabel","getBlockLabel","getBlockType","useSelect","Dropdown","Button","VisuallyHidden","__experimentalText","Text","chevronDown","useRef","store","blockEditorStore","getBlockDisplayText","block","name","attributes","useSecondaryText","getBlock","activeEntityBlockId","select","__experimentalGetActiveBlockIdByBlockNames","label","isActive","DocumentActions","entityTitle","entityLabel","isLoaded","children","dropdownContent","titleRef","anchorRef","current","isOpen","onToggle"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport {\n\t__experimentalGetBlockLabel as getBlockLabel,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tDropdown,\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction getBlockDisplayText( block ) {\n\treturn block\n\t\t? getBlockLabel( getBlockType( block.name ), block.attributes )\n\t\t: null;\n}\n\nfunction useSecondaryText() {\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst activeEntityBlockId = useSelect(\n\t\t( select ) =>\n\t\t\tselect(\n\t\t\t\tblockEditorStore\n\t\t\t).__experimentalGetActiveBlockIdByBlockNames( [\n\t\t\t\t'core/template-part',\n\t\t\t] ),\n\t\t[]\n\t);\n\n\tif ( activeEntityBlockId ) {\n\t\treturn {\n\t\t\tlabel: getBlockDisplayText( getBlock( activeEntityBlockId ) ),\n\t\t\tisActive: true,\n\t\t};\n\t}\n\n\treturn {};\n}\n\n/**\n * @param {Object} props Props for the DocumentActions component.\n * @param {string} props.entityTitle The title to display.\n * @param {string} props.entityLabel A label to use for entity-related options.\n * E.g. \"template\" would be used for \"edit\n * template\" and \"show template details\".\n * @param {boolean} props.isLoaded Whether the data is available.\n * @param {Function} props.children React component to use for the\n * information dropdown area. Should be a\n * function which accepts dropdown props.\n */\nexport default function DocumentActions( {\n\tentityTitle,\n\tentityLabel,\n\tisLoaded,\n\tchildren: dropdownContent,\n} ) {\n\tconst { label } = useSecondaryText();\n\n\t// The title ref is passed to the popover as the anchorRef so that the\n\t// dropdown is centered over the whole title area rather than just one\n\t// part of it.\n\tconst titleRef = useRef();\n\n\t// Return a simple loading indicator until we have information to show.\n\tif ( ! isLoaded ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Loading…' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Return feedback that the template does not seem to exist.\n\tif ( ! entityTitle ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Template not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', {\n\t\t\t\t'has-secondary-label': !! label,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tref={ titleRef }\n\t\t\t\tclassName=\"edit-site-document-actions__title-wrapper\"\n\t\t\t>\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__title-prefix\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t\t\t__( 'Editing %s:' ),\n\t\t\t\t\t\t\tentityLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</Text>\n\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tas=\"h1\"\n\t\t\t\t>\n\t\t\t\t\t{ entityTitle }\n\t\t\t\t</Text>\n\n\t\t\t\t<Text\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tclassName=\"edit-site-document-actions__secondary-item\"\n\t\t\t\t>\n\t\t\t\t\t{ label ?? '' }\n\t\t\t\t</Text>\n\n\t\t\t\t{ dropdownContent && (\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tanchorRef: titleRef.current,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-document-actions__get-info\"\n\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: the entity to see details about, like \"template\"*/\n\t\t\t\t\t\t\t\t\t__( 'Show %s details' ),\n\t\t\t\t\t\t\t\t\tentityLabel\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\tcontentClassName=\"edit-site-document-actions__info-dropdown\"\n\t\t\t\t\t\trenderContent={ dropdownContent }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { ActionItem } from '@wordpress/interface';
|
|
5
|
+
import { compose } from '@wordpress/compose';
|
|
6
|
+
import { withPluginContext } from '@wordpress/plugins';
|
|
7
|
+
/**
|
|
8
|
+
* Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
|
|
9
|
+
* The text within the component appears as the menu item label.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} props Component properties.
|
|
12
|
+
* @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
|
|
13
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
14
|
+
* @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
|
|
15
|
+
* @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* // Using ES5 syntax
|
|
20
|
+
* var __ = wp.i18n.__;
|
|
21
|
+
* var PluginMoreMenuItem = wp.editSite.PluginMoreMenuItem;
|
|
22
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
23
|
+
*
|
|
24
|
+
* function onButtonClick() {
|
|
25
|
+
* alert( 'Button clicked.' );
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* function MyButtonMoreMenuItem() {
|
|
29
|
+
* return wp.element.createElement(
|
|
30
|
+
* PluginMoreMenuItem,
|
|
31
|
+
* {
|
|
32
|
+
* icon: moreIcon,
|
|
33
|
+
* onClick: onButtonClick,
|
|
34
|
+
* },
|
|
35
|
+
* __( 'My button title' )
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```jsx
|
|
42
|
+
* // Using ESNext syntax
|
|
43
|
+
* import { __ } from '@wordpress/i18n';
|
|
44
|
+
* import { PluginMoreMenuItem } from '@wordpress/edit-site';
|
|
45
|
+
* import { more } from '@wordpress/icons';
|
|
46
|
+
*
|
|
47
|
+
* function onButtonClick() {
|
|
48
|
+
* alert( 'Button clicked.' );
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* const MyButtonMoreMenuItem = () => (
|
|
52
|
+
* <PluginMoreMenuItem
|
|
53
|
+
* icon={ more }
|
|
54
|
+
* onClick={ onButtonClick }
|
|
55
|
+
* >
|
|
56
|
+
* { __( 'My button title' ) }
|
|
57
|
+
* </PluginMoreMenuItem>
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @return {WPComponent} The component to be rendered.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
export default compose(withPluginContext((context, ownProps) => {
|
|
65
|
+
return {
|
|
66
|
+
icon: ownProps.icon || context.icon,
|
|
67
|
+
name: 'core/edit-site/plugin-more-menu'
|
|
68
|
+
};
|
|
69
|
+
}))(ActionItem);
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/plugin-more-menu-item/index.js"],"names":["ActionItem","compose","withPluginContext","context","ownProps","icon","name"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,sBAA3B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAeD,OAAO,CACrBC,iBAAiB,CAAE,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNC,IAAAA,IAAI,EAAED,QAAQ,CAACC,IAAT,IAAiBF,OAAO,CAACE,IADzB;AAENC,IAAAA,IAAI,EAAE;AAFA,GAAP;AAIA,CALgB,CADI,CAAP,CAOZN,UAPY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ActionItem } from '@wordpress/interface';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginMoreMenuItem = wp.editSite.PluginMoreMenuItem;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * function MyButtonMoreMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginMoreMenuItem,\n * \t\t{\n * \t\t\ticon: moreIcon,\n * \t\t\tonClick: onButtonClick,\n * \t\t},\n * \t\t__( 'My button title' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginMoreMenuItem } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * const MyButtonMoreMenuItem = () => (\n * \t<PluginMoreMenuItem\n * \t\ticon={ more }\n * \t\tonClick={ onButtonClick }\n * \t>\n * \t\t{ __( 'My button title' ) }\n * \t</PluginMoreMenuItem>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nexport default compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t\tname: 'core/edit-site/plugin-more-menu',\n\t\t};\n\t} )\n)( ActionItem );\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WordPress dependencies
|
|
6
|
+
*/
|
|
7
|
+
import { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';
|
|
8
|
+
/**
|
|
9
|
+
* Renders a menu item in `Plugins` group in `More Menu` drop down,
|
|
10
|
+
* and can be used to activate the corresponding `PluginSidebar` component.
|
|
11
|
+
* The text within the component appears as the menu item label.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} props Component props.
|
|
14
|
+
* @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
|
|
15
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* // Using ES5 syntax
|
|
20
|
+
* var __ = wp.i18n.__;
|
|
21
|
+
* var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;
|
|
22
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
23
|
+
*
|
|
24
|
+
* function MySidebarMoreMenuItem() {
|
|
25
|
+
* return wp.element.createElement(
|
|
26
|
+
* PluginSidebarMoreMenuItem,
|
|
27
|
+
* {
|
|
28
|
+
* target: 'my-sidebar',
|
|
29
|
+
* icon: moreIcon,
|
|
30
|
+
* },
|
|
31
|
+
* __( 'My sidebar title' )
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```jsx
|
|
38
|
+
* // Using ESNext syntax
|
|
39
|
+
* import { __ } from '@wordpress/i18n';
|
|
40
|
+
* import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';
|
|
41
|
+
* import { more } from '@wordpress/icons';
|
|
42
|
+
*
|
|
43
|
+
* const MySidebarMoreMenuItem = () => (
|
|
44
|
+
* <PluginSidebarMoreMenuItem
|
|
45
|
+
* target="my-sidebar"
|
|
46
|
+
* icon={ more }
|
|
47
|
+
* >
|
|
48
|
+
* { __( 'My sidebar title' ) }
|
|
49
|
+
* </PluginSidebarMoreMenuItem>
|
|
50
|
+
* );
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @return {WPComponent} The component to be rendered.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
export default function PluginSidebarMoreMenuItem(props) {
|
|
57
|
+
return createElement(ComplementaryAreaMoreMenuItem // Menu item is marked with unstable prop for backward compatibility.
|
|
58
|
+
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
59
|
+
, _extends({
|
|
60
|
+
__unstableExplicitMenuItem: true,
|
|
61
|
+
scope: "core/edit-site"
|
|
62
|
+
}, props));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/plugin-sidebar-more-menu-item/index.js"],"names":["ComplementaryAreaMoreMenuItem","PluginSidebarMoreMenuItem","props"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,6BAAT,QAA8C,sBAA9C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,yBAAT,CAAoCC,KAApC,EAA4C;AAC1D,SACC,cAAC,6BAAD,CACC;AACA;AAFD;AAGC,IAAA,0BAA0B,MAH3B;AAIC,IAAA,KAAK,EAAC;AAJP,KAKMA,KALN,EADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down,\n * and can be used to activate the corresponding `PluginSidebar` component.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component props.\n * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MySidebarMoreMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginSidebarMoreMenuItem,\n * \t\t{\n * \t\t\ttarget: 'my-sidebar',\n * \t\t\ticon: moreIcon,\n * \t\t},\n * \t\t__( 'My sidebar title' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MySidebarMoreMenuItem = () => (\n * \t<PluginSidebarMoreMenuItem\n * \t\ttarget=\"my-sidebar\"\n * \t\ticon={ more }\n * \t>\n * \t\t{ __( 'My sidebar title' ) }\n * \t</PluginSidebarMoreMenuItem>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\n\nexport default function PluginSidebarMoreMenuItem( props ) {\n\treturn (\n\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t// Menu item is marked with unstable prop for backward compatibility.\n\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t__unstableExplicitMenuItem\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';
|
|
|
10
10
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
export default function RedoButton() {
|
|
13
|
-
const hasRedo = useSelect(select => select(coreStore).hasRedo());
|
|
13
|
+
const hasRedo = useSelect(select => select(coreStore).hasRedo(), []);
|
|
14
14
|
const {
|
|
15
15
|
redo
|
|
16
16
|
} = useDispatch(coreStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/redo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","redo","redoIcon","undo","undoIcon","displayShortcut","store","coreStore","RedoButton","hasRedo","select","primaryShift","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/redo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","redo","redoIcon","undo","undoIcon","displayShortcut","store","coreStore","RedoButton","hasRedo","select","primaryShift","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,CACtBW,MAAF,IAAcA,MAAM,CAAEH,SAAF,CAAN,CAAoBE,OAApB,EADU,EAExB,EAFwB,CAAzB;AAIA,QAAM;AAAER,IAAAA;AAAF,MAAWD,WAAW,CAAEO,SAAF,CAA5B;AACA,SACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAG,CAAEV,KAAK,EAAP,GAAYK,QAAZ,GAAuBE,QAD/B;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,MAAF,CAFX;AAGC,IAAA,QAAQ,EAAGS,eAAe,CAACM,YAAhB,CAA8B,GAA9B,CAHZ,CAIC;AACA;AACA;AAND;AAOC,qBAAgB,CAAEF,OAPnB;AAQC,IAAA,OAAO,EAAGA,OAAO,GAAGR,IAAH,GAAUW;AAR5B,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function RedoButton() {\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( coreStore ).hasRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ displayShortcut.primaryShift( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';
|
|
|
10
10
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
export default function UndoButton() {
|
|
13
|
-
const hasUndo = useSelect(select => select(coreStore).hasUndo());
|
|
13
|
+
const hasUndo = useSelect(select => select(coreStore).hasUndo(), []);
|
|
14
14
|
const {
|
|
15
15
|
undo
|
|
16
16
|
} = useDispatch(coreStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/undo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","undo","undoIcon","redo","redoIcon","displayShortcut","store","coreStore","UndoButton","hasUndo","select","primary","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/undo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","undo","undoIcon","redo","redoIcon","displayShortcut","store","coreStore","UndoButton","hasUndo","select","primary","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,CACtBW,MAAF,IAAcA,MAAM,CAAEH,SAAF,CAAN,CAAoBE,OAApB,EADU,EAExB,EAFwB,CAAzB;AAIA,QAAM;AAAER,IAAAA;AAAF,MAAWD,WAAW,CAAEO,SAAF,CAA5B;AACA,SACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAG,CAAEV,KAAK,EAAP,GAAYK,QAAZ,GAAuBE,QAD/B;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,MAAF,CAFX;AAGC,IAAA,QAAQ,EAAGS,eAAe,CAACM,OAAhB,CAAyB,GAAzB,CAHZ,CAIC;AACA;AACA;AAND;AAOC,qBAAgB,CAAEF,OAPnB;AAQC,IAAA,OAAO,EAAGA,OAAO,GAAGR,IAAH,GAAUW;AAR5B,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function UndoButton() {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( coreStore ).hasUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { useEffect } from '@wordpress/element';
|
|
5
5
|
import { useShortcut, store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
6
6
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
@@ -16,7 +16,7 @@ import { SIDEBAR_BLOCK } from '../sidebar/constants';
|
|
|
16
16
|
import { STORE_NAME } from '../../store/constants';
|
|
17
17
|
|
|
18
18
|
function KeyboardShortcuts() {
|
|
19
|
-
const isListViewOpen = useSelect(select => select(editSiteStore).isListViewOpened());
|
|
19
|
+
const isListViewOpen = useSelect(select => select(editSiteStore).isListViewOpened(), []);
|
|
20
20
|
const isBlockInspectorOpen = useSelect(select => select(interfaceStore).getActiveComplementaryArea(editSiteStore.name) === SIDEBAR_BLOCK, []);
|
|
21
21
|
const {
|
|
22
22
|
redo,
|
|
@@ -32,19 +32,13 @@ function KeyboardShortcuts() {
|
|
|
32
32
|
useShortcut('core/edit-site/undo', event => {
|
|
33
33
|
undo();
|
|
34
34
|
event.preventDefault();
|
|
35
|
-
}, {
|
|
36
|
-
bindGlobal: true
|
|
37
35
|
});
|
|
38
36
|
useShortcut('core/edit-site/redo', event => {
|
|
39
37
|
redo();
|
|
40
38
|
event.preventDefault();
|
|
41
|
-
}, {
|
|
42
|
-
bindGlobal: true
|
|
43
39
|
});
|
|
44
|
-
useShortcut('core/edit-site/toggle-list-view',
|
|
40
|
+
useShortcut('core/edit-site/toggle-list-view', () => {
|
|
45
41
|
setIsListViewOpened(!isListViewOpen);
|
|
46
|
-
}, [isListViewOpen, setIsListViewOpened]), {
|
|
47
|
-
bindGlobal: true
|
|
48
42
|
});
|
|
49
43
|
useShortcut('core/edit-site/toggle-block-settings-sidebar', event => {
|
|
50
44
|
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
@@ -56,8 +50,6 @@ function KeyboardShortcuts() {
|
|
|
56
50
|
} else {
|
|
57
51
|
enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
|
|
58
52
|
}
|
|
59
|
-
}, {
|
|
60
|
-
bindGlobal: true
|
|
61
53
|
});
|
|
62
54
|
return null;
|
|
63
55
|
}
|