: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const [fontSizes] = useSettings('typography.fontSizes');
const onChange = value => {
const fontSizeSlug = getFontSizeObjectByValue(fontSizes, value).slug;
style: cleanEmptyObject({
fontSize: fontSizeSlug ? undefined : value
const fontSizeObject = getFontSize(fontSizes, fontSize, style?.typography?.fontSize);
const fontSizeValue = fontSizeObject?.size || style?.typography?.fontSize || fontSize;
return /*#__PURE__*/_jsx(FontSizePicker, {
* Custom hook that checks if font-size settings have been disabled.
* @param {string} name The name of the block.
* @return {boolean} Whether setting is disabled.
function useIsFontSizeDisabled({
const [fontSizes] = useSettings('typography.fontSizes');
const hasFontSizes = !!fontSizes?.length;
return !hasBlockSupport(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes;
function font_size_useBlockProps({
const [fontSizes, fluidTypographySettings, layoutSettings] = use_settings_useSettings('typography.fontSizes', 'typography.fluid', 'layout');
* Only add inline styles if the block supports font sizes,
* doesn't skip serialization of font sizes,
* and has either a custom font size or a preset font size.
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_SIZE_SUPPORT_KEY) || shouldSkipSerialization(name, TYPOGRAPHY_SUPPORT_KEY, 'fontSize') || !fontSize && !style?.typography?.fontSize) {
if (style?.typography?.fontSize) {
fontSize: getTypographyFontSizeValue({
size: style.typography.fontSize
fluid: fluidTypographySettings
fontSize: utils_getFontSize(fontSizes, fontSize, style?.typography?.fontSize).size
return font_size_addSaveProps(props, name, {
/* harmony default export */ const font_size = ({
useBlockProps: font_size_useBlockProps,
addSaveProps: font_size_addSaveProps,
attributeKeys: ['fontSize', 'style'],
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_SIZE_SUPPORT_KEY);
const font_size_MIGRATION_PATHS = {
fontSize: [['fontSize'], ['style', 'typography', 'fontSize']]
function font_size_addTransforms(result, source, index, results) {
const destinationBlockType = result.name;
fontSize: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(destinationBlockType, FONT_SIZE_SUPPORT_KEY)
return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/ui.js
const DEFAULT_ALIGNMENT_CONTROLS = [{
title: (0,external_wp_i18n_namespaceObject.__)('Align text left'),
title: (0,external_wp_i18n_namespaceObject.__)('Align text center'),
title: (0,external_wp_i18n_namespaceObject.__)('Align text right'),
const ui_POPOVER_PROPS = {
placement: 'bottom-start'
alignmentControls = DEFAULT_ALIGNMENT_CONTROLS,
label = (0,external_wp_i18n_namespaceObject.__)('Align text'),
describedBy = (0,external_wp_i18n_namespaceObject.__)('Change text alignment'),
function applyOrUnset(align) {
return () => onChange(value === align ? undefined : align);
const activeAlignment = alignmentControls.find(control => control.align === value);
return activeAlignment.icon;
return (0,external_wp_i18n_namespaceObject.isRTL)() ? align_right : align_left;
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
const extraProps = isToolbar ? {
popoverProps: ui_POPOVER_PROPS
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UIComponent, {
controls: alignmentControls.map(control => {
const isActive = value === align;
role: isCollapsed ? 'menuitemradio' : undefined,
onClick: applyOrUnset(align)
/* harmony default export */ const alignment_control_ui = (AlignmentUI);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/index.js
const AlignmentControl = props => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(alignment_control_ui, {
const AlignmentToolbar = props => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(alignment_control_ui, {
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/alignment-control/README.md
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-align.js
const TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';
const text_align_TEXT_ALIGNMENT_OPTIONS = [{
title: (0,external_wp_i18n_namespaceObject.__)('Align text left'),
title: (0,external_wp_i18n_namespaceObject.__)('Align text center'),
title: (0,external_wp_i18n_namespaceObject.__)('Align text right'),
const VALID_TEXT_ALIGNMENTS = ['left', 'center', 'right'];
const NO_TEXT_ALIGNMENTS = [];
* Returns the valid text alignments.
* Takes into consideration the text aligns supported by a block.
* Exported just for testing purposes, not exported outside the module.
* @param {?boolean|string[]} blockTextAlign Text aligns supported by the block.
* @return {string[]} Valid text alignments.
function getValidTextAlignments(blockTextAlign) {
if (Array.isArray(blockTextAlign)) {
return VALID_TEXT_ALIGNMENTS.filter(textAlign => blockTextAlign.includes(textAlign));
return blockTextAlign === true ? VALID_TEXT_ALIGNMENTS : NO_TEXT_ALIGNMENTS;
function BlockEditTextAlignmentToolbarControlsPure({
const settings = useBlockSettings(blockName);
const hasTextAlignControl = settings?.typography?.textAlign;
const blockEditingMode = useBlockEditingMode();
if (!hasTextAlignControl || blockEditingMode !== 'default') {
const validTextAlignments = getValidTextAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, TEXT_ALIGN_SUPPORT_KEY));
if (!validTextAlignments.length) {
const textAlignmentControls = text_align_TEXT_ALIGNMENT_OPTIONS.filter(control => validTextAlignments.includes(control.align));
const onChange = newTextAlignValue => {
textAlign: newTextAlignValue
style: utils_cleanEmptyObject(newStyle)
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AlignmentControl, {
value: style?.typography?.textAlign,
alignmentControls: textAlignmentControls
/* harmony default export */ const text_align = ({
edit: BlockEditTextAlignmentToolbarControlsPure,
useBlockProps: text_align_useBlockProps,
addSaveProps: addAssignedTextAlign,
attributeKeys: ['style'],
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, TEXT_ALIGN_SUPPORT_KEY, false);
function text_align_useBlockProps({
if (!style?.typography?.textAlign) {
const validTextAlignments = getValidTextAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(name, TEXT_ALIGN_SUPPORT_KEY));
if (!validTextAlignments.length) {
if (shouldSkipSerialization(name, TYPOGRAPHY_SUPPORT_KEY, 'textAlign')) {
const textAlign = style.typography.textAlign;
const className = dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
* Override props assigned to save component to inject text alignment class
* name if block supports it.
* @param {Object} props Additional props applied to save element.
* @param {Object} blockType Block type.
* @param {Object} attributes Block attributes.
* @return {Object} Filtered props applied to save element.
function addAssignedTextAlign(props, blockType, attributes) {
if (!attributes?.style?.typography?.textAlign) {
} = attributes.style.typography;
const blockTextAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, TEXT_ALIGN_SUPPORT_KEY);
const isTextAlignValid = getValidTextAlignments(blockTextAlign).includes(textAlign);
if (isTextAlignValid && !shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'textAlign')) {
props.className = dist_clsx(`has-text-align-${textAlign}`, props.className);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js
function omit(object, keys) {
return Object.fromEntries(Object.entries(object).filter(([key]) => !keys.includes(key)));
const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
const TYPOGRAPHY_SUPPORT_KEY = 'typography';
const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_ALIGN_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
function typography_styleToAttributes(style) {
...omit(style, ['fontFamily'])
const fontSizeValue = style?.typography?.fontSize;
const fontFamilyValue = style?.typography?.fontFamily;
const fontSizeSlug = fontSizeValue?.startsWith('var:preset|font-size|') ? fontSizeValue.substring('var:preset|font-size|'.length) : undefined;
const fontFamilySlug = fontFamilyValue?.startsWith('var:preset|font-family|') ? fontFamilyValue.substring('var:preset|font-family|'.length) : undefined;
updatedStyle.typography = {
...omit(updatedStyle.typography, ['fontFamily']),
fontSize: fontSizeSlug ? undefined : fontSizeValue
style: utils_cleanEmptyObject(updatedStyle),
fontFamily: fontFamilySlug,
function typography_attributesToStyle(attributes) {
...attributes.style?.typography,
fontFamily: attributes.fontFamily ? 'var:preset|font-family|' + attributes.fontFamily : undefined,
fontSize: attributes.fontSize ? 'var:preset|font-size|' + attributes.fontSize : attributes.style?.typography?.fontSize
function TypographyInspectorControl({
const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => {
const existingStyle = typography_attributesToStyle(attributes);
const updatedStyle = resetAllFilter(existingStyle);
...typography_styleToAttributes(updatedStyle)
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, {
resetAllFilter: attributesResetAllFilter,
function typography_TypographyPanel({
function selector(select) {
} = select(store).getBlockAttributes(clientId) || {};
} = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]);
const isEnabled = useHasTypographyPanel(settings);
const value = (0,external_wp_element_namespaceObject.useMemo)(() => typography_attributesToStyle({
}), [style, fontSize, fontFamily]);
const onChange = newStyle => {
setAttributes(typography_styleToAttributes(newStyle));
const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [TYPOGRAPHY_SUPPORT_KEY, '__experimentalDefaultControls']);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyPanel, {
as: TypographyInspectorControl,
defaultControls: defaultControls
const hasTypographySupport = blockName => {
return TYPOGRAPHY_SUPPORT_KEYS.some(key => hasBlockSupport(blockName, key));
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
const settings_settings = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"
/* harmony default export */ const library_settings = (settings_settings);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js