: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function RichTextWrapper({
value: adjustedValue = '',
onChange: adjustedOnChange,
isSelected: originalIsSelected,
withoutInteractiveFormatting,
__unstableOnSplitAtEnd: onSplitAtEnd,
__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,
__unstablePastePlainText: pastePlainText,
__unstableEmbedURLOnPaste,
__unstableDisableFormats: disableFormats,
__unstableAllowPrefixTransformations,
props = removeNativeProps(props);
external_wp_deprecated_default()('wp.blockEditor.RichText onSplit prop', {
alternative: 'block.json support key: "splitting"'
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(RichTextWrapper);
const anchorRef = (0,external_wp_element_namespaceObject.useRef)();
const context = useBlockEditContext();
isSelected: isBlockSelected,
const blockBindings = context[blockBindingsKey];
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context);
const selector = select => {
// Avoid subscribing to the block editor store if the block is not
const selectionStart = getSelectionStart();
const selectionEnd = getSelectionEnd();
if (originalIsSelected === undefined) {
isSelected = selectionStart.clientId === clientId && selectionEnd.clientId === clientId && (identifier ? selectionStart.attributeKey === identifier : selectionStart[instanceIdKey] === instanceId);
} else if (originalIsSelected) {
isSelected = selectionStart.clientId === clientId;
selectionStart: isSelected ? selectionStart.offset : undefined,
selectionEnd: isSelected ? selectionEnd.offset : undefined,
} = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId, identifier, instanceId, originalIsSelected, isBlockSelected]);
const disableBoundBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
// Disable Rich Text editing if block bindings specify that.
let _disableBoundBlocks = false;
if (blockBindings && canBindBlock(blockName)) {
const blockTypeAttributes = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName).attributes;
} = unlock(select(external_wp_blocks_namespaceObject.store));
for (const [attribute, binding] of Object.entries(blockBindings)) {
if (blockTypeAttributes?.[attribute]?.source !== 'rich-text') {
// If the source is not defined, or if its value of `canUserEditValue` is `false`, disable it.
const blockBindingsSource = getBlockBindingsSource(binding.source);
if (!blockBindingsSource?.canUserEditValue({
_disableBoundBlocks = true;
return _disableBoundBlocks;
}, [blockBindings, blockName]);
const shouldDisableEditing = readOnly || disableBoundBlocks;
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const adjustedAllowedFormats = getAllowedFormats({
const hasFormats = !adjustedAllowedFormats || adjustedAllowedFormats.length > 0;
const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => {
const unset = start === undefined && end === undefined;
[identifier ? 'attributeKey' : instanceIdKey]: identifier ? identifier : instanceId
if (typeof start === 'number' || unset) {
// If we are only setting the start (or the end below), which
// means a partial selection, and we're not updating a selection
// with the same client ID, abort. This means the selected block
if (end === undefined && getBlockRootClientId(clientId) !== getBlockRootClientId(getSelectionEnd().clientId)) {
if (typeof end === 'number' || unset) {
if (start === undefined && getBlockRootClientId(clientId) !== getBlockRootClientId(getSelectionStart().clientId)) {
selectionChange(selection);
}, [clientId, getBlockRootClientId, getSelectionEnd, getSelectionStart, identifier, instanceId, selectionChange]);
withoutInteractiveFormatting,
allowedFormats: adjustedAllowedFormats
function addEditorOnlyFormats(value) {
return valueHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats);
function removeEditorOnlyFormats(value) {
formatTypes.forEach(formatType => {
// Remove formats created by prepareEditableTree, because they are editor only.
if (formatType.__experimentalCreatePrepareEditableTree) {
value = (0,external_wp_richText_namespaceObject.removeFormat)(value, formatType.name, 0, value.text.length);
function addInvisibleFormats(value) {
return prepareHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats);
} = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({
Object.values(changeHandlers).forEach(changeHandler => {
changeHandler(__unstableFormats, __unstableText);
__unstableIsSelected: isSelected,
__unstableDisableFormats: disableFormats,
__unstableDependencies: [...dependencies, tagName],
__unstableAfterParse: addEditorOnlyFormats,
__unstableBeforeSerialize: removeEditorOnlyFormats,
__unstableAddInvisibleFormats: addInvisibleFormats
const autocompleteProps = useBlockEditorAutocompleteProps({
completers: autocompleters,
const keyboardShortcuts = (0,external_wp_element_namespaceObject.useRef)(new Set());
const inputEvents = (0,external_wp_element_namespaceObject.useRef)(new Set());
anchorRef.current?.focus();
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboardShortcutContext.Provider, {
value: keyboardShortcuts,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inputEventContext.Provider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover.__unstableSlotNameProvider, {
value: "__unstable-block-tools-after",
children: [children && children({
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormatEdit, {
formatTypes: formatTypes,
}), isSelected && hasFormats && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(format_toolbar_container, {
editableContentElement: anchorRef.current
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName
"aria-multiline": !disableLineBreaks,
"aria-label": placeholder,
"aria-readonly": shouldDisableEditing,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([
// Rich text ref must be first because its focus listener
// must be set up before any other ref calls .focus() on
richTextRef, forwardedRef, autocompleteProps.ref, props.ref, useEventListeners({
__unstableAllowPrefixTransformations,
__unstableEmbedURLOnPaste,
contentEditable: !shouldDisableEditing,
suppressContentEditableWarning: true,
className: dist_clsx('block-editor-rich-text__editable', props.className, 'rich-text')
// Setting tabIndex to 0 is unnecessary, the element is already
// focusable because it's contentEditable. This also fixes a
// Safari bug where it's not possible to Shift+Click multi
// select blocks when Shift Clicking into an element with
// tabIndex because Safari will focus the element. However,
// Safari will correctly ignore nested contentEditable elements.
tabIndex: props.tabIndex === 0 && !shouldDisableEditing ? null : props.tabIndex,
"data-wp-block-attribute-key": identifier
// This is the private API for the RichText component.
// It allows access to all props, not just the public ones.
const PrivateRichText = withDeprecations((0,external_wp_element_namespaceObject.forwardRef)(RichTextWrapper));
PrivateRichText.Content = Content;
PrivateRichText.isEmpty = value => {
return !value || value.length === 0;
// This is the public API for the RichText component.
// We wrap the PrivateRichText component to hide some props from the public API.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md
const PublicForwardedRichTextContainer = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
const context = useBlockEditContext();
const isPreviewMode = context[isPreviewModeKey];
// Remove all non-content props.
withoutInteractiveFormatting,
__unstableOnSplitAtDoubleLineEnd,
__unstablePastePlainText,
__unstableEmbedURLOnPaste,
__unstableDisableFormats,
__unstableAllowPrefixTransformations,
} = removeNativeProps(props);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
dangerouslySetInnerHTML: {
__html: valueToHTMLString(value, multiline)
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateRichText, {
PublicForwardedRichTextContainer.Content = Content;
PublicForwardedRichTextContainer.isEmpty = value => {
return !value || value.length === 0;
/* harmony default export */ const rich_text = (PublicForwardedRichTextContainer);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js
const EditableText = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rich_text, {
__unstableDisableFormats: true
EditableText.Content = ({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
* Renders an editable text input in which text formatting is not allowed.
/* harmony default export */ const editable_text = (EditableText);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md
const PlainText = (0,external_wp_element_namespaceObject.forwardRef)(({
if (__experimentalVersion === 2) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editable_text, {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(lib/* default */.A, {
className: dist_clsx('block-editor-plain-text', className),
onChange: event => onChange(event.target.value),
/* harmony default export */ const plain_text = (PlainText);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/label.js
function ResponsiveBlockControlLabel({
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResponsiveBlockControlLabel);
const accessibleLabel = desc || (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: property name. 2: viewport name. */
(0,external_wp_i18n_namespaceObject._x)('Controls the %1$s property for %2$s viewports.', 'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'), property, viewport.label);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
"aria-describedby": `rbc-desc-${instanceId}`,
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
id: `rbc-desc-${instanceId}`,
children: accessibleLabel
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/index.js
function ResponsiveBlockControl(props) {