@wordpress/edit-site 4.7.0 → 4.10.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 +6 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js +84 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +1 -0
- package/build/components/add-new-template/add-custom-template-modal.js +224 -0
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -0
- package/build/components/add-new-template/new-template.js +94 -33
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +405 -0
- package/build/components/add-new-template/utils.js.map +1 -0
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/code-editor/index.js +17 -4
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build/components/editor/index.js +16 -0
- package/build/components/editor/index.js.map +1 -1
- package/build/components/error-boundary/index.js +6 -0
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-styles/context-menu.js +6 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -6
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +4 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +3 -7
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +2 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +80 -0
- package/build/components/global-styles/screen-button-color.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +13 -17
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +56 -8
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +48 -14
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +4 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +9 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +4 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +9 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +11 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +199 -30
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +4 -2
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/index.js +28 -10
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/copy-content-menu-item.js +1 -1
- package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/header/more-menu/site-export.js +4 -1
- package/build/components/header/more-menu/site-export.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +13 -4
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +13 -4
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +17 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -3
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -1
- package/build/components/sidebar/template-card/index.js +19 -7
- package/build/components/sidebar/template-card/index.js.map +1 -1
- package/build/components/sidebar/template-card/template-actions.js +64 -0
- package/build/components/sidebar/template-card/template-actions.js.map +1 -0
- package/build/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build/components/template-details/edit-template-title.js +11 -3
- package/build/components/template-details/edit-template-title.js.map +1 -1
- package/build/components/template-details/index.js +1 -20
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +4 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js +77 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js +209 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -0
- package/build-module/components/add-new-template/new-template.js +93 -34
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +365 -0
- package/build-module/components/add-new-template/utils.js.map +1 -0
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/code-editor/index.js +18 -5
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -0
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +5 -0
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +6 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +2 -6
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +4 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +3 -5
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +4 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +67 -0
- package/build-module/components/global-styles/screen-button-color.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +14 -19
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +57 -9
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +47 -14
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +4 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +9 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +4 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +10 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +10 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +198 -32
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +5 -3
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/index.js +29 -11
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/copy-content-menu-item.js +1 -1
- package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/header/more-menu/site-export.js +4 -1
- package/build-module/components/header/more-menu/site-export.js.map +1 -1
- package/build-module/components/header/undo-redo/redo.js +9 -3
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +9 -3
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +17 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -1
- package/build-module/components/sidebar/template-card/index.js +18 -7
- package/build-module/components/sidebar/template-card/index.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-actions.js +49 -0
- package/build-module/components/sidebar/template-card/template-actions.js.map +1 -0
- package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build-module/components/template-details/edit-template-title.js +12 -3
- package/build-module/components/template-details/edit-template-title.js.map +1 -1
- package/build-module/components/template-details/index.js +2 -21
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +5 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +188 -42
- package/build-style/style.css +188 -42
- package/package.json +29 -29
- package/src/components/add-new-template/add-custom-generic-template-modal.js +97 -0
- package/src/components/add-new-template/add-custom-template-modal.js +265 -0
- package/src/components/add-new-template/new-template.js +194 -70
- package/src/components/add-new-template/style.scss +137 -0
- package/src/components/add-new-template/utils.js +369 -0
- package/src/components/block-editor/block-inspector-button.js +2 -3
- package/src/components/block-editor/index.js +4 -9
- package/src/components/code-editor/index.js +15 -5
- package/src/components/edit-template-part-menu-button/index.js +2 -3
- package/src/components/editor/index.js +15 -5
- package/src/components/error-boundary/index.js +5 -0
- package/src/components/global-styles/context-menu.js +3 -0
- package/src/components/global-styles/dimensions-panel.js +2 -7
- package/src/components/global-styles/global-styles-provider.js +12 -17
- package/src/components/global-styles/gradients-palette-panel.js +2 -5
- package/src/components/global-styles/hooks.js +20 -3
- package/src/components/global-styles/palette.js +4 -1
- package/src/components/global-styles/screen-block-list.js +14 -5
- package/src/components/global-styles/screen-button-color.js +102 -0
- package/src/components/global-styles/screen-color-palette.js +25 -27
- package/src/components/global-styles/screen-colors.js +58 -7
- package/src/components/global-styles/screen-link-color.js +65 -23
- package/src/components/global-styles/screen-root.js +12 -5
- package/src/components/global-styles/screen-style-variations.js +10 -4
- package/src/components/global-styles/screen-typography-element.js +4 -0
- package/src/components/global-styles/screen-typography.js +17 -2
- package/src/components/global-styles/style.scss +14 -8
- package/src/components/global-styles/test/use-global-styles-output.js +250 -16
- package/src/components/global-styles/ui.js +13 -0
- package/src/components/global-styles/use-global-styles-output.js +246 -32
- package/src/components/global-styles/utils.js +5 -2
- package/src/components/header/index.js +38 -13
- package/src/components/header/mode-switcher/index.js +4 -4
- package/src/components/header/more-menu/copy-content-menu-item.js +3 -4
- package/src/components/header/more-menu/site-export.js +5 -3
- package/src/components/header/style.scss +53 -5
- package/src/components/header/undo-redo/redo.js +6 -1
- package/src/components/header/undo-redo/undo.js +6 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -5
- package/src/components/keyboard-shortcuts/index.js +6 -10
- package/src/components/list/actions/index.js +2 -3
- package/src/components/list/actions/rename-menu-item.js +4 -6
- package/src/components/list/added-by.js +4 -3
- package/src/components/list/style.scss +0 -8
- package/src/components/navigation-sidebar/index.js +2 -4
- package/src/components/save-button/index.js +2 -4
- package/src/components/sidebar/index.js +6 -6
- package/src/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +6 -9
- package/src/components/sidebar/template-card/index.js +17 -9
- package/src/components/sidebar/template-card/style.scss +49 -35
- package/src/components/sidebar/template-card/template-actions.js +43 -0
- package/src/components/sidebar/template-card/template-areas.js +6 -6
- package/src/components/template-details/edit-template-title.js +10 -2
- package/src/components/template-details/index.js +4 -21
- package/src/components/template-details/template-areas.js +6 -6
- package/src/components/template-part-converter/index.js +2 -3
- package/src/components/test/error-boundary.js +38 -0
- package/src/components/url-query-controller/index.js +2 -3
- package/src/store/actions.js +257 -233
- package/src/store/selectors.js +19 -14
|
@@ -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"],"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;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","button","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,GALU;AAShBE,EAAAA,MAAM,EAAE;AACPH,IAAAA,WAAW,EAAE,cAAI,kDAAJ,CADN;AAEPC,IAAAA,KAAK,EAAE,cAAI,SAAJ;AAFA;AATQ,CAAjB;;AAeA,SAASG,uBAAT,OAAsD;AAAA,MAApB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAoB;AACrD,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAGR,QAAQ,CAAEQ,OAAF,CAAR,CAAoBL,KAD7B;AAEC,IAAA,WAAW,EAAGH,QAAQ,CAAEQ,OAAF,CAAR,CAAoBN;AAFnC,IADD,EAKC,4BAAC,wBAAD;AAAiB,IAAA,IAAI,EAAGK,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\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\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"]}
|
|
@@ -54,8 +54,11 @@ function Item(_ref) {
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
const navigationButtonLabel = (0, _i18n.sprintf)( // translators: %s: is a subset of Typography, e.g., 'text' or 'links'.
|
|
58
|
+
(0, _i18n.__)('Typography %s styles'), label);
|
|
57
59
|
return (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
58
|
-
path: parentMenu + '/typography/' + element
|
|
60
|
+
path: parentMenu + '/typography/' + element,
|
|
61
|
+
"aria-label": navigationButtonLabel
|
|
59
62
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
60
63
|
justify: "flex-start"
|
|
61
64
|
}, (0, _element.createElement)(_components.FlexItem, {
|
|
@@ -97,6 +100,11 @@ function ScreenTypography(_ref2) {
|
|
|
97
100
|
parentMenu: parentMenu,
|
|
98
101
|
element: "link",
|
|
99
102
|
label: (0, _i18n.__)('Links')
|
|
103
|
+
}), (0, _element.createElement)(Item, {
|
|
104
|
+
name: name,
|
|
105
|
+
parentMenu: parentMenu,
|
|
106
|
+
element: "button",
|
|
107
|
+
label: (0, _i18n.__)('Buttons')
|
|
100
108
|
})))), !!name && (0, _element.createElement)(_typographyPanel.default, {
|
|
101
109
|
name: name,
|
|
102
110
|
element: "text"
|
|
@@ -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,wCAAD;
|
|
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","navigationButtonLabel","background","ScreenTypography","undefined"],"mappings":";;;;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,UAAU,EAAGC,UAFd;AAGC,IAAA,OAAO,EAAC,MAHT;AAIC,IAAA,KAAK,EAAG,cAAI,OAAJ;AAJT,IAPD,EAaC,4BAAC,IAAD;AACC,IAAA,IAAI,EAAGD,IADR;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,OAAO,EAAC,QAHT;AAIC,IAAA,KAAK,EAAG,cAAI,SAAJ;AAJT,IAbD,CAFD,CADD,CATF,EAoCG,CAAC,CAAED,IAAH,IAAW,4BAAC,wBAAD;AAAiB,IAAA,IAAI,EAAGA,IAAxB;AAA+B,IAAA,OAAO,EAAC;AAAvC,IApCd,CADD;AAwCA;;eAEciB,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } 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 { NavigationButtonAsItem } 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\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\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</NavigationButtonAsItem>\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\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=\"button\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\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\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"]}
|
|
@@ -35,6 +35,8 @@ var _screenTextColor = _interopRequireDefault(require("./screen-text-color"));
|
|
|
35
35
|
|
|
36
36
|
var _screenLinkColor = _interopRequireDefault(require("./screen-link-color"));
|
|
37
37
|
|
|
38
|
+
var _screenButtonColor = _interopRequireDefault(require("./screen-button-color"));
|
|
39
|
+
|
|
38
40
|
var _screenLayout = _interopRequireDefault(require("./screen-layout"));
|
|
39
41
|
|
|
40
42
|
var _screenStyleVariations = _interopRequireDefault(require("./screen-style-variations"));
|
|
@@ -75,6 +77,11 @@ function ContextScreens(_ref2) {
|
|
|
75
77
|
}, (0, _element.createElement)(_screenTypographyElement.default, {
|
|
76
78
|
name: name,
|
|
77
79
|
element: "link"
|
|
80
|
+
})), (0, _element.createElement)(GlobalStylesNavigationScreen, {
|
|
81
|
+
path: parentMenu + '/typography/button'
|
|
82
|
+
}, (0, _element.createElement)(_screenTypographyElement.default, {
|
|
83
|
+
name: name,
|
|
84
|
+
element: "button"
|
|
78
85
|
})), (0, _element.createElement)(GlobalStylesNavigationScreen, {
|
|
79
86
|
path: parentMenu + '/colors'
|
|
80
87
|
}, (0, _element.createElement)(_screenColors.default, {
|
|
@@ -95,6 +102,10 @@ function ContextScreens(_ref2) {
|
|
|
95
102
|
path: parentMenu + '/colors/link'
|
|
96
103
|
}, (0, _element.createElement)(_screenLinkColor.default, {
|
|
97
104
|
name: name
|
|
105
|
+
})), (0, _element.createElement)(GlobalStylesNavigationScreen, {
|
|
106
|
+
path: parentMenu + '/colors/button'
|
|
107
|
+
}, (0, _element.createElement)(_screenButtonColor.default, {
|
|
108
|
+
name: name
|
|
98
109
|
})), (0, _element.createElement)(GlobalStylesNavigationScreen, {
|
|
99
110
|
path: parentMenu + '/layout'
|
|
100
111
|
}, (0, _element.createElement)(_screenLayout.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["GlobalStylesNavigationScreen","className","props","filter","Boolean","join","ContextScreens","name","parentMenu","undefined","GlobalStylesUI","blocks","map","block"],"mappings":";;;;;;;;;;;;;AAGA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["GlobalStylesNavigationScreen","className","props","filter","Boolean","join","ContextScreens","name","parentMenu","undefined","GlobalStylesUI","blocks","map","block"],"mappings":";;;;;;;;;;;;;AAGA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAxBA;AACA;AACA;;AAOA;AACA;AACA;AAeA,SAASA,4BAAT,OAAiE;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AAChE,SACC,4BAAC,yCAAD;AACC,IAAA,SAAS,EAAG,CACX,mDADW,EAEXD,SAFW,EAIVE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C,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAACN,IADhC;AAEC,IAAA,IAAI,EAAGM,KAAK,CAACN;AAFd,IADC,CA3BH,CADD;AAoCA;;eAEcG,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { getBlockTypes } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport ScreenBlockList from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenBackgroundColor from './screen-background-color';\nimport ScreenTextColor from './screen-text-color';\nimport ScreenLinkColor from './screen-link-color';\nimport ScreenButtonColor from './screen-button-color';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ContextScreens( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>\n\t\t\t\t<ScreenTypography name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/typography/text' }\n\t\t\t>\n\t\t\t\t<ScreenTypographyElement name={ name } element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/typography/link' }\n\t\t\t>\n\t\t\t\t<ScreenTypographyElement name={ name } element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/typography/button' }\n\t\t\t>\n\t\t\t\t<ScreenTypographyElement name={ name } element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/colors' }>\n\t\t\t\t<ScreenColors name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/background' }\n\t\t\t>\n\t\t\t\t<ScreenBackgroundColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>\n\t\t\t\t<ScreenTextColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/colors/link' }>\n\t\t\t\t<ScreenLinkColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/button' }\n\t\t\t>\n\t\t\t\t<ScreenButtonColor name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>\n\t\t\t\t<ScreenLayout name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + block.name }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</NavigatorProvider>\n\t);\n}\n\nexport default GlobalStylesUI;\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getLayoutStyles = getLayoutStyles;
|
|
6
7
|
exports.toStyles = exports.toCustomProperties = exports.getNodesWithStyles = exports.getNodesWithSettings = void 0;
|
|
7
8
|
exports.toSvgFilters = toSvgFilters;
|
|
8
9
|
exports.useGlobalStylesOutput = useGlobalStylesOutput;
|
|
@@ -181,7 +182,7 @@ function getStylesDeclarations() {
|
|
|
181
182
|
|
|
182
183
|
const styleValue = (0, _lodash.get)(blockStyles, pathToValue);
|
|
183
184
|
|
|
184
|
-
if (!!properties &&
|
|
185
|
+
if (!!properties && typeof styleValue !== 'string') {
|
|
185
186
|
Object.entries(properties).forEach(entry => {
|
|
186
187
|
const [name, prop] = entry;
|
|
187
188
|
|
|
@@ -210,6 +211,117 @@ function getStylesDeclarations() {
|
|
|
210
211
|
});
|
|
211
212
|
return output;
|
|
212
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Get generated CSS for layout styles by looking up layout definitions provided
|
|
216
|
+
* in theme.json, and outputting common layout styles, and specific blockGap values.
|
|
217
|
+
*
|
|
218
|
+
* @param {Object} props
|
|
219
|
+
* @param {Object} props.tree A theme.json tree containing layout definitions.
|
|
220
|
+
* @param {Object} props.style A style object containing spacing values.
|
|
221
|
+
* @param {string} props.selector Selector used to group together layout styling rules.
|
|
222
|
+
* @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.
|
|
223
|
+
* @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles.
|
|
224
|
+
* @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available.
|
|
225
|
+
* @return {string} Generated CSS rules for the layout styles.
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
function getLayoutStyles(_ref6) {
|
|
230
|
+
var _style$spacing, _tree$settings, _tree$settings$layout, _tree$settings2, _tree$settings2$layou;
|
|
231
|
+
|
|
232
|
+
let {
|
|
233
|
+
tree,
|
|
234
|
+
style,
|
|
235
|
+
selector,
|
|
236
|
+
hasBlockGapSupport,
|
|
237
|
+
hasFallbackGapSupport,
|
|
238
|
+
fallbackGapValue
|
|
239
|
+
} = _ref6;
|
|
240
|
+
let ruleset = '';
|
|
241
|
+
let gapValue = hasBlockGapSupport ? (0, _blockEditor.__experimentalGetGapCSSValue)(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) : ''; // Ensure a fallback gap value for the root layout definitions,
|
|
242
|
+
// and use a fallback value if one is provided for the current block.
|
|
243
|
+
|
|
244
|
+
if (hasFallbackGapSupport) {
|
|
245
|
+
if (selector === _utils.ROOT_BLOCK_SELECTOR) {
|
|
246
|
+
gapValue = !gapValue ? '0.5em' : gapValue;
|
|
247
|
+
} else if (!hasBlockGapSupport && fallbackGapValue) {
|
|
248
|
+
gapValue = fallbackGapValue;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (gapValue && tree !== null && tree !== void 0 && (_tree$settings = tree.settings) !== null && _tree$settings !== void 0 && (_tree$settings$layout = _tree$settings.layout) !== null && _tree$settings$layout !== void 0 && _tree$settings$layout.definitions) {
|
|
253
|
+
Object.values(tree.settings.layout.definitions).forEach(_ref7 => {
|
|
254
|
+
let {
|
|
255
|
+
className,
|
|
256
|
+
name,
|
|
257
|
+
spacingStyles
|
|
258
|
+
} = _ref7;
|
|
259
|
+
|
|
260
|
+
// Allow skipping default layout for themes that opt-in to block styles, but opt-out of blockGap.
|
|
261
|
+
if (!hasBlockGapSupport && 'default' === name) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (spacingStyles !== null && spacingStyles !== void 0 && spacingStyles.length) {
|
|
266
|
+
spacingStyles.forEach(spacingStyle => {
|
|
267
|
+
const declarations = [];
|
|
268
|
+
|
|
269
|
+
if (spacingStyle.rules) {
|
|
270
|
+
Object.entries(spacingStyle.rules).forEach(_ref8 => {
|
|
271
|
+
let [cssProperty, cssValue] = _ref8;
|
|
272
|
+
declarations.push(`${cssProperty}: ${cssValue ? cssValue : gapValue}`);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (declarations.length) {
|
|
277
|
+
const combinedSelector = selector === _utils.ROOT_BLOCK_SELECTOR ? `${selector} .${className}${(spacingStyle === null || spacingStyle === void 0 ? void 0 : spacingStyle.selector) || ''}` : `${selector}.${className}${(spacingStyle === null || spacingStyle === void 0 ? void 0 : spacingStyle.selector) || ''}`;
|
|
278
|
+
ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}); // For backwards compatibility, ensure the legacy block gap CSS variable is still available.
|
|
283
|
+
|
|
284
|
+
if (selector === _utils.ROOT_BLOCK_SELECTOR && hasBlockGapSupport) {
|
|
285
|
+
ruleset += `${selector} { --wp--style--block-gap: ${gapValue}; }`;
|
|
286
|
+
}
|
|
287
|
+
} // Output base styles
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
if (selector === _utils.ROOT_BLOCK_SELECTOR && tree !== null && tree !== void 0 && (_tree$settings2 = tree.settings) !== null && _tree$settings2 !== void 0 && (_tree$settings2$layou = _tree$settings2.layout) !== null && _tree$settings2$layou !== void 0 && _tree$settings2$layou.definitions) {
|
|
291
|
+
const validDisplayModes = ['block', 'flex', 'grid'];
|
|
292
|
+
Object.values(tree.settings.layout.definitions).forEach(_ref9 => {
|
|
293
|
+
let {
|
|
294
|
+
className,
|
|
295
|
+
displayMode,
|
|
296
|
+
baseStyles
|
|
297
|
+
} = _ref9;
|
|
298
|
+
|
|
299
|
+
if (displayMode && validDisplayModes.includes(displayMode)) {
|
|
300
|
+
ruleset += `${selector} .${className} { display:${displayMode}; }`;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (baseStyles !== null && baseStyles !== void 0 && baseStyles.length) {
|
|
304
|
+
baseStyles.forEach(baseStyle => {
|
|
305
|
+
const declarations = [];
|
|
306
|
+
|
|
307
|
+
if (baseStyle.rules) {
|
|
308
|
+
Object.entries(baseStyle.rules).forEach(_ref10 => {
|
|
309
|
+
let [cssProperty, cssValue] = _ref10;
|
|
310
|
+
declarations.push(`${cssProperty}: ${cssValue}`);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (declarations.length) {
|
|
315
|
+
const combinedSelector = `${selector} .${className}${(baseStyle === null || baseStyle === void 0 ? void 0 : baseStyle.selector) || ''}`;
|
|
316
|
+
ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return ruleset;
|
|
324
|
+
}
|
|
213
325
|
|
|
214
326
|
const getNodesWithStyles = (tree, blockSelectors) => {
|
|
215
327
|
var _tree$styles, _tree$styles2;
|
|
@@ -248,9 +360,11 @@ const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
248
360
|
|
|
249
361
|
if (!!blockStyles && !!(blockSelectors !== null && blockSelectors !== void 0 && (_blockSelectors$block = blockSelectors[blockName]) !== null && _blockSelectors$block !== void 0 && _blockSelectors$block.selector)) {
|
|
250
362
|
nodes.push({
|
|
251
|
-
|
|
363
|
+
duotoneSelector: blockSelectors[blockName].duotoneSelector,
|
|
364
|
+
fallbackGapValue: blockSelectors[blockName].fallbackGapValue,
|
|
365
|
+
hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport,
|
|
252
366
|
selector: blockSelectors[blockName].selector,
|
|
253
|
-
|
|
367
|
+
styles: blockStyles
|
|
254
368
|
});
|
|
255
369
|
}
|
|
256
370
|
|
|
@@ -258,7 +372,11 @@ const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
258
372
|
if (!!value && !!(blockSelectors !== null && blockSelectors !== void 0 && blockSelectors[blockName]) && !!(_blocks.__EXPERIMENTAL_ELEMENTS !== null && _blocks.__EXPERIMENTAL_ELEMENTS !== void 0 && _blocks.__EXPERIMENTAL_ELEMENTS[elementName])) {
|
|
259
373
|
nodes.push({
|
|
260
374
|
styles: value,
|
|
261
|
-
selector: blockSelectors[blockName].selector.split(',').map(sel =>
|
|
375
|
+
selector: blockSelectors[blockName].selector.split(',').map(sel => {
|
|
376
|
+
const elementSelectors = _blocks.__EXPERIMENTAL_ELEMENTS[elementName].split(',');
|
|
377
|
+
|
|
378
|
+
return elementSelectors.map(elementSelector => sel + ' ' + elementSelector);
|
|
379
|
+
}).join(',')
|
|
262
380
|
});
|
|
263
381
|
}
|
|
264
382
|
});
|
|
@@ -269,7 +387,7 @@ const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
269
387
|
exports.getNodesWithStyles = getNodesWithStyles;
|
|
270
388
|
|
|
271
389
|
const getNodesWithSettings = (tree, blockSelectors) => {
|
|
272
|
-
var _tree$
|
|
390
|
+
var _tree$settings3, _tree$settings4;
|
|
273
391
|
|
|
274
392
|
const nodes = [];
|
|
275
393
|
|
|
@@ -280,10 +398,10 @@ const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
280
398
|
const pickPresets = treeToPickFrom => {
|
|
281
399
|
const presets = {};
|
|
282
400
|
|
|
283
|
-
_utils.PRESET_METADATA.forEach(
|
|
401
|
+
_utils.PRESET_METADATA.forEach(_ref11 => {
|
|
284
402
|
let {
|
|
285
403
|
path
|
|
286
|
-
} =
|
|
404
|
+
} = _ref11;
|
|
287
405
|
const value = (0, _lodash.get)(treeToPickFrom, path, false);
|
|
288
406
|
|
|
289
407
|
if (value !== false) {
|
|
@@ -296,7 +414,7 @@ const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
296
414
|
|
|
297
415
|
|
|
298
416
|
const presets = pickPresets(tree.settings);
|
|
299
|
-
const custom = (_tree$
|
|
417
|
+
const custom = (_tree$settings3 = tree.settings) === null || _tree$settings3 === void 0 ? void 0 : _tree$settings3.custom;
|
|
300
418
|
|
|
301
419
|
if (!(0, _lodash.isEmpty)(presets) || !!custom) {
|
|
302
420
|
nodes.push({
|
|
@@ -307,7 +425,7 @@ const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
307
425
|
} // Blocks.
|
|
308
426
|
|
|
309
427
|
|
|
310
|
-
(0, _lodash.forEach)((_tree$
|
|
428
|
+
(0, _lodash.forEach)((_tree$settings4 = tree.settings) === null || _tree$settings4 === void 0 ? void 0 : _tree$settings4.blocks, (node, blockName) => {
|
|
311
429
|
const blockPresets = pickPresets(node);
|
|
312
430
|
const blockCustom = node.custom;
|
|
313
431
|
|
|
@@ -327,12 +445,12 @@ exports.getNodesWithSettings = getNodesWithSettings;
|
|
|
327
445
|
const toCustomProperties = (tree, blockSelectors) => {
|
|
328
446
|
const settings = getNodesWithSettings(tree, blockSelectors);
|
|
329
447
|
let ruleset = '';
|
|
330
|
-
settings.forEach(
|
|
448
|
+
settings.forEach(_ref12 => {
|
|
331
449
|
let {
|
|
332
450
|
presets,
|
|
333
451
|
custom,
|
|
334
452
|
selector
|
|
335
|
-
} =
|
|
453
|
+
} = _ref12;
|
|
336
454
|
const declarations = getPresetsDeclarations(presets);
|
|
337
455
|
const customProps = flattenTree(custom, '--wp--custom--', '--');
|
|
338
456
|
|
|
@@ -349,7 +467,7 @@ const toCustomProperties = (tree, blockSelectors) => {
|
|
|
349
467
|
|
|
350
468
|
exports.toCustomProperties = toCustomProperties;
|
|
351
469
|
|
|
352
|
-
const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
470
|
+
const toStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport) => {
|
|
353
471
|
const nodesWithStyles = getNodesWithStyles(tree, blockSelectors);
|
|
354
472
|
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
|
|
355
473
|
/*
|
|
@@ -362,12 +480,14 @@ const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
|
362
480
|
*/
|
|
363
481
|
|
|
364
482
|
let ruleset = 'body {margin: 0;}';
|
|
365
|
-
nodesWithStyles.forEach(
|
|
483
|
+
nodesWithStyles.forEach(_ref13 => {
|
|
366
484
|
let {
|
|
367
485
|
selector,
|
|
368
486
|
duotoneSelector,
|
|
369
|
-
styles
|
|
370
|
-
|
|
487
|
+
styles,
|
|
488
|
+
fallbackGapValue,
|
|
489
|
+
hasLayoutSupport
|
|
490
|
+
} = _ref13;
|
|
371
491
|
const duotoneStyles = {};
|
|
372
492
|
|
|
373
493
|
if (styles !== null && styles !== void 0 && styles.filter) {
|
|
@@ -384,16 +504,55 @@ const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
|
384
504
|
}
|
|
385
505
|
|
|
386
506
|
ruleset = ruleset + `${duotoneSelector}{${duotoneDeclarations.join(';')};}`;
|
|
387
|
-
} // Process
|
|
507
|
+
} // Process blockGap and layout styles.
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
if (_utils.ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport) {
|
|
511
|
+
ruleset += getLayoutStyles({
|
|
512
|
+
tree,
|
|
513
|
+
style: styles,
|
|
514
|
+
selector,
|
|
515
|
+
hasBlockGapSupport,
|
|
516
|
+
hasFallbackGapSupport,
|
|
517
|
+
fallbackGapValue
|
|
518
|
+
});
|
|
519
|
+
} // Process the remaining block styles (they use either normal block class or __experimentalSelector).
|
|
388
520
|
|
|
389
521
|
|
|
390
522
|
const declarations = getStylesDeclarations(styles);
|
|
391
523
|
|
|
392
|
-
if (declarations
|
|
393
|
-
|
|
394
|
-
}
|
|
524
|
+
if (declarations !== null && declarations !== void 0 && declarations.length) {
|
|
525
|
+
ruleset = ruleset + `${selector}{${declarations.join(';')};}`;
|
|
526
|
+
} // Check for pseudo selector in `styles` and handle separately.
|
|
395
527
|
|
|
396
|
-
|
|
528
|
+
|
|
529
|
+
const pseudoSelectorStyles = Object.entries(styles).filter(_ref14 => {
|
|
530
|
+
let [key] = _ref14;
|
|
531
|
+
return key.startsWith(':');
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
if (pseudoSelectorStyles !== null && pseudoSelectorStyles !== void 0 && pseudoSelectorStyles.length) {
|
|
535
|
+
pseudoSelectorStyles.forEach(_ref15 => {
|
|
536
|
+
let [pseudoKey, pseudoStyle] = _ref15;
|
|
537
|
+
const pseudoDeclarations = getStylesDeclarations(pseudoStyle);
|
|
538
|
+
|
|
539
|
+
if (!(pseudoDeclarations !== null && pseudoDeclarations !== void 0 && pseudoDeclarations.length)) {
|
|
540
|
+
return;
|
|
541
|
+
} // `selector` maybe provided in a form
|
|
542
|
+
// where block level selectors have sub element
|
|
543
|
+
// selectors appended to them as a comma seperated
|
|
544
|
+
// string.
|
|
545
|
+
// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;
|
|
546
|
+
// Split and append pseudo selector to create
|
|
547
|
+
// the proper rules to target the elements.
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
const _selector = selector.split(',').map(sel => sel + pseudoKey).join(',');
|
|
551
|
+
|
|
552
|
+
const pseudoRule = `${_selector}{${pseudoDeclarations.join(';')};}`;
|
|
553
|
+
ruleset = ruleset + pseudoRule;
|
|
554
|
+
});
|
|
555
|
+
}
|
|
397
556
|
});
|
|
398
557
|
/* Add alignment / layout styles */
|
|
399
558
|
|
|
@@ -402,15 +561,19 @@ const toStyles = (tree, blockSelectors, hasBlockGapSupport) => {
|
|
|
402
561
|
ruleset = ruleset + '.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';
|
|
403
562
|
|
|
404
563
|
if (hasBlockGapSupport) {
|
|
564
|
+
var _tree$styles3, _tree$styles3$spacing;
|
|
565
|
+
|
|
566
|
+
// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.
|
|
567
|
+
const gapValue = (0, _blockEditor.__experimentalGetGapCSSValue)(tree === null || tree === void 0 ? void 0 : (_tree$styles3 = tree.styles) === null || _tree$styles3 === void 0 ? void 0 : (_tree$styles3$spacing = _tree$styles3.spacing) === null || _tree$styles3$spacing === void 0 ? void 0 : _tree$styles3$spacing.blockGap) || '0.5em';
|
|
405
568
|
ruleset = ruleset + '.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }';
|
|
406
|
-
ruleset = ruleset +
|
|
569
|
+
ruleset = ruleset + `.wp-site-blocks > * + * { margin-block-start: ${gapValue}; }`;
|
|
407
570
|
}
|
|
408
571
|
|
|
409
|
-
nodesWithSettings.forEach(
|
|
572
|
+
nodesWithSettings.forEach(_ref16 => {
|
|
410
573
|
let {
|
|
411
574
|
selector,
|
|
412
575
|
presets
|
|
413
|
-
} =
|
|
576
|
+
} = _ref16;
|
|
414
577
|
|
|
415
578
|
if (_utils.ROOT_BLOCK_SELECTOR === selector) {
|
|
416
579
|
// Do not add extra specificity for top-level classes.
|
|
@@ -430,10 +593,10 @@ exports.toStyles = toStyles;
|
|
|
430
593
|
|
|
431
594
|
function toSvgFilters(tree, blockSelectors) {
|
|
432
595
|
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
|
|
433
|
-
return nodesWithSettings.flatMap(
|
|
596
|
+
return nodesWithSettings.flatMap(_ref17 => {
|
|
434
597
|
let {
|
|
435
598
|
presets
|
|
436
|
-
} =
|
|
599
|
+
} = _ref17;
|
|
437
600
|
return getPresetsSvgFilters(presets);
|
|
438
601
|
});
|
|
439
602
|
}
|
|
@@ -441,15 +604,19 @@ function toSvgFilters(tree, blockSelectors) {
|
|
|
441
604
|
const getBlockSelectors = blockTypes => {
|
|
442
605
|
const result = {};
|
|
443
606
|
blockTypes.forEach(blockType => {
|
|
444
|
-
var _blockType$supports$_, _blockType$supports, _blockType$supports$c, _blockType$supports2, _blockType$supports2
|
|
607
|
+
var _blockType$supports$_, _blockType$supports, _blockType$supports$c, _blockType$supports2, _blockType$supports2$, _blockType$supports3, _blockType$supports4, _blockType$supports4$, _blockType$supports4$2;
|
|
445
608
|
|
|
446
609
|
const name = blockType.name;
|
|
447
610
|
const selector = (_blockType$supports$_ = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports = blockType.supports) === null || _blockType$supports === void 0 ? void 0 : _blockType$supports.__experimentalSelector) !== null && _blockType$supports$_ !== void 0 ? _blockType$supports$_ : '.wp-block-' + name.replace('core/', '').replace('/', '-');
|
|
448
611
|
const duotoneSelector = (_blockType$supports$c = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports2 = blockType.supports) === null || _blockType$supports2 === void 0 ? void 0 : (_blockType$supports2$ = _blockType$supports2.color) === null || _blockType$supports2$ === void 0 ? void 0 : _blockType$supports2$.__experimentalDuotone) !== null && _blockType$supports$c !== void 0 ? _blockType$supports$c : null;
|
|
612
|
+
const hasLayoutSupport = !!(blockType !== null && blockType !== void 0 && (_blockType$supports3 = blockType.supports) !== null && _blockType$supports3 !== void 0 && _blockType$supports3.__experimentalLayout);
|
|
613
|
+
const fallbackGapValue = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports4 = blockType.supports) === null || _blockType$supports4 === void 0 ? void 0 : (_blockType$supports4$ = _blockType$supports4.spacing) === null || _blockType$supports4$ === void 0 ? void 0 : (_blockType$supports4$2 = _blockType$supports4$.blockGap) === null || _blockType$supports4$2 === void 0 ? void 0 : _blockType$supports4$2.__experimentalDefault;
|
|
449
614
|
result[name] = {
|
|
615
|
+
duotoneSelector,
|
|
616
|
+
fallbackGapValue,
|
|
617
|
+
hasLayoutSupport,
|
|
450
618
|
name,
|
|
451
|
-
selector
|
|
452
|
-
duotoneSelector
|
|
619
|
+
selector
|
|
453
620
|
};
|
|
454
621
|
});
|
|
455
622
|
return result;
|
|
@@ -464,6 +631,8 @@ function useGlobalStylesOutput() {
|
|
|
464
631
|
} = (0, _element.useContext)(_context.GlobalStylesContext);
|
|
465
632
|
const [blockGap] = (0, _hooks.useSetting)('spacing.blockGap');
|
|
466
633
|
const hasBlockGapSupport = blockGap !== null;
|
|
634
|
+
const hasFallbackGapSupport = !hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.
|
|
635
|
+
|
|
467
636
|
(0, _element.useEffect)(() => {
|
|
468
637
|
if (!(mergedConfig !== null && mergedConfig !== void 0 && mergedConfig.styles) || !(mergedConfig !== null && mergedConfig !== void 0 && mergedConfig.settings)) {
|
|
469
638
|
return;
|
|
@@ -471,7 +640,7 @@ function useGlobalStylesOutput() {
|
|
|
471
640
|
|
|
472
641
|
const blockSelectors = getBlockSelectors((0, _blocks.getBlockTypes)());
|
|
473
642
|
const customProperties = toCustomProperties(mergedConfig, blockSelectors);
|
|
474
|
-
const globalStyles = toStyles(mergedConfig, blockSelectors, hasBlockGapSupport);
|
|
643
|
+
const globalStyles = toStyles(mergedConfig, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport);
|
|
475
644
|
const filters = toSvgFilters(mergedConfig, blockSelectors);
|
|
476
645
|
setStylesheets([{
|
|
477
646
|
css: customProperties,
|
|
@@ -482,7 +651,7 @@ function useGlobalStylesOutput() {
|
|
|
482
651
|
}]);
|
|
483
652
|
setSettings(mergedConfig.settings);
|
|
484
653
|
setSvgFilters(filters);
|
|
485
|
-
}, [mergedConfig]);
|
|
654
|
+
}, [hasBlockGapSupport, hasFallbackGapSupport, mergedConfig]);
|
|
486
655
|
return [stylesheets, settings, svgFilters, hasBlockGapSupport];
|
|
487
656
|
}
|
|
488
657
|
//# sourceMappingURL=use-global-styles-output.js.map
|