: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/* harmony default export */ const enter = (props => element => {
function onKeyDownDeprecated(event) {
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
if (onReplace && onSplit) {
event.__deprecatedOnSplit = true;
function onKeyDown(event) {
if (event.defaultPrevented) {
// The event listener is attached to the window, so we need to check if
// the target is the element.
if (event.target !== element) {
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
if (!disableLineBreaks) {
onChange((0,external_wp_richText_namespaceObject.insert)(value, '\n'));
} else if (onSplitAtEnd && start === end && end === text.length) {
// For some blocks it's desirable to split at the end of the
// block when there are two line breaks at the end of the
// block, so triple Enter exits the block.
onSplitAtDoubleLineEnd && start === end && end === text.length && text.slice(-2) === '\n\n') {
_value.start = _value.end - 2;
onChange((0,external_wp_richText_namespaceObject.remove)(_value));
onSplitAtDoubleLineEnd();
} else if (!disableLineBreaks) {
onChange((0,external_wp_richText_namespaceObject.insert)(value, '\n'));
} = element.ownerDocument;
// Attach the listener to the window so parent elements have the chance to
// prevent the default behavior.
defaultView.addEventListener('keydown', onKeyDown);
element.addEventListener('keydown', onKeyDownDeprecated);
defaultView.removeEventListener('keydown', onKeyDown);
element.removeEventListener('keydown', onKeyDownDeprecated);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/firefox-compat.js
/* harmony default export */ const firefox_compat = (props => element => {
if (!registry.select(store).isMultiSelecting()) {
// This is a little hack to work around focus issues with nested
// editable elements in Firefox. For some reason the editable child
// element sometimes regains focus, while it should not be focusable
// and focus should remain on the editable parent element.
// To do: try to find the cause of the shifting focus.
const parentEditable = element.parentElement.closest('[contenteditable="true"]');
element.addEventListener('focus', onFocus);
element.removeEventListener('focus', onFocus);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/index.js
const allEventListeners = [before_input_rules, input_rules, insert_replacement_text, remove_browser_shortcuts, shortcuts, input_events, undo_automatic_change, paste_handler, event_listeners_delete, enter, firefox_compat];
function useEventListeners(props) {
const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
propsRef.current = props;
const refEffects = (0,external_wp_element_namespaceObject.useMemo)(() => allEventListeners.map(refEffect => refEffect(propsRef)), [propsRef]);
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
const cleanups = refEffects.map(effect => effect(element));
cleanups.forEach(cleanup => cleanup());
}, [refEffects, props.isSelected]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-edit.js
const format_edit_DEFAULT_BLOCK_CONTEXT = {};
const usesContextKey = Symbol('usesContext');
function format_edit_Edit({
[usesContextKey]: usesContext
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context);
// Assign context values using the block type's declared context needs.
const context = (0,external_wp_element_namespaceObject.useMemo)(() => {
return usesContext ? Object.fromEntries(Object.entries(blockContext).filter(([key]) => usesContext.includes(key))) : format_edit_DEFAULT_BLOCK_CONTEXT;
}, [usesContext, blockContext]);
const activeFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name);
const isActive = activeFormat !== undefined;
const activeObject = (0,external_wp_richText_namespaceObject.getActiveObject)(value);
const isObjectActive = activeObject !== undefined && activeObject.type === name;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditFunction, {
activeAttributes: isActive ? activeFormat.attributes || {} : {},
isObjectActive: isObjectActive,
activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
contentRef: forwardedRef,
return formatTypes.map(settings => /*#__PURE__*/(0,external_React_.createElement)(format_edit_Edit, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/content.js
function valueToHTMLString(value, multiline) {
if (rich_text.isEmpty(value)) {
const multilineTag = getMultilineTag(multiline);
return multilineTag ? `<${multilineTag}></${multilineTag}>` : '';
if (Array.isArray(value)) {
external_wp_deprecated_default()('wp.blockEditor.RichText value prop as children type', {
alternative: 'value prop as string',
link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
return external_wp_blocks_namespaceObject.children.toHTML(value);
// To do: deprecate string type.
if (typeof value === 'string') {
// To do: create a toReactComponent method on RichTextData, which we
// might in the future also use for the editable tree. See
// https://github.com/WordPress/gutenberg/pull/41655.
return value.toHTMLString();
value = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
children: valueToHTMLString(value, multiline)
return Tag ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/multiline.js
function RichTextMultiline({
tagName: TagName = 'div',
external_wp_deprecated_default()('wp.blockEditor.RichText multiline prop', {
alternative: 'nested blocks (InnerBlocks)',
link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/'
} = useBlockEditContext();
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const multilineTagName = getMultilineTag(multiline);
value = value || `<${multilineTagName}></${multilineTagName}>`;
const padded = `</${multilineTagName}>${value}<${multilineTagName}>`;
const values = padded.split(`</${multilineTagName}><${multilineTagName}>`);
function _onChange(newValues) {
onChange(`<${multilineTagName}>${newValues.join(`</${multilineTagName}><${multilineTagName}>`)}</${multilineTagName}>`);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
children: values.map((_value, index) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RichTextWrapper, {
identifier: `${identifier}-${index}`,
tagName: multilineTagName,
const newValues = values.slice();
newValues[index] = newValue;
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
// Cannot split if there is no selection.
if (typeof start !== 'number' || typeof end !== 'number') {
const richTextValue = (0,external_wp_richText_namespaceObject.create)({
richTextValue.start = start;
const array = (0,external_wp_richText_namespaceObject.split)(richTextValue).map(v => (0,external_wp_richText_namespaceObject.toHTMLString)({
const newValues = values.slice();
newValues.splice(index, 1, ...array);
selectionChange(clientId, `${identifier}-${index + 1}`, 0, 0);
const newValues = values.slice();
if (!newValues[index + 1]) {
newValues.splice(index, 2, newValues[index] + newValues[index + 1]);
offset = newValues[index].length - 1;
if (!newValues[index - 1]) {
newValues.splice(index - 1, 2, newValues[index - 1] + newValues[index]);
offset = newValues[index - 1].length - 1;
selectionChange(clientId, `${identifier}-${index - (forward ? 0 : 1)}`, offset, offset);
/* harmony default export */ const multiline = ((0,external_wp_element_namespaceObject.forwardRef)(RichTextMultiline));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/with-deprecations.js
function withDeprecations(Component) {
return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
let onChange = props.onChange;
// Handle deprecated format.
if (Array.isArray(value)) {
external_wp_deprecated_default()('wp.blockEditor.RichText value prop as children type', {
alternative: 'value prop as string',
link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
value = external_wp_blocks_namespaceObject.children.toHTML(props.value);
onChange = newValue => props.onChange(external_wp_blocks_namespaceObject.children.fromDOM((0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, newValue).childNodes));
const NewComponent = props.multiline ? multiline : Component;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NewComponent, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/index.js
const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
const instanceIdKey = Symbol('instanceId');
* Removes props used for the native version of RichText so that they are not
* passed to the DOM element and log warnings.
* @param {Object} props Props to filter.
* @return {Object} Filtered props.
function removeNativeProps(props) {
__unstableMobileNoFocusOnMount,