Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: compose.js
instanceMap.set(object, instances + 1);
[3500] Fix | Delete
return instances;
[3501] Fix | Delete
}
[3502] Fix | Delete
[3503] Fix | Delete
/**
[3504] Fix | Delete
* Specify the useInstanceId *function* signatures.
[3505] Fix | Delete
*
[3506] Fix | Delete
* More accurately, useInstanceId distinguishes between three different
[3507] Fix | Delete
* signatures:
[3508] Fix | Delete
*
[3509] Fix | Delete
* 1. When only object is given, the returned value is a number
[3510] Fix | Delete
* 2. When object and prefix is given, the returned value is a string
[3511] Fix | Delete
* 3. When preferredId is given, the returned value is the type of preferredId
[3512] Fix | Delete
*
[3513] Fix | Delete
* @param object Object reference to create an id for.
[3514] Fix | Delete
*/
[3515] Fix | Delete
[3516] Fix | Delete
/**
[3517] Fix | Delete
* Provides a unique instance ID.
[3518] Fix | Delete
*
[3519] Fix | Delete
* @param object Object reference to create an id for.
[3520] Fix | Delete
* @param [prefix] Prefix for the unique id.
[3521] Fix | Delete
* @param [preferredId] Default ID to use.
[3522] Fix | Delete
* @return The unique instance id.
[3523] Fix | Delete
*/
[3524] Fix | Delete
function useInstanceId(object, prefix, preferredId) {
[3525] Fix | Delete
return (0,external_wp_element_namespaceObject.useMemo)(() => {
[3526] Fix | Delete
if (preferredId) {
[3527] Fix | Delete
return preferredId;
[3528] Fix | Delete
}
[3529] Fix | Delete
const id = createId(object);
[3530] Fix | Delete
return prefix ? `${prefix}-${id}` : id;
[3531] Fix | Delete
}, [object, preferredId, prefix]);
[3532] Fix | Delete
}
[3533] Fix | Delete
/* harmony default export */ const use_instance_id = (useInstanceId);
[3534] Fix | Delete
[3535] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js
[3536] Fix | Delete
/**
[3537] Fix | Delete
* Internal dependencies
[3538] Fix | Delete
*/
[3539] Fix | Delete
[3540] Fix | Delete
[3541] Fix | Delete
[3542] Fix | Delete
[3543] Fix | Delete
/**
[3544] Fix | Delete
* A Higher Order Component used to be provide a unique instance ID by
[3545] Fix | Delete
* component.
[3546] Fix | Delete
*/
[3547] Fix | Delete
const withInstanceId = createHigherOrderComponent(WrappedComponent => {
[3548] Fix | Delete
return props => {
[3549] Fix | Delete
const instanceId = use_instance_id(WrappedComponent);
[3550] Fix | Delete
// @ts-ignore
[3551] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
[3552] Fix | Delete
...props,
[3553] Fix | Delete
instanceId: instanceId
[3554] Fix | Delete
});
[3555] Fix | Delete
};
[3556] Fix | Delete
}, 'instanceId');
[3557] Fix | Delete
/* harmony default export */ const with_instance_id = (withInstanceId);
[3558] Fix | Delete
[3559] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js
[3560] Fix | Delete
/**
[3561] Fix | Delete
* WordPress dependencies
[3562] Fix | Delete
*/
[3563] Fix | Delete
[3564] Fix | Delete
[3565] Fix | Delete
/**
[3566] Fix | Delete
* Internal dependencies
[3567] Fix | Delete
*/
[3568] Fix | Delete
[3569] Fix | Delete
[3570] Fix | Delete
[3571] Fix | Delete
/**
[3572] Fix | Delete
* We cannot use the `Window['setTimeout']` and `Window['clearTimeout']`
[3573] Fix | Delete
* types here because those functions include functionality that is not handled
[3574] Fix | Delete
* by this component, like the ability to pass extra arguments.
[3575] Fix | Delete
*
[3576] Fix | Delete
* In the case of this component, we only handle the simplest case where
[3577] Fix | Delete
* `setTimeout` only accepts a function (not a string) and an optional delay.
[3578] Fix | Delete
*/
[3579] Fix | Delete
[3580] Fix | Delete
/**
[3581] Fix | Delete
* A higher-order component used to provide and manage delayed function calls
[3582] Fix | Delete
* that ought to be bound to a component's lifecycle.
[3583] Fix | Delete
*/
[3584] Fix | Delete
const withSafeTimeout = createHigherOrderComponent(OriginalComponent => {
[3585] Fix | Delete
return class WrappedComponent extends external_wp_element_namespaceObject.Component {
[3586] Fix | Delete
constructor(props) {
[3587] Fix | Delete
super(props);
[3588] Fix | Delete
this.timeouts = [];
[3589] Fix | Delete
this.setTimeout = this.setTimeout.bind(this);
[3590] Fix | Delete
this.clearTimeout = this.clearTimeout.bind(this);
[3591] Fix | Delete
}
[3592] Fix | Delete
componentWillUnmount() {
[3593] Fix | Delete
this.timeouts.forEach(clearTimeout);
[3594] Fix | Delete
}
[3595] Fix | Delete
setTimeout(fn, delay) {
[3596] Fix | Delete
const id = setTimeout(() => {
[3597] Fix | Delete
fn();
[3598] Fix | Delete
this.clearTimeout(id);
[3599] Fix | Delete
}, delay);
[3600] Fix | Delete
this.timeouts.push(id);
[3601] Fix | Delete
return id;
[3602] Fix | Delete
}
[3603] Fix | Delete
clearTimeout(id) {
[3604] Fix | Delete
clearTimeout(id);
[3605] Fix | Delete
this.timeouts = this.timeouts.filter(timeoutId => timeoutId !== id);
[3606] Fix | Delete
}
[3607] Fix | Delete
render() {
[3608] Fix | Delete
return (
[3609] Fix | Delete
/*#__PURE__*/
[3610] Fix | Delete
// @ts-ignore
[3611] Fix | Delete
(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
[3612] Fix | Delete
...this.props,
[3613] Fix | Delete
setTimeout: this.setTimeout,
[3614] Fix | Delete
clearTimeout: this.clearTimeout
[3615] Fix | Delete
})
[3616] Fix | Delete
);
[3617] Fix | Delete
}
[3618] Fix | Delete
};
[3619] Fix | Delete
}, 'withSafeTimeout');
[3620] Fix | Delete
/* harmony default export */ const with_safe_timeout = (withSafeTimeout);
[3621] Fix | Delete
[3622] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js
[3623] Fix | Delete
/**
[3624] Fix | Delete
* WordPress dependencies
[3625] Fix | Delete
*/
[3626] Fix | Delete
[3627] Fix | Delete
[3628] Fix | Delete
[3629] Fix | Delete
/**
[3630] Fix | Delete
* Internal dependencies
[3631] Fix | Delete
*/
[3632] Fix | Delete
[3633] Fix | Delete
[3634] Fix | Delete
/**
[3635] Fix | Delete
* A Higher Order Component used to provide and manage internal component state
[3636] Fix | Delete
* via props.
[3637] Fix | Delete
*
[3638] Fix | Delete
* @deprecated Use `useState` instead.
[3639] Fix | Delete
*
[3640] Fix | Delete
* @param {any} initialState Optional initial state of the component.
[3641] Fix | Delete
*
[3642] Fix | Delete
* @return {any} A higher order component wrapper accepting a component that takes the state props + its own props + `setState` and returning a component that only accepts the own props.
[3643] Fix | Delete
*/
[3644] Fix | Delete
[3645] Fix | Delete
function withState(initialState = {}) {
[3646] Fix | Delete
external_wp_deprecated_default()('wp.compose.withState', {
[3647] Fix | Delete
since: '5.8',
[3648] Fix | Delete
alternative: 'wp.element.useState'
[3649] Fix | Delete
});
[3650] Fix | Delete
return createHigherOrderComponent(OriginalComponent => {
[3651] Fix | Delete
return class WrappedComponent extends external_wp_element_namespaceObject.Component {
[3652] Fix | Delete
constructor( /** @type {any} */props) {
[3653] Fix | Delete
super(props);
[3654] Fix | Delete
this.setState = this.setState.bind(this);
[3655] Fix | Delete
this.state = initialState;
[3656] Fix | Delete
}
[3657] Fix | Delete
render() {
[3658] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
[3659] Fix | Delete
...this.props,
[3660] Fix | Delete
...this.state,
[3661] Fix | Delete
setState: this.setState
[3662] Fix | Delete
});
[3663] Fix | Delete
}
[3664] Fix | Delete
};
[3665] Fix | Delete
}, 'withState');
[3666] Fix | Delete
}
[3667] Fix | Delete
[3668] Fix | Delete
;// CONCATENATED MODULE: external ["wp","dom"]
[3669] Fix | Delete
const external_wp_dom_namespaceObject = window["wp"]["dom"];
[3670] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-ref-effect/index.js
[3671] Fix | Delete
/**
[3672] Fix | Delete
* External dependencies
[3673] Fix | Delete
*/
[3674] Fix | Delete
[3675] Fix | Delete
/**
[3676] Fix | Delete
* WordPress dependencies
[3677] Fix | Delete
*/
[3678] Fix | Delete
[3679] Fix | Delete
[3680] Fix | Delete
/**
[3681] Fix | Delete
* Effect-like ref callback. Just like with `useEffect`, this allows you to
[3682] Fix | Delete
* return a cleanup function to be run if the ref changes or one of the
[3683] Fix | Delete
* dependencies changes. The ref is provided as an argument to the callback
[3684] Fix | Delete
* functions. The main difference between this and `useEffect` is that
[3685] Fix | Delete
* the `useEffect` callback is not called when the ref changes, but this is.
[3686] Fix | Delete
* Pass the returned ref callback as the component's ref and merge multiple refs
[3687] Fix | Delete
* with `useMergeRefs`.
[3688] Fix | Delete
*
[3689] Fix | Delete
* It's worth noting that if the dependencies array is empty, there's not
[3690] Fix | Delete
* strictly a need to clean up event handlers for example, because the node is
[3691] Fix | Delete
* to be removed. It *is* necessary if you add dependencies because the ref
[3692] Fix | Delete
* callback will be called multiple times for the same node.
[3693] Fix | Delete
*
[3694] Fix | Delete
* @param callback Callback with ref as argument.
[3695] Fix | Delete
* @param dependencies Dependencies of the callback.
[3696] Fix | Delete
*
[3697] Fix | Delete
* @return Ref callback.
[3698] Fix | Delete
*/
[3699] Fix | Delete
function useRefEffect(callback, dependencies) {
[3700] Fix | Delete
const cleanup = (0,external_wp_element_namespaceObject.useRef)();
[3701] Fix | Delete
return (0,external_wp_element_namespaceObject.useCallback)(node => {
[3702] Fix | Delete
if (node) {
[3703] Fix | Delete
cleanup.current = callback(node);
[3704] Fix | Delete
} else if (cleanup.current) {
[3705] Fix | Delete
cleanup.current();
[3706] Fix | Delete
}
[3707] Fix | Delete
}, dependencies);
[3708] Fix | Delete
}
[3709] Fix | Delete
[3710] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-constrained-tabbing/index.js
[3711] Fix | Delete
/**
[3712] Fix | Delete
* WordPress dependencies
[3713] Fix | Delete
*/
[3714] Fix | Delete
[3715] Fix | Delete
[3716] Fix | Delete
/**
[3717] Fix | Delete
* Internal dependencies
[3718] Fix | Delete
*/
[3719] Fix | Delete
[3720] Fix | Delete
[3721] Fix | Delete
/**
[3722] Fix | Delete
* In Dialogs/modals, the tabbing must be constrained to the content of
[3723] Fix | Delete
* the wrapper element. This hook adds the behavior to the returned ref.
[3724] Fix | Delete
*
[3725] Fix | Delete
* @return {import('react').RefCallback<Element>} Element Ref.
[3726] Fix | Delete
*
[3727] Fix | Delete
* @example
[3728] Fix | Delete
* ```js
[3729] Fix | Delete
* import { useConstrainedTabbing } from '@wordpress/compose';
[3730] Fix | Delete
*
[3731] Fix | Delete
* const ConstrainedTabbingExample = () => {
[3732] Fix | Delete
* const constrainedTabbingRef = useConstrainedTabbing()
[3733] Fix | Delete
* return (
[3734] Fix | Delete
* <div ref={ constrainedTabbingRef }>
[3735] Fix | Delete
* <Button />
[3736] Fix | Delete
* <Button />
[3737] Fix | Delete
* </div>
[3738] Fix | Delete
* );
[3739] Fix | Delete
* }
[3740] Fix | Delete
* ```
[3741] Fix | Delete
*/
[3742] Fix | Delete
function useConstrainedTabbing() {
[3743] Fix | Delete
return useRefEffect(( /** @type {HTMLElement} */node) => {
[3744] Fix | Delete
function onKeyDown( /** @type {KeyboardEvent} */event) {
[3745] Fix | Delete
const {
[3746] Fix | Delete
key,
[3747] Fix | Delete
shiftKey,
[3748] Fix | Delete
target
[3749] Fix | Delete
} = event;
[3750] Fix | Delete
if (key !== 'Tab') {
[3751] Fix | Delete
return;
[3752] Fix | Delete
}
[3753] Fix | Delete
const action = shiftKey ? 'findPrevious' : 'findNext';
[3754] Fix | Delete
const nextElement = external_wp_dom_namespaceObject.focus.tabbable[action]( /** @type {HTMLElement} */target) || null;
[3755] Fix | Delete
[3756] Fix | Delete
// When the target element contains the element that is about to
[3757] Fix | Delete
// receive focus, for example when the target is a tabbable
[3758] Fix | Delete
// container, browsers may disagree on where to move focus next.
[3759] Fix | Delete
// In this case we can't rely on native browsers behavior. We need
[3760] Fix | Delete
// to manage focus instead.
[3761] Fix | Delete
// See https://github.com/WordPress/gutenberg/issues/46041.
[3762] Fix | Delete
if ( /** @type {HTMLElement} */target.contains(nextElement)) {
[3763] Fix | Delete
event.preventDefault();
[3764] Fix | Delete
nextElement?.focus();
[3765] Fix | Delete
return;
[3766] Fix | Delete
}
[3767] Fix | Delete
[3768] Fix | Delete
// If the element that is about to receive focus is inside the
[3769] Fix | Delete
// area, rely on native browsers behavior and let tabbing follow
[3770] Fix | Delete
// the native tab sequence.
[3771] Fix | Delete
if (node.contains(nextElement)) {
[3772] Fix | Delete
return;
[3773] Fix | Delete
}
[3774] Fix | Delete
[3775] Fix | Delete
// If the element that is about to receive focus is outside the
[3776] Fix | Delete
// area, move focus to a div and insert it at the start or end of
[3777] Fix | Delete
// the area, depending on the direction. Without preventing default
[3778] Fix | Delete
// behaviour, the browser will then move focus to the next element.
[3779] Fix | Delete
const domAction = shiftKey ? 'append' : 'prepend';
[3780] Fix | Delete
const {
[3781] Fix | Delete
ownerDocument
[3782] Fix | Delete
} = node;
[3783] Fix | Delete
const trap = ownerDocument.createElement('div');
[3784] Fix | Delete
trap.tabIndex = -1;
[3785] Fix | Delete
node[domAction](trap);
[3786] Fix | Delete
[3787] Fix | Delete
// Remove itself when the trap loses focus.
[3788] Fix | Delete
trap.addEventListener('blur', () => node.removeChild(trap));
[3789] Fix | Delete
trap.focus();
[3790] Fix | Delete
}
[3791] Fix | Delete
node.addEventListener('keydown', onKeyDown);
[3792] Fix | Delete
return () => {
[3793] Fix | Delete
node.removeEventListener('keydown', onKeyDown);
[3794] Fix | Delete
};
[3795] Fix | Delete
}, []);
[3796] Fix | Delete
}
[3797] Fix | Delete
/* harmony default export */ const use_constrained_tabbing = (useConstrainedTabbing);
[3798] Fix | Delete
[3799] Fix | Delete
// EXTERNAL MODULE: ./node_modules/clipboard/dist/clipboard.js
[3800] Fix | Delete
var dist_clipboard = __webpack_require__(3758);
[3801] Fix | Delete
var clipboard_default = /*#__PURE__*/__webpack_require__.n(dist_clipboard);
[3802] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-copy-on-click/index.js
[3803] Fix | Delete
/**
[3804] Fix | Delete
* External dependencies
[3805] Fix | Delete
*/
[3806] Fix | Delete
[3807] Fix | Delete
[3808] Fix | Delete
/**
[3809] Fix | Delete
* WordPress dependencies
[3810] Fix | Delete
*/
[3811] Fix | Delete
[3812] Fix | Delete
[3813] Fix | Delete
[3814] Fix | Delete
/* eslint-disable jsdoc/no-undefined-types */
[3815] Fix | Delete
/**
[3816] Fix | Delete
* Copies the text to the clipboard when the element is clicked.
[3817] Fix | Delete
*
[3818] Fix | Delete
* @deprecated
[3819] Fix | Delete
*
[3820] Fix | Delete
* @param {import('react').RefObject<string | Element | NodeListOf<Element>>} ref Reference with the element.
[3821] Fix | Delete
* @param {string|Function} text The text to copy.
[3822] Fix | Delete
* @param {number} [timeout] Optional timeout to reset the returned
[3823] Fix | Delete
* state. 4 seconds by default.
[3824] Fix | Delete
*
[3825] Fix | Delete
* @return {boolean} Whether or not the text has been copied. Resets after the
[3826] Fix | Delete
* timeout.
[3827] Fix | Delete
*/
[3828] Fix | Delete
function useCopyOnClick(ref, text, timeout = 4000) {
[3829] Fix | Delete
/* eslint-enable jsdoc/no-undefined-types */
[3830] Fix | Delete
external_wp_deprecated_default()('wp.compose.useCopyOnClick', {
[3831] Fix | Delete
since: '5.8',
[3832] Fix | Delete
alternative: 'wp.compose.useCopyToClipboard'
[3833] Fix | Delete
});
[3834] Fix | Delete
[3835] Fix | Delete
/** @type {import('react').MutableRefObject<Clipboard | undefined>} */
[3836] Fix | Delete
const clipboard = (0,external_wp_element_namespaceObject.useRef)();
[3837] Fix | Delete
const [hasCopied, setHasCopied] = (0,external_wp_element_namespaceObject.useState)(false);
[3838] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[3839] Fix | Delete
/** @type {number | undefined} */
[3840] Fix | Delete
let timeoutId;
[3841] Fix | Delete
if (!ref.current) {
[3842] Fix | Delete
return;
[3843] Fix | Delete
}
[3844] Fix | Delete
[3845] Fix | Delete
// Clipboard listens to click events.
[3846] Fix | Delete
clipboard.current = new (clipboard_default())(ref.current, {
[3847] Fix | Delete
text: () => typeof text === 'function' ? text() : text
[3848] Fix | Delete
});
[3849] Fix | Delete
clipboard.current.on('success', ({
[3850] Fix | Delete
clearSelection,
[3851] Fix | Delete
trigger
[3852] Fix | Delete
}) => {
[3853] Fix | Delete
// Clearing selection will move focus back to the triggering button,
[3854] Fix | Delete
// ensuring that it is not reset to the body, and further that it is
[3855] Fix | Delete
// kept within the rendered node.
[3856] Fix | Delete
clearSelection();
[3857] Fix | Delete
[3858] Fix | Delete
// Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
[3859] Fix | Delete
if (trigger) {
[3860] Fix | Delete
/** @type {HTMLElement} */trigger.focus();
[3861] Fix | Delete
}
[3862] Fix | Delete
if (timeout) {
[3863] Fix | Delete
setHasCopied(true);
[3864] Fix | Delete
clearTimeout(timeoutId);
[3865] Fix | Delete
timeoutId = setTimeout(() => setHasCopied(false), timeout);
[3866] Fix | Delete
}
[3867] Fix | Delete
});
[3868] Fix | Delete
return () => {
[3869] Fix | Delete
if (clipboard.current) {
[3870] Fix | Delete
clipboard.current.destroy();
[3871] Fix | Delete
}
[3872] Fix | Delete
clearTimeout(timeoutId);
[3873] Fix | Delete
};
[3874] Fix | Delete
}, [text, timeout, setHasCopied]);
[3875] Fix | Delete
return hasCopied;
[3876] Fix | Delete
}
[3877] Fix | Delete
[3878] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-copy-to-clipboard/index.js
[3879] Fix | Delete
/**
[3880] Fix | Delete
* External dependencies
[3881] Fix | Delete
*/
[3882] Fix | Delete
[3883] Fix | Delete
[3884] Fix | Delete
/**
[3885] Fix | Delete
* WordPress dependencies
[3886] Fix | Delete
*/
[3887] Fix | Delete
[3888] Fix | Delete
[3889] Fix | Delete
/**
[3890] Fix | Delete
* Internal dependencies
[3891] Fix | Delete
*/
[3892] Fix | Delete
[3893] Fix | Delete
[3894] Fix | Delete
/**
[3895] Fix | Delete
* @template T
[3896] Fix | Delete
* @param {T} value
[3897] Fix | Delete
* @return {import('react').RefObject<T>} The updated ref
[3898] Fix | Delete
*/
[3899] Fix | Delete
function useUpdatedRef(value) {
[3900] Fix | Delete
const ref = (0,external_wp_element_namespaceObject.useRef)(value);
[3901] Fix | Delete
ref.current = value;
[3902] Fix | Delete
return ref;
[3903] Fix | Delete
}
[3904] Fix | Delete
[3905] Fix | Delete
/**
[3906] Fix | Delete
* Copies the given text to the clipboard when the element is clicked.
[3907] Fix | Delete
*
[3908] Fix | Delete
* @template {HTMLElement} TElementType
[3909] Fix | Delete
* @param {string | (() => string)} text The text to copy. Use a function if not
[3910] Fix | Delete
* already available and expensive to compute.
[3911] Fix | Delete
* @param {Function} onSuccess Called when to text is copied.
[3912] Fix | Delete
*
[3913] Fix | Delete
* @return {import('react').Ref<TElementType>} A ref to assign to the target element.
[3914] Fix | Delete
*/
[3915] Fix | Delete
function useCopyToClipboard(text, onSuccess) {
[3916] Fix | Delete
// Store the dependencies as refs and continuously update them so they're
[3917] Fix | Delete
// fresh when the callback is called.
[3918] Fix | Delete
const textRef = useUpdatedRef(text);
[3919] Fix | Delete
const onSuccessRef = useUpdatedRef(onSuccess);
[3920] Fix | Delete
return useRefEffect(node => {
[3921] Fix | Delete
// Clipboard listens to click events.
[3922] Fix | Delete
const clipboard = new (clipboard_default())(node, {
[3923] Fix | Delete
text() {
[3924] Fix | Delete
return typeof textRef.current === 'function' ? textRef.current() : textRef.current || '';
[3925] Fix | Delete
}
[3926] Fix | Delete
});
[3927] Fix | Delete
clipboard.on('success', ({
[3928] Fix | Delete
clearSelection
[3929] Fix | Delete
}) => {
[3930] Fix | Delete
// Clearing selection will move focus back to the triggering
[3931] Fix | Delete
// button, ensuring that it is not reset to the body, and
[3932] Fix | Delete
// further that it is kept within the rendered node.
[3933] Fix | Delete
clearSelection();
[3934] Fix | Delete
if (onSuccessRef.current) {
[3935] Fix | Delete
onSuccessRef.current();
[3936] Fix | Delete
}
[3937] Fix | Delete
});
[3938] Fix | Delete
return () => {
[3939] Fix | Delete
clipboard.destroy();
[3940] Fix | Delete
};
[3941] Fix | Delete
}, []);
[3942] Fix | Delete
}
[3943] Fix | Delete
[3944] Fix | Delete
;// CONCATENATED MODULE: external ["wp","keycodes"]
[3945] Fix | Delete
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
[3946] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-on-mount/index.js
[3947] Fix | Delete
/**
[3948] Fix | Delete
* WordPress dependencies
[3949] Fix | Delete
*/
[3950] Fix | Delete
[3951] Fix | Delete
[3952] Fix | Delete
[3953] Fix | Delete
/**
[3954] Fix | Delete
* Internal dependencies
[3955] Fix | Delete
*/
[3956] Fix | Delete
[3957] Fix | Delete
[3958] Fix | Delete
/**
[3959] Fix | Delete
* Hook used to focus the first tabbable element on mount.
[3960] Fix | Delete
*
[3961] Fix | Delete
* @param {boolean | 'firstElement'} focusOnMount Focus on mount mode.
[3962] Fix | Delete
* @return {import('react').RefCallback<HTMLElement>} Ref callback.
[3963] Fix | Delete
*
[3964] Fix | Delete
* @example
[3965] Fix | Delete
* ```js
[3966] Fix | Delete
* import { useFocusOnMount } from '@wordpress/compose';
[3967] Fix | Delete
*
[3968] Fix | Delete
* const WithFocusOnMount = () => {
[3969] Fix | Delete
* const ref = useFocusOnMount()
[3970] Fix | Delete
* return (
[3971] Fix | Delete
* <div ref={ ref }>
[3972] Fix | Delete
* <Button />
[3973] Fix | Delete
* <Button />
[3974] Fix | Delete
* </div>
[3975] Fix | Delete
* );
[3976] Fix | Delete
* }
[3977] Fix | Delete
* ```
[3978] Fix | Delete
*/
[3979] Fix | Delete
function useFocusOnMount(focusOnMount = 'firstElement') {
[3980] Fix | Delete
const focusOnMountRef = (0,external_wp_element_namespaceObject.useRef)(focusOnMount);
[3981] Fix | Delete
[3982] Fix | Delete
/**
[3983] Fix | Delete
* Sets focus on a DOM element.
[3984] Fix | Delete
*
[3985] Fix | Delete
* @param {HTMLElement} target The DOM element to set focus to.
[3986] Fix | Delete
* @return {void}
[3987] Fix | Delete
*/
[3988] Fix | Delete
const setFocus = target => {
[3989] Fix | Delete
target.focus({
[3990] Fix | Delete
// When focusing newly mounted dialogs,
[3991] Fix | Delete
// the position of the popover is often not right on the first render
[3992] Fix | Delete
// This prevents the layout shifts when focusing the dialogs.
[3993] Fix | Delete
preventScroll: true
[3994] Fix | Delete
});
[3995] Fix | Delete
};
[3996] Fix | Delete
[3997] Fix | Delete
/** @type {import('react').MutableRefObject<ReturnType<setTimeout> | undefined>} */
[3998] Fix | Delete
const timerId = (0,external_wp_element_namespaceObject.useRef)();
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function