@wordpress/edit-site 3.0.26 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/build/components/block-editor/resizable-editor.js +1 -0
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/code-editor/code-editor-text-area.js +95 -0
- package/build/components/code-editor/code-editor-text-area.js.map +1 -0
- package/build/components/code-editor/index.js +79 -0
- package/build/components/code-editor/index.js.map +1 -0
- package/build/components/editor/index.js +10 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +81 -22
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +4 -6
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +1 -0
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/header.js +2 -7
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +27 -12
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +2 -2
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +46 -15
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +9 -12
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +0 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +0 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -6
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +0 -2
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +6 -12
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +22 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +138 -0
- package/build/components/global-styles/screen-style-variations.js.map +1 -0
- package/build/components/global-styles/screen-text-color.js +6 -12
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -2
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +31 -14
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header/index.js +12 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +78 -0
- package/build/components/header/mode-switcher/index.js.map +1 -0
- package/build/components/header/more-menu/copy-content-menu-item.js +74 -0
- package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/header/more-menu/index.js +72 -39
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build/components/header/more-menu/site-export.js.map +1 -0
- package/build/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/header/tools-more-menu-group/index.js +1 -5
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +45 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +56 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +137 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +65 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +26 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -4
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +3 -3
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/added-by.js +51 -50
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/routes/redirect-to-homepage.js +87 -0
- package/build/components/routes/redirect-to-homepage.js.map +1 -0
- package/build/components/secondary-sidebar/inserter-sidebar.js +13 -3
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/default-sidebar.js +4 -2
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +1 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -38
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +9 -4
- package/build/index.js.map +1 -1
- package/build/store/actions.js +26 -25
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +2 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +11 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +1 -0
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/code-editor/code-editor-text-area.js +83 -0
- package/build-module/components/code-editor/code-editor-text-area.js.map +1 -0
- package/build-module/components/code-editor/index.js +62 -0
- package/build-module/components/code-editor/index.js.map +1 -0
- package/build-module/components/editor/index.js +9 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +82 -23
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +1 -1
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +27 -10
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -15
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +9 -13
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +0 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +0 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +2 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +0 -2
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -13
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +21 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +119 -0
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -0
- package/build-module/components/global-styles/screen-text-color.js +7 -13
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -2
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +29 -14
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header/index.js +13 -5
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +65 -0
- package/build-module/components/header/mode-switcher/index.js.map +1 -0
- package/build-module/components/header/more-menu/copy-content-menu-item.js +59 -0
- package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/header/more-menu/index.js +67 -40
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build-module/components/header/more-menu/site-export.js.map +1 -0
- package/build-module/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/header/tools-more-menu-group/index.js +2 -5
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +36 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +44 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +120 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +26 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +5 -4
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +3 -3
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/added-by.js +52 -51
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/routes/redirect-to-homepage.js +75 -0
- package/build-module/components/routes/redirect-to-homepage.js.map +1 -0
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +14 -4
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/default-sidebar.js +4 -2
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +1 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +3 -40
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +8 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +22 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +2 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +11 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +199 -68
- package/build-style/style.css +199 -68
- package/package.json +29 -28
- package/src/components/block-editor/resizable-editor.js +1 -0
- package/src/components/block-editor/style.scss +10 -18
- package/src/components/code-editor/code-editor-text-area.js +79 -0
- package/src/components/code-editor/index.js +65 -0
- package/src/components/code-editor/style.scss +100 -0
- package/src/components/editor/index.js +16 -7
- package/src/components/global-styles/border-panel.js +106 -42
- package/src/components/global-styles/context-menu.js +1 -1
- package/src/components/global-styles/global-styles-provider.js +1 -2
- package/src/components/global-styles/header.js +3 -5
- package/src/components/global-styles/navigation-button.js +14 -10
- package/src/components/global-styles/palette.js +1 -1
- package/src/components/global-styles/preview.js +46 -18
- package/src/components/global-styles/screen-background-color.js +7 -12
- package/src/components/global-styles/screen-block-list.js +1 -2
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-color-palette.js +0 -2
- package/src/components/global-styles/screen-colors.js +2 -3
- package/src/components/global-styles/screen-layout.js +1 -5
- package/src/components/global-styles/screen-link-color.js +6 -16
- package/src/components/global-styles/screen-root.js +32 -3
- package/src/components/global-styles/screen-style-variations.js +130 -0
- package/src/components/global-styles/screen-text-color.js +6 -16
- package/src/components/global-styles/screen-typography-element.js +0 -4
- package/src/components/global-styles/screen-typography.js +2 -3
- package/src/components/global-styles/style.scss +24 -25
- package/src/components/global-styles/ui.js +55 -25
- package/src/components/header/document-actions/style.scss +1 -9
- package/src/components/header/index.js +10 -2
- package/src/components/header/mode-switcher/index.js +67 -0
- package/src/components/header/more-menu/copy-content-menu-item.js +53 -0
- package/src/components/header/more-menu/index.js +107 -44
- package/src/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/src/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/src/components/header/style.scss +2 -1
- package/src/components/header/tools-more-menu-group/index.js +2 -7
- package/src/components/keyboard-shortcut-help-modal/config.js +27 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +135 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +73 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +66 -0
- package/src/components/keyboard-shortcuts/index.js +27 -1
- package/src/components/list/actions/index.js +5 -4
- package/src/components/list/actions/rename-menu-item.js +3 -3
- package/src/components/list/added-by.js +57 -63
- package/src/components/routes/redirect-to-homepage.js +71 -0
- package/src/components/secondary-sidebar/inserter-sidebar.js +14 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +12 -5
- package/src/components/secondary-sidebar/style.scss +0 -4
- package/src/components/sidebar/default-sidebar.js +2 -0
- package/src/components/sidebar/global-styles-sidebar.js +1 -0
- package/src/components/sidebar/style.scss +21 -14
- package/src/components/url-query-controller/index.js +3 -35
- package/src/index.js +9 -2
- package/src/store/actions.js +22 -35
- package/src/store/defaults.js +1 -0
- package/src/store/reducer.js +6 -0
- package/src/store/selectors.js +11 -0
- package/src/store/test/actions.js +2 -92
- package/src/style.scss +2 -0
- package/build/plugins/index.js +0 -28
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/site-export.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item.js.map +0 -1
- package/build-module/plugins/index.js +0 -20
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/site-export.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item.js.map +0 -1
- package/src/plugins/index.js +0 -24
|
@@ -17,7 +17,7 @@ var _header = _interopRequireDefault(require("./header"));
|
|
|
17
17
|
|
|
18
18
|
var _palette = _interopRequireDefault(require("./palette"));
|
|
19
19
|
|
|
20
|
-
var _navigationButton =
|
|
20
|
+
var _navigationButton = require("./navigation-button");
|
|
21
21
|
|
|
22
22
|
var _hooks = require("./hooks");
|
|
23
23
|
|
|
@@ -44,7 +44,7 @@ function BackgroundColorItem(_ref) {
|
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
return (0, _element.createElement)(_navigationButton.
|
|
47
|
+
return (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
48
48
|
path: parentMenu + '/colors/background'
|
|
49
49
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
50
50
|
justify: "flex-start"
|
|
@@ -66,7 +66,7 @@ function TextColorItem(_ref2) {
|
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
return (0, _element.createElement)(_navigationButton.
|
|
69
|
+
return (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
70
70
|
path: parentMenu + '/colors/text'
|
|
71
71
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
72
72
|
justify: "flex-start"
|
|
@@ -88,7 +88,7 @@ function LinkColorItem(_ref3) {
|
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
return (0, _element.createElement)(_navigationButton.
|
|
91
|
+
return (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
92
92
|
path: parentMenu + '/colors/link'
|
|
93
93
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
94
94
|
justify: "flex-start"
|
|
@@ -103,9 +103,8 @@ function ScreenColors(_ref4) {
|
|
|
103
103
|
} = _ref4;
|
|
104
104
|
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
105
105
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
106
|
-
back: parentMenu ? parentMenu : '/',
|
|
107
106
|
title: (0, _i18n.__)('Colors'),
|
|
108
|
-
description: (0, _i18n.__)('Manage palettes and the default color of different global elements on the
|
|
107
|
+
description: (0, _i18n.__)('Manage palettes and the default color of different global elements on the site.')
|
|
109
108
|
}), (0, _element.createElement)("div", {
|
|
110
109
|
className: "edit-site-global-styles-screen-colors"
|
|
111
110
|
}, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAOA,SAASA,mBAAT,OAAqD;AAAA,MAAvB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAuB;AACpD,QAAMC,QAAQ,GAAG,2CAAgCF,IAAhC,CAAjB;AACA,QAAMG,UAAU,GACfD,QAAQ,CAACE,QAAT,CAAmB,iBAAnB,KACAF,QAAQ,CAACE,QAAT,CAAmB,YAAnB,CAFD;AAGA,QAAM,CAAEC,eAAF,IAAsB,qBAAU,kBAAV,EAA8BL,IAA9B,CAA5B;AACA,QAAM,CAAEM,aAAF,IAAoB,qBAAU,gBAAV,EAA4BN,IAA5B,CAA1B;;AAEA,MAAK,CAAEG,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["BackgroundColorItem","name","parentMenu","supports","hasSupport","includes","backgroundColor","gradientValue","TextColorItem","color","LinkColorItem","ScreenColors","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAOA,SAASA,mBAAT,OAAqD;AAAA,MAAvB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAuB;AACpD,QAAMC,QAAQ,GAAG,2CAAgCF,IAAhC,CAAjB;AACA,QAAMG,UAAU,GACfD,QAAQ,CAACE,QAAT,CAAmB,iBAAnB,KACAF,QAAQ,CAACE,QAAT,CAAmB,YAAnB,CAFD;AAGA,QAAM,CAAEC,eAAF,IAAsB,qBAAU,kBAAV,EAA8BL,IAA9B,CAA5B;AACA,QAAM,CAAEM,aAAF,IAAoB,qBAAU,gBAAV,EAA4BN,IAA5B,CAA1B;;AAEA,MAAK,CAAEG,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAGF,UAAU,GAAG;AAAtC,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACC,4BAAC,0BAAD;AACC,IAAA,UAAU,EAAGK,aAAH,aAAGA,aAAH,cAAGA,aAAH,GAAoBD;AAD/B,IADD,CADD,EAMC,4BAAC,oBAAD,QAAY,cAAI,YAAJ,CAAZ,CAND,CADD,CADD;AAYA;;AAED,SAASE,aAAT,QAA+C;AAAA,MAAvB;AAAEP,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAuB;AAC9C,QAAMC,QAAQ,GAAG,2CAAgCF,IAAhC,CAAjB;AACA,QAAMG,UAAU,GAAGD,QAAQ,CAACE,QAAT,CAAmB,OAAnB,CAAnB;AACA,QAAM,CAAEI,KAAF,IAAY,qBAAU,YAAV,EAAwBR,IAAxB,CAAlB;;AAEA,MAAK,CAAEG,UAA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AA,OAAO,EAAG;AAAlB,KACC,4BAAC,gBAAD;AAAS,IAAA,IAAI,EAAGA;AAAhB,IADD,EAGC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iBAAD,QAAY,cAAI,UAAJ,CAAZ,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,mBAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IADD,EAKC,4BAAC,aAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IALD,EASC,4BAAC,aAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC;AAFd,IATD,CAFD,CAHD,CADD,CARD,CADD;AAkCA;;eAEcS,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tColorIndicator,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport Palette from './palette';\nimport { NavigationButton } from './navigation-button';\nimport { getSupportedGlobalStylesPanels, useStyle } from './hooks';\nimport Subtitle from './subtitle';\n\nfunction BackgroundColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport =\n\t\tsupports.includes( 'backgroundColor' ) ||\n\t\tsupports.includes( 'background' );\n\tconst [ backgroundColor ] = useStyle( 'color.background', name );\n\tconst [ gradientValue ] = useStyle( 'color.gradient', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/background' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\tcolorValue={ gradientValue ?? backgroundColor }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Background' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction TextColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'color' );\n\tconst [ color ] = useStyle( 'color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/text' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Text' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction LinkColorItem( { name, parentMenu } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst hasSupport = supports.includes( 'linkColor' );\n\tconst [ color ] = useStyle( 'elements.link.color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/colors/link' }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ __( 'Links' ) }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenColors( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Colors' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage palettes and the default color of different global elements on the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<div className=\"edit-site-global-styles-screen-colors\">\n\t\t\t\t<VStack spacing={ 10 }>\n\t\t\t\t\t<Palette name={ name } />\n\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t\t<BackgroundColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<TextColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<LinkColorItem\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenColors;\n"]}
|
|
@@ -32,11 +32,9 @@ function ScreenLayout(_ref) {
|
|
|
32
32
|
let {
|
|
33
33
|
name
|
|
34
34
|
} = _ref;
|
|
35
|
-
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
36
35
|
const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(name);
|
|
37
36
|
const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(name);
|
|
38
37
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
39
|
-
back: parentMenu ? parentMenu : '/',
|
|
40
38
|
title: (0, _i18n.__)('Layout')
|
|
41
39
|
}), hasDimensionsPanel && (0, _element.createElement)(_dimensionsPanel.default, {
|
|
42
40
|
name: name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["ScreenLayout","name","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["ScreenLayout","name","hasBorderPanel","hasDimensionsPanel"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;;;;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,YAAT,OAAkC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACjC,QAAMC,cAAc,GAAG,oCAAmBD,IAAnB,CAAvB;AACA,QAAME,kBAAkB,GAAG,4CAAuBF,IAAvB,CAA3B;AAEA,SACC,qDACC,4BAAC,eAAD;AAAc,IAAA,KAAK,EAAG,cAAI,QAAJ;AAAtB,IADD,EAEGE,kBAAkB,IAAI,4BAAC,wBAAD;AAAiB,IAAA,IAAI,EAAGF;AAAxB,IAFzB,EAGGC,cAAc,IAAI,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAGD;AAApB,IAHrB,CADD;AAOA;;eAEcD,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderPanel, { useHasBorderPanel } from './border-panel';\nimport DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenLayout( { name } ) {\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Layout' ) } />\n\t\t\t{ hasDimensionsPanel && <DimensionsPanel name={ name } /> }\n\t\t\t{ hasBorderPanel && <BorderPanel name={ name } /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
|
|
@@ -28,7 +28,6 @@ function ScreenLinkColor(_ref) {
|
|
|
28
28
|
let {
|
|
29
29
|
name
|
|
30
30
|
} = _ref;
|
|
31
|
-
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
32
31
|
const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
|
|
33
32
|
const [solids] = (0, _hooks.useSetting)('color.palette', name);
|
|
34
33
|
const [areCustomSolidsEnabled] = (0, _hooks.useSetting)('color.custom', name);
|
|
@@ -42,25 +41,20 @@ function ScreenLinkColor(_ref) {
|
|
|
42
41
|
return null;
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
const settings = [{
|
|
46
|
-
colorValue: linkColor,
|
|
47
|
-
onColorChange: setLinkColor,
|
|
48
|
-
label: (0, _i18n.__)('Link color'),
|
|
49
|
-
clearable: linkColor === userLinkColor
|
|
50
|
-
}];
|
|
51
44
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
52
|
-
back: parentMenu + '/colors',
|
|
53
45
|
title: (0, _i18n.__)('Links'),
|
|
54
46
|
description: (0, _i18n.__)('Set the default color used for links across the site.')
|
|
55
|
-
}), (0, _element.createElement)(_blockEditor.
|
|
56
|
-
|
|
57
|
-
settings: settings,
|
|
47
|
+
}), (0, _element.createElement)(_blockEditor.__experimentalColorGradientControl, {
|
|
48
|
+
className: "edit-site-screen-link-color__control",
|
|
58
49
|
colors: colorsPerOrigin,
|
|
59
50
|
disableCustomColors: !areCustomSolidsEnabled,
|
|
60
51
|
__experimentalHasMultipleOrigins: true,
|
|
61
52
|
showTitle: false,
|
|
62
53
|
enableAlpha: true,
|
|
63
|
-
__experimentalIsRenderedInSidebar: true
|
|
54
|
+
__experimentalIsRenderedInSidebar: true,
|
|
55
|
+
colorValue: linkColor,
|
|
56
|
+
onColorChange: setLinkColor,
|
|
57
|
+
clearable: linkColor === userLinkColor
|
|
64
58
|
}));
|
|
65
59
|
}
|
|
66
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-link-color.js"],"names":["ScreenLinkColor","name","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-link-color.js"],"names":["ScreenLinkColor","name","supports","solids","areCustomSolidsEnabled","colorsPerOrigin","isLinkE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A,aAAa,EAAGC,YATjB;AAUC,IAAA,SAAS,EAAGD,SAAS,KAAKE;AAV3B,IAPD,CADD;AAsBA;;eAEcZ,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseSetting,\n\tuseStyle,\n\tuseColorsPerOrigin,\n} from './hooks';\n\nfunction ScreenLinkColor( { name } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\n\tconst [ isLinkEnabled ] = useSetting( 'color.link', name );\n\n\tconst hasLinkColor =\n\t\tsupports.includes( 'linkColor' ) &&\n\t\tisLinkEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\n\tconst [ linkColor, setLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname\n\t);\n\tconst [ userLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname,\n\t\t'user'\n\t);\n\n\tif ( ! hasLinkColor ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Links' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set the default color used for links across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-link-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\tcolorValue={ linkColor }\n\t\t\t\tonColorChange={ setLinkColor }\n\t\t\t\tclearable={ linkColor === userLinkColor }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenLinkColor;\n"]}
|
|
@@ -15,12 +15,16 @@ var _i18n = require("@wordpress/i18n");
|
|
|
15
15
|
|
|
16
16
|
var _icons = require("@wordpress/icons");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _data = require("@wordpress/data");
|
|
19
|
+
|
|
20
|
+
var _coreData = require("@wordpress/core-data");
|
|
19
21
|
|
|
20
|
-
var _navigationButton =
|
|
22
|
+
var _navigationButton = require("./navigation-button");
|
|
21
23
|
|
|
22
24
|
var _contextMenu = _interopRequireDefault(require("./context-menu"));
|
|
23
25
|
|
|
26
|
+
var _preview = _interopRequireDefault(require("./preview"));
|
|
27
|
+
|
|
24
28
|
/**
|
|
25
29
|
* WordPress dependencies
|
|
26
30
|
*/
|
|
@@ -29,9 +33,24 @@ var _contextMenu = _interopRequireDefault(require("./context-menu"));
|
|
|
29
33
|
* Internal dependencies
|
|
30
34
|
*/
|
|
31
35
|
function ScreenRoot() {
|
|
36
|
+
const {
|
|
37
|
+
variations
|
|
38
|
+
} = (0, _data.useSelect)(select => {
|
|
39
|
+
return {
|
|
40
|
+
variations: select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
32
43
|
return (0, _element.createElement)(_components.Card, {
|
|
33
44
|
size: "small"
|
|
34
|
-
}, (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(
|
|
45
|
+
}, (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
46
|
+
spacing: 2
|
|
47
|
+
}, (0, _element.createElement)(_components.Card, null, (0, _element.createElement)(_preview.default, null)), !!(variations !== null && variations !== void 0 && variations.length) && (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
48
|
+
path: "/variations"
|
|
49
|
+
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
50
|
+
justify: "space-between"
|
|
51
|
+
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Other styles')), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_icons.Icon, {
|
|
52
|
+
icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
|
|
53
|
+
})))))), (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_contextMenu.default, null)), (0, _element.createElement)(_components.CardDivider, null), (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_components.__experimentalItem, null, (0, _i18n.__)('Customize the appearance of specific blocks for the whole site.')), (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
35
54
|
path: "/blocks"
|
|
36
55
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
37
56
|
justify: "space-between"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAgBA;AACA;AACA;AAKA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAiB,qBAAaC,MAAF,IAAc;AAC/C,WAAO;AACND,MAAAA,UAAU,EAAEC,MAAM,CACjBC,eADiB,CAAN,CAEVC,mDAFU;AADN,KAAP;AAKA,GANsB,EAMpB,EANoB,CAAvB;AAQA,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC;AAAX,KACC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gBAAD,QACC,4BAAC,gBAAD,OADD,CADD,EAIG,CAAC,EAAEH,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEI,MAAd,CAAD,IACD,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QAAY,cAAI,cAAJ,CAAZ,CADD,EAEC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AACC,IAAA,IAAI,EACH,qBAAUC,kBAAV,GAAwBC;AAF1B,IADD,CAFD,CADD,CALF,CADD,CADD,EAuBC,4BAAC,oBAAD,QACC,4BAAC,oBAAD,OADD,CAvBD,EA2BC,4BAAC,uBAAD,OA3BD,EA6BC,4BAAC,oBAAD,QACC,4BAAC,mCAAD,QACC,4BAAC,8BAAD,QACG,cACD,iEADC,CADH,CADD,EAMC,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QAAY,cAAI,QAAJ,CAAZ,CADD,EAEC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AACC,IAAA,IAAI,EACH,qBAAUD,kBAAV,GAAwBC;AAF1B,IADD,CAFD,CADD,CAND,CADD,CA7BD,CADD;AAqDA;;eAEcP,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButton } from './navigation-button';\nimport ContextMenu from './context-menu';\nimport StylesPreview from './preview';\n\nfunction ScreenRoot() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations: select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ !! variations?.length && (\n\t\t\t\t\t\t<NavigationButton path=\"/variations\">\n\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t<FlexItem>{ __( 'Other styles' ) }</FlexItem>\n\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</NavigationButton>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardBody>\n\t\t\t\t<ContextMenu />\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<Item>\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</Item>\n\t\t\t\t\t<NavigationButton path=\"/blocks\">\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</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</CardBody>\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _coreData = require("@wordpress/core-data");
|
|
17
|
+
|
|
18
|
+
var _data = require("@wordpress/data");
|
|
19
|
+
|
|
20
|
+
var _keycodes = require("@wordpress/keycodes");
|
|
21
|
+
|
|
22
|
+
var _components = require("@wordpress/components");
|
|
23
|
+
|
|
24
|
+
var _i18n = require("@wordpress/i18n");
|
|
25
|
+
|
|
26
|
+
var _globalStylesProvider = require("./global-styles-provider");
|
|
27
|
+
|
|
28
|
+
var _context = require("./context");
|
|
29
|
+
|
|
30
|
+
var _preview = _interopRequireDefault(require("./preview"));
|
|
31
|
+
|
|
32
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* External dependencies
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* WordPress dependencies
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Internal dependencies
|
|
44
|
+
*/
|
|
45
|
+
function compareVariations(a, b) {
|
|
46
|
+
return (0, _lodash.isEqual)(a.styles, b.styles) && (0, _lodash.isEqual)(a.settings, b.settings);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function Variation(_ref) {
|
|
50
|
+
let {
|
|
51
|
+
variation
|
|
52
|
+
} = _ref;
|
|
53
|
+
const {
|
|
54
|
+
base,
|
|
55
|
+
user,
|
|
56
|
+
setUserConfig
|
|
57
|
+
} = (0, _element.useContext)(_context.GlobalStylesContext);
|
|
58
|
+
const context = (0, _element.useMemo)(() => {
|
|
59
|
+
var _variation$settings, _variation$styles;
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
user: {
|
|
63
|
+
settings: (_variation$settings = variation.settings) !== null && _variation$settings !== void 0 ? _variation$settings : {},
|
|
64
|
+
styles: (_variation$styles = variation.styles) !== null && _variation$styles !== void 0 ? _variation$styles : {}
|
|
65
|
+
},
|
|
66
|
+
base,
|
|
67
|
+
merged: (0, _globalStylesProvider.mergeBaseAndUserConfigs)(base, variation),
|
|
68
|
+
setUserConfig: () => {}
|
|
69
|
+
};
|
|
70
|
+
}, [variation, base]);
|
|
71
|
+
|
|
72
|
+
const selectVariation = () => {
|
|
73
|
+
setUserConfig(() => {
|
|
74
|
+
return {
|
|
75
|
+
settings: variation.settings,
|
|
76
|
+
styles: variation.styles
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const selectOnEnter = event => {
|
|
82
|
+
if (event.keyCode === _keycodes.ENTER) {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
selectVariation();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const isActive = (0, _element.useMemo)(() => {
|
|
89
|
+
return compareVariations(user, variation);
|
|
90
|
+
}, [user, variation]);
|
|
91
|
+
return (0, _element.createElement)(_context.GlobalStylesContext.Provider, {
|
|
92
|
+
value: context
|
|
93
|
+
}, (0, _element.createElement)("div", {
|
|
94
|
+
className: (0, _classnames.default)('edit-site-global-styles-variations_item', {
|
|
95
|
+
'is-active': isActive
|
|
96
|
+
}),
|
|
97
|
+
role: "button",
|
|
98
|
+
onClick: selectVariation,
|
|
99
|
+
onKeyDown: selectOnEnter,
|
|
100
|
+
tabIndex: "0"
|
|
101
|
+
}, (0, _element.createElement)(_preview.default, {
|
|
102
|
+
height: 100
|
|
103
|
+
})));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function ScreenStyleVariations() {
|
|
107
|
+
const {
|
|
108
|
+
variations
|
|
109
|
+
} = (0, _data.useSelect)(select => {
|
|
110
|
+
return {
|
|
111
|
+
variations: select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()
|
|
112
|
+
};
|
|
113
|
+
}, []);
|
|
114
|
+
const withEmptyVariation = (0, _element.useMemo)(() => {
|
|
115
|
+
return [{
|
|
116
|
+
name: (0, _i18n.__)('Default'),
|
|
117
|
+
settings: {},
|
|
118
|
+
styles: {}
|
|
119
|
+
}, ...variations];
|
|
120
|
+
}, [variations]);
|
|
121
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
122
|
+
back: "/",
|
|
123
|
+
title: (0, _i18n.__)('Other styles'),
|
|
124
|
+
description: (0, _i18n.__)('Choose a different style combination for the theme styles')
|
|
125
|
+
}), (0, _element.createElement)(_components.Card, {
|
|
126
|
+
size: "small",
|
|
127
|
+
isBorderless: true
|
|
128
|
+
}, (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalGrid, {
|
|
129
|
+
columns: 2
|
|
130
|
+
}, withEmptyVariation === null || withEmptyVariation === void 0 ? void 0 : withEmptyVariation.map((variation, index) => (0, _element.createElement)(Variation, {
|
|
131
|
+
key: index,
|
|
132
|
+
variation: variation
|
|
133
|
+
}))))));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var _default = ScreenStyleVariations;
|
|
137
|
+
exports.default = _default;
|
|
138
|
+
//# sourceMappingURL=screen-style-variations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"names":["compareVariations","a","b","styles","settings","Variation","variation","base","user","setUserConfig","GlobalStylesContext","context","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","ScreenStyleVariations","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","name","map","index"],"mappings":";;;;;;;;;AAWA;;AARA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAIA;AACA;AACA;;AAYA;AACA;AACA;AAMA,SAASA,iBAAT,CAA4BC,CAA5B,EAA+BC,CAA/B,EAAmC;AAClC,SAAO,qBAASD,CAAC,CAACE,MAAX,EAAmBD,CAAC,CAACC,MAArB,KAAiC,qBAASF,CAAC,CAACG,QAAX,EAAqBF,CAAC,CAACE,QAAvB,CAAxC;AACA;;AAED,SAASC,SAAT,OAAoC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AACnC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAAgC,yBAAYC,4BAAZ,CAAtC;AACA,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAAA;;AAC9B,WAAO;AACNH,MAAAA,IAAI,EAAE;AACLJ,QAAAA,QAAQ,yBAAEE,SAAS,CAACF,QAAZ,qEAAwB,EAD3B;AAELD,QAAAA,MAAM,uBAAEG,SAAS,CAACH,MAAZ,iEAAsB;AAFvB,OADA;AAKNI,MAAAA,IALM;AAMNK,MAAAA,MAAM,EAAE,mDAAyBL,IAAzB,EAA+BD,SAA/B,CANF;AAONG,MAAAA,aAAa,EAAE,MAAM,CAAE;AAPjB,KAAP;AASA,GAVe,EAUb,CAAEH,SAAF,EAAaC,IA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MAAAA,MAAM,EAAE;AAHT,KADM,EAMN,GAAGkB,UANG,CAAP;AAQA,GAT0B,EASxB,CAAEA,UAAF,CATwB,CAA3B;AAWA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAC,GADN;AAEC,IAAA,KAAK,EAAG,cAAI,cAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,2DADa;AAHf,IADD,EASC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC,OAAX;AAAmB,IAAA,YAAY;AAA/B,KACC,4BAAC,oBAAD,QACC,4BAAC,8BAAD;AAAM,IAAA,OAAO,EAAG;AAAhB,KACGI,kBADH,aACGA,kBADH,uBACGA,kBAAkB,CAAEE,GAApB,CAAyB,CAAErB,SAAF,EAAasB,KAAb,KAC1B,4BAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGtB;AAArC,IADC,CADH,CADD,CADD,CATD,CADD;AAqBA;;eAEcc,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEqual } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport {\n\t__experimentalGrid as Grid,\n\tCard,\n\tCardBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport { GlobalStylesContext } from './context';\nimport StylesPreview from './preview';\nimport ScreenHeader from './header';\n\nfunction compareVariations( a, b ) {\n\treturn isEqual( a.styles, b.styles ) && isEqual( a.settings, b.settings );\n}\n\nfunction Variation( { variation } ) {\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn compareVariations( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<StylesPreview height={ 100 } />\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nfunction ScreenStyleVariations() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations: select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t};\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variations,\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback=\"/\"\n\t\t\t\ttitle={ __( 'Other styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card size=\"small\" isBorderless>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<Grid columns={ 2 }>\n\t\t\t\t\t\t{ withEmptyVariation?.map( ( variation, index ) => (\n\t\t\t\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Grid>\n\t\t\t\t</CardBody>\n\t\t\t</Card>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"]}
|
|
@@ -28,7 +28,6 @@ function ScreenTextColor(_ref) {
|
|
|
28
28
|
let {
|
|
29
29
|
name
|
|
30
30
|
} = _ref;
|
|
31
|
-
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
32
31
|
const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
|
|
33
32
|
const [solids] = (0, _hooks.useSetting)('color.palette', name);
|
|
34
33
|
const [areCustomSolidsEnabled] = (0, _hooks.useSetting)('color.custom', name);
|
|
@@ -42,25 +41,20 @@ function ScreenTextColor(_ref) {
|
|
|
42
41
|
return null;
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
const settings = [{
|
|
46
|
-
colorValue: color,
|
|
47
|
-
onColorChange: setColor,
|
|
48
|
-
label: (0, _i18n.__)('Text color'),
|
|
49
|
-
clearable: color === userColor
|
|
50
|
-
}];
|
|
51
44
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
52
|
-
back: parentMenu + '/colors',
|
|
53
45
|
title: (0, _i18n.__)('Text'),
|
|
54
46
|
description: (0, _i18n.__)('Set the default color used for text across the site.')
|
|
55
|
-
}), (0, _element.createElement)(_blockEditor.
|
|
56
|
-
|
|
57
|
-
settings: settings,
|
|
47
|
+
}), (0, _element.createElement)(_blockEditor.__experimentalColorGradientControl, {
|
|
48
|
+
className: "edit-site-screen-text-color__control",
|
|
58
49
|
colors: colorsPerOrigin,
|
|
59
50
|
disableCustomColors: !areCustomSolidsEnabled,
|
|
60
51
|
__experimentalHasMultipleOrigins: true,
|
|
61
52
|
showTitle: false,
|
|
62
53
|
enableAlpha: true,
|
|
63
|
-
__experimentalIsRenderedInSidebar: true
|
|
54
|
+
__experimentalIsRenderedInSidebar: true,
|
|
55
|
+
colorValue: color,
|
|
56
|
+
onColorChange: setColor,
|
|
57
|
+
clearable: color === userColor
|
|
64
58
|
}));
|
|
65
59
|
}
|
|
66
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-text-color.js"],"names":["ScreenTextColor","name","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-text-color.js"],"names":["ScreenTextColor","name","supports","solids","areCustomSolidsEnabled","isTextEnabled","colorsPerOrigin","hasTextColor","includes","length","color","setColor","userColor"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AASA,SAASA,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAMC,QAAQ,GAAG,2CAAgCD,IAAhC,CAAjB;AACA,QAAM,CAAEE,MAAF,IAAa,uBAAY,eAAZ,EAA6BF,IAA7B,CAAnB;AACA,QAAM,CAAEG,sBAAF,IAA6B,uBAAY,cAAZ,EAA4BH,IAA5B,CAAnC;AACA,QAAM,CAAEI,aAAF,IAAoB,uBAAY,YAAZ,EAA0BJ,IAA1B,CAA1B;AAEA,QAAMK,eAAe,GAAG,+BAAoBL,IAApB,CAAxB;AAEA,QAAMM,YAAY,GACjBL,QAAQ,CAACM,QAAT,CAAmB,OAAnB,KACAH,aADA,KAEEF,MAAM,CAACM,MAAP,GAAgB,CAAhB,IAAqBL,sBAFvB,CADD;AAKA,QAAM,CAAEM,KAAF,EAASC,QAAT,IAAsB,qBAAU,YAAV,EAAwBV,IAAxB,CAA5B;AACA,QAAM,CAAEW,SAAF,IAAgB,qBAAU,YAAV,EAAwBX,IAAxB,EAA8B,MAA9B,CAAtB;;AAEA,MAAK,CAAEM,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,MAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,sDADa;AAFf,IADD,EAOC,4BAAC,+CAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,MAAM,EAAGD,eAFV;AAGC,IAAA,mBAAmB,EAAG,CAAEF,sBAHzB;AAIC,IAAA,gCAAgC,MAJjC;AAKC,IAAA,SAAS,EAAG,KALb;AAMC,IAAA,WAAW,MANZ;AAOC,IAAA,iCAAiC,MAPlC;AAQC,IAAA,UAAU,EAAGM,KARd;AASC,IAAA,aAAa,EAAGC,QATjB;AAUC,IAAA,SAAS,EAAGD,KAAK,KAAKE;AAVvB,IAPD,CADD;AAsBA;;eAEcZ,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseSetting,\n\tuseStyle,\n\tuseColorsPerOrigin,\n} from './hooks';\n\nfunction ScreenTextColor( { name } ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\tconst [ isTextEnabled ] = useSetting( 'color.text', name );\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\n\tconst hasTextColor =\n\t\tsupports.includes( 'color' ) &&\n\t\tisTextEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\n\tconst [ color, setColor ] = useStyle( 'color.text', name );\n\tconst [ userColor ] = useStyle( 'color.text', name, 'user' );\n\n\tif ( ! hasTextColor ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Text' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set the default color used for text across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-text-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\tcolorValue={ color }\n\t\t\t\tonColorChange={ setColor }\n\t\t\t\tclearable={ color === userColor }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTextColor;\n"]}
|
|
@@ -38,9 +38,7 @@ function ScreenTypographyElement(_ref) {
|
|
|
38
38
|
name,
|
|
39
39
|
element
|
|
40
40
|
} = _ref;
|
|
41
|
-
const parentMenu = name === undefined ? '/typography' : '/blocks/' + name + '/typography';
|
|
42
41
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
43
|
-
back: parentMenu,
|
|
44
42
|
title: elements[element].title,
|
|
45
43
|
description: elements[element].description
|
|
46
44
|
}), (0, _element.createElement)(_typographyPanel.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","ScreenTypographyElement","name","element"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","ScreenTypographyElement","name","element"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAE,cAAI,oCAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,MAAJ;AAFF,GADU;AAKhBC,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAE,cAAI,oDAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,OAAJ;AAFF;AALU,CAAjB;;AAWA,SAASE,uBAAT,OAAsD;AAAA,MAApB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAoB;AACrD,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAGP,QAAQ,CAAEO,OAAF,CAAR,CAAoBJ,KAD7B;AAEC,IAAA,WAAW,EAAGH,QAAQ,CAAEO,OAAF,CAAR,CAAoBL;AAFnC,IADD,EAKC,4BAAC,wBAAD;AAAiB,IAAA,IAAI,EAAGI,IAAxB;AAA+B,IAAA,OAAO,EAAGC;AAAzC,IALD,CADD;AASA;;eAEcF,uB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { name, element } ) {\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<TypographyPanel name={ name } element={ element } />\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
|
|
@@ -15,7 +15,7 @@ var _components = require("@wordpress/components");
|
|
|
15
15
|
|
|
16
16
|
var _header = _interopRequireDefault(require("./header"));
|
|
17
17
|
|
|
18
|
-
var _navigationButton =
|
|
18
|
+
var _navigationButton = require("./navigation-button");
|
|
19
19
|
|
|
20
20
|
var _hooks = require("./hooks");
|
|
21
21
|
|
|
@@ -54,7 +54,7 @@ function Item(_ref) {
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
return (0, _element.createElement)(_navigationButton.
|
|
57
|
+
return (0, _element.createElement)(_navigationButton.NavigationButton, {
|
|
58
58
|
path: parentMenu + '/typography/' + element
|
|
59
59
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
60
60
|
justify: "flex-start"
|
|
@@ -78,7 +78,6 @@ function ScreenTypography(_ref2) {
|
|
|
78
78
|
} = _ref2;
|
|
79
79
|
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
80
80
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
81
|
-
back: parentMenu ? parentMenu : '/',
|
|
82
81
|
title: (0, _i18n.__)('Typography'),
|
|
83
82
|
description: (0, _i18n.__)('Manage the typography settings for different elements.')
|
|
84
83
|
}), !name && (0, _element.createElement)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["Item","name","parentMenu","element","label","hasSupport","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","background","ScreenTypography","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AASA;AACA;AACA;AAOA,SAASA,IAAT,OAAsD;AAAA,MAAvC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAR;AAAoBC,IAAAA,OAApB;AAA6BC,IAAAA;AAA7B,GAAuC;AACrD,QAAMC,UAAU,GAAG,CAAEJ,IAArB;AACA,QAAMK,MAAM,GACXH,OAAO,KAAK,MAAZ,IAAsB,CAAEA,OAAxB,GAAkC,EAAlC,GAAwC,YAAYA,OAAS,GAD9D;AAEA,QAAMI,WAAW,GAChBJ,OAAO,KAAK,MAAZ,GACG;AACAK,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAMA,QAAM,CAAEC,UAAF,IAAiB,qBAAUH,MAAM,GAAG,uBAAnB,EAA4CL,IAA5C,CAAvB;AACA,QAAM,CAAES,SAAF,IAAgB,qBAAUJ,MAAM,GAAG,sBAAnB,EAA2CL,IAA3C,CAAtB;AACA,QAAM,CAAEU,UAAF,IAAiB,qBAAUL,MAAM,GAAG,uBAAnB,EAA4CL,IAA5C,CAAvB;AACA,QAAM,CAAEW,aAAF,IAAoB,qBACzBN,MAAM,GAAG,0BADgB,EAEzBL,IAFyB,CAA1B;AAIA,QAAM,CAAEY,eAAF,IAAsB,qBAAUP,MAAM,GAAG,kBAAnB,EAAuCL,IAAvC,CAA5B;AACA,QAAM,CAAEa,aAAF,IAAoB,qBAAUR,MAAM,GAAG,gBAAnB,EAAqCL,IAArC,CAA1B;AACA,QAAM,CAAEc,KAAF,IAAY,qBAAUT,MAAM,GAAG,YAAnB,EAAiCL,IAAjC,CAAlB;;AAEA,MAAK,CAAEI,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["Item","name","parentMenu","element","label","hasSupport","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","background","ScreenTypography","undefined"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AASA;AACA;AACA;AAOA,SAASA,IAAT,OAAsD;AAAA,MAAvC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAR;AAAoBC,IAAAA,OAApB;AAA6BC,IAAAA;AAA7B,GAAuC;AACrD,QAAMC,UAAU,GAAG,CAAEJ,IAArB;AACA,QAAMK,MAAM,GACXH,OAAO,KAAK,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AAAA,aANO;AAOP,SAAGL;AAPI;AAFT,KAYG,cAAI,IAAJ,CAZH,CADD,EAeC,4BAAC,oBAAD,QAAYH,KAAZ,CAfD,CADD,CADD;AAqBA;;AAED,SAASa,gBAAT,QAAsC;AAAA,MAAX;AAAEhB,IAAAA;AAAF,GAAW;AACrC,QAAMC,UAAU,GAAGD,IAAI,KAAKiB,SAAT,GAAqB,EAArB,GAA0B,aAAajB,IAA1D;AAEA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,wDADa;AAFf,IADD,EAQG,CAAEA,IAAF,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iBAAD,QAAY,cAAI,UAAJ,CAAZ,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,IAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,OAAO,EAAC,MAHT;AAIC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAJT,IADD,EAOC,4BAAC,IAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,OAAO,EAAC,MAHT;AAIC,IAAA,KAAK,EAAG,cAAI,OAAJ;AAJT,IAPD,CAFD,CADD,CATF,EA+BG,CAAC,CAAED,IAAH,IAAW,4BAAC,wBAAD;AAAiB,IAAA,IAAI,EAAGA,IAAxB;AAA+B,IAAA,OAAO,EAAC;AAAvC,IA/Bd,CADD;AAmCA;;eAEcgB,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButton } from './navigation-button';\nimport { useStyle } from './hooks';\nimport Subtitle from './subtitle';\nimport TypographyPanel from './typography-panel';\n\nfunction Item( { name, parentMenu, element, label } ) {\n\tconst hasSupport = ! name;\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useStyle( prefix + 'typography.fontFamily', name );\n\tconst [ fontStyle ] = useStyle( prefix + 'typography.fontStyle', name );\n\tconst [ fontWeight ] = useStyle( prefix + 'typography.fontWeight', name );\n\tconst [ letterSpacing ] = useStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst [ backgroundColor ] = useStyle( prefix + 'color.background', name );\n\tconst [ gradientValue ] = useStyle( prefix + 'color.gradient', name );\n\tconst [ color ] = useStyle( prefix + 'color.text', name );\n\n\tif ( ! hasSupport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ parentMenu + '/typography/' + element }>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenTypography( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t{ ! name && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ /* no typography elements support yet for blocks */ }\n\t\t\t{ !! name && <TypographyPanel name={ name } element=\"text\" /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
|