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: components.js
onChange: onChangeProp,
[46500] Fix | Delete
onFilterValueChange = combobox_control_noop,
[46501] Fix | Delete
hideLabelFromVision,
[46502] Fix | Delete
help,
[46503] Fix | Delete
allowReset = true,
[46504] Fix | Delete
className,
[46505] Fix | Delete
messages = {
[46506] Fix | Delete
selected: (0,external_wp_i18n_namespaceObject.__)('Item selected.')
[46507] Fix | Delete
},
[46508] Fix | Delete
__experimentalRenderItem,
[46509] Fix | Delete
expandOnFocus = true
[46510] Fix | Delete
} = useDeprecated36pxDefaultSizeProp(props);
[46511] Fix | Delete
const [value, setValue] = useControlledValue({
[46512] Fix | Delete
value: valueProp,
[46513] Fix | Delete
onChange: onChangeProp
[46514] Fix | Delete
});
[46515] Fix | Delete
const currentOption = options.find(option => option.value === value);
[46516] Fix | Delete
const currentLabel = (_currentOption$label = currentOption?.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : '';
[46517] Fix | Delete
// Use a custom prefix when generating the `instanceId` to avoid having
[46518] Fix | Delete
// duplicate input IDs when rendering this component and `FormTokenField`
[46519] Fix | Delete
// in the same page (see https://github.com/WordPress/gutenberg/issues/42112).
[46520] Fix | Delete
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ComboboxControl, 'combobox-control');
[46521] Fix | Delete
const [selectedSuggestion, setSelectedSuggestion] = (0,external_wp_element_namespaceObject.useState)(currentOption || null);
[46522] Fix | Delete
const [isExpanded, setIsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
[46523] Fix | Delete
const [inputHasFocus, setInputHasFocus] = (0,external_wp_element_namespaceObject.useState)(false);
[46524] Fix | Delete
const [inputValue, setInputValue] = (0,external_wp_element_namespaceObject.useState)('');
[46525] Fix | Delete
const inputContainer = (0,external_wp_element_namespaceObject.useRef)(null);
[46526] Fix | Delete
const matchingSuggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
[46527] Fix | Delete
const startsWithMatch = [];
[46528] Fix | Delete
const containsMatch = [];
[46529] Fix | Delete
const match = normalizeTextString(inputValue);
[46530] Fix | Delete
options.forEach(option => {
[46531] Fix | Delete
const index = normalizeTextString(option.label).indexOf(match);
[46532] Fix | Delete
if (index === 0) {
[46533] Fix | Delete
startsWithMatch.push(option);
[46534] Fix | Delete
} else if (index > 0) {
[46535] Fix | Delete
containsMatch.push(option);
[46536] Fix | Delete
}
[46537] Fix | Delete
});
[46538] Fix | Delete
return startsWithMatch.concat(containsMatch);
[46539] Fix | Delete
}, [inputValue, options]);
[46540] Fix | Delete
const onSuggestionSelected = newSelectedSuggestion => {
[46541] Fix | Delete
if (newSelectedSuggestion.disabled) {
[46542] Fix | Delete
return;
[46543] Fix | Delete
}
[46544] Fix | Delete
setValue(newSelectedSuggestion.value);
[46545] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(messages.selected, 'assertive');
[46546] Fix | Delete
setSelectedSuggestion(newSelectedSuggestion);
[46547] Fix | Delete
setInputValue('');
[46548] Fix | Delete
setIsExpanded(false);
[46549] Fix | Delete
};
[46550] Fix | Delete
const handleArrowNavigation = (offset = 1) => {
[46551] Fix | Delete
const index = getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions);
[46552] Fix | Delete
let nextIndex = index + offset;
[46553] Fix | Delete
if (nextIndex < 0) {
[46554] Fix | Delete
nextIndex = matchingSuggestions.length - 1;
[46555] Fix | Delete
} else if (nextIndex >= matchingSuggestions.length) {
[46556] Fix | Delete
nextIndex = 0;
[46557] Fix | Delete
}
[46558] Fix | Delete
setSelectedSuggestion(matchingSuggestions[nextIndex]);
[46559] Fix | Delete
setIsExpanded(true);
[46560] Fix | Delete
};
[46561] Fix | Delete
const onKeyDown = withIgnoreIMEEvents(event => {
[46562] Fix | Delete
let preventDefault = false;
[46563] Fix | Delete
if (event.defaultPrevented) {
[46564] Fix | Delete
return;
[46565] Fix | Delete
}
[46566] Fix | Delete
switch (event.code) {
[46567] Fix | Delete
case 'Enter':
[46568] Fix | Delete
if (selectedSuggestion) {
[46569] Fix | Delete
onSuggestionSelected(selectedSuggestion);
[46570] Fix | Delete
preventDefault = true;
[46571] Fix | Delete
}
[46572] Fix | Delete
break;
[46573] Fix | Delete
case 'ArrowUp':
[46574] Fix | Delete
handleArrowNavigation(-1);
[46575] Fix | Delete
preventDefault = true;
[46576] Fix | Delete
break;
[46577] Fix | Delete
case 'ArrowDown':
[46578] Fix | Delete
handleArrowNavigation(1);
[46579] Fix | Delete
preventDefault = true;
[46580] Fix | Delete
break;
[46581] Fix | Delete
case 'Escape':
[46582] Fix | Delete
setIsExpanded(false);
[46583] Fix | Delete
setSelectedSuggestion(null);
[46584] Fix | Delete
preventDefault = true;
[46585] Fix | Delete
break;
[46586] Fix | Delete
default:
[46587] Fix | Delete
break;
[46588] Fix | Delete
}
[46589] Fix | Delete
if (preventDefault) {
[46590] Fix | Delete
event.preventDefault();
[46591] Fix | Delete
}
[46592] Fix | Delete
});
[46593] Fix | Delete
const onBlur = () => {
[46594] Fix | Delete
setInputHasFocus(false);
[46595] Fix | Delete
};
[46596] Fix | Delete
const onFocus = () => {
[46597] Fix | Delete
setInputHasFocus(true);
[46598] Fix | Delete
if (expandOnFocus) {
[46599] Fix | Delete
setIsExpanded(true);
[46600] Fix | Delete
}
[46601] Fix | Delete
onFilterValueChange('');
[46602] Fix | Delete
setInputValue('');
[46603] Fix | Delete
};
[46604] Fix | Delete
const onClick = () => {
[46605] Fix | Delete
setIsExpanded(true);
[46606] Fix | Delete
};
[46607] Fix | Delete
const onFocusOutside = () => {
[46608] Fix | Delete
setIsExpanded(false);
[46609] Fix | Delete
};
[46610] Fix | Delete
const onInputChange = event => {
[46611] Fix | Delete
const text = event.value;
[46612] Fix | Delete
setInputValue(text);
[46613] Fix | Delete
onFilterValueChange(text);
[46614] Fix | Delete
if (inputHasFocus) {
[46615] Fix | Delete
setIsExpanded(true);
[46616] Fix | Delete
}
[46617] Fix | Delete
};
[46618] Fix | Delete
const handleOnReset = () => {
[46619] Fix | Delete
setValue(null);
[46620] Fix | Delete
inputContainer.current?.focus();
[46621] Fix | Delete
};
[46622] Fix | Delete
[46623] Fix | Delete
// Update current selections when the filter input changes.
[46624] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[46625] Fix | Delete
const hasMatchingSuggestions = matchingSuggestions.length > 0;
[46626] Fix | Delete
const hasSelectedMatchingSuggestions = getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions) > 0;
[46627] Fix | Delete
if (hasMatchingSuggestions && !hasSelectedMatchingSuggestions) {
[46628] Fix | Delete
// If the current selection isn't present in the list of suggestions, then automatically select the first item from the list of suggestions.
[46629] Fix | Delete
setSelectedSuggestion(matchingSuggestions[0]);
[46630] Fix | Delete
}
[46631] Fix | Delete
}, [matchingSuggestions, selectedSuggestion]);
[46632] Fix | Delete
[46633] Fix | Delete
// Announcements.
[46634] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[46635] Fix | Delete
const hasMatchingSuggestions = matchingSuggestions.length > 0;
[46636] Fix | Delete
if (isExpanded) {
[46637] Fix | Delete
const message = hasMatchingSuggestions ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */
[46638] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : (0,external_wp_i18n_namespaceObject.__)('No results.');
[46639] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(message, 'polite');
[46640] Fix | Delete
}
[46641] Fix | Delete
}, [matchingSuggestions, isExpanded]);
[46642] Fix | Delete
[46643] Fix | Delete
// Disable reason: There is no appropriate role which describes the
[46644] Fix | Delete
// input container intended accessible usability.
[46645] Fix | Delete
// TODO: Refactor click detection to use blur to stop propagation.
[46646] Fix | Delete
/* eslint-disable jsx-a11y/no-static-element-interactions */
[46647] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DetectOutside, {
[46648] Fix | Delete
onFocusOutside: onFocusOutside,
[46649] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control, {
[46650] Fix | Delete
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
[46651] Fix | Delete
className: dist_clsx(className, 'components-combobox-control'),
[46652] Fix | Delete
label: label,
[46653] Fix | Delete
id: `components-form-token-input-${instanceId}`,
[46654] Fix | Delete
hideLabelFromVision: hideLabelFromVision,
[46655] Fix | Delete
help: help,
[46656] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[46657] Fix | Delete
className: "components-combobox-control__suggestions-container",
[46658] Fix | Delete
tabIndex: -1,
[46659] Fix | Delete
onKeyDown: onKeyDown,
[46660] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapperFlex, {
[46661] Fix | Delete
__next40pxDefaultSize: __next40pxDefaultSize,
[46662] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component, {
[46663] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(token_input, {
[46664] Fix | Delete
className: "components-combobox-control__input",
[46665] Fix | Delete
instanceId: instanceId,
[46666] Fix | Delete
ref: inputContainer,
[46667] Fix | Delete
value: isExpanded ? inputValue : currentLabel,
[46668] Fix | Delete
onFocus: onFocus,
[46669] Fix | Delete
onBlur: onBlur,
[46670] Fix | Delete
onClick: onClick,
[46671] Fix | Delete
isExpanded: isExpanded,
[46672] Fix | Delete
selectedSuggestionIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions),
[46673] Fix | Delete
onChange: onInputChange
[46674] Fix | Delete
})
[46675] Fix | Delete
}), allowReset && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component, {
[46676] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, {
[46677] Fix | Delete
className: "components-combobox-control__reset",
[46678] Fix | Delete
icon: close_small,
[46679] Fix | Delete
disabled: !value,
[46680] Fix | Delete
onClick: handleOnReset,
[46681] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Reset')
[46682] Fix | Delete
})
[46683] Fix | Delete
})]
[46684] Fix | Delete
}), isExpanded && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(suggestions_list, {
[46685] Fix | Delete
instanceId: instanceId
[46686] Fix | Delete
// The empty string for `value` here is not actually used, but is
[46687] Fix | Delete
// just a quick way to satisfy the TypeScript requirements of SuggestionsList.
[46688] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/47581/files#r1091089330
[46689] Fix | Delete
,
[46690] Fix | Delete
match: {
[46691] Fix | Delete
label: inputValue,
[46692] Fix | Delete
value: ''
[46693] Fix | Delete
},
[46694] Fix | Delete
displayTransform: suggestion => suggestion.label,
[46695] Fix | Delete
suggestions: matchingSuggestions,
[46696] Fix | Delete
selectedIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions),
[46697] Fix | Delete
onHover: setSelectedSuggestion,
[46698] Fix | Delete
onSelect: onSuggestionSelected,
[46699] Fix | Delete
scrollIntoView: true,
[46700] Fix | Delete
__experimentalRenderItem: __experimentalRenderItem
[46701] Fix | Delete
})]
[46702] Fix | Delete
})
[46703] Fix | Delete
})
[46704] Fix | Delete
});
[46705] Fix | Delete
/* eslint-enable jsx-a11y/no-static-element-interactions */
[46706] Fix | Delete
}
[46707] Fix | Delete
/* harmony default export */ const combobox_control = (ComboboxControl);
[46708] Fix | Delete
[46709] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3X3MDQGM.js
[46710] Fix | Delete
"use client";
[46711] Fix | Delete
[46712] Fix | Delete
// src/group/group-label-context.ts
[46713] Fix | Delete
[46714] Fix | Delete
var GroupLabelContext = (0,external_React_.createContext)(void 0);
[46715] Fix | Delete
[46716] Fix | Delete
[46717] Fix | Delete
[46718] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/R2QZ3KXH.js
[46719] Fix | Delete
"use client";
[46720] Fix | Delete
[46721] Fix | Delete
[46722] Fix | Delete
[46723] Fix | Delete
[46724] Fix | Delete
[46725] Fix | Delete
// src/group/group.tsx
[46726] Fix | Delete
[46727] Fix | Delete
[46728] Fix | Delete
var useGroup = createHook((props) => {
[46729] Fix | Delete
const [labelId, setLabelId] = (0,external_React_.useState)();
[46730] Fix | Delete
props = useWrapElement(
[46731] Fix | Delete
props,
[46732] Fix | Delete
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupLabelContext.Provider, { value: setLabelId, children: element }),
[46733] Fix | Delete
[]
[46734] Fix | Delete
);
[46735] Fix | Delete
props = _4R3V3JGP_spreadValues({
[46736] Fix | Delete
role: "group",
[46737] Fix | Delete
"aria-labelledby": labelId
[46738] Fix | Delete
}, props);
[46739] Fix | Delete
return props;
[46740] Fix | Delete
});
[46741] Fix | Delete
var Group = createComponent((props) => {
[46742] Fix | Delete
const htmlProps = useGroup(props);
[46743] Fix | Delete
return _3ORBWXWF_createElement("div", htmlProps);
[46744] Fix | Delete
});
[46745] Fix | Delete
if (false) {}
[46746] Fix | Delete
[46747] Fix | Delete
[46748] Fix | Delete
[46749] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/636A7WVS.js
[46750] Fix | Delete
"use client";
[46751] Fix | Delete
[46752] Fix | Delete
[46753] Fix | Delete
[46754] Fix | Delete
[46755] Fix | Delete
// src/composite/composite-group.ts
[46756] Fix | Delete
var useCompositeGroup = createHook(
[46757] Fix | Delete
(_a) => {
[46758] Fix | Delete
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
[46759] Fix | Delete
props = useGroup(props);
[46760] Fix | Delete
return props;
[46761] Fix | Delete
}
[46762] Fix | Delete
);
[46763] Fix | Delete
var CompositeGroup = createComponent(
[46764] Fix | Delete
(props) => {
[46765] Fix | Delete
const htmlProps = useCompositeGroup(props);
[46766] Fix | Delete
return _3ORBWXWF_createElement("div", htmlProps);
[46767] Fix | Delete
}
[46768] Fix | Delete
);
[46769] Fix | Delete
if (false) {}
[46770] Fix | Delete
[46771] Fix | Delete
[46772] Fix | Delete
[46773] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/legacy/index.js
[46774] Fix | Delete
/**
[46775] Fix | Delete
* Composite is a component that may contain navigable items represented by
[46776] Fix | Delete
* CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements
[46777] Fix | Delete
* all the keyboard navigation mechanisms to ensure that there's only one
[46778] Fix | Delete
* tab stop for the whole Composite element. This means that it can behave as
[46779] Fix | Delete
* a roving tabindex or aria-activedescendant container.
[46780] Fix | Delete
*
[46781] Fix | Delete
* @see https://ariakit.org/components/composite
[46782] Fix | Delete
*/
[46783] Fix | Delete
[46784] Fix | Delete
/**
[46785] Fix | Delete
* WordPress dependencies
[46786] Fix | Delete
*/
[46787] Fix | Delete
[46788] Fix | Delete
[46789] Fix | Delete
/**
[46790] Fix | Delete
* Internal dependencies
[46791] Fix | Delete
*/
[46792] Fix | Delete
[46793] Fix | Delete
[46794] Fix | Delete
[46795] Fix | Delete
// Legacy composite components can either provide state through a
[46796] Fix | Delete
// single `state` prop, or via individual props, usually through
[46797] Fix | Delete
// spreading the state generated by `useCompositeState`.
[46798] Fix | Delete
// That is, `<Composite* { ...state }>`.
[46799] Fix | Delete
[46800] Fix | Delete
function mapLegacyStatePropsToComponentProps(legacyProps) {
[46801] Fix | Delete
// If a `state` prop is provided, we unpack that; otherwise,
[46802] Fix | Delete
// the necessary props are provided directly in `legacyProps`.
[46803] Fix | Delete
if (legacyProps.state) {
[46804] Fix | Delete
const {
[46805] Fix | Delete
state,
[46806] Fix | Delete
...rest
[46807] Fix | Delete
} = legacyProps;
[46808] Fix | Delete
const {
[46809] Fix | Delete
store,
[46810] Fix | Delete
...props
[46811] Fix | Delete
} = mapLegacyStatePropsToComponentProps(state);
[46812] Fix | Delete
return {
[46813] Fix | Delete
...rest,
[46814] Fix | Delete
...props,
[46815] Fix | Delete
store
[46816] Fix | Delete
};
[46817] Fix | Delete
}
[46818] Fix | Delete
return legacyProps;
[46819] Fix | Delete
}
[46820] Fix | Delete
function proxyComposite(ProxiedComponent, propMap = {}) {
[46821] Fix | Delete
const displayName = ProxiedComponent.displayName;
[46822] Fix | Delete
const Component = legacyProps => {
[46823] Fix | Delete
const {
[46824] Fix | Delete
store,
[46825] Fix | Delete
...rest
[46826] Fix | Delete
} = mapLegacyStatePropsToComponentProps(legacyProps);
[46827] Fix | Delete
const props = rest;
[46828] Fix | Delete
props.id = (0,external_wp_compose_namespaceObject.useInstanceId)(store, props.baseId, props.id);
[46829] Fix | Delete
Object.entries(propMap).forEach(([from, to]) => {
[46830] Fix | Delete
if (props.hasOwnProperty(from)) {
[46831] Fix | Delete
Object.assign(props, {
[46832] Fix | Delete
[to]: props[from]
[46833] Fix | Delete
});
[46834] Fix | Delete
delete props[from];
[46835] Fix | Delete
}
[46836] Fix | Delete
});
[46837] Fix | Delete
delete props.baseId;
[46838] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ProxiedComponent, {
[46839] Fix | Delete
...props,
[46840] Fix | Delete
store: store
[46841] Fix | Delete
});
[46842] Fix | Delete
};
[46843] Fix | Delete
Component.displayName = displayName;
[46844] Fix | Delete
return Component;
[46845] Fix | Delete
}
[46846] Fix | Delete
[46847] Fix | Delete
// The old `CompositeGroup` used to behave more like the current
[46848] Fix | Delete
// `CompositeRow`, but this has been split into two different
[46849] Fix | Delete
// components. We handle that difference by checking on the
[46850] Fix | Delete
// provided role, and returning the appropriate component.
[46851] Fix | Delete
const unproxiedCompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(({
[46852] Fix | Delete
role,
[46853] Fix | Delete
...props
[46854] Fix | Delete
}, ref) => {
[46855] Fix | Delete
const Component = role === 'row' ? CompositeRow : CompositeGroup;
[46856] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
[46857] Fix | Delete
ref: ref,
[46858] Fix | Delete
role: role,
[46859] Fix | Delete
...props
[46860] Fix | Delete
});
[46861] Fix | Delete
});
[46862] Fix | Delete
unproxiedCompositeGroup.displayName = 'CompositeGroup';
[46863] Fix | Delete
const legacy_Composite = proxyComposite(Composite, {
[46864] Fix | Delete
baseId: 'id'
[46865] Fix | Delete
});
[46866] Fix | Delete
const legacy_CompositeGroup = proxyComposite(unproxiedCompositeGroup);
[46867] Fix | Delete
const legacy_CompositeItem = proxyComposite(CompositeItem, {
[46868] Fix | Delete
focusable: 'accessibleWhenDisabled'
[46869] Fix | Delete
});
[46870] Fix | Delete
function useCompositeState(legacyStateOptions = {}) {
[46871] Fix | Delete
const {
[46872] Fix | Delete
baseId,
[46873] Fix | Delete
currentId: defaultActiveId,
[46874] Fix | Delete
orientation,
[46875] Fix | Delete
rtl = false,
[46876] Fix | Delete
loop: focusLoop = false,
[46877] Fix | Delete
wrap: focusWrap = false,
[46878] Fix | Delete
shift: focusShift = false,
[46879] Fix | Delete
// eslint-disable-next-line camelcase
[46880] Fix | Delete
unstable_virtual: virtualFocus
[46881] Fix | Delete
} = legacyStateOptions;
[46882] Fix | Delete
return {
[46883] Fix | Delete
baseId: (0,external_wp_compose_namespaceObject.useInstanceId)(legacy_Composite, 'composite', baseId),
[46884] Fix | Delete
store: useCompositeStore({
[46885] Fix | Delete
defaultActiveId,
[46886] Fix | Delete
rtl,
[46887] Fix | Delete
orientation,
[46888] Fix | Delete
focusLoop,
[46889] Fix | Delete
focusShift,
[46890] Fix | Delete
focusWrap,
[46891] Fix | Delete
virtualFocus
[46892] Fix | Delete
})
[46893] Fix | Delete
};
[46894] Fix | Delete
}
[46895] Fix | Delete
[46896] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/aria-helper.js
[46897] Fix | Delete
const LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']);
[46898] Fix | Delete
const hiddenElementsByDepth = [];
[46899] Fix | Delete
[46900] Fix | Delete
/**
[46901] Fix | Delete
* Hides all elements in the body element from screen-readers except
[46902] Fix | Delete
* the provided element and elements that should not be hidden from
[46903] Fix | Delete
* screen-readers.
[46904] Fix | Delete
*
[46905] Fix | Delete
* The reason we do this is because `aria-modal="true"` currently is bugged
[46906] Fix | Delete
* in Safari, and support is spotty in other browsers overall. In the future
[46907] Fix | Delete
* we should consider removing these helper functions in favor of
[46908] Fix | Delete
* `aria-modal="true"`.
[46909] Fix | Delete
*
[46910] Fix | Delete
* @param modalElement The element that should not be hidden.
[46911] Fix | Delete
*/
[46912] Fix | Delete
function modalize(modalElement) {
[46913] Fix | Delete
const elements = Array.from(document.body.children);
[46914] Fix | Delete
const hiddenElements = [];
[46915] Fix | Delete
hiddenElementsByDepth.push(hiddenElements);
[46916] Fix | Delete
for (const element of elements) {
[46917] Fix | Delete
if (element === modalElement) {
[46918] Fix | Delete
continue;
[46919] Fix | Delete
}
[46920] Fix | Delete
if (elementShouldBeHidden(element)) {
[46921] Fix | Delete
element.setAttribute('aria-hidden', 'true');
[46922] Fix | Delete
hiddenElements.push(element);
[46923] Fix | Delete
}
[46924] Fix | Delete
}
[46925] Fix | Delete
}
[46926] Fix | Delete
[46927] Fix | Delete
/**
[46928] Fix | Delete
* Determines if the passed element should not be hidden from screen readers.
[46929] Fix | Delete
*
[46930] Fix | Delete
* @param element The element that should be checked.
[46931] Fix | Delete
*
[46932] Fix | Delete
* @return Whether the element should not be hidden from screen-readers.
[46933] Fix | Delete
*/
[46934] Fix | Delete
function elementShouldBeHidden(element) {
[46935] Fix | Delete
const role = element.getAttribute('role');
[46936] Fix | Delete
return !(element.tagName === 'SCRIPT' || element.hasAttribute('aria-hidden') || element.hasAttribute('aria-live') || role && LIVE_REGION_ARIA_ROLES.has(role));
[46937] Fix | Delete
}
[46938] Fix | Delete
[46939] Fix | Delete
/**
[46940] Fix | Delete
* Accessibly reveals the elements hidden by the latest modal.
[46941] Fix | Delete
*/
[46942] Fix | Delete
function unmodalize() {
[46943] Fix | Delete
const hiddenElements = hiddenElementsByDepth.pop();
[46944] Fix | Delete
if (!hiddenElements) {
[46945] Fix | Delete
return;
[46946] Fix | Delete
}
[46947] Fix | Delete
for (const element of hiddenElements) {
[46948] Fix | Delete
element.removeAttribute('aria-hidden');
[46949] Fix | Delete
}
[46950] Fix | Delete
}
[46951] Fix | Delete
[46952] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/index.js
[46953] Fix | Delete
/**
[46954] Fix | Delete
* External dependencies
[46955] Fix | Delete
*/
[46956] Fix | Delete
[46957] Fix | Delete
/**
[46958] Fix | Delete
* WordPress dependencies
[46959] Fix | Delete
*/
[46960] Fix | Delete
[46961] Fix | Delete
[46962] Fix | Delete
[46963] Fix | Delete
[46964] Fix | Delete
[46965] Fix | Delete
[46966] Fix | Delete
/**
[46967] Fix | Delete
* Internal dependencies
[46968] Fix | Delete
*/
[46969] Fix | Delete
[46970] Fix | Delete
[46971] Fix | Delete
[46972] Fix | Delete
[46973] Fix | Delete
[46974] Fix | Delete
// Used to track and dismiss the prior modal when another opens unless nested.
[46975] Fix | Delete
[46976] Fix | Delete
[46977] Fix | Delete
const ModalContext = (0,external_wp_element_namespaceObject.createContext)([]);
[46978] Fix | Delete
[46979] Fix | Delete
// Used to track body class names applied while modals are open.
[46980] Fix | Delete
const bodyOpenClasses = new Map();
[46981] Fix | Delete
function UnforwardedModal(props, forwardedRef) {
[46982] Fix | Delete
const {
[46983] Fix | Delete
bodyOpenClassName = 'modal-open',
[46984] Fix | Delete
role = 'dialog',
[46985] Fix | Delete
title = null,
[46986] Fix | Delete
focusOnMount = true,
[46987] Fix | Delete
shouldCloseOnEsc = true,
[46988] Fix | Delete
shouldCloseOnClickOutside = true,
[46989] Fix | Delete
isDismissible = true,
[46990] Fix | Delete
/* Accessibility. */
[46991] Fix | Delete
aria = {
[46992] Fix | Delete
labelledby: undefined,
[46993] Fix | Delete
describedby: undefined
[46994] Fix | Delete
},
[46995] Fix | Delete
onRequestClose,
[46996] Fix | Delete
icon,
[46997] Fix | Delete
closeButtonLabel,
[46998] Fix | Delete
children,
[46999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function