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
} : 0)("grid-column:1/-1;border:none;height:", config_values.borderWidth, ";background-color:", props => props.variant === 'toolbar' ? TOOLBAR_VARIANT_BORDER_COLOR : DIVIDER_COLOR, ";margin-block:", space(2), ";margin-inline:", ITEM_PADDING_INLINE, ";outline:2px solid transparent;" + ( true ? "" : 0));
[73000] Fix | Delete
const SubmenuChevronIcon = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_icon, true ? {
[73001] Fix | Delete
target: "e1kdzosf2"
[73002] Fix | Delete
} : 0)("width:", space(1.5), ";", rtl({
[73003] Fix | Delete
transform: `scaleX(1)`
[73004] Fix | Delete
}, {
[73005] Fix | Delete
transform: `scaleX(-1)`
[73006] Fix | Delete
}), ";" + ( true ? "" : 0));
[73007] Fix | Delete
const styles_DropdownMenuItemLabel = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? {
[73008] Fix | Delete
target: "e1kdzosf1"
[73009] Fix | Delete
} : 0)("font-size:", font('default.fontSize'), ";line-height:20px;color:inherit;" + ( true ? "" : 0));
[73010] Fix | Delete
const styles_DropdownMenuItemHelpText = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? {
[73011] Fix | Delete
target: "e1kdzosf0"
[73012] Fix | Delete
} : 0)("font-size:", font('helpText.fontSize'), ";line-height:16px;color:", COLORS.gray['700'], ";[data-active-item]:not( [data-focus-visible] ) *:not( ", dropdown_menu_v2_styles_DropdownMenu, " ) &,[aria-disabled='true'] *:not( ", dropdown_menu_v2_styles_DropdownMenu, " ) &{color:inherit;}" + ( true ? "" : 0));
[73013] Fix | Delete
[73014] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/index.js
[73015] Fix | Delete
/**
[73016] Fix | Delete
* External dependencies
[73017] Fix | Delete
*/
[73018] Fix | Delete
// eslint-disable-next-line no-restricted-imports
[73019] Fix | Delete
[73020] Fix | Delete
[73021] Fix | Delete
/**
[73022] Fix | Delete
* WordPress dependencies
[73023] Fix | Delete
*/
[73024] Fix | Delete
[73025] Fix | Delete
[73026] Fix | Delete
[73027] Fix | Delete
[73028] Fix | Delete
[73029] Fix | Delete
/**
[73030] Fix | Delete
* Internal dependencies
[73031] Fix | Delete
*/
[73032] Fix | Delete
[73033] Fix | Delete
[73034] Fix | Delete
[73035] Fix | Delete
[73036] Fix | Delete
[73037] Fix | Delete
[73038] Fix | Delete
const DropdownMenuContext = (0,external_wp_element_namespaceObject.createContext)(undefined);
[73039] Fix | Delete
const DropdownMenuItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItem({
[73040] Fix | Delete
prefix,
[73041] Fix | Delete
suffix,
[73042] Fix | Delete
children,
[73043] Fix | Delete
hideOnClick = true,
[73044] Fix | Delete
...props
[73045] Fix | Delete
}, ref) {
[73046] Fix | Delete
const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext);
[73047] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_DropdownMenuItem, {
[73048] Fix | Delete
ref: ref,
[73049] Fix | Delete
...props,
[73050] Fix | Delete
accessibleWhenDisabled: true,
[73051] Fix | Delete
hideOnClick: hideOnClick,
[73052] Fix | Delete
store: dropdownMenuContext?.store,
[73053] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {
[73054] Fix | Delete
children: prefix
[73055] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuItemContentWrapper, {
[73056] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemChildrenWrapper, {
[73057] Fix | Delete
children: children
[73058] Fix | Delete
}), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
[73059] Fix | Delete
children: suffix
[73060] Fix | Delete
})]
[73061] Fix | Delete
})]
[73062] Fix | Delete
});
[73063] Fix | Delete
});
[73064] Fix | Delete
const DropdownMenuCheckboxItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuCheckboxItem({
[73065] Fix | Delete
suffix,
[73066] Fix | Delete
children,
[73067] Fix | Delete
hideOnClick = false,
[73068] Fix | Delete
...props
[73069] Fix | Delete
}, ref) {
[73070] Fix | Delete
const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext);
[73071] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_DropdownMenuCheckboxItem, {
[73072] Fix | Delete
ref: ref,
[73073] Fix | Delete
...props,
[73074] Fix | Delete
accessibleWhenDisabled: true,
[73075] Fix | Delete
hideOnClick: hideOnClick,
[73076] Fix | Delete
store: dropdownMenuContext?.store,
[73077] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, {
[73078] Fix | Delete
store: dropdownMenuContext?.store,
[73079] Fix | Delete
render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {})
[73080] Fix | Delete
// Override some ariakit inline styles
[73081] Fix | Delete
,
[73082] Fix | Delete
style: {
[73083] Fix | Delete
width: 'auto',
[73084] Fix | Delete
height: 'auto'
[73085] Fix | Delete
},
[73086] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[73087] Fix | Delete
icon: library_check,
[73088] Fix | Delete
size: 24
[73089] Fix | Delete
})
[73090] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuItemContentWrapper, {
[73091] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemChildrenWrapper, {
[73092] Fix | Delete
children: children
[73093] Fix | Delete
}), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
[73094] Fix | Delete
children: suffix
[73095] Fix | Delete
})]
[73096] Fix | Delete
})]
[73097] Fix | Delete
});
[73098] Fix | Delete
});
[73099] Fix | Delete
const radioCheck = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[73100] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[73101] Fix | Delete
viewBox: "0 0 24 24",
[73102] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, {
[73103] Fix | Delete
cx: 12,
[73104] Fix | Delete
cy: 12,
[73105] Fix | Delete
r: 3
[73106] Fix | Delete
})
[73107] Fix | Delete
});
[73108] Fix | Delete
const DropdownMenuRadioItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuRadioItem({
[73109] Fix | Delete
suffix,
[73110] Fix | Delete
children,
[73111] Fix | Delete
hideOnClick = false,
[73112] Fix | Delete
...props
[73113] Fix | Delete
}, ref) {
[73114] Fix | Delete
const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext);
[73115] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_DropdownMenuRadioItem, {
[73116] Fix | Delete
ref: ref,
[73117] Fix | Delete
...props,
[73118] Fix | Delete
accessibleWhenDisabled: true,
[73119] Fix | Delete
hideOnClick: hideOnClick,
[73120] Fix | Delete
store: dropdownMenuContext?.store,
[73121] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, {
[73122] Fix | Delete
store: dropdownMenuContext?.store,
[73123] Fix | Delete
render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {})
[73124] Fix | Delete
// Override some ariakit inline styles
[73125] Fix | Delete
,
[73126] Fix | Delete
style: {
[73127] Fix | Delete
width: 'auto',
[73128] Fix | Delete
height: 'auto'
[73129] Fix | Delete
},
[73130] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[73131] Fix | Delete
icon: radioCheck,
[73132] Fix | Delete
size: 24
[73133] Fix | Delete
})
[73134] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuItemContentWrapper, {
[73135] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemChildrenWrapper, {
[73136] Fix | Delete
children: children
[73137] Fix | Delete
}), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
[73138] Fix | Delete
children: suffix
[73139] Fix | Delete
})]
[73140] Fix | Delete
})]
[73141] Fix | Delete
});
[73142] Fix | Delete
});
[73143] Fix | Delete
const DropdownMenuGroup = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuGroup(props, ref) {
[73144] Fix | Delete
const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext);
[73145] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuGroup, {
[73146] Fix | Delete
ref: ref,
[73147] Fix | Delete
...props,
[73148] Fix | Delete
store: dropdownMenuContext?.store
[73149] Fix | Delete
});
[73150] Fix | Delete
});
[73151] Fix | Delete
const dropdown_menu_v2_UnconnectedDropdownMenu = (props, ref) => {
[73152] Fix | Delete
var _props$placement;
[73153] Fix | Delete
const {
[73154] Fix | Delete
// Store props
[73155] Fix | Delete
open,
[73156] Fix | Delete
defaultOpen = false,
[73157] Fix | Delete
onOpenChange,
[73158] Fix | Delete
placement,
[73159] Fix | Delete
// Menu trigger props
[73160] Fix | Delete
trigger,
[73161] Fix | Delete
// Menu props
[73162] Fix | Delete
gutter,
[73163] Fix | Delete
children,
[73164] Fix | Delete
shift,
[73165] Fix | Delete
modal = true,
[73166] Fix | Delete
// From internal components context
[73167] Fix | Delete
variant,
[73168] Fix | Delete
// Rest
[73169] Fix | Delete
...otherProps
[73170] Fix | Delete
} = useContextSystem(props, 'DropdownMenu');
[73171] Fix | Delete
const parentContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext);
[73172] Fix | Delete
const computedDirection = (0,external_wp_i18n_namespaceObject.isRTL)() ? 'rtl' : 'ltr';
[73173] Fix | Delete
[73174] Fix | Delete
// If an explicit value for the `placement` prop is not passed,
[73175] Fix | Delete
// apply a default placement of `bottom-start` for the root dropdown,
[73176] Fix | Delete
// and of `right-start` for nested dropdowns.
[73177] Fix | Delete
let computedPlacement = (_props$placement = props.placement) !== null && _props$placement !== void 0 ? _props$placement : parentContext?.store ? 'right-start' : 'bottom-start';
[73178] Fix | Delete
// Swap left/right in case of RTL direction
[73179] Fix | Delete
if (computedDirection === 'rtl') {
[73180] Fix | Delete
if (/right/.test(computedPlacement)) {
[73181] Fix | Delete
computedPlacement = computedPlacement.replace('right', 'left');
[73182] Fix | Delete
} else if (/left/.test(computedPlacement)) {
[73183] Fix | Delete
computedPlacement = computedPlacement.replace('left', 'right');
[73184] Fix | Delete
}
[73185] Fix | Delete
}
[73186] Fix | Delete
const dropdownMenuStore = useMenuStore({
[73187] Fix | Delete
parent: parentContext?.store,
[73188] Fix | Delete
open,
[73189] Fix | Delete
defaultOpen,
[73190] Fix | Delete
placement: computedPlacement,
[73191] Fix | Delete
focusLoop: true,
[73192] Fix | Delete
setOpen(willBeOpen) {
[73193] Fix | Delete
onOpenChange?.(willBeOpen);
[73194] Fix | Delete
},
[73195] Fix | Delete
rtl: computedDirection === 'rtl'
[73196] Fix | Delete
});
[73197] Fix | Delete
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[73198] Fix | Delete
store: dropdownMenuStore,
[73199] Fix | Delete
variant
[73200] Fix | Delete
}), [dropdownMenuStore, variant]);
[73201] Fix | Delete
[73202] Fix | Delete
// Extract the side from the applied placement — useful for animations.
[73203] Fix | Delete
const appliedPlacementSide = dropdownMenuStore.useState('placement').split('-')[0];
[73204] Fix | Delete
if (dropdownMenuStore.parent && !((0,external_wp_element_namespaceObject.isValidElement)(trigger) && DropdownMenuItem === trigger.type)) {
[73205] Fix | Delete
// eslint-disable-next-line no-console
[73206] Fix | Delete
console.warn('For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.');
[73207] Fix | Delete
}
[73208] Fix | Delete
const hideOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => {
[73209] Fix | Delete
// Pressing Escape can cause unexpected consequences (ie. exiting
[73210] Fix | Delete
// full screen mode on MacOs, close parent modals...).
[73211] Fix | Delete
event.preventDefault();
[73212] Fix | Delete
// Returning `true` causes the menu to hide.
[73213] Fix | Delete
return true;
[73214] Fix | Delete
}, []);
[73215] Fix | Delete
const wrapperProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[73216] Fix | Delete
dir: computedDirection,
[73217] Fix | Delete
style: {
[73218] Fix | Delete
direction: computedDirection
[73219] Fix | Delete
}
[73220] Fix | Delete
}), [computedDirection]);
[73221] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[73222] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, {
[73223] Fix | Delete
ref: ref,
[73224] Fix | Delete
store: dropdownMenuStore,
[73225] Fix | Delete
render: dropdownMenuStore.parent ? (0,external_wp_element_namespaceObject.cloneElement)(trigger, {
[73226] Fix | Delete
// Add submenu arrow, unless a `suffix` is explicitly specified
[73227] Fix | Delete
suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[73228] Fix | Delete
children: [trigger.props.suffix, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SubmenuChevronIcon, {
[73229] Fix | Delete
"aria-hidden": "true",
[73230] Fix | Delete
icon: chevron_right_small,
[73231] Fix | Delete
size: 24,
[73232] Fix | Delete
preserveAspectRatio: "xMidYMid slice"
[73233] Fix | Delete
})]
[73234] Fix | Delete
})
[73235] Fix | Delete
}) : trigger
[73236] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_v2_styles_DropdownMenu, {
[73237] Fix | Delete
...otherProps,
[73238] Fix | Delete
modal: modal,
[73239] Fix | Delete
store: dropdownMenuStore
[73240] Fix | Delete
// Root menu has an 8px distance from its trigger,
[73241] Fix | Delete
// otherwise 0 (which causes the submenu to slightly overlap)
[73242] Fix | Delete
,
[73243] Fix | Delete
gutter: gutter !== null && gutter !== void 0 ? gutter : dropdownMenuStore.parent ? 0 : 8
[73244] Fix | Delete
// Align nested menu by the same (but opposite) amount
[73245] Fix | Delete
// as the menu container's padding.
[73246] Fix | Delete
,
[73247] Fix | Delete
shift: shift !== null && shift !== void 0 ? shift : dropdownMenuStore.parent ? -4 : 0,
[73248] Fix | Delete
hideOnHoverOutside: false,
[73249] Fix | Delete
"data-side": appliedPlacementSide,
[73250] Fix | Delete
variant: variant,
[73251] Fix | Delete
wrapperProps: wrapperProps,
[73252] Fix | Delete
hideOnEscape: hideOnEscape,
[73253] Fix | Delete
unmountOnHide: true,
[73254] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuContext.Provider, {
[73255] Fix | Delete
value: contextValue,
[73256] Fix | Delete
children: children
[73257] Fix | Delete
})
[73258] Fix | Delete
})]
[73259] Fix | Delete
});
[73260] Fix | Delete
};
[73261] Fix | Delete
const dropdown_menu_v2_DropdownMenu = contextConnect(dropdown_menu_v2_UnconnectedDropdownMenu, 'DropdownMenu');
[73262] Fix | Delete
const DropdownMenuSeparator = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuSeparator(props, ref) {
[73263] Fix | Delete
const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext);
[73264] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuSeparator, {
[73265] Fix | Delete
ref: ref,
[73266] Fix | Delete
...props,
[73267] Fix | Delete
store: dropdownMenuContext?.store,
[73268] Fix | Delete
variant: dropdownMenuContext?.variant
[73269] Fix | Delete
});
[73270] Fix | Delete
});
[73271] Fix | Delete
const DropdownMenuItemLabel = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItemLabel(props, ref) {
[73272] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuItemLabel, {
[73273] Fix | Delete
numberOfLines: 1,
[73274] Fix | Delete
ref: ref,
[73275] Fix | Delete
...props
[73276] Fix | Delete
});
[73277] Fix | Delete
});
[73278] Fix | Delete
const DropdownMenuItemHelpText = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItemHelpText(props, ref) {
[73279] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuItemHelpText, {
[73280] Fix | Delete
numberOfLines: 2,
[73281] Fix | Delete
ref: ref,
[73282] Fix | Delete
...props
[73283] Fix | Delete
});
[73284] Fix | Delete
});
[73285] Fix | Delete
[73286] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/theme/styles.js
[73287] Fix | Delete
[73288] Fix | Delete
function theme_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
[73289] Fix | Delete
/**
[73290] Fix | Delete
* External dependencies
[73291] Fix | Delete
*/
[73292] Fix | Delete
[73293] Fix | Delete
[73294] Fix | Delete
[73295] Fix | Delete
/**
[73296] Fix | Delete
* Internal dependencies
[73297] Fix | Delete
*/
[73298] Fix | Delete
[73299] Fix | Delete
const colorVariables = ({
[73300] Fix | Delete
colors
[73301] Fix | Delete
}) => {
[73302] Fix | Delete
const shades = Object.entries(colors.gray || {}).map(([k, v]) => `--wp-components-color-gray-${k}: ${v};`).join('');
[73303] Fix | Delete
return [/*#__PURE__*/emotion_react_browser_esm_css("--wp-components-color-accent:", colors.accent, ";--wp-components-color-accent-darker-10:", colors.accentDarker10, ";--wp-components-color-accent-darker-20:", colors.accentDarker20, ";--wp-components-color-accent-inverted:", colors.accentInverted, ";--wp-components-color-background:", colors.background, ";--wp-components-color-foreground:", colors.foreground, ";--wp-components-color-foreground-inverted:", colors.foregroundInverted, ";", shades, ";" + ( true ? "" : 0), true ? "" : 0)];
[73304] Fix | Delete
};
[73305] Fix | Delete
const theme_styles_Wrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
[73306] Fix | Delete
target: "e1krjpvb0"
[73307] Fix | Delete
} : 0)( true ? {
[73308] Fix | Delete
name: "1a3idx0",
[73309] Fix | Delete
styles: "color:var( --wp-components-color-foreground, currentColor )"
[73310] Fix | Delete
} : 0);
[73311] Fix | Delete
[73312] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/theme/color-algorithms.js
[73313] Fix | Delete
/**
[73314] Fix | Delete
* External dependencies
[73315] Fix | Delete
*/
[73316] Fix | Delete
[73317] Fix | Delete
[73318] Fix | Delete
[73319] Fix | Delete
[73320] Fix | Delete
/**
[73321] Fix | Delete
* WordPress dependencies
[73322] Fix | Delete
*/
[73323] Fix | Delete
[73324] Fix | Delete
[73325] Fix | Delete
/**
[73326] Fix | Delete
* Internal dependencies
[73327] Fix | Delete
*/
[73328] Fix | Delete
[73329] Fix | Delete
[73330] Fix | Delete
k([names, a11y]);
[73331] Fix | Delete
function generateThemeVariables(inputs) {
[73332] Fix | Delete
validateInputs(inputs);
[73333] Fix | Delete
const generatedColors = {
[73334] Fix | Delete
...generateAccentDependentColors(inputs.accent),
[73335] Fix | Delete
...generateBackgroundDependentColors(inputs.background)
[73336] Fix | Delete
};
[73337] Fix | Delete
warnContrastIssues(checkContrasts(inputs, generatedColors));
[73338] Fix | Delete
return {
[73339] Fix | Delete
colors: generatedColors
[73340] Fix | Delete
};
[73341] Fix | Delete
}
[73342] Fix | Delete
function validateInputs(inputs) {
[73343] Fix | Delete
for (const [key, value] of Object.entries(inputs)) {
[73344] Fix | Delete
if (typeof value !== 'undefined' && !w(value).isValid()) {
[73345] Fix | Delete
true ? external_wp_warning_default()(`wp.components.Theme: "${value}" is not a valid color value for the '${key}' prop.`) : 0;
[73346] Fix | Delete
}
[73347] Fix | Delete
}
[73348] Fix | Delete
}
[73349] Fix | Delete
function checkContrasts(inputs, outputs) {
[73350] Fix | Delete
const background = inputs.background || COLORS.white;
[73351] Fix | Delete
const accent = inputs.accent || '#3858e9';
[73352] Fix | Delete
const foreground = outputs.foreground || COLORS.gray[900];
[73353] Fix | Delete
const gray = outputs.gray || COLORS.gray;
[73354] Fix | Delete
return {
[73355] Fix | Delete
accent: w(background).isReadable(accent) ? undefined : `The background color ("${background}") does not have sufficient contrast against the accent color ("${accent}").`,
[73356] Fix | Delete
foreground: w(background).isReadable(foreground) ? undefined : `The background color provided ("${background}") does not have sufficient contrast against the standard foreground colors.`,
[73357] Fix | Delete
grays: w(background).contrast(gray[600]) >= 3 && w(background).contrast(gray[700]) >= 4.5 ? undefined : `The background color provided ("${background}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`
[73358] Fix | Delete
};
[73359] Fix | Delete
}
[73360] Fix | Delete
function warnContrastIssues(issues) {
[73361] Fix | Delete
for (const error of Object.values(issues)) {
[73362] Fix | Delete
if (error) {
[73363] Fix | Delete
true ? external_wp_warning_default()('wp.components.Theme: ' + error) : 0;
[73364] Fix | Delete
}
[73365] Fix | Delete
}
[73366] Fix | Delete
}
[73367] Fix | Delete
function generateAccentDependentColors(accent) {
[73368] Fix | Delete
if (!accent) {
[73369] Fix | Delete
return {};
[73370] Fix | Delete
}
[73371] Fix | Delete
return {
[73372] Fix | Delete
accent,
[73373] Fix | Delete
accentDarker10: w(accent).darken(0.1).toHex(),
[73374] Fix | Delete
accentDarker20: w(accent).darken(0.2).toHex(),
[73375] Fix | Delete
accentInverted: getForegroundForColor(accent)
[73376] Fix | Delete
};
[73377] Fix | Delete
}
[73378] Fix | Delete
function generateBackgroundDependentColors(background) {
[73379] Fix | Delete
if (!background) {
[73380] Fix | Delete
return {};
[73381] Fix | Delete
}
[73382] Fix | Delete
const foreground = getForegroundForColor(background);
[73383] Fix | Delete
return {
[73384] Fix | Delete
background,
[73385] Fix | Delete
foreground,
[73386] Fix | Delete
foregroundInverted: getForegroundForColor(foreground),
[73387] Fix | Delete
gray: generateShades(background, foreground)
[73388] Fix | Delete
};
[73389] Fix | Delete
}
[73390] Fix | Delete
function getForegroundForColor(color) {
[73391] Fix | Delete
return w(color).isDark() ? COLORS.white : COLORS.gray[900];
[73392] Fix | Delete
}
[73393] Fix | Delete
function generateShades(background, foreground) {
[73394] Fix | Delete
// How much darkness you need to add to #fff to get the COLORS.gray[n] color
[73395] Fix | Delete
const SHADES = {
[73396] Fix | Delete
100: 0.06,
[73397] Fix | Delete
200: 0.121,
[73398] Fix | Delete
300: 0.132,
[73399] Fix | Delete
400: 0.2,
[73400] Fix | Delete
600: 0.42,
[73401] Fix | Delete
700: 0.543,
[73402] Fix | Delete
800: 0.821
[73403] Fix | Delete
};
[73404] Fix | Delete
[73405] Fix | Delete
// Darkness of COLORS.gray[ 900 ], relative to #fff
[73406] Fix | Delete
const limit = 0.884;
[73407] Fix | Delete
const direction = w(background).isDark() ? 'lighten' : 'darken';
[73408] Fix | Delete
[73409] Fix | Delete
// Lightness delta between the background and foreground colors
[73410] Fix | Delete
const range = Math.abs(w(background).toHsl().l - w(foreground).toHsl().l) / 100;
[73411] Fix | Delete
const result = {};
[73412] Fix | Delete
Object.entries(SHADES).forEach(([key, value]) => {
[73413] Fix | Delete
result[parseInt(key)] = w(background)[direction](value / limit * range).toHex();
[73414] Fix | Delete
});
[73415] Fix | Delete
return result;
[73416] Fix | Delete
}
[73417] Fix | Delete
[73418] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/theme/index.js
[73419] Fix | Delete
/**
[73420] Fix | Delete
* WordPress dependencies
[73421] Fix | Delete
*/
[73422] Fix | Delete
[73423] Fix | Delete
[73424] Fix | Delete
/**
[73425] Fix | Delete
* Internal dependencies
[73426] Fix | Delete
*/
[73427] Fix | Delete
[73428] Fix | Delete
[73429] Fix | Delete
[73430] Fix | Delete
[73431] Fix | Delete
[73432] Fix | Delete
/**
[73433] Fix | Delete
* `Theme` allows defining theme variables for components in the `@wordpress/components` package.
[73434] Fix | Delete
*
[73435] Fix | Delete
* Multiple `Theme` components can be nested in order to override specific theme variables.
[73436] Fix | Delete
*
[73437] Fix | Delete
*
[73438] Fix | Delete
* ```jsx
[73439] Fix | Delete
* const Example = () => {
[73440] Fix | Delete
* return (
[73441] Fix | Delete
* <Theme accent="red">
[73442] Fix | Delete
* <Button variant="primary">I'm red</Button>
[73443] Fix | Delete
* <Theme accent="blue">
[73444] Fix | Delete
* <Button variant="primary">I'm blue</Button>
[73445] Fix | Delete
* </Theme>
[73446] Fix | Delete
* </Theme>
[73447] Fix | Delete
* );
[73448] Fix | Delete
* };
[73449] Fix | Delete
* ```
[73450] Fix | Delete
*/
[73451] Fix | Delete
[73452] Fix | Delete
function Theme({
[73453] Fix | Delete
accent,
[73454] Fix | Delete
background,
[73455] Fix | Delete
className,
[73456] Fix | Delete
...props
[73457] Fix | Delete
}) {
[73458] Fix | Delete
const cx = useCx();
[73459] Fix | Delete
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(...colorVariables(generateThemeVariables({
[73460] Fix | Delete
accent,
[73461] Fix | Delete
background
[73462] Fix | Delete
})), className), [accent, background, className, cx]);
[73463] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(theme_styles_Wrapper, {
[73464] Fix | Delete
className: classes,
[73465] Fix | Delete
...props
[73466] Fix | Delete
});
[73467] Fix | Delete
}
[73468] Fix | Delete
/* harmony default export */ const theme = (Theme);
[73469] Fix | Delete
[73470] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/context.js
[73471] Fix | Delete
/**
[73472] Fix | Delete
* WordPress dependencies
[73473] Fix | Delete
*/
[73474] Fix | Delete
[73475] Fix | Delete
[73476] Fix | Delete
/**
[73477] Fix | Delete
* Internal dependencies
[73478] Fix | Delete
*/
[73479] Fix | Delete
[73480] Fix | Delete
const TabsContext = (0,external_wp_element_namespaceObject.createContext)(undefined);
[73481] Fix | Delete
const useTabsContext = () => (0,external_wp_element_namespaceObject.useContext)(TabsContext);
[73482] Fix | Delete
[73483] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/styles.js
[73484] Fix | Delete
[73485] Fix | Delete
/**
[73486] Fix | Delete
* External dependencies
[73487] Fix | Delete
*/
[73488] Fix | Delete
[73489] Fix | Delete
// eslint-disable-next-line no-restricted-imports
[73490] Fix | Delete
[73491] Fix | Delete
[73492] Fix | Delete
/**
[73493] Fix | Delete
* Internal dependencies
[73494] Fix | Delete
*/
[73495] Fix | Delete
[73496] Fix | Delete
[73497] Fix | Delete
const TabListWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
[73498] Fix | Delete
target: "enfox0g2"
[73499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function