: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} = useContextSystem(props, 'NavigatorScreen');
} = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext);
const isMatch = match === screenId;
const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useEffect)(() => {
path: (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path)
return () => removeScreen(screen);
}, [screenId, path, addScreen, removeScreen]);
const isRTL = (0,external_wp_i18n_namespaceObject.isRTL)();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorScreen({
}), className), [className, cx, isInitial, isBack, isRTL]);
const locationRef = (0,external_wp_element_namespaceObject.useRef)(location);
(0,external_wp_element_namespaceObject.useEffect)(() => {
locationRef.current = location;
const isInitialLocation = location.isInitial && !location.isBack;
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Only attempt to restore focus:
// - if the current location is not the initial one (to avoid moving focus on page load)
// - when the screen becomes visible
// - if the wrapper ref has been assigned
// - if focus hasn't already been restored for the current location
// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.
if (isInitialLocation || !isMatch || !wrapperRef.current || locationRef.current.hasRestoredFocus || location.skipFocus) {
const activeElement = wrapperRef.current.ownerDocument.activeElement;
// If an element is already focused within the wrapper do not focus the
// element. This prevents inputs or buttons from losing focus unnecessarily.
if (wrapperRef.current.contains(activeElement)) {
let elementToFocus = null;
// When navigating back, if a selector is provided, use it to look for the
// target element (assumed to be a node inside the current NavigatorScreen)
if (location.isBack && location.focusTargetSelector) {
elementToFocus = wrapperRef.current.querySelector(location.focusTargetSelector);
// If the previous query didn't run or find any element to focus, fallback
// to the first tabbable element in the screen (or the screen itself).
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(wrapperRef.current);
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperRef.current;
locationRef.current.hasRestoredFocus = true;
}, [isInitialLocation, isMatch, location.isBack, location.focusTargetSelector, location.skipFocus]);
const mergedWrapperRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, wrapperRef]);
return isMatch ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {
* The `NavigatorScreen` component represents a single view/screen/panel and
* should be used in combination with the `NavigatorProvider`, the
* `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* } from '@wordpress/components';
* const MyNavigation = () => (
* <NavigatorProvider initialPath="/">
* <NavigatorScreen path="/">
* <p>This is the home screen.</p>
* <NavigatorButton path="/child">
* Navigate to child screen.
* <NavigatorScreen path="/child">
* <p>This is the child screen.</p>
const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, 'NavigatorScreen');
/* harmony default export */ const navigator_screen_component = (NavigatorScreen);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/use-navigator.js
* Retrieves a `navigator` instance.
function useNavigator() {
} = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext);
/* harmony default export */ const use_navigator = (useNavigator);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-button/hook.js
const cssSelectorForAttribute = (attrName, attrValue) => `[${attrName}="${attrValue}"]`;
function useNavigatorButton(props) {
as = build_module_button,
} = useContextSystem(props, 'NavigatorButton');
const escapedPath = (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path);
const handleClick = (0,external_wp_element_namespaceObject.useCallback)(e => {
focusTargetSelector: cssSelectorForAttribute(attributeName, escapedPath)
}, [goTo, onClick, attributeName, escapedPath]);
[attributeName]: escapedPath
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-button/component.js
function UnconnectedNavigatorButton(props, forwardedRef) {
const navigatorButtonProps = useNavigatorButton(props);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {
* The `NavigatorButton` component can be used to navigate to a screen and should
* be used in combination with the `NavigatorProvider`, the `NavigatorScreen`
* and the `NavigatorBackButton` components (or the `useNavigator` hook).
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* } from '@wordpress/components';
* const MyNavigation = () => (
* <NavigatorProvider initialPath="/">
* <NavigatorScreen path="/">
* <p>This is the home screen.</p>
* <NavigatorButton path="/child">
* Navigate to child screen.
* <NavigatorScreen path="/child">
* <p>This is the child screen.</p>
const NavigatorButton = contextConnect(UnconnectedNavigatorButton, 'NavigatorButton');
/* harmony default export */ const navigator_button_component = (NavigatorButton);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/hook.js
function useNavigatorBackButton(props) {
as = build_module_button,
goToParent: goToParentProp = false,
} = useContextSystem(props, 'NavigatorBackButton');
const handleClick = (0,external_wp_element_namespaceObject.useCallback)(e => {
}, [goToParentProp, goToParent, goBack, onClick]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/component.js
function UnconnectedNavigatorBackButton(props, forwardedRef) {
const navigatorBackButtonProps = useNavigatorBackButton(props);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {
...navigatorBackButtonProps
* The `NavigatorBackButton` component can be used to navigate to a screen and
* should be used in combination with the `NavigatorProvider`, the
* `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorBackButton as NavigatorBackButton,
* } from '@wordpress/components';
* const MyNavigation = () => (
* <NavigatorProvider initialPath="/">
* <NavigatorScreen path="/">
* <p>This is the home screen.</p>
* <NavigatorButton path="/child">
* Navigate to child screen.
* <NavigatorScreen path="/child">
* <p>This is the child screen.</p>
const NavigatorBackButton = contextConnect(UnconnectedNavigatorBackButton, 'NavigatorBackButton');
/* harmony default export */ const navigator_back_button_component = (NavigatorBackButton);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-to-parent-button/component.js
function UnconnectedNavigatorToParentButton(props, forwardedRef) {
const navigatorToParentButtonProps = useNavigatorBackButton({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {
...navigatorToParentButtonProps
* The `NavigatorToParentButton` component can be used to navigate to a screen and
* should be used in combination with the `NavigatorProvider`, the
* `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`
* __experimentalNavigatorProvider as NavigatorProvider,
* __experimentalNavigatorScreen as NavigatorScreen,
* __experimentalNavigatorButton as NavigatorButton,
* __experimentalNavigatorToParentButton as NavigatorToParentButton,
* } from '@wordpress/components';
* const MyNavigation = () => (
* <NavigatorProvider initialPath="/">
* <NavigatorScreen path="/">
* <p>This is the home screen.</p>
* <NavigatorButton path="/child">
* Navigate to child screen.
* <NavigatorScreen path="/child">
* <p>This is the child screen.</p>
* <NavigatorToParentButton>
* </NavigatorToParentButton>
const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, 'NavigatorToParentButton');
/* harmony default export */ const navigator_to_parent_button_component = (NavigatorToParentButton);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/index.js
const notice_noop = () => {};
* Custom hook which announces the message with the given politeness, if a
* valid message is provided.
function useSpokenMessage(message, politeness) {
const spokenMessage = typeof message === 'string' ? message : (0,external_wp_element_namespaceObject.renderToString)(message);
(0,external_wp_element_namespaceObject.useEffect)(() => {
(0,external_wp_a11y_namespaceObject.speak)(spokenMessage, politeness);
}, [spokenMessage, politeness]);
function getDefaultPoliteness(status) {
// The default will also catch the 'error' status.
function getStatusLabel(status) {
return (0,external_wp_i18n_namespaceObject.__)('Warning notice');
return (0,external_wp_i18n_namespaceObject.__)('Information notice');
return (0,external_wp_i18n_namespaceObject.__)('Error notice');
// The default will also catch the 'success' status.
return (0,external_wp_i18n_namespaceObject.__)('Notice');
* `Notice` is a component used to communicate feedback to the user.
* import { Notice } from `@wordpress/components`;
* const MyNotice = () => (
* <Notice status="error">An unknown error occurred.</Notice>
spokenMessage = children,
politeness = getDefaultPoliteness(status),
// onDismiss is a callback executed when the notice is dismissed.
// It is distinct from onRemove, which _looks_ like a callback but is
// actually the function to call to remove the notice from the UI.
useSpokenMessage(spokenMessage, politeness);
const classes = dist_clsx(className, 'components-notice', 'is-' + status, {
'is-dismissible': isDismissible
if (__unstableHTML && typeof children === 'string') {
children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {