: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function useWheel(handler, config) {
registerAction(wheelAction);
}, config || {}, 'wheel');
function useScroll(handler, config) {
registerAction(scrollAction);
}, config || {}, 'scroll');
function useMove(handler, config) {
registerAction(moveAction);
}, config || {}, 'move');
function useHover(handler, config) {
registerAction(hoverAction);
}, config || {}, 'hover');
function createUseGesture(actions) {
actions.forEach(registerAction);
return function useGesture(_handlers, _config) {
} = parseMergedHandlers(_handlers, _config || {});
return useRecognizers(handlers, config, undefined, nativeHandlers);
function useGesture(handlers, config) {
const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);
return hook(handlers, config || {});
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/utils.js
* Gets a CSS cursor value based on a drag direction.
* @param dragDirection The drag direction.
* @return The CSS cursor value.
function getDragCursor(dragDirection) {
let dragCursor = 'ns-resize';
dragCursor = 'ns-resize';
dragCursor = 'ew-resize';
* Custom hook that renders a drag cursor when dragging.
* @param {boolean} isDragging The dragging state.
* @param {string} dragDirection The drag direction.
* @return {string} The CSS cursor value.
function useDragCursor(isDragging, dragDirection) {
const dragCursor = getDragCursor(dragDirection);
(0,external_wp_element_namespaceObject.useEffect)(() => {
document.documentElement.style.cursor = dragCursor;
document.documentElement.style.cursor = null;
}, [isDragging, dragCursor]);
function useDraft(props) {
const refPreviousValue = (0,external_wp_element_namespaceObject.useRef)(props.value);
const [draft, setDraft] = (0,external_wp_element_namespaceObject.useState)({});
const value = draft.value !== undefined ? draft.value : props.value;
// Determines when to discard the draft value to restore controlled status.
// To do so, it tracks the previous value and marks the draft value as stale
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
refPreviousValue.current = props.value;
if (draft.value !== undefined && !draft.isStale) {
} else if (draft.isStale && props.value !== previousValue) {
}, [props.value, draft]);
const onChange = (nextValue, extra) => {
// Mutates the draft value to avoid an extra effect run.
setDraft(current => Object.assign(current, {
props.onChange(nextValue, extra);
const onBlur = event => {
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/reducer/state.js
const initialStateReducer = state => state;
const initialInputControlState = {
isPressEnterToChange: false,
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/reducer/actions.js
const CONTROL = 'CONTROL';
const DRAG_END = 'DRAG_END';
const DRAG_START = 'DRAG_START';
const INVALIDATE = 'INVALIDATE';
const PRESS_DOWN = 'PRESS_DOWN';
const PRESS_ENTER = 'PRESS_ENTER';
const PRESS_UP = 'PRESS_UP';
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/reducer/reducer.js
* Prepares initialState for the reducer.
* @param initialState The initial state.
* @return Prepared initialState for the reducer
function mergeInitialState(initialState = initialInputControlState) {
...initialInputControlState,
* Creates the base reducer which may be coupled to a specializing reducer.
* As its final step, for all actions other than CONTROL, the base reducer
* passes the state and action on through the specializing reducer. The
* exception for CONTROL actions is because they represent controlled updates
* from props and no case has yet presented for their specialization.
* @param composedStateReducers A reducer to specialize state changes.
function inputControlStateReducer(composedStateReducers) {
return (state, action) => {
nextState.value = action.payload.value;
nextState.isDirty = false;
nextState._event = undefined;
// Returns immediately to avoid invoking additional reducers.
nextState.isDirty = false;
nextState.isDirty = false;
nextState.isDragging = true;
nextState.isDragging = false;
nextState.value = action.payload.value;
if (state.isPressEnterToChange) {
nextState.isDirty = true;
nextState.value = action.payload.value;
nextState.isDirty = false;
nextState.isDirty = false;
nextState.value = action.payload.value || state.initialValue;
nextState.error = action.payload.error;
nextState._event = action.payload.event;
* Send the nextState + action to the composedReducers via
* this "bridge" mechanism. This allows external stateReducers
* to hook into actions, and modify state if needed.
return composedStateReducers(nextState, action);
* A custom hook that connects and external stateReducer with an internal
* reducer. This hook manages the internal state of InputControl.
* However, by connecting an external stateReducer function, other
* components can react to actions as well as modify state before it is
* This technique uses the "stateReducer" design pattern:
* https://kentcdodds.com/blog/the-state-reducer-pattern/
* @param stateReducer An external state reducer.
* @param initialState The initial state for the reducer.
* @param onChangeHandler A handler for the onChange event.
* @return State, dispatch, and a collection of actions.
function useInputControlStateReducer(stateReducer = initialStateReducer, initialState = initialInputControlState, onChangeHandler) {
const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(inputControlStateReducer(stateReducer), mergeInitialState(initialState));
const createChangeEvent = type => (nextValue, event) => {
const createKeyEvent = type => event => {
const createDragEvent = type => payload => {
* Actions for the reducer
const change = createChangeEvent(CHANGE);
const invalidate = (error, event) => dispatch({
const reset = createChangeEvent(RESET);
const commit = createChangeEvent(COMMIT);
const dragStart = createDragEvent(DRAG_START);
const drag = createDragEvent(DRAG);
const dragEnd = createDragEvent(DRAG_END);
const pressUp = createKeyEvent(PRESS_UP);
const pressDown = createKeyEvent(PRESS_DOWN);
const pressEnter = createKeyEvent(PRESS_ENTER);
const currentState = (0,external_wp_element_namespaceObject.useRef)(state);
const refProps = (0,external_wp_element_namespaceObject.useRef)({
value: initialState.value,
// Freshens refs to props and state so that subsequent effects have access
// to their latest values without their changes causing effect runs.
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
currentState.current = state;
value: initialState.value,
// Propagates the latest state through onChange.
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (currentState.current._event !== undefined && state.value !== refProps.current.value && !state.isDirty) {
refProps.current.onChangeHandler((_state$value = state.value) !== null && _state$value !== void 0 ? _state$value : '', {
event: currentState.current._event
}, [state.value, state.isDirty]);
// Updates the state from props.
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (initialState.value !== currentState.current.value && !currentState.current.isDirty) {
value: (_initialState$value = initialState.value) !== null && _initialState$value !== void 0 ? _initialState$value : ''
}, [initialState.value]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/with-ignore-ime-events.js
* A higher-order function that wraps a keydown event handler to ensure it is not an IME event.
* In CJK languages, an IME (Input Method Editor) is used to input complex characters.
* During an IME composition, keydown events (e.g. Enter or Escape) can be fired
* which are intended to control the IME and not the application.
* These events should be ignored by any application logic.
* @param keydownHandler The keydown event handler to execute after ensuring it was not an IME event.
* @return A wrapped version of the given event handler that ignores IME events.
function withIgnoreIMEEvents(keydownHandler) {
} = 'nativeEvent' in event ? event.nativeEvent : event;
// Workaround for Mac Safari where the final Enter/Backspace of an IME composition
// is `isComposing=false`, even though it's technically still part of the composition.
// These can only be detected by keyCode.
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-field.js
const input_field_noop = () => {};
isPressEnterToChange = false,
onBlur = input_field_noop,
onChange = input_field_noop,
onDrag = input_field_noop,
onDragEnd = input_field_noop,
onDragStart = input_field_noop,
onKeyDown = input_field_noop,
onValidate = input_field_noop,
stateReducer = state => state,
} = useInputControlStateReducer(stateReducer, {