@wordpress/block-editor 11.3.2 → 11.4.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/README.md +4 -4
- package/build/components/block-actions/index.js +2 -7
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +5 -3
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-popover/inbetween.js +10 -33
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +2 -2
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-types-list/index.native.js +2 -0
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/colors-gradients/control.js +6 -3
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/font-appearance-control/index.js +0 -3
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/hooks.js +106 -45
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +24 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +421 -0
- package/build/components/global-styles/typography-panel.js.map +1 -0
- package/build/components/global-styles/use-global-styles-output.js +6 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/index.js +17 -11
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +2 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +6 -11
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +9 -15
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +4 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +4 -1
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-results.native.js +4 -1
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/link-control/index.js +15 -15
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +72 -30
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +52 -0
- package/build/components/link-control/settings.js.map +1 -0
- package/build/components/list-view/index.js +6 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +5 -4
- package/build/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js +116 -0
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +1 -0
- package/build/components/off-canvas-editor/link-ui.js +1 -0
- package/build/components/off-canvas-editor/link-ui.js.map +1 -1
- package/build/components/provider/index.js +2 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/rich-text/index.js +0 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/url-input/index.js +2 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/index.js +6 -1
- package/build/components/url-popover/index.js.map +1 -1
- package/build/hooks/dimensions.js +8 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +2 -76
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +3 -51
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +2 -1
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/line-height.js +0 -42
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/metadata.js +6 -0
- package/build/hooks/metadata.js.map +1 -1
- package/build/hooks/position.js +6 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/typography.js +112 -127
- package/build/hooks/typography.js.map +1 -1
- package/build/index.js +6 -6
- package/build/index.js.map +1 -1
- package/build/layouts/flow.js +23 -2
- package/build/layouts/flow.js.map +1 -1
- package/build/lock-unlock.js +19 -0
- package/build/lock-unlock.js.map +1 -0
- package/build/{experiments.js → private-apis.js} +12 -19
- package/build/private-apis.js.map +1 -0
- package/build/{experiments.native.js → private-apis.native.js} +9 -19
- package/build/private-apis.native.js.map +1 -0
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/store/selectors.js +18 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-actions/index.js +2 -7
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +5 -3
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +10 -33
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +1 -1
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -0
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +6 -3
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +2 -1
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +100 -46
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +400 -0
- package/build-module/components/global-styles/typography-panel.js.map +1 -0
- package/build-module/components/global-styles/use-global-styles-output.js +6 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/index.js +17 -11
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +2 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-size-control/index.js +7 -12
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +9 -15
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +3 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +3 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +3 -1
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/link-control/index.js +16 -16
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +68 -30
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/settings.js +43 -0
- package/build-module/components/link-control/settings.js.map +1 -0
- package/build-module/components/list-view/index.js +6 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +4 -3
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js +99 -0
- package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +1 -0
- package/build-module/components/off-canvas-editor/link-ui.js +1 -0
- package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +0 -2
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/url-input/index.js +2 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/index.js +6 -2
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/hooks/dimensions.js +7 -1
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +3 -69
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +6 -47
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +3 -2
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/line-height.js +0 -38
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/metadata.js +6 -0
- package/build-module/hooks/metadata.js.map +1 -1
- package/build-module/hooks/position.js +5 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/typography.js +110 -123
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flow.js +23 -2
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/lock-unlock.js +9 -0
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/private-apis.js +19 -0
- package/build-module/private-apis.js.map +1 -0
- package/build-module/private-apis.native.js +15 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/selectors.js +18 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +35 -22
- package/build-style/style.css +35 -22
- package/package.json +31 -31
- package/src/components/block-actions/index.js +0 -9
- package/src/components/block-alignment-control/use-available-alignments.js +17 -12
- package/src/components/block-popover/inbetween.js +21 -53
- package/src/components/block-tools/selected-block-popover.js +1 -1
- package/src/components/block-types-list/index.native.js +2 -0
- package/src/components/colors-gradients/control.js +3 -0
- package/src/components/font-appearance-control/index.js +1 -1
- package/src/components/global-styles/hooks.js +186 -66
- package/src/components/global-styles/index.js +5 -0
- package/src/components/global-styles/typography-panel.js +403 -0
- package/src/components/global-styles/use-global-styles-output.js +6 -2
- package/src/components/iframe/index.js +20 -18
- package/src/components/image-editor/aspect-ratio-dropdown.js +1 -0
- package/src/components/image-size-control/index.js +10 -12
- package/src/components/image-size-control/style.scss +3 -21
- package/src/components/inserter/block-patterns-tab.js +9 -23
- package/src/components/inserter/block-types-tab.native.js +2 -0
- package/src/components/inserter/reusable-blocks-tab.native.js +2 -0
- package/src/components/inserter/search-results.native.js +2 -0
- package/src/components/link-control/index.js +22 -22
- package/src/components/link-control/settings-drawer.js +85 -30
- package/src/components/link-control/settings.js +41 -0
- package/src/components/link-control/style.scss +39 -7
- package/src/components/link-control/test/index.js +213 -4
- package/src/components/list-view/index.js +5 -0
- package/src/components/off-canvas-editor/block-contents.js +3 -2
- package/src/components/off-canvas-editor/leaf-more-menu.js +115 -0
- package/src/components/off-canvas-editor/link-ui.js +1 -0
- package/src/components/provider/index.js +1 -1
- package/src/components/rich-text/index.js +0 -2
- package/src/components/url-input/index.js +3 -2
- package/src/components/url-popover/index.js +8 -2
- package/src/hooks/dimensions.js +13 -1
- package/src/hooks/font-family.js +0 -58
- package/src/hooks/font-size.js +1 -36
- package/src/hooks/gap.js +9 -2
- package/src/hooks/index.js +1 -0
- package/src/hooks/line-height.js +0 -33
- package/src/hooks/metadata.js +4 -0
- package/src/hooks/position.js +7 -1
- package/src/hooks/typography.js +133 -212
- package/src/index.js +1 -1
- package/src/layouts/flow.js +16 -1
- package/src/lock-unlock.js +10 -0
- package/src/private-apis.js +19 -0
- package/src/private-apis.native.js +15 -0
- package/src/store/index.js +1 -1
- package/src/store/selectors.js +16 -1
- package/tsconfig.json +20 -1
- package/build/experiments.js.map +0 -1
- package/build/experiments.native.js.map +0 -1
- package/build/hooks/font-appearance.js +0 -188
- package/build/hooks/font-appearance.js.map +0 -1
- package/build/hooks/letter-spacing.js +0 -129
- package/build/hooks/letter-spacing.js.map +0 -1
- package/build/hooks/text-decoration.js +0 -130
- package/build/hooks/text-decoration.js.map +0 -1
- package/build/hooks/text-transform.js +0 -130
- package/build/hooks/text-transform.js.map +0 -1
- package/build-module/experiments.js +0 -25
- package/build-module/experiments.js.map +0 -1
- package/build-module/experiments.native.js +0 -23
- package/build-module/experiments.native.js.map +0 -1
- package/build-module/hooks/font-appearance.js +0 -161
- package/build-module/hooks/font-appearance.js.map +0 -1
- package/build-module/hooks/letter-spacing.js +0 -107
- package/build-module/hooks/letter-spacing.js.map +0 -1
- package/build-module/hooks/text-decoration.js +0 -108
- package/build-module/hooks/text-decoration.js.map +0 -1
- package/build-module/hooks/text-transform.js +0 -108
- package/build-module/hooks/text-transform.js.map +0 -1
- package/src/experiments.js +0 -27
- package/src/experiments.native.js +0 -25
- package/src/hooks/font-appearance.js +0 -146
- package/src/hooks/letter-spacing.js +0 -101
- package/src/hooks/text-decoration.js +0 -102
- package/src/hooks/text-transform.js +0 -101
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
FontSizePicker,
|
|
6
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
7
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import FontFamilyControl from '../font-family';
|
|
15
|
+
import FontAppearanceControl from '../font-appearance-control';
|
|
16
|
+
import LineHeightControl from '../line-height-control';
|
|
17
|
+
import LetterSpacingControl from '../letter-spacing-control';
|
|
18
|
+
import TextTransformControl from '../text-transform-control';
|
|
19
|
+
import TextDecorationControl from '../text-decoration-control';
|
|
20
|
+
import { getValueFromVariable } from './utils';
|
|
21
|
+
|
|
22
|
+
export function useHasTypographyPanel( settings ) {
|
|
23
|
+
const hasFontFamily = useHasFontFamilyControl( settings );
|
|
24
|
+
const hasLineHeight = useHasLineHeightControl( settings );
|
|
25
|
+
const hasFontAppearance = useHasAppearanceControl( settings );
|
|
26
|
+
const hasLetterSpacing = useHasLetterSpacingControl( settings );
|
|
27
|
+
const hasTextTransform = useHasTextTransformControl( settings );
|
|
28
|
+
const hasTextDecoration = useHasTextDecorationControl( settings );
|
|
29
|
+
const hasFontSize = useHasFontSizeControl( settings );
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
hasFontFamily ||
|
|
33
|
+
hasLineHeight ||
|
|
34
|
+
hasFontAppearance ||
|
|
35
|
+
hasLetterSpacing ||
|
|
36
|
+
hasTextTransform ||
|
|
37
|
+
hasFontSize ||
|
|
38
|
+
hasTextDecoration
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function useHasFontSizeControl( settings ) {
|
|
43
|
+
const disableCustomFontSizes = ! settings?.typography?.customFontSize;
|
|
44
|
+
const fontSizesPerOrigin = settings?.typography?.fontSizes ?? {};
|
|
45
|
+
const fontSizes =
|
|
46
|
+
fontSizesPerOrigin?.custom ??
|
|
47
|
+
fontSizesPerOrigin?.theme ??
|
|
48
|
+
fontSizesPerOrigin.default;
|
|
49
|
+
return !! fontSizes?.length || ! disableCustomFontSizes;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function useHasFontFamilyControl( settings ) {
|
|
53
|
+
const fontFamiliesPerOrigin = settings?.typography?.fontFamilies;
|
|
54
|
+
const fontFamilies =
|
|
55
|
+
fontFamiliesPerOrigin?.custom ??
|
|
56
|
+
fontFamiliesPerOrigin?.theme ??
|
|
57
|
+
fontFamiliesPerOrigin?.default;
|
|
58
|
+
return !! fontFamilies?.length;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function useHasLineHeightControl( settings ) {
|
|
62
|
+
return settings?.typography?.lineHeight;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function useHasAppearanceControl( settings ) {
|
|
66
|
+
const hasFontStyles = settings?.typography?.fontStyle;
|
|
67
|
+
const hasFontWeights = settings?.typography?.fontWeight;
|
|
68
|
+
return hasFontStyles || hasFontWeights;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function useAppearanceControlLabel( settings ) {
|
|
72
|
+
const hasFontStyles = settings?.typography?.fontStyle;
|
|
73
|
+
const hasFontWeights = settings?.typography?.fontWeight;
|
|
74
|
+
if ( ! hasFontStyles ) {
|
|
75
|
+
return __( 'Font weight' );
|
|
76
|
+
}
|
|
77
|
+
if ( ! hasFontWeights ) {
|
|
78
|
+
return __( 'Font style' );
|
|
79
|
+
}
|
|
80
|
+
return __( 'Appearance' );
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function useHasLetterSpacingControl( settings ) {
|
|
84
|
+
return settings?.typography?.letterSpacing;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function useHasTextTransformControl( settings ) {
|
|
88
|
+
return settings?.typography?.textTransform;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function useHasTextDecorationControl( settings ) {
|
|
92
|
+
return settings?.typography?.textDecoration;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function TypographyToolsPanel( { ...props } ) {
|
|
96
|
+
return <ToolsPanel label={ __( 'Typography' ) } { ...props } />;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const DEFAULT_CONTROLS = {
|
|
100
|
+
fontFamily: true,
|
|
101
|
+
fontSize: true,
|
|
102
|
+
fontAppearance: true,
|
|
103
|
+
lineHeight: true,
|
|
104
|
+
letterSpacing: true,
|
|
105
|
+
textTransform: true,
|
|
106
|
+
textDecoration: true,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default function TypographyPanel( {
|
|
110
|
+
as: Wrapper = TypographyToolsPanel,
|
|
111
|
+
value,
|
|
112
|
+
onChange,
|
|
113
|
+
inheritedValue = value,
|
|
114
|
+
settings,
|
|
115
|
+
panelId,
|
|
116
|
+
defaultControls = DEFAULT_CONTROLS,
|
|
117
|
+
} ) {
|
|
118
|
+
const decodeValue = ( rawValue ) =>
|
|
119
|
+
getValueFromVariable( { settings }, '', rawValue );
|
|
120
|
+
|
|
121
|
+
// Font Family
|
|
122
|
+
const hasFontFamilyEnabled = useHasFontFamilyControl( settings );
|
|
123
|
+
const fontFamiliesPerOrigin = settings?.typography?.fontFamilies;
|
|
124
|
+
const fontFamilies =
|
|
125
|
+
fontFamiliesPerOrigin?.custom ??
|
|
126
|
+
fontFamiliesPerOrigin?.theme ??
|
|
127
|
+
fontFamiliesPerOrigin?.default;
|
|
128
|
+
const fontFamily = decodeValue( inheritedValue?.typography?.fontFamily );
|
|
129
|
+
const setFontFamily = ( newValue ) => {
|
|
130
|
+
const slug = fontFamilies?.find(
|
|
131
|
+
( { fontFamily: f } ) => f === newValue
|
|
132
|
+
)?.slug;
|
|
133
|
+
onChange( {
|
|
134
|
+
...value,
|
|
135
|
+
typography: {
|
|
136
|
+
...value?.typography,
|
|
137
|
+
fontFamily: slug
|
|
138
|
+
? `var:preset|font-family|${ slug }`
|
|
139
|
+
: newValue,
|
|
140
|
+
},
|
|
141
|
+
} );
|
|
142
|
+
};
|
|
143
|
+
const hasFontFamily = () => !! value?.typography?.fontFamily;
|
|
144
|
+
const resetFontFamily = () => setFontFamily( undefined );
|
|
145
|
+
|
|
146
|
+
// Font Size
|
|
147
|
+
const hasFontSizeEnabled = useHasFontSizeControl( settings );
|
|
148
|
+
const disableCustomFontSizes = ! settings?.typography?.customFontSize;
|
|
149
|
+
const fontSizesPerOrigin = settings?.typography?.fontSizes ?? {};
|
|
150
|
+
const fontSizes =
|
|
151
|
+
fontSizesPerOrigin?.custom ??
|
|
152
|
+
fontSizesPerOrigin?.theme ??
|
|
153
|
+
fontSizesPerOrigin.default;
|
|
154
|
+
const fontSize = decodeValue( inheritedValue?.typography?.fontSize );
|
|
155
|
+
const setFontSize = ( newValue, metadata ) => {
|
|
156
|
+
const actualValue = !! metadata?.slug
|
|
157
|
+
? `var:preset|font-size|${ metadata?.slug }`
|
|
158
|
+
: newValue;
|
|
159
|
+
|
|
160
|
+
onChange( {
|
|
161
|
+
...value,
|
|
162
|
+
typography: {
|
|
163
|
+
...value?.typography,
|
|
164
|
+
fontSize: actualValue,
|
|
165
|
+
},
|
|
166
|
+
} );
|
|
167
|
+
};
|
|
168
|
+
const hasFontSize = () => !! value?.typography?.fontSize;
|
|
169
|
+
const resetFontSize = () => setFontSize( undefined );
|
|
170
|
+
|
|
171
|
+
// Appearance
|
|
172
|
+
const hasAppearanceControl = useHasAppearanceControl( settings );
|
|
173
|
+
const appearanceControlLabel = useAppearanceControlLabel( settings );
|
|
174
|
+
const hasFontStyles = settings?.typography?.fontStyle;
|
|
175
|
+
const hasFontWeights = settings?.typography?.fontWeight;
|
|
176
|
+
const fontStyle = decodeValue( inheritedValue?.typography?.fontStyle );
|
|
177
|
+
const fontWeight = decodeValue( inheritedValue?.typography?.fontWeight );
|
|
178
|
+
const setFontAppearance = ( {
|
|
179
|
+
fontStyle: newFontStyle,
|
|
180
|
+
fontWeight: newFontWeight,
|
|
181
|
+
} ) => {
|
|
182
|
+
onChange( {
|
|
183
|
+
...value,
|
|
184
|
+
typography: {
|
|
185
|
+
...value?.typography,
|
|
186
|
+
fontStyle: newFontStyle,
|
|
187
|
+
fontWeight: newFontWeight,
|
|
188
|
+
},
|
|
189
|
+
} );
|
|
190
|
+
};
|
|
191
|
+
const hasFontAppearance = () =>
|
|
192
|
+
!! value?.typography?.fontStyle || !! value?.typography?.fontWeight;
|
|
193
|
+
const resetFontAppearance = () => {
|
|
194
|
+
setFontAppearance( {} );
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// Line Height
|
|
198
|
+
const hasLineHeightEnabled = useHasLineHeightControl( settings );
|
|
199
|
+
const lineHeight = decodeValue( inheritedValue?.typography?.lineHeight );
|
|
200
|
+
const setLineHeight = ( newValue ) => {
|
|
201
|
+
onChange( {
|
|
202
|
+
...value,
|
|
203
|
+
typography: {
|
|
204
|
+
...value?.typography,
|
|
205
|
+
lineHeight: newValue,
|
|
206
|
+
},
|
|
207
|
+
} );
|
|
208
|
+
};
|
|
209
|
+
const hasLineHeight = () => !! value?.typography?.lineHeight;
|
|
210
|
+
const resetLineHeight = () => setLineHeight( undefined );
|
|
211
|
+
|
|
212
|
+
// Letter Spacing
|
|
213
|
+
const hasLetterSpacingControl = useHasLetterSpacingControl( settings );
|
|
214
|
+
const letterSpacing = decodeValue(
|
|
215
|
+
inheritedValue?.typography?.letterSpacing
|
|
216
|
+
);
|
|
217
|
+
const setLetterSpacing = ( newValue ) => {
|
|
218
|
+
onChange( {
|
|
219
|
+
...value,
|
|
220
|
+
typography: {
|
|
221
|
+
...value?.typography,
|
|
222
|
+
letterSpacing: newValue,
|
|
223
|
+
},
|
|
224
|
+
} );
|
|
225
|
+
};
|
|
226
|
+
const hasLetterSpacing = () => !! value?.typography?.letterSpacing;
|
|
227
|
+
const resetLetterSpacing = () => setLetterSpacing( undefined );
|
|
228
|
+
|
|
229
|
+
// Text Transform
|
|
230
|
+
const hasTextTransformControl = useHasTextTransformControl( settings );
|
|
231
|
+
const textTransform = decodeValue(
|
|
232
|
+
inheritedValue?.typography?.textTransform
|
|
233
|
+
);
|
|
234
|
+
const setTextTransform = ( newValue ) => {
|
|
235
|
+
onChange( {
|
|
236
|
+
...value,
|
|
237
|
+
typography: {
|
|
238
|
+
...value?.typography,
|
|
239
|
+
textTransform: newValue,
|
|
240
|
+
},
|
|
241
|
+
} );
|
|
242
|
+
};
|
|
243
|
+
const hasTextTransform = () => !! value?.typography?.textTransform;
|
|
244
|
+
const resetTextTransform = () => setTextTransform( undefined );
|
|
245
|
+
|
|
246
|
+
// Text Decoration
|
|
247
|
+
const hasTextDecorationControl = useHasTextDecorationControl( settings );
|
|
248
|
+
const textDecoration = decodeValue(
|
|
249
|
+
inheritedValue?.typography?.textDecoration
|
|
250
|
+
);
|
|
251
|
+
const setTextDecoration = ( newValue ) => {
|
|
252
|
+
onChange( {
|
|
253
|
+
...value,
|
|
254
|
+
typography: {
|
|
255
|
+
...value?.typography,
|
|
256
|
+
textDecoration: newValue,
|
|
257
|
+
},
|
|
258
|
+
} );
|
|
259
|
+
};
|
|
260
|
+
const hasTextDecoration = () => !! value?.typography?.textDecoration;
|
|
261
|
+
const resetTextDecoration = () => setTextDecoration( undefined );
|
|
262
|
+
|
|
263
|
+
const resetAll = () => {
|
|
264
|
+
onChange( {
|
|
265
|
+
...value,
|
|
266
|
+
typography: {},
|
|
267
|
+
} );
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<Wrapper resetAll={ resetAll }>
|
|
272
|
+
{ hasFontFamilyEnabled && (
|
|
273
|
+
<ToolsPanelItem
|
|
274
|
+
label={ __( 'Font family' ) }
|
|
275
|
+
hasValue={ hasFontFamily }
|
|
276
|
+
onDeselect={ resetFontFamily }
|
|
277
|
+
isShownByDefault={ defaultControls.fontFamily }
|
|
278
|
+
panelId={ panelId }
|
|
279
|
+
>
|
|
280
|
+
<FontFamilyControl
|
|
281
|
+
fontFamilies={ fontFamilies }
|
|
282
|
+
value={ fontFamily }
|
|
283
|
+
onChange={ setFontFamily }
|
|
284
|
+
size="__unstable-large"
|
|
285
|
+
__nextHasNoMarginBottom
|
|
286
|
+
/>
|
|
287
|
+
</ToolsPanelItem>
|
|
288
|
+
) }
|
|
289
|
+
{ hasFontSizeEnabled && (
|
|
290
|
+
<ToolsPanelItem
|
|
291
|
+
label={ __( 'Font size' ) }
|
|
292
|
+
hasValue={ hasFontSize }
|
|
293
|
+
onDeselect={ resetFontSize }
|
|
294
|
+
isShownByDefault={ defaultControls.fontSize }
|
|
295
|
+
panelId={ panelId }
|
|
296
|
+
>
|
|
297
|
+
<FontSizePicker
|
|
298
|
+
value={ fontSize }
|
|
299
|
+
onChange={ setFontSize }
|
|
300
|
+
fontSizes={ fontSizes }
|
|
301
|
+
disableCustomFontSizes={ disableCustomFontSizes }
|
|
302
|
+
withReset={ false }
|
|
303
|
+
withSlider
|
|
304
|
+
size="__unstable-large"
|
|
305
|
+
__nextHasNoMarginBottom
|
|
306
|
+
/>
|
|
307
|
+
</ToolsPanelItem>
|
|
308
|
+
) }
|
|
309
|
+
{ hasAppearanceControl && (
|
|
310
|
+
<ToolsPanelItem
|
|
311
|
+
className="single-column"
|
|
312
|
+
label={ appearanceControlLabel }
|
|
313
|
+
hasValue={ hasFontAppearance }
|
|
314
|
+
onDeselect={ resetFontAppearance }
|
|
315
|
+
isShownByDefault={ defaultControls.fontAppearance }
|
|
316
|
+
panelId={ panelId }
|
|
317
|
+
>
|
|
318
|
+
<FontAppearanceControl
|
|
319
|
+
value={ {
|
|
320
|
+
fontStyle,
|
|
321
|
+
fontWeight,
|
|
322
|
+
} }
|
|
323
|
+
onChange={ setFontAppearance }
|
|
324
|
+
hasFontStyles={ hasFontStyles }
|
|
325
|
+
hasFontWeights={ hasFontWeights }
|
|
326
|
+
size="__unstable-large"
|
|
327
|
+
__nextHasNoMarginBottom
|
|
328
|
+
/>
|
|
329
|
+
</ToolsPanelItem>
|
|
330
|
+
) }
|
|
331
|
+
{ hasLineHeightEnabled && (
|
|
332
|
+
<ToolsPanelItem
|
|
333
|
+
className="single-column"
|
|
334
|
+
label={ __( 'Line height' ) }
|
|
335
|
+
hasValue={ hasLineHeight }
|
|
336
|
+
onDeselect={ resetLineHeight }
|
|
337
|
+
isShownByDefault={ defaultControls.lineHeight }
|
|
338
|
+
panelId={ panelId }
|
|
339
|
+
>
|
|
340
|
+
<LineHeightControl
|
|
341
|
+
__nextHasNoMarginBottom
|
|
342
|
+
__unstableInputWidth="auto"
|
|
343
|
+
value={ lineHeight }
|
|
344
|
+
onChange={ setLineHeight }
|
|
345
|
+
size="__unstable-large"
|
|
346
|
+
/>
|
|
347
|
+
</ToolsPanelItem>
|
|
348
|
+
) }
|
|
349
|
+
{ hasLetterSpacingControl && (
|
|
350
|
+
<ToolsPanelItem
|
|
351
|
+
className="single-column"
|
|
352
|
+
label={ __( 'Letter spacing' ) }
|
|
353
|
+
hasValue={ hasLetterSpacing }
|
|
354
|
+
onDeselect={ resetLetterSpacing }
|
|
355
|
+
isShownByDefault={ defaultControls.letterSpacing }
|
|
356
|
+
panelId={ panelId }
|
|
357
|
+
>
|
|
358
|
+
<LetterSpacingControl
|
|
359
|
+
value={ letterSpacing }
|
|
360
|
+
onChange={ setLetterSpacing }
|
|
361
|
+
size="__unstable-large"
|
|
362
|
+
__unstableInputWidth="auto"
|
|
363
|
+
/>
|
|
364
|
+
</ToolsPanelItem>
|
|
365
|
+
) }
|
|
366
|
+
{ hasTextDecorationControl && (
|
|
367
|
+
<ToolsPanelItem
|
|
368
|
+
className="single-column"
|
|
369
|
+
label={ __( 'Text decoration' ) }
|
|
370
|
+
hasValue={ hasTextDecoration }
|
|
371
|
+
onDeselect={ resetTextDecoration }
|
|
372
|
+
isShownByDefault={ defaultControls.textDecoration }
|
|
373
|
+
panelId={ panelId }
|
|
374
|
+
>
|
|
375
|
+
<TextDecorationControl
|
|
376
|
+
value={ textDecoration }
|
|
377
|
+
onChange={ setTextDecoration }
|
|
378
|
+
size="__unstable-large"
|
|
379
|
+
__unstableInputWidth="auto"
|
|
380
|
+
/>
|
|
381
|
+
</ToolsPanelItem>
|
|
382
|
+
) }
|
|
383
|
+
{ hasTextTransformControl && (
|
|
384
|
+
<ToolsPanelItem
|
|
385
|
+
label={ __( 'Letter case' ) }
|
|
386
|
+
hasValue={ hasTextTransform }
|
|
387
|
+
onDeselect={ resetTextTransform }
|
|
388
|
+
isShownByDefault={ defaultControls.textTransform }
|
|
389
|
+
panelId={ panelId }
|
|
390
|
+
>
|
|
391
|
+
<TextTransformControl
|
|
392
|
+
value={ textTransform }
|
|
393
|
+
onChange={ setTextTransform }
|
|
394
|
+
showNone
|
|
395
|
+
isBlock
|
|
396
|
+
size="__unstable-large"
|
|
397
|
+
__nextHasNoMarginBottom
|
|
398
|
+
/>
|
|
399
|
+
</ToolsPanelItem>
|
|
400
|
+
) }
|
|
401
|
+
</Wrapper>
|
|
402
|
+
);
|
|
403
|
+
}
|
|
@@ -664,13 +664,17 @@ export const toStyles = (
|
|
|
664
664
|
}
|
|
665
665
|
|
|
666
666
|
if ( useRootPaddingAlign ) {
|
|
667
|
+
/*
|
|
668
|
+
* These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508
|
|
669
|
+
* almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.
|
|
670
|
+
*/
|
|
667
671
|
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
|
|
668
672
|
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
|
|
669
673
|
.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }
|
|
670
674
|
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
|
|
671
675
|
.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }
|
|
672
|
-
.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where(
|
|
673
|
-
.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(
|
|
676
|
+
.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
|
|
677
|
+
.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;
|
|
674
678
|
}
|
|
675
679
|
|
|
676
680
|
ruleset += '}';
|
|
@@ -108,6 +108,7 @@ function Iframe( {
|
|
|
108
108
|
tabIndex = 0,
|
|
109
109
|
scale = 1,
|
|
110
110
|
frameSize = 0,
|
|
111
|
+
expand = false,
|
|
111
112
|
readonly,
|
|
112
113
|
forwardedRef: ref,
|
|
113
114
|
...props
|
|
@@ -246,11 +247,30 @@ function Iframe( {
|
|
|
246
247
|
return '<!doctype html>' + renderToString( styleAssets );
|
|
247
248
|
}, [] );
|
|
248
249
|
|
|
250
|
+
// We need to counter the margin created by scaling the iframe. If the scale
|
|
251
|
+
// is e.g. 0.45, then the top + bottom margin is 0.55 (1 - scale). Just the
|
|
252
|
+
// top or bottom margin is 0.55 / 2 ((1 - scale) / 2).
|
|
253
|
+
const marginFromScaling = ( contentHeight * ( 1 - scale ) ) / 2;
|
|
254
|
+
|
|
249
255
|
return (
|
|
250
256
|
<>
|
|
251
257
|
{ tabIndex >= 0 && before }
|
|
252
258
|
<iframe
|
|
253
259
|
{ ...props }
|
|
260
|
+
style={ {
|
|
261
|
+
...props.style,
|
|
262
|
+
height: expand ? contentHeight : props.style?.height,
|
|
263
|
+
marginTop: scale
|
|
264
|
+
? -marginFromScaling + frameSize
|
|
265
|
+
: props.style?.marginTop,
|
|
266
|
+
marginBottom: scale
|
|
267
|
+
? -marginFromScaling + frameSize
|
|
268
|
+
: props.style?.marginBottom,
|
|
269
|
+
transform: scale
|
|
270
|
+
? `scale( ${ scale } )`
|
|
271
|
+
: props.style?.transform,
|
|
272
|
+
transition: 'all .3s',
|
|
273
|
+
} }
|
|
254
274
|
ref={ useMergeRefs( [ ref, setRef ] ) }
|
|
255
275
|
tabIndex={ tabIndex }
|
|
256
276
|
// Correct doctype is required to enable rendering in standards
|
|
@@ -265,13 +285,6 @@ function Iframe( {
|
|
|
265
285
|
<head ref={ headRef }>
|
|
266
286
|
{ styleAssets }
|
|
267
287
|
{ head }
|
|
268
|
-
<style>
|
|
269
|
-
{ `html { transition: background 5s; ${
|
|
270
|
-
frameSize
|
|
271
|
-
? 'background: #2f2f2f; transition: background 0s;'
|
|
272
|
-
: ''
|
|
273
|
-
} }` }
|
|
274
|
-
</style>
|
|
275
288
|
</head>
|
|
276
289
|
<body
|
|
277
290
|
ref={ bodyRef }
|
|
@@ -280,17 +293,6 @@ function Iframe( {
|
|
|
280
293
|
'editor-styles-wrapper',
|
|
281
294
|
...bodyClasses
|
|
282
295
|
) }
|
|
283
|
-
style={ {
|
|
284
|
-
// This is the remaining percentage from the scaling down
|
|
285
|
-
// of the iframe body(`scale(0.45)`). We also need to subtract
|
|
286
|
-
// the body's bottom margin.
|
|
287
|
-
marginBottom: `-${
|
|
288
|
-
contentHeight * ( 1 - scale ) -
|
|
289
|
-
frameSize
|
|
290
|
-
}px`,
|
|
291
|
-
marginTop: frameSize,
|
|
292
|
-
transform: `scale( ${ scale } )`,
|
|
293
|
-
} }
|
|
294
296
|
>
|
|
295
297
|
{ contentResizeListener }
|
|
296
298
|
<StyleProvider document={ iframeDocument }>
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
Button,
|
|
6
6
|
ButtonGroup,
|
|
7
7
|
SelectControl,
|
|
8
|
-
|
|
8
|
+
__experimentalNumberControl as NumberControl,
|
|
9
|
+
__experimentalHStack as HStack,
|
|
9
10
|
} from '@wordpress/components';
|
|
10
11
|
import { __ } from '@wordpress/i18n';
|
|
11
12
|
|
|
@@ -46,12 +47,10 @@ export default function ImageSizeControl( {
|
|
|
46
47
|
) }
|
|
47
48
|
{ isResizable && (
|
|
48
49
|
<div className="block-editor-image-size-control">
|
|
49
|
-
<p
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<TextControl
|
|
54
|
-
type="number"
|
|
50
|
+
<p>{ __( 'Image dimensions' ) }</p>
|
|
51
|
+
|
|
52
|
+
<HStack align="baseline" spacing="3">
|
|
53
|
+
<NumberControl
|
|
55
54
|
className="block-editor-image-size-control__width"
|
|
56
55
|
label={ __( 'Width' ) }
|
|
57
56
|
value={ currentWidth }
|
|
@@ -60,8 +59,7 @@ export default function ImageSizeControl( {
|
|
|
60
59
|
updateDimension( 'width', value )
|
|
61
60
|
}
|
|
62
61
|
/>
|
|
63
|
-
<
|
|
64
|
-
type="number"
|
|
62
|
+
<NumberControl
|
|
65
63
|
className="block-editor-image-size-control__height"
|
|
66
64
|
label={ __( 'Height' ) }
|
|
67
65
|
value={ currentHeight }
|
|
@@ -70,8 +68,8 @@ export default function ImageSizeControl( {
|
|
|
70
68
|
updateDimension( 'height', value )
|
|
71
69
|
}
|
|
72
70
|
/>
|
|
73
|
-
</
|
|
74
|
-
<
|
|
71
|
+
</HStack>
|
|
72
|
+
<HStack>
|
|
75
73
|
<ButtonGroup aria-label={ __( 'Image size presets' ) }>
|
|
76
74
|
{ IMAGE_SIZE_PRESETS.map( ( scale ) => {
|
|
77
75
|
const scaledWidth = Math.round(
|
|
@@ -108,7 +106,7 @@ export default function ImageSizeControl( {
|
|
|
108
106
|
<Button isSmall onClick={ () => updateDimensions() }>
|
|
109
107
|
{ __( 'Reset' ) }
|
|
110
108
|
</Button>
|
|
111
|
-
</
|
|
109
|
+
</HStack>
|
|
112
110
|
</div>
|
|
113
111
|
) }
|
|
114
112
|
</>
|
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
.block-editor-image-size-control {
|
|
2
2
|
margin-bottom: 1em;
|
|
3
3
|
|
|
4
|
-
.block-editor-image-size-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.block-editor-image-size-control__width,
|
|
9
|
-
.block-editor-image-size-control__height {
|
|
10
|
-
margin-bottom: 0.5em;
|
|
11
|
-
|
|
12
|
-
// Fix the text and placeholder text being misaligned in Safari
|
|
13
|
-
input {
|
|
14
|
-
line-height: 1.25;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.block-editor-image-size-control__width {
|
|
19
|
-
margin-right: 5px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.block-editor-image-size-control__height {
|
|
23
|
-
margin-left: 5px;
|
|
24
|
-
}
|
|
4
|
+
.block-editor-image-size-control__width,
|
|
5
|
+
.block-editor-image-size-control__height {
|
|
6
|
+
margin-bottom: 1.115em;
|
|
25
7
|
}
|
|
26
8
|
}
|
|
@@ -28,7 +28,7 @@ import BlockPatternList from '../block-patterns-list';
|
|
|
28
28
|
import PatternsExplorerModal from './block-patterns-explorer/explorer';
|
|
29
29
|
import MobileTabNavigation from './mobile-tab-navigation';
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// Preferred order of pattern categories. Any other categories should
|
|
32
32
|
// be at the bottom without any re-ordering.
|
|
33
33
|
const patternCategoriesOrder = [
|
|
34
34
|
'featured',
|
|
@@ -68,28 +68,14 @@ function usePatternsCategories( rootClientId ) {
|
|
|
68
68
|
pattern.categories?.includes( category.name )
|
|
69
69
|
)
|
|
70
70
|
)
|
|
71
|
-
.sort( ( { name:
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
) {
|
|
80
|
-
return 0;
|
|
81
|
-
}
|
|
82
|
-
if (
|
|
83
|
-
[ currentName, nextName ].every( ( categoryName ) =>
|
|
84
|
-
patternCategoriesOrder.includes( categoryName )
|
|
85
|
-
)
|
|
86
|
-
) {
|
|
87
|
-
return (
|
|
88
|
-
patternCategoriesOrder.indexOf( currentName ) -
|
|
89
|
-
patternCategoriesOrder.indexOf( nextName )
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
return patternCategoriesOrder.includes( currentName ) ? -1 : 1;
|
|
71
|
+
.sort( ( { name: aName }, { name: bName } ) => {
|
|
72
|
+
// Sort categories according to `patternCategoriesOrder`.
|
|
73
|
+
let aIndex = patternCategoriesOrder.indexOf( aName );
|
|
74
|
+
let bIndex = patternCategoriesOrder.indexOf( bName );
|
|
75
|
+
// All other categories should come after that.
|
|
76
|
+
if ( aIndex < 0 ) aIndex = patternCategoriesOrder.length;
|
|
77
|
+
if ( bIndex < 0 ) bIndex = patternCategoriesOrder.length;
|
|
78
|
+
return aIndex - bIndex;
|
|
93
79
|
} );
|
|
94
80
|
|
|
95
81
|
if (
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo } from '@wordpress/element';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -66,6 +67,7 @@ function BlockTypesTab( { onSelect, rootClientId, listProps } ) {
|
|
|
66
67
|
sections={ sections }
|
|
67
68
|
onSelect={ handleSelect }
|
|
68
69
|
listProps={ listProps }
|
|
70
|
+
label={ __( 'Blocks menu' ) }
|
|
69
71
|
/>
|
|
70
72
|
);
|
|
71
73
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -31,6 +32,7 @@ function ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {
|
|
|
31
32
|
sections={ sections }
|
|
32
33
|
onSelect={ onSelect }
|
|
33
34
|
listProps={ listProps }
|
|
35
|
+
label={ __( 'Reusable blocks' ) }
|
|
34
36
|
/>
|
|
35
37
|
);
|
|
36
38
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -54,6 +55,7 @@ function InserterSearchResults( {
|
|
|
54
55
|
sections={ [ createInserterSection( { key: 'search', items } ) ] }
|
|
55
56
|
onSelect={ handleSelect }
|
|
56
57
|
listProps={ listProps }
|
|
58
|
+
label={ __( 'Blocks' ) }
|
|
57
59
|
/>
|
|
58
60
|
);
|
|
59
61
|
}
|