@wordpress/edit-site 3.0.2 → 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 +18 -4
- 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 +1 -1
- package/build/components/editor/global-styles-provider.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 +1 -1
- package/build/components/editor/utils.js.map +1 -1
- package/build/components/{sidebar → global-styles}/border-panel.js +0 -0
- 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 +7 -11
- 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 +6 -7
- 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/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/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/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 +54 -1
- 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 +15 -4
- 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 +1 -1
- package/build-module/components/editor/global-styles-provider.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 +1 -1
- package/build-module/components/editor/utils.js.map +1 -1
- package/build-module/components/{sidebar → global-styles}/border-panel.js +0 -0
- 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 +8 -12
- 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 +6 -7
- 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/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/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/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 +45 -1
- 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 +122 -17
- package/build-style/style.css +122 -17
- package/package.json +26 -26
- package/src/components/block-editor/back-button.js +44 -0
- package/src/components/block-editor/index.js +16 -1
- 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 +1 -1
- package/src/components/editor/index.js +5 -8
- package/src/components/editor/utils.js +1 -0
- package/src/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
- package/src/components/{sidebar → global-styles}/color-panel.js +12 -17
- package/src/components/global-styles/context-menu.js +54 -0
- package/src/components/{sidebar → global-styles}/dimensions-panel.js +6 -10
- 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/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/style.scss +1 -0
- 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/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 +53 -1
- 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,41 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalSpacer as Spacer, __experimentalHeading as Heading, __experimentalView as View } from '@wordpress/components';
|
|
7
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
8
|
+
import { chevronRight, chevronLeft, Icon } from '@wordpress/icons';
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import NavigationButton from './navigation-button';
|
|
14
|
+
|
|
15
|
+
function ScreenHeader({
|
|
16
|
+
back,
|
|
17
|
+
title,
|
|
18
|
+
description
|
|
19
|
+
}) {
|
|
20
|
+
return createElement(VStack, {
|
|
21
|
+
spacing: 2
|
|
22
|
+
}, createElement(HStack, {
|
|
23
|
+
spacing: 2
|
|
24
|
+
}, createElement(View, null, createElement(NavigationButton, {
|
|
25
|
+
path: back,
|
|
26
|
+
icon: createElement(Icon, {
|
|
27
|
+
icon: isRTL() ? chevronRight : chevronLeft,
|
|
28
|
+
variant: "muted"
|
|
29
|
+
}),
|
|
30
|
+
size: "small",
|
|
31
|
+
isBack: true,
|
|
32
|
+
"aria-label": __('Navigate to the previous view')
|
|
33
|
+
})), createElement(Spacer, null, createElement(Heading, {
|
|
34
|
+
level: 5
|
|
35
|
+
}, title))), description && createElement("p", {
|
|
36
|
+
className: "edit-site-global-styles-header__description"
|
|
37
|
+
}, description));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default ScreenHeader;
|
|
41
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalSpacer","Spacer","__experimentalHeading","Heading","__experimentalView","View","isRTL","__","chevronRight","chevronLeft","Icon","NavigationButton","ScreenHeader","back","title","description"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,qBAAqB,IAAIC,OAJ1B,EAKCC,kBAAkB,IAAIC,IALvB,QAMO,uBANP;AAOA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,YAAT,EAAuBC,WAAvB,EAAoCC,IAApC,QAAgD,kBAAhD;AAEA;AACA;AACA;;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;;AAEA,SAASC,YAAT,CAAuB;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,KAAR;AAAeC,EAAAA;AAAf,CAAvB,EAAsD;AACrD,SACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,IAAD,QACC,cAAC,gBAAD;AACC,IAAA,IAAI,EAAGF,IADR;AAEC,IAAA,IAAI,EACH,cAAC,IAAD;AACC,MAAA,IAAI,EAAGP,KAAK,KAAKE,YAAL,GAAoBC,WADjC;AAEC,MAAA,OAAO,EAAC;AAFT,MAHF;AAQC,IAAA,IAAI,EAAC,OARN;AASC,IAAA,MAAM,MATP;AAUC,kBAAaF,EAAE,CAAE,+BAAF;AAVhB,IADD,CADD,EAeC,cAAC,MAAD,QACC,cAAC,OAAD;AAAS,IAAA,KAAK,EAAG;AAAjB,KAAuBO,KAAvB,CADD,CAfD,CADD,EAoBGC,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CArBF,CADD;AA4BA;;AAED,eAAeH,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft, Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport NavigationButton from './navigation-button';\n\nfunction ScreenHeader( { back, title, description } ) {\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t<View>\n\t\t\t\t\t<NavigationButton\n\t\t\t\t\t\tpath={ back }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tisBack\n\t\t\t\t\t\taria-label={ __( 'Navigate to the previous view' ) }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<Spacer>\n\t\t\t\t\t<Heading level={ 5 }>{ title }</Heading>\n\t\t\t\t</Spacer>\n\t\t\t</HStack>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* External dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { map } from 'lodash';
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen } from '@wordpress/components';
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
17
|
+
import ScreenRoot from './screen-root';
|
|
18
|
+
import ScreenBlockList from './screen-block-list';
|
|
19
|
+
import ScreenBlock from './screen-block';
|
|
20
|
+
import ScreenTypography from './screen-typography';
|
|
21
|
+
import ScreenColors from './screen-colors';
|
|
22
|
+
import ScreenColorPalette from './screen-color-palette';
|
|
23
|
+
import ScreenLayout from './screen-layout';
|
|
24
|
+
|
|
25
|
+
function ContextScreens({
|
|
26
|
+
name
|
|
27
|
+
}) {
|
|
28
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
29
|
+
return createElement(Fragment, null, createElement(NavigatorScreen, {
|
|
30
|
+
path: parentMenu + '/typography'
|
|
31
|
+
}, createElement(ScreenTypography, {
|
|
32
|
+
name: name
|
|
33
|
+
})), createElement(NavigatorScreen, {
|
|
34
|
+
path: parentMenu + '/colors'
|
|
35
|
+
}, createElement(ScreenColors, {
|
|
36
|
+
name: name
|
|
37
|
+
})), createElement(NavigatorScreen, {
|
|
38
|
+
path: parentMenu + '/colors/palette'
|
|
39
|
+
}, createElement(ScreenColorPalette, {
|
|
40
|
+
name: name
|
|
41
|
+
})), createElement(NavigatorScreen, {
|
|
42
|
+
path: parentMenu + '/layout'
|
|
43
|
+
}, createElement(ScreenLayout, {
|
|
44
|
+
name: name
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function GlobalStyles() {
|
|
49
|
+
const {
|
|
50
|
+
blocks
|
|
51
|
+
} = useGlobalStylesContext();
|
|
52
|
+
return createElement(NavigatorProvider, {
|
|
53
|
+
initialPath: "/"
|
|
54
|
+
}, createElement(NavigatorScreen, {
|
|
55
|
+
path: "/"
|
|
56
|
+
}, createElement(ScreenRoot, null)), createElement(NavigatorScreen, {
|
|
57
|
+
path: "/blocks"
|
|
58
|
+
}, createElement(ScreenBlockList, null)), map(blocks, (block, name) => createElement(NavigatorScreen, {
|
|
59
|
+
key: 'menu-block-' + name,
|
|
60
|
+
path: '/blocks/' + name
|
|
61
|
+
}, createElement(ScreenBlock, {
|
|
62
|
+
name: name
|
|
63
|
+
}))), createElement(ContextScreens, null), map(blocks, (_, name) => createElement(ContextScreens, {
|
|
64
|
+
key: 'screens-block-' + name,
|
|
65
|
+
name: name
|
|
66
|
+
})));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default GlobalStyles;
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/index.js"],"names":["map","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","useGlobalStylesContext","ScreenRoot","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenColors","ScreenColorPalette","ScreenLayout","ContextScreens","name","parentMenu","undefined","GlobalStyles","blocks","block","_"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAKA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;;AAEA,SAASC,cAAT,CAAyB;AAAEC,EAAAA;AAAF,CAAzB,EAAoC;AACnC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AAEA,SACC,8BACC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGC,UAAU,GAAG;AAArC,KACC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAGD;AAAzB,IADD,CADD,EAKC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGC,UAAU,GAAG;AAArC,KACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGD;AAArB,IADD,CALD,EASC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGC,UAAU,GAAG;AAArC,KACC,cAAC,kBAAD;AAAoB,IAAA,IAAI,EAAGD;AAA3B,IADD,CATD,EAaC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGC,UAAU,GAAG;AAArC,KACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGD;AAArB,IADD,CAbD,CADD;AAmBA;;AAED,SAASG,YAAT,GAAwB;AACvB,QAAM;AAAEC,IAAAA;AAAF,MAAab,sBAAsB,EAAzC;AAEA,SACC,cAAC,iBAAD;AAAmB,IAAA,WAAW,EAAC;AAA/B,KACC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,UAAD,OADD,CADD,EAKC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,eAAD,OADD,CALD,EASGL,GAAG,CAAEkB,MAAF,EAAU,CAAEC,KAAF,EAASL,IAAT,KACd,cAAC,eAAD;AACC,IAAA,GAAG,EAAG,gBAAgBA,IADvB;AAEC,IAAA,IAAI,EAAG,aAAaA;AAFrB,KAIC,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGA;AAApB,IAJD,CADI,CATN,EAkBC,cAAC,cAAD,OAlBD,EAoBGd,GAAG,CAAEkB,MAAF,EAAU,CAAEE,CAAF,EAAKN,IAAL,KACd,cAAC,cAAD;AAAgB,IAAA,GAAG,EAAG,mBAAmBA,IAAzC;AAAgD,IAAA,IAAI,EAAGA;AAAvD,IADI,CApBN,CADD;AA0BA;;AAED,eAAeG,YAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ScreenRoot from './screen-root';\nimport ScreenBlockList from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\n\nfunction ContextScreens( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path={ parentMenu + '/typography' }>\n\t\t\t\t<ScreenTypography name={ name } />\n\t\t\t</NavigatorScreen>\n\n\t\t\t<NavigatorScreen path={ parentMenu + '/colors' }>\n\t\t\t\t<ScreenColors name={ name } />\n\t\t\t</NavigatorScreen>\n\n\t\t\t<NavigatorScreen path={ parentMenu + '/colors/palette' }>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</NavigatorScreen>\n\n\t\t\t<NavigatorScreen path={ parentMenu + '/layout' }>\n\t\t\t\t<ScreenLayout name={ name } />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction GlobalStyles() {\n\tconst { blocks } = useGlobalStylesContext();\n\n\treturn (\n\t\t<NavigatorProvider initialPath=\"/\">\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</NavigatorScreen>\n\n\t\t\t<NavigatorScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</NavigatorScreen>\n\n\t\t\t{ map( blocks, ( block, name ) => (\n\t\t\t\t<NavigatorScreen\n\t\t\t\t\tkey={ 'menu-block-' + name }\n\t\t\t\t\tpath={ '/blocks/' + name }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ name } />\n\t\t\t\t</NavigatorScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ map( blocks, ( _, name ) => (\n\t\t\t\t<ContextScreens key={ 'screens-block-' + name } name={ name } />\n\t\t\t) ) }\n\t\t</NavigatorProvider>\n\t);\n}\n\nexport default GlobalStyles;\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WordPress dependencies
|
|
6
|
+
*/
|
|
7
|
+
import { __experimentalUseNavigator as useNavigator, __experimentalItem as Item, FlexItem, __experimentalHStack as HStack } from '@wordpress/components';
|
|
8
|
+
import { Icon } from '@wordpress/icons';
|
|
9
|
+
|
|
10
|
+
function NavigationButton({
|
|
11
|
+
path,
|
|
12
|
+
icon,
|
|
13
|
+
children,
|
|
14
|
+
isBack = false,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const navigator = useNavigator();
|
|
18
|
+
return createElement(Item, _extends({
|
|
19
|
+
onClick: () => navigator.push(path, {
|
|
20
|
+
isBack
|
|
21
|
+
})
|
|
22
|
+
}, props), icon && createElement(HStack, {
|
|
23
|
+
justify: "flex-start"
|
|
24
|
+
}, createElement(FlexItem, null, createElement(Icon, {
|
|
25
|
+
icon: icon,
|
|
26
|
+
size: 24
|
|
27
|
+
})), createElement(FlexItem, null, children)), !icon && children);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default NavigationButton;
|
|
31
|
+
//# sourceMappingURL=navigation-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/navigation-button.js"],"names":["__experimentalUseNavigator","useNavigator","__experimentalItem","Item","FlexItem","__experimentalHStack","HStack","Icon","NavigationButton","path","icon","children","isBack","props","navigator","push"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,0BAA0B,IAAIC,YAD/B,EAECC,kBAAkB,IAAIC,IAFvB,EAGCC,QAHD,EAICC,oBAAoB,IAAIC,MAJzB,QAKO,uBALP;AAMA,SAASC,IAAT,QAAqB,kBAArB;;AAEA,SAASC,gBAAT,CAA2B;AAC1BC,EAAAA,IAD0B;AAE1BC,EAAAA,IAF0B;AAG1BC,EAAAA,QAH0B;AAI1BC,EAAAA,MAAM,GAAG,KAJiB;AAK1B,KAAGC;AALuB,CAA3B,EAMI;AACH,QAAMC,SAAS,GAAGb,YAAY,EAA9B;AACA,SACC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAG,MAAMa,SAAS,CAACC,IAAV,CAAgBN,IAAhB,EAAsB;AAAEG,MAAAA;AAAF,KAAtB;AAAtB,KAAgEC,KAAhE,GACGH,IAAI,IACL,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGA,IAAb;AAAoB,IAAA,IAAI,EAAG;AAA3B,IADD,CADD,EAIC,cAAC,QAAD,QAAYC,QAAZ,CAJD,CAFF,EASG,CAAED,IAAF,IAAUC,QATb,CADD;AAaA;;AAED,eAAeH,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalItem as Item,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { Icon } from '@wordpress/icons';\n\nfunction NavigationButton( {\n\tpath,\n\ticon,\n\tchildren,\n\tisBack = false,\n\t...props\n} ) {\n\tconst navigator = useNavigator();\n\treturn (\n\t\t<Item onClick={ () => navigator.push( path, { isBack } ) } { ...props }>\n\t\t\t{ icon && (\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Icon icon={ icon } size={ 24 } />\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>{ children }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ ! icon && children }\n\t\t</Item>\n\t);\n}\n\nexport default NavigationButton;\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __experimentalItemGroup as ItemGroup, FlexItem, __experimentalHStack as HStack, __experimentalZStack as ZStack, __experimentalVStack as VStack, FlexBlock, ColorIndicator } from '@wordpress/components';
|
|
7
|
+
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import Subtitle from './subtitle';
|
|
13
|
+
import { useSetting } from '../editor/utils';
|
|
14
|
+
import NavigationButton from './navigation-button';
|
|
15
|
+
|
|
16
|
+
function Palette({
|
|
17
|
+
contextName
|
|
18
|
+
}) {
|
|
19
|
+
const colors = useSetting('color.palette', contextName);
|
|
20
|
+
const screenPath = contextName === 'root' ? '/colors/palette' : '/blocks/' + contextName + '/colors/palette';
|
|
21
|
+
return createElement("div", {
|
|
22
|
+
className: "edit-site-global-style-palette"
|
|
23
|
+
}, createElement(VStack, {
|
|
24
|
+
spacing: 1
|
|
25
|
+
}, createElement(Subtitle, null, __('Palette')), createElement(ItemGroup, {
|
|
26
|
+
isBordered: true,
|
|
27
|
+
isSeparated: true
|
|
28
|
+
}, createElement(NavigationButton, {
|
|
29
|
+
path: screenPath
|
|
30
|
+
}, createElement(HStack, null, createElement(FlexBlock, null, createElement(ZStack, {
|
|
31
|
+
isLayered: false,
|
|
32
|
+
offset: -8
|
|
33
|
+
}, colors.slice(0, 5).map(({
|
|
34
|
+
color
|
|
35
|
+
}) => createElement(ColorIndicator, {
|
|
36
|
+
key: color,
|
|
37
|
+
colorValue: color
|
|
38
|
+
})))), createElement(FlexItem, null, sprintf( // Translators: %d: Number of palette colors.
|
|
39
|
+
_n('%d color', '%d colors', colors.length), colors.length)))))));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default Palette;
|
|
43
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","FlexBlock","ColorIndicator","__","_n","sprintf","Subtitle","useSetting","NavigationButton","Palette","contextName","colors","screenPath","slice","map","color","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,QAFD,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,oBAAoB,IAAIC,MALzB,EAMCC,SAND,EAOCC,cAPD,QAQO,uBARP;AASA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;;AAEA,SAASC,OAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAAoC;AACnC,QAAMC,MAAM,GAAGJ,UAAU,CAAE,eAAF,EAAmBG,WAAnB,CAAzB;AACA,QAAME,UAAU,GACfF,WAAW,KAAK,MAAhB,GACG,iBADH,GAEG,aAAaA,WAAb,GAA2B,iBAH/B;AAKA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD,QAAYP,EAAE,CAAE,SAAF,CAAd,CADD,EAEC,cAAC,SAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAGS;AAAzB,KACC,cAAC,MAAD,QACC,cAAC,SAAD,QACC,cAAC,MAAD;AAAQ,IAAA,SAAS,EAAG,KAApB;AAA4B,IAAA,MAAM,EAAG,CAAC;AAAtC,KACGD,MAAM,CACNE,KADA,CACO,CADP,EACU,CADV,EAEAC,GAFA,CAEK,CAAE;AAAEC,IAAAA;AAAF,GAAF,KACL,cAAC,cAAD;AACC,IAAA,GAAG,EAAGA,KADP;AAEC,IAAA,UAAU,EAAGA;AAFd,IAHA,CADH,CADD,CADD,EAaC,cAAC,QAAD,QACGV,OAAO,EACR;AACAD,EAAAA,EAAE,CACD,UADC,EAED,WAFC,EAGDO,MAAM,CAACK,MAHN,CAFM,EAORL,MAAM,CAACK,MAPC,CADV,CAbD,CADD,CADD,CAFD,CADD,CADD;AAoCA;;AAED,eAAeP,OAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tFlexBlock,\n\tColorIndicator,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { useSetting } from '../editor/utils';\nimport NavigationButton from './navigation-button';\n\nfunction Palette( { contextName } ) {\n\tconst colors = useSetting( 'color.palette', contextName );\n\tconst screenPath =\n\t\tcontextName === 'root'\n\t\t\t? '/colors/palette'\n\t\t\t: '/blocks/' + contextName + '/colors/palette';\n\n\treturn (\n\t\t<div className=\"edit-site-global-style-palette\">\n\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t<Subtitle>{ __( 'Palette' ) }</Subtitle>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t<NavigationButton path={ screenPath }>\n\t\t\t\t\t\t<HStack>\n\t\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t\t\t.map( ( { color } ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ color }\n\t\t\t\t\t\t\t\t\t\t\t\tcolorValue={ color }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'%d color',\n\t\t\t\t\t\t\t\t\t\t'%d colors',\n\t\t\t\t\t\t\t\t\t\tcolors.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tcolors.length\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButton>\n\t\t\t\t</ItemGroup>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default Palette;\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __experimentalHStack as HStack, __experimentalVStack as VStack, Card, ColorIndicator } from '@wordpress/components';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
12
|
+
|
|
13
|
+
const StylesPreview = () => {
|
|
14
|
+
var _getStyle, _getStyle2, _getStyle3, _getStyle4;
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
getStyle
|
|
18
|
+
} = useGlobalStylesContext();
|
|
19
|
+
const fontFamily = (_getStyle = getStyle('root', 'fontFamily')) !== null && _getStyle !== void 0 ? _getStyle : 'serif';
|
|
20
|
+
const textColor = (_getStyle2 = getStyle('root', 'color')) !== null && _getStyle2 !== void 0 ? _getStyle2 : 'black';
|
|
21
|
+
const linkColor = (_getStyle3 = getStyle('root', 'linkColor')) !== null && _getStyle3 !== void 0 ? _getStyle3 : 'blue';
|
|
22
|
+
const backgroundColor = (_getStyle4 = getStyle('root', 'backgroundColor')) !== null && _getStyle4 !== void 0 ? _getStyle4 : 'white';
|
|
23
|
+
return createElement(Card, {
|
|
24
|
+
className: "edit-site-global-styles-preview",
|
|
25
|
+
style: {
|
|
26
|
+
background: backgroundColor
|
|
27
|
+
}
|
|
28
|
+
}, createElement(HStack, {
|
|
29
|
+
spacing: 5
|
|
30
|
+
}, createElement("div", null, createElement("span", {
|
|
31
|
+
style: {
|
|
32
|
+
fontFamily,
|
|
33
|
+
fontSize: '80px'
|
|
34
|
+
}
|
|
35
|
+
}, "A"), createElement("span", {
|
|
36
|
+
style: {
|
|
37
|
+
fontFamily,
|
|
38
|
+
fontSize: '80px'
|
|
39
|
+
}
|
|
40
|
+
}, "a")), createElement(VStack, {
|
|
41
|
+
spacing: 2
|
|
42
|
+
}, createElement(ColorIndicator, {
|
|
43
|
+
colorValue: textColor
|
|
44
|
+
}), createElement(ColorIndicator, {
|
|
45
|
+
colorValue: linkColor
|
|
46
|
+
}))));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default StylesPreview;
|
|
50
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Card","ColorIndicator","useGlobalStylesContext","StylesPreview","getStyle","fontFamily","textColor","linkColor","backgroundColor","background","fontSize"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,IAHD,EAICC,cAJD,QAKO,uBALP;AAOA;AACA;AACA;;AAAI,SAASC,sBAAT,QAAuC,kCAAvC;;AAEJ,MAAMC,aAAa,GAAG,MAAM;AAAA;;AAC3B,QAAM;AAAEC,IAAAA;AAAF,MAAeF,sBAAsB,EAA3C;AACA,QAAMG,UAAU,gBAAGD,QAAQ,CAAE,MAAF,EAAU,YAAV,CAAX,iDAAuC,OAAvD;AACA,QAAME,SAAS,iBAAGF,QAAQ,CAAE,MAAF,EAAU,OAAV,CAAX,mDAAkC,OAAjD;AACA,QAAMG,SAAS,iBAAGH,QAAQ,CAAE,MAAF,EAAU,WAAV,CAAX,mDAAsC,MAArD;AACA,QAAMI,eAAe,iBAAGJ,QAAQ,CAAE,MAAF,EAAU,iBAAV,CAAX,mDAA4C,OAAjE;AAEA,SACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,KAAK,EAAG;AAAEK,MAAAA,UAAU,EAAED;AAAd;AAFT,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,2BACC;AAAM,IAAA,KAAK,EAAG;AAAEH,MAAAA,UAAF;AAAcK,MAAAA,QAAQ,EAAE;AAAxB;AAAd,SADD,EAEC;AAAM,IAAA,KAAK,EAAG;AAAEL,MAAAA,UAAF;AAAcK,MAAAA,QAAQ,EAAE;AAAxB;AAAd,SAFD,CADD,EAKC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,cAAD;AAAgB,IAAA,UAAU,EAAGJ;AAA7B,IADD,EAEC,cAAC,cAAD;AAAgB,IAAA,UAAU,EAAGC;AAA7B,IAFD,CALD,CAJD,CADD;AAiBA,CAxBD;;AA0BA,eAAeJ,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tCard,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */ import { useGlobalStylesContext } from '../editor/global-styles-provider';\n\nconst StylesPreview = () => {\n\tconst { getStyle } = useGlobalStylesContext();\n\tconst fontFamily = getStyle( 'root', 'fontFamily' ) ?? 'serif';\n\tconst textColor = getStyle( 'root', 'color' ) ?? 'black';\n\tconst linkColor = getStyle( 'root', 'linkColor' ) ?? 'blue';\n\tconst backgroundColor = getStyle( 'root', 'backgroundColor' ) ?? 'white';\n\n\treturn (\n\t\t<Card\n\t\t\tclassName=\"edit-site-global-styles-preview\"\n\t\t\tstyle={ { background: backgroundColor } }\n\t\t>\n\t\t\t<HStack spacing={ 5 }>\n\t\t\t\t<div>\n\t\t\t\t\t<span style={ { fontFamily, fontSize: '80px' } }>A</span>\n\t\t\t\t\t<span style={ { fontFamily, fontSize: '80px' } }>a</span>\n\t\t\t\t</div>\n\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t<ColorIndicator colorValue={ textColor } />\n\t\t\t\t\t<ColorIndicator colorValue={ linkColor } />\n\t\t\t\t</VStack>\n\t\t\t</HStack>\n\t\t</Card>\n\t);\n};\n\nexport default StylesPreview;\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { getBlockType } from '@wordpress/blocks';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
13
|
+
import { useHasBorderPanel } from './border-panel';
|
|
14
|
+
import { useHasColorPanel } from './color-panel';
|
|
15
|
+
import { useHasDimensionsPanel } from './dimensions-panel';
|
|
16
|
+
import { useHasTypographyPanel } from './typography-panel';
|
|
17
|
+
import ScreenHeader from './header';
|
|
18
|
+
import NavigationButton from './navigation-button';
|
|
19
|
+
|
|
20
|
+
function BlockMenuItem({
|
|
21
|
+
block
|
|
22
|
+
}) {
|
|
23
|
+
const {
|
|
24
|
+
blocks
|
|
25
|
+
} = useGlobalStylesContext();
|
|
26
|
+
const context = blocks[block.name];
|
|
27
|
+
const hasTypographyPanel = useHasTypographyPanel(context);
|
|
28
|
+
const hasColorPanel = useHasColorPanel(context);
|
|
29
|
+
const hasBorderPanel = useHasBorderPanel(context);
|
|
30
|
+
const hasDimensionsPanel = useHasDimensionsPanel(context);
|
|
31
|
+
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
|
|
32
|
+
const hasBlockMenuItem = hasTypographyPanel || hasColorPanel || hasLayoutPanel;
|
|
33
|
+
|
|
34
|
+
if (!hasBlockMenuItem) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return createElement(NavigationButton, {
|
|
39
|
+
path: '/blocks/' + block.name
|
|
40
|
+
}, block.title);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function ScreenBlockList() {
|
|
44
|
+
const {
|
|
45
|
+
blocks
|
|
46
|
+
} = useGlobalStylesContext();
|
|
47
|
+
const visibleBlocks = Object.keys(blocks).map(name => getBlockType(name)).filter(blockType => !!blockType);
|
|
48
|
+
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
49
|
+
back: "/",
|
|
50
|
+
title: __('Blocks')
|
|
51
|
+
}), visibleBlocks.map(block => createElement(BlockMenuItem, {
|
|
52
|
+
block: block,
|
|
53
|
+
key: 'menu-itemblock-' + block.name
|
|
54
|
+
})));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default ScreenBlockList;
|
|
58
|
+
//# sourceMappingURL=screen-block-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["getBlockType","__","useGlobalStylesContext","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","ScreenHeader","NavigationButton","BlockMenuItem","block","blocks","context","name","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","title","ScreenBlockList","visibleBlocks","Object","keys","map","filter","blockType"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,mBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,SAASC,iBAAT,QAAkC,gBAAlC;AACA,SAASC,gBAAT,QAAiC,eAAjC;AACA,SAASC,qBAAT,QAAsC,oBAAtC;AACA,SAASC,qBAAT,QAAsC,oBAAtC;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;;AAEA,SAASC,aAAT,CAAwB;AAAEC,EAAAA;AAAF,CAAxB,EAAoC;AACnC,QAAM;AAAEC,IAAAA;AAAF,MAAaT,sBAAsB,EAAzC;AACA,QAAMU,OAAO,GAAGD,MAAM,CAAED,KAAK,CAACG,IAAR,CAAtB;AACA,QAAMC,kBAAkB,GAAGR,qBAAqB,CAAEM,OAAF,CAAhD;AACA,QAAMG,aAAa,GAAGX,gBAAgB,CAAEQ,OAAF,CAAtC;AACA,QAAMI,cAAc,GAAGb,iBAAiB,CAAES,OAAF,CAAxC;AACA,QAAMK,kBAAkB,GAAGZ,qBAAqB,CAAEO,OAAF,CAAhD;AACA,QAAMM,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AACA,QAAME,gBAAgB,GACrBL,kBAAkB,IAAIC,aAAtB,IAAuCG,cADxC;;AAGA,MAAK,CAAEC,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAG,aAAaT,KAAK,CAACG;AAA5C,KACGH,KAAK,CAACU,KADT,CADD;AAKA;;AAED,SAASC,eAAT,GAA2B;AAC1B,QAAM;AAAEV,IAAAA;AAAF,MAAaT,sBAAsB,EAAzC;AACA,QAAMoB,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAab,MAAb,EACpBc,GADoB,CACbZ,IAAF,IAAYb,YAAY,CAAEa,IAAF,CADT,EAEpBa,MAFoB,CAEVC,SAAF,IAAiB,CAAC,CAAEA,SAFR,CAAtB;AAIA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAC,GAAnB;AAAuB,IAAA,KAAK,EAAG1B,EAAE,CAAE,QAAF;AAAjC,IADD,EAEGqB,aAAa,CAACG,GAAd,CAAqBf,KAAF,IACpB,cAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACG;AAFjC,IADC,CAFH,CADD;AAWA;;AAED,eAAeQ,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-panel';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport ScreenHeader from './header';\nimport NavigationButton from './navigation-button';\n\nfunction BlockMenuItem( { block } ) {\n\tconst { blocks } = useGlobalStylesContext();\n\tconst context = blocks[ block.name ];\n\tconst hasTypographyPanel = useHasTypographyPanel( context );\n\tconst hasColorPanel = useHasColorPanel( context );\n\tconst hasBorderPanel = useHasBorderPanel( context );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( context );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasBlockMenuItem =\n\t\thasTypographyPanel || hasColorPanel || hasLayoutPanel;\n\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ '/blocks/' + block.name }>\n\t\t\t{ block.title }\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenBlockList() {\n\tconst { blocks } = useGlobalStylesContext();\n\tconst visibleBlocks = Object.keys( blocks )\n\t\t.map( ( name ) => getBlockType( name ) )\n\t\t.filter( ( blockType ) => !! blockType );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader back=\"/\" title={ __( 'Blocks' ) } />\n\t\t\t{ visibleBlocks.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { getBlockType } from '@wordpress/blocks';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useGlobalStylesContext } from '../editor/global-styles-provider';
|
|
12
|
+
import ContextMenu from './context-menu';
|
|
13
|
+
import ScreenHeader from './header';
|
|
14
|
+
|
|
15
|
+
function ScreenBlock({
|
|
16
|
+
name
|
|
17
|
+
}) {
|
|
18
|
+
const blockType = getBlockType(name);
|
|
19
|
+
const {
|
|
20
|
+
blocks
|
|
21
|
+
} = useGlobalStylesContext();
|
|
22
|
+
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
23
|
+
back: "/blocks",
|
|
24
|
+
title: blockType.title
|
|
25
|
+
}), createElement(ContextMenu, {
|
|
26
|
+
parentMenu: '/blocks/' + name,
|
|
27
|
+
context: blocks[name]
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default ScreenBlock;
|
|
32
|
+
//# sourceMappingURL=screen-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"names":["getBlockType","useGlobalStylesContext","ContextMenu","ScreenHeader","ScreenBlock","name","blockType","blocks","title"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,mBAA7B;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,kCAAvC;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,WAAT,CAAsB;AAAEC,EAAAA;AAAF,CAAtB,EAAiC;AAChC,QAAMC,SAAS,GAAGN,YAAY,CAAEK,IAAF,CAA9B;AACA,QAAM;AAAEE,IAAAA;AAAF,MAAaN,sBAAsB,EAAzC;AAEA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAC,SAAnB;AAA6B,IAAA,KAAK,EAAGK,SAAS,CAACE;AAA/C,IADD,EAEC,cAAC,WAAD;AACC,IAAA,UAAU,EAAG,aAAaH,IAD3B;AAEC,IAAA,OAAO,EAAGE,MAAM,CAAEF,IAAF;AAFjB,IAFD,CADD;AASA;;AAED,eAAeD,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ContextMenu from './context-menu';\nimport ScreenHeader from './header';\n\nfunction ScreenBlock( { name } ) {\n\tconst blockType = getBlockType( name );\n\tconst { blocks } = useGlobalStylesContext();\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader back=\"/blocks\" title={ blockType.title } />\n\t\t\t<ContextMenu\n\t\t\t\tparentMenu={ '/blocks/' + name }\n\t\t\t\tcontext={ blocks[ name ] }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"]}
|
|
@@ -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"]}
|