: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function stopAddingLink() {
// Don't let the click handler on the toolbar button trigger again.
// There are two places for us to return focus to on Escape keypress:
// 1. The rich text field.
// 2. The toolbar button.
// The toolbar button is the only one we need to handle returning focus to.
// Otherwise, we rely on the passed in onFocus to return focus to the rich text field.
// Return focus to the toolbar button or the rich text field
if (openedBy?.el?.tagName === 'BUTTON') {
// Remove the openedBy state
// 1. Click on the link button
// 2. Click the Options button in the top right of header
// 3. Focus should be in the dropdown of the Options button
// 5. Focus should be on the Options button
function onFocusOutside() {
function onRemoveFormat() {
onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, link_name));
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
// Only autofocus if we have clicked a link within the editor
const shouldAutoFocus = !(openedBy?.el?.tagName === 'A' && openedBy?.action === 'click');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
title: isActive ? (0,external_wp_i18n_namespaceObject.__)('Link') : link_title,
addLink(event.currentTarget);
isActive: isActive || addingLink,
"aria-expanded": addingLink
}), addingLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inline, {
stopAddingLink: stopAddingLink,
onFocusOutside: onFocusOutside,
activeAttributes: activeAttributes,
focusOnMount: shouldAutoFocus ? 'firstElement' : false
const build_module_link_link = {
__unstablePasteRule(value, {
const pastedText = (html || plainText).replace(/<[^>]+>/g, '').trim();
// A URL was pasted, turn the selection into a link.
// For the link pasting feature, allow only http(s) protocols.
if (!(0,external_wp_url_namespaceObject.isURL)(pastedText) || !/^https?:/.test(pastedText)) {
// Allows us to ask for this information when we get a report.
window.console.log('Created link:\n\n', pastedText);
url: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(pastedText)
if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) {
return (0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.applyFormat)((0,external_wp_richText_namespaceObject.create)({
}), format, 0, plainText.length));
return (0,external_wp_richText_namespaceObject.applyFormat)(value, format);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js
const formatStrikethrough = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(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: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"
/* harmony default export */ const format_strikethrough = (formatStrikethrough);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/strikethrough/index.js
const strikethrough_name = 'core/strikethrough';
const strikethrough_title = (0,external_wp_i18n_namespaceObject.__)('Strikethrough');
name: strikethrough_name,
title: strikethrough_title,
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, {
type: strikethrough_name,
title: strikethrough_title
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
icon: format_strikethrough,
title: strikethrough_title,
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js
const underline_name = 'core/underline';
const underline_title = (0,external_wp_i18n_namespaceObject.__)('Underline');
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, {
style: 'text-decoration: underline;'
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
inputType: "formatUnderline",
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
* @param {IconProps} props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
* @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element.
* @return {JSX.Element} Icon component
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
/* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon));
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js
const textColor = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(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: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"
/* harmony default export */ const text_color = (textColor);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/color.js
const color = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(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: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"
/* harmony default export */ const library_color = (color);
;// CONCATENATED MODULE: external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/lock-unlock.js
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/format-library');
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js
} = unlock(external_wp_components_namespaceObject.privateApis);
title: (0,external_wp_i18n_namespaceObject.__)('Text')
title: (0,external_wp_i18n_namespaceObject.__)('Background')
function parseCSS(css = '') {
return css.split(';').reduce((accumulator, rule) => {
const [property, value] = rule.split(':');
if (property === 'color') {
accumulator.color = value;
if (property === 'background-color' && value !== transparentValue) {
accumulator.backgroundColor = value;
function parseClassName(className = '', colorSettings) {
return className.split(' ').reduce((accumulator, name) => {
// `colorSlug` could contain dashes, so simply match the start and end.
if (name.startsWith('has-') && name.endsWith('-color')) {
const colorSlug = name.replace(/^has-/, '').replace(/-color$/, '');
const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colorSettings, colorSlug);
accumulator.color = colorObject.color;
function getActiveColors(value, name, colorSettings) {
const activeColorFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name);
if (!activeColorFormat) {
...parseCSS(activeColorFormat.attributes.style),
...parseClassName(activeColorFormat.attributes.class, colorSettings)
function setColors(value, name, colorSettings, colors) {
...getActiveColors(value, name, colorSettings),
if (!color && !backgroundColor) {
return (0,external_wp_richText_namespaceObject.removeFormat)(value, name);
styles.push(['background-color', backgroundColor].join(':'));
// Override default browser color for mark element.
styles.push(['background-color', transparentValue].join(':'));
const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByColorValue)(colorSettings, color);
classNames.push((0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', colorObject.slug));
styles.push(['color', color].join(':'));
attributes.style = styles.join(';');
attributes.class = classNames.join(' ');
return (0,external_wp_richText_namespaceObject.applyFormat)(value, {
const colors = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
return (_getSettings$colors = getSettings().colors) !== null && _getSettings$colors !== void 0 ? _getSettings$colors : [];
const onColorChange = (0,external_wp_element_namespaceObject.useCallback)(color => {
onChange(setColors(value, name, colors, {
}, [colors, onChange, property]);
const activeColors = (0,external_wp_element_namespaceObject.useMemo)(() => getActiveColors(value, name, colors), [name, value, colors]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, {
value: activeColors[property],
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
className: "format-library__inline-color-popover",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, {
children: TABS.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
}), TABS.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPicker, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/index.js
const transparentValue = 'rgba(0, 0, 0, 0)';
const text_color_name = 'core/text-color';
const text_color_title = (0,external_wp_i18n_namespaceObject.__)('Highlight');
function getComputedStyleProperty(element, property) {
const style = defaultView.getComputedStyle(element);
const value = style.getPropertyValue(property);
if (property === 'background-color' && value === transparentValue && element.parentElement) {
return getComputedStyleProperty(element.parentElement, property);
function fillComputedColors(element, {