Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
if (activeMenu !== menu) {
[37000] Fix | Delete
return Object(external_wp_element_["createElement"])(NavigationMenuContext.Provider, {
[37001] Fix | Delete
value: context
[37002] Fix | Delete
}, children);
[37003] Fix | Delete
}
[37004] Fix | Delete
[37005] Fix | Delete
var isControlledSearch = !!setControlledSearch;
[37006] Fix | Delete
var search = isControlledSearch ? controlledSearch : uncontrolledSearch;
[37007] Fix | Delete
var onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;
[37008] Fix | Delete
var menuTitleId = "components-navigation__menu-title-".concat(menu);
[37009] Fix | Delete
var classes = classnames_default()('components-navigation__menu', className);
[37010] Fix | Delete
return Object(external_wp_element_["createElement"])(NavigationMenuContext.Provider, {
[37011] Fix | Delete
value: context
[37012] Fix | Delete
}, Object(external_wp_element_["createElement"])(MenuUI, {
[37013] Fix | Delete
className: classes
[37014] Fix | Delete
}, (parentMenu || onBackButtonClick) && Object(external_wp_element_["createElement"])(back_button, {
[37015] Fix | Delete
backButtonLabel: backButtonLabel,
[37016] Fix | Delete
parentMenu: parentMenu,
[37017] Fix | Delete
onClick: onBackButtonClick
[37018] Fix | Delete
}), Object(external_wp_element_["createElement"])(NavigationMenuTitle, {
[37019] Fix | Delete
hasSearch: hasSearch,
[37020] Fix | Delete
onSearch: onSearch,
[37021] Fix | Delete
search: search,
[37022] Fix | Delete
title: title,
[37023] Fix | Delete
titleAction: titleAction
[37024] Fix | Delete
}), Object(external_wp_element_["createElement"])(navigable_container_menu, null, Object(external_wp_element_["createElement"])("ul", {
[37025] Fix | Delete
"aria-labelledby": menuTitleId
[37026] Fix | Delete
}, children, search && !isSearchDebouncing && Object(external_wp_element_["createElement"])(NavigationSearchNoResultsFound, {
[37027] Fix | Delete
search: search
[37028] Fix | Delete
})))));
[37029] Fix | Delete
}
[37030] Fix | Delete
[37031] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/index.js
[37032] Fix | Delete
[37033] Fix | Delete
[37034] Fix | Delete
/**
[37035] Fix | Delete
* External dependencies
[37036] Fix | Delete
*/
[37037] Fix | Delete
[37038] Fix | Delete
[37039] Fix | Delete
/**
[37040] Fix | Delete
* WordPress dependencies
[37041] Fix | Delete
*/
[37042] Fix | Delete
[37043] Fix | Delete
[37044] Fix | Delete
[37045] Fix | Delete
[37046] Fix | Delete
[37047] Fix | Delete
/**
[37048] Fix | Delete
* Internal dependencies
[37049] Fix | Delete
*/
[37050] Fix | Delete
[37051] Fix | Delete
[37052] Fix | Delete
/** @typedef {import('@wordpress/element').WPElement} WPElement */
[37053] Fix | Delete
[37054] Fix | Delete
/**
[37055] Fix | Delete
* Custom hook which announces the message with the given politeness, if a
[37056] Fix | Delete
* valid message is provided.
[37057] Fix | Delete
*
[37058] Fix | Delete
* @param {string|WPElement} [message] Message to announce.
[37059] Fix | Delete
* @param {'polite'|'assertive'} politeness Politeness to announce.
[37060] Fix | Delete
*/
[37061] Fix | Delete
[37062] Fix | Delete
function useSpokenMessage(message, politeness) {
[37063] Fix | Delete
var spokenMessage = typeof message === 'string' ? message : Object(external_wp_element_["renderToString"])(message);
[37064] Fix | Delete
Object(external_wp_element_["useEffect"])(function () {
[37065] Fix | Delete
if (spokenMessage) {
[37066] Fix | Delete
Object(external_wp_a11y_["speak"])(spokenMessage, politeness);
[37067] Fix | Delete
}
[37068] Fix | Delete
}, [spokenMessage, politeness]);
[37069] Fix | Delete
}
[37070] Fix | Delete
/**
[37071] Fix | Delete
* Given a notice status, returns an assumed default politeness for the status.
[37072] Fix | Delete
* Defaults to 'assertive'.
[37073] Fix | Delete
*
[37074] Fix | Delete
* @param {string} [status] Notice status.
[37075] Fix | Delete
*
[37076] Fix | Delete
* @return {'polite'|'assertive'} Notice politeness.
[37077] Fix | Delete
*/
[37078] Fix | Delete
[37079] Fix | Delete
[37080] Fix | Delete
function getDefaultPoliteness(status) {
[37081] Fix | Delete
switch (status) {
[37082] Fix | Delete
case 'success':
[37083] Fix | Delete
case 'warning':
[37084] Fix | Delete
case 'info':
[37085] Fix | Delete
return 'polite';
[37086] Fix | Delete
[37087] Fix | Delete
case 'error':
[37088] Fix | Delete
default:
[37089] Fix | Delete
return 'assertive';
[37090] Fix | Delete
}
[37091] Fix | Delete
}
[37092] Fix | Delete
[37093] Fix | Delete
function Notice(_ref) {
[37094] Fix | Delete
var className = _ref.className,
[37095] Fix | Delete
_ref$status = _ref.status,
[37096] Fix | Delete
status = _ref$status === void 0 ? 'info' : _ref$status,
[37097] Fix | Delete
children = _ref.children,
[37098] Fix | Delete
_ref$spokenMessage = _ref.spokenMessage,
[37099] Fix | Delete
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
[37100] Fix | Delete
_ref$onRemove = _ref.onRemove,
[37101] Fix | Delete
onRemove = _ref$onRemove === void 0 ? external_lodash_["noop"] : _ref$onRemove,
[37102] Fix | Delete
_ref$isDismissible = _ref.isDismissible,
[37103] Fix | Delete
isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible,
[37104] Fix | Delete
_ref$actions = _ref.actions,
[37105] Fix | Delete
actions = _ref$actions === void 0 ? [] : _ref$actions,
[37106] Fix | Delete
_ref$politeness = _ref.politeness,
[37107] Fix | Delete
politeness = _ref$politeness === void 0 ? getDefaultPoliteness(status) : _ref$politeness,
[37108] Fix | Delete
__unstableHTML = _ref.__unstableHTML;
[37109] Fix | Delete
useSpokenMessage(spokenMessage, politeness);
[37110] Fix | Delete
var classes = classnames_default()(className, 'components-notice', 'is-' + status, {
[37111] Fix | Delete
'is-dismissible': isDismissible
[37112] Fix | Delete
});
[37113] Fix | Delete
[37114] Fix | Delete
if (__unstableHTML) {
[37115] Fix | Delete
children = Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, children);
[37116] Fix | Delete
}
[37117] Fix | Delete
[37118] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[37119] Fix | Delete
className: classes
[37120] Fix | Delete
}, Object(external_wp_element_["createElement"])("div", {
[37121] Fix | Delete
className: "components-notice__content"
[37122] Fix | Delete
}, children, actions.map(function (_ref2, index) {
[37123] Fix | Delete
var buttonCustomClasses = _ref2.className,
[37124] Fix | Delete
label = _ref2.label,
[37125] Fix | Delete
isPrimary = _ref2.isPrimary,
[37126] Fix | Delete
_ref2$noDefaultClasse = _ref2.noDefaultClasses,
[37127] Fix | Delete
noDefaultClasses = _ref2$noDefaultClasse === void 0 ? false : _ref2$noDefaultClasse,
[37128] Fix | Delete
onClick = _ref2.onClick,
[37129] Fix | Delete
url = _ref2.url;
[37130] Fix | Delete
return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[37131] Fix | Delete
key: index,
[37132] Fix | Delete
href: url,
[37133] Fix | Delete
isPrimary: isPrimary,
[37134] Fix | Delete
isSecondary: !noDefaultClasses && !url,
[37135] Fix | Delete
isLink: !noDefaultClasses && !!url,
[37136] Fix | Delete
onClick: url ? undefined : onClick,
[37137] Fix | Delete
className: classnames_default()('components-notice__action', buttonCustomClasses)
[37138] Fix | Delete
}, label);
[37139] Fix | Delete
})), isDismissible && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[37140] Fix | Delete
className: "components-notice__dismiss",
[37141] Fix | Delete
icon: library_close["a" /* default */],
[37142] Fix | Delete
label: Object(external_wp_i18n_["__"])('Dismiss this notice'),
[37143] Fix | Delete
onClick: onRemove,
[37144] Fix | Delete
showTooltip: false
[37145] Fix | Delete
}));
[37146] Fix | Delete
}
[37147] Fix | Delete
[37148] Fix | Delete
/* harmony default export */ var build_module_notice = (Notice);
[37149] Fix | Delete
[37150] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/list.js
[37151] Fix | Delete
[37152] Fix | Delete
[37153] Fix | Delete
[37154] Fix | Delete
[37155] Fix | Delete
/**
[37156] Fix | Delete
* External dependencies
[37157] Fix | Delete
*/
[37158] Fix | Delete
[37159] Fix | Delete
[37160] Fix | Delete
/**
[37161] Fix | Delete
* Internal dependencies
[37162] Fix | Delete
*/
[37163] Fix | Delete
[37164] Fix | Delete
[37165] Fix | Delete
/**
[37166] Fix | Delete
* Renders a list of notices.
[37167] Fix | Delete
*
[37168] Fix | Delete
* @param {Object} $0 Props passed to the component.
[37169] Fix | Delete
* @param {Array} $0.notices Array of notices to render.
[37170] Fix | Delete
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
[37171] Fix | Delete
* @param {Object} $0.className Name of the class used by the component.
[37172] Fix | Delete
* @param {Object} $0.children Array of children to be rendered inside the notice list.
[37173] Fix | Delete
* @return {Object} The rendered notices list.
[37174] Fix | Delete
*/
[37175] Fix | Delete
[37176] Fix | Delete
function NoticeList(_ref) {
[37177] Fix | Delete
var notices = _ref.notices,
[37178] Fix | Delete
_ref$onRemove = _ref.onRemove,
[37179] Fix | Delete
onRemove = _ref$onRemove === void 0 ? external_lodash_["noop"] : _ref$onRemove,
[37180] Fix | Delete
className = _ref.className,
[37181] Fix | Delete
children = _ref.children;
[37182] Fix | Delete
[37183] Fix | Delete
var removeNotice = function removeNotice(id) {
[37184] Fix | Delete
return function () {
[37185] Fix | Delete
return onRemove(id);
[37186] Fix | Delete
};
[37187] Fix | Delete
};
[37188] Fix | Delete
[37189] Fix | Delete
className = classnames_default()('components-notice-list', className);
[37190] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[37191] Fix | Delete
className: className
[37192] Fix | Delete
}, children, Object(toConsumableArray["a" /* default */])(notices).reverse().map(function (notice) {
[37193] Fix | Delete
return Object(external_wp_element_["createElement"])(build_module_notice, Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
[37194] Fix | Delete
key: notice.id,
[37195] Fix | Delete
onRemove: removeNotice(notice.id)
[37196] Fix | Delete
}), notice.content);
[37197] Fix | Delete
}));
[37198] Fix | Delete
}
[37199] Fix | Delete
[37200] Fix | Delete
/* harmony default export */ var list = (NoticeList);
[37201] Fix | Delete
[37202] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/header.js
[37203] Fix | Delete
[37204] Fix | Delete
[37205] Fix | Delete
function PanelHeader(_ref) {
[37206] Fix | Delete
var label = _ref.label,
[37207] Fix | Delete
children = _ref.children;
[37208] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[37209] Fix | Delete
className: "components-panel__header"
[37210] Fix | Delete
}, label && Object(external_wp_element_["createElement"])("h2", null, label), children);
[37211] Fix | Delete
}
[37212] Fix | Delete
[37213] Fix | Delete
/* harmony default export */ var panel_header = (PanelHeader);
[37214] Fix | Delete
[37215] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/index.js
[37216] Fix | Delete
[37217] Fix | Delete
[37218] Fix | Delete
/**
[37219] Fix | Delete
* External dependencies
[37220] Fix | Delete
*/
[37221] Fix | Delete
[37222] Fix | Delete
/**
[37223] Fix | Delete
* WordPress dependencies
[37224] Fix | Delete
*/
[37225] Fix | Delete
[37226] Fix | Delete
[37227] Fix | Delete
/**
[37228] Fix | Delete
* Internal dependencies
[37229] Fix | Delete
*/
[37230] Fix | Delete
[37231] Fix | Delete
[37232] Fix | Delete
[37233] Fix | Delete
function Panel(_ref, ref) {
[37234] Fix | Delete
var header = _ref.header,
[37235] Fix | Delete
className = _ref.className,
[37236] Fix | Delete
children = _ref.children;
[37237] Fix | Delete
var classNames = classnames_default()(className, 'components-panel');
[37238] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[37239] Fix | Delete
className: classNames,
[37240] Fix | Delete
ref: ref
[37241] Fix | Delete
}, header && Object(external_wp_element_["createElement"])(panel_header, {
[37242] Fix | Delete
label: header
[37243] Fix | Delete
}), children);
[37244] Fix | Delete
}
[37245] Fix | Delete
[37246] Fix | Delete
/* harmony default export */ var panel = (Object(external_wp_element_["forwardRef"])(Panel));
[37247] Fix | Delete
[37248] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/body.js
[37249] Fix | Delete
[37250] Fix | Delete
[37251] Fix | Delete
[37252] Fix | Delete
[37253] Fix | Delete
[37254] Fix | Delete
/**
[37255] Fix | Delete
* External dependencies
[37256] Fix | Delete
*/
[37257] Fix | Delete
[37258] Fix | Delete
[37259] Fix | Delete
[37260] Fix | Delete
/**
[37261] Fix | Delete
* WordPress dependencies
[37262] Fix | Delete
*/
[37263] Fix | Delete
[37264] Fix | Delete
[37265] Fix | Delete
[37266] Fix | Delete
[37267] Fix | Delete
/**
[37268] Fix | Delete
* Internal dependencies
[37269] Fix | Delete
*/
[37270] Fix | Delete
[37271] Fix | Delete
[37272] Fix | Delete
[37273] Fix | Delete
[37274] Fix | Delete
function PanelBody(_ref, ref) {
[37275] Fix | Delete
var _ref$buttonProps = _ref.buttonProps,
[37276] Fix | Delete
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
[37277] Fix | Delete
children = _ref.children,
[37278] Fix | Delete
className = _ref.className,
[37279] Fix | Delete
icon = _ref.icon,
[37280] Fix | Delete
initialOpen = _ref.initialOpen,
[37281] Fix | Delete
_ref$onToggle = _ref.onToggle,
[37282] Fix | Delete
onToggle = _ref$onToggle === void 0 ? external_lodash_["noop"] : _ref$onToggle,
[37283] Fix | Delete
opened = _ref.opened,
[37284] Fix | Delete
title = _ref.title,
[37285] Fix | Delete
_ref$scrollAfterOpen = _ref.scrollAfterOpen,
[37286] Fix | Delete
scrollAfterOpen = _ref$scrollAfterOpen === void 0 ? true : _ref$scrollAfterOpen;
[37287] Fix | Delete
[37288] Fix | Delete
var _useControlledState = use_controlled_state(opened, {
[37289] Fix | Delete
initial: initialOpen === undefined ? true : initialOpen
[37290] Fix | Delete
}),
[37291] Fix | Delete
_useControlledState2 = Object(slicedToArray["a" /* default */])(_useControlledState, 2),
[37292] Fix | Delete
isOpened = _useControlledState2[0],
[37293] Fix | Delete
setIsOpened = _useControlledState2[1];
[37294] Fix | Delete
[37295] Fix | Delete
var nodeRef = Object(external_wp_element_["useRef"])(); // Defaults to 'smooth' scrolling
[37296] Fix | Delete
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
[37297] Fix | Delete
[37298] Fix | Delete
var scrollBehavior = Object(external_wp_compose_["useReducedMotion"])() ? 'auto' : 'smooth';
[37299] Fix | Delete
[37300] Fix | Delete
var handleOnToggle = function handleOnToggle(event) {
[37301] Fix | Delete
event.preventDefault();
[37302] Fix | Delete
var next = !isOpened;
[37303] Fix | Delete
setIsOpened(next);
[37304] Fix | Delete
onToggle(next);
[37305] Fix | Delete
}; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value
[37306] Fix | Delete
[37307] Fix | Delete
[37308] Fix | Delete
var scrollAfterOpenRef = Object(external_wp_element_["useRef"])();
[37309] Fix | Delete
scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render
[37310] Fix | Delete
[37311] Fix | Delete
use_update_effect(function () {
[37312] Fix | Delete
var _nodeRef$current;
[37313] Fix | Delete
[37314] Fix | Delete
if (isOpened && scrollAfterOpenRef.current && (_nodeRef$current = nodeRef.current) !== null && _nodeRef$current !== void 0 && _nodeRef$current.scrollIntoView) {
[37315] Fix | Delete
/*
[37316] Fix | Delete
* Scrolls the content into view when visible.
[37317] Fix | Delete
* This improves the UX when there are multiple stacking <PanelBody />
[37318] Fix | Delete
* components in a scrollable container.
[37319] Fix | Delete
*/
[37320] Fix | Delete
nodeRef.current.scrollIntoView({
[37321] Fix | Delete
inline: 'nearest',
[37322] Fix | Delete
block: 'nearest',
[37323] Fix | Delete
behavior: scrollBehavior
[37324] Fix | Delete
});
[37325] Fix | Delete
}
[37326] Fix | Delete
}, [isOpened, scrollBehavior]);
[37327] Fix | Delete
var classes = classnames_default()('components-panel__body', className, {
[37328] Fix | Delete
'is-opened': isOpened
[37329] Fix | Delete
});
[37330] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[37331] Fix | Delete
className: classes,
[37332] Fix | Delete
ref: Object(react_merge_refs_esm["a" /* default */])([nodeRef, ref])
[37333] Fix | Delete
}, Object(external_wp_element_["createElement"])(PanelBodyTitle, Object(esm_extends["a" /* default */])({
[37334] Fix | Delete
icon: icon,
[37335] Fix | Delete
isOpened: isOpened,
[37336] Fix | Delete
onClick: handleOnToggle,
[37337] Fix | Delete
title: title
[37338] Fix | Delete
}, buttonProps)), typeof children === 'function' ? children({
[37339] Fix | Delete
opened: isOpened
[37340] Fix | Delete
}) : isOpened && children);
[37341] Fix | Delete
}
[37342] Fix | Delete
var PanelBodyTitle = Object(external_wp_element_["forwardRef"])(function (_ref2, ref) {
[37343] Fix | Delete
var isOpened = _ref2.isOpened,
[37344] Fix | Delete
icon = _ref2.icon,
[37345] Fix | Delete
title = _ref2.title,
[37346] Fix | Delete
props = Object(objectWithoutProperties["a" /* default */])(_ref2, ["isOpened", "icon", "title"]);
[37347] Fix | Delete
[37348] Fix | Delete
if (!title) return null;
[37349] Fix | Delete
return Object(external_wp_element_["createElement"])("h2", {
[37350] Fix | Delete
className: "components-panel__body-title"
[37351] Fix | Delete
}, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
[37352] Fix | Delete
className: "components-panel__body-toggle",
[37353] Fix | Delete
"aria-expanded": isOpened,
[37354] Fix | Delete
ref: ref
[37355] Fix | Delete
}, props), Object(external_wp_element_["createElement"])("span", {
[37356] Fix | Delete
"aria-hidden": "true"
[37357] Fix | Delete
}, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
[37358] Fix | Delete
className: "components-panel__arrow",
[37359] Fix | Delete
icon: isOpened ? chevron_up["a" /* default */] : chevron_down["a" /* default */]
[37360] Fix | Delete
})), title, icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
[37361] Fix | Delete
icon: icon,
[37362] Fix | Delete
className: "components-panel__icon",
[37363] Fix | Delete
size: 20
[37364] Fix | Delete
})));
[37365] Fix | Delete
});
[37366] Fix | Delete
var body_ForwardedComponent = Object(external_wp_element_["forwardRef"])(PanelBody);
[37367] Fix | Delete
body_ForwardedComponent.displayName = 'PanelBody';
[37368] Fix | Delete
/* harmony default export */ var panel_body = (body_ForwardedComponent);
[37369] Fix | Delete
[37370] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/row.js
[37371] Fix | Delete
[37372] Fix | Delete
[37373] Fix | Delete
/**
[37374] Fix | Delete
* External dependencies
[37375] Fix | Delete
*/
[37376] Fix | Delete
[37377] Fix | Delete
[37378] Fix | Delete
function PanelRow(_ref) {
[37379] Fix | Delete
var className = _ref.className,
[37380] Fix | Delete
children = _ref.children;
[37381] Fix | Delete
var classes = classnames_default()('components-panel__row', className);
[37382] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[37383] Fix | Delete
className: classes
[37384] Fix | Delete
}, children);
[37385] Fix | Delete
}
[37386] Fix | Delete
[37387] Fix | Delete
/* harmony default export */ var panel_row = (PanelRow);
[37388] Fix | Delete
[37389] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/placeholder/index.js
[37390] Fix | Delete
[37391] Fix | Delete
[37392] Fix | Delete
[37393] Fix | Delete
[37394] Fix | Delete
[37395] Fix | Delete
/**
[37396] Fix | Delete
* External dependencies
[37397] Fix | Delete
*/
[37398] Fix | Delete
[37399] Fix | Delete
/**
[37400] Fix | Delete
* WordPress dependencies
[37401] Fix | Delete
*/
[37402] Fix | Delete
[37403] Fix | Delete
[37404] Fix | Delete
/**
[37405] Fix | Delete
* Internal dependencies
[37406] Fix | Delete
*/
[37407] Fix | Delete
[37408] Fix | Delete
[37409] Fix | Delete
/**
[37410] Fix | Delete
* Renders a placeholder. Normally used by blocks to render their empty state.
[37411] Fix | Delete
*
[37412] Fix | Delete
* @param {Object} props The component props.
[37413] Fix | Delete
* @param {WPIcon} props.icon An icon rendered before the label.
[37414] Fix | Delete
* @param {WPElement} props.children Children to be rendered.
[37415] Fix | Delete
* @param {string} props.label Title of the placeholder.
[37416] Fix | Delete
* @param {string} props.instructions Instructions of the placeholder.
[37417] Fix | Delete
* @param {string} props.className Class to set on the container div.
[37418] Fix | Delete
* @param {Object} props.notices A rendered notices list.
[37419] Fix | Delete
* @param {Object} props.preview Preview to be rendered in the placeholder.
[37420] Fix | Delete
* @param {boolean} props.isColumnLayout Whether a column layout should be used.
[37421] Fix | Delete
*
[37422] Fix | Delete
* @return {Object} The rendered placeholder.
[37423] Fix | Delete
*/
[37424] Fix | Delete
[37425] Fix | Delete
function Placeholder(_ref) {
[37426] Fix | Delete
var icon = _ref.icon,
[37427] Fix | Delete
children = _ref.children,
[37428] Fix | Delete
label = _ref.label,
[37429] Fix | Delete
instructions = _ref.instructions,
[37430] Fix | Delete
className = _ref.className,
[37431] Fix | Delete
notices = _ref.notices,
[37432] Fix | Delete
preview = _ref.preview,
[37433] Fix | Delete
isColumnLayout = _ref.isColumnLayout,
[37434] Fix | Delete
additionalProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["icon", "children", "label", "instructions", "className", "notices", "preview", "isColumnLayout"]);
[37435] Fix | Delete
[37436] Fix | Delete
var _useResizeObserver = Object(external_wp_compose_["useResizeObserver"])(),
[37437] Fix | Delete
_useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2),
[37438] Fix | Delete
resizeListener = _useResizeObserver2[0],
[37439] Fix | Delete
width = _useResizeObserver2[1].width; // Since `useResizeObserver` will report a width of `null` until after the
[37440] Fix | Delete
// first render, avoid applying any modifier classes until width is known.
[37441] Fix | Delete
[37442] Fix | Delete
[37443] Fix | Delete
var modifierClassNames;
[37444] Fix | Delete
[37445] Fix | Delete
if (typeof width === 'number') {
[37446] Fix | Delete
modifierClassNames = {
[37447] Fix | Delete
'is-large': width >= 320,
[37448] Fix | Delete
'is-medium': width >= 160 && width < 320,
[37449] Fix | Delete
'is-small': width < 160
[37450] Fix | Delete
};
[37451] Fix | Delete
}
[37452] Fix | Delete
[37453] Fix | Delete
var classes = classnames_default()('components-placeholder', className, modifierClassNames);
[37454] Fix | Delete
var fieldsetClasses = classnames_default()('components-placeholder__fieldset', {
[37455] Fix | Delete
'is-column-layout': isColumnLayout
[37456] Fix | Delete
});
[37457] Fix | Delete
return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, additionalProps, {
[37458] Fix | Delete
className: classes
[37459] Fix | Delete
}), resizeListener, notices, preview && Object(external_wp_element_["createElement"])("div", {
[37460] Fix | Delete
className: "components-placeholder__preview"
[37461] Fix | Delete
}, preview), Object(external_wp_element_["createElement"])("div", {
[37462] Fix | Delete
className: "components-placeholder__label"
[37463] Fix | Delete
}, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
[37464] Fix | Delete
icon: icon
[37465] Fix | Delete
}), label), !!instructions && Object(external_wp_element_["createElement"])("div", {
[37466] Fix | Delete
className: "components-placeholder__instructions"
[37467] Fix | Delete
}, instructions), Object(external_wp_element_["createElement"])("div", {
[37468] Fix | Delete
className: fieldsetClasses
[37469] Fix | Delete
}, children));
[37470] Fix | Delete
}
[37471] Fix | Delete
[37472] Fix | Delete
/* harmony default export */ var build_module_placeholder = (Placeholder);
[37473] Fix | Delete
[37474] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/terms.js
[37475] Fix | Delete
[37476] Fix | Delete
[37477] Fix | Delete
function terms_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[37478] Fix | Delete
[37479] Fix | Delete
function terms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { terms_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { terms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[37480] Fix | Delete
[37481] Fix | Delete
/**
[37482] Fix | Delete
* External dependencies
[37483] Fix | Delete
*/
[37484] Fix | Delete
[37485] Fix | Delete
/**
[37486] Fix | Delete
* Returns terms in a tree form.
[37487] Fix | Delete
*
[37488] Fix | Delete
* @param {Array} flatTerms Array of terms in flat format.
[37489] Fix | Delete
*
[37490] Fix | Delete
* @return {Array} Array of terms in tree format.
[37491] Fix | Delete
*/
[37492] Fix | Delete
[37493] Fix | Delete
function buildTermsTree(flatTerms) {
[37494] Fix | Delete
var flatTermsWithParentAndChildren = flatTerms.map(function (term) {
[37495] Fix | Delete
return terms_objectSpread({
[37496] Fix | Delete
children: [],
[37497] Fix | Delete
parent: null
[37498] Fix | Delete
}, term);
[37499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function