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: edit-widgets.js
};
[2000] Fix | Delete
}
[2001] Fix | Delete
[2002] Fix | Delete
/**
[2003] Fix | Delete
* Returns an action object used to open/close the list view.
[2004] Fix | Delete
*
[2005] Fix | Delete
* @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
[2006] Fix | Delete
* @return {Object} Action object.
[2007] Fix | Delete
*/
[2008] Fix | Delete
function setIsListViewOpened(isOpen) {
[2009] Fix | Delete
return {
[2010] Fix | Delete
type: 'SET_IS_LIST_VIEW_OPENED',
[2011] Fix | Delete
isOpen
[2012] Fix | Delete
};
[2013] Fix | Delete
}
[2014] Fix | Delete
[2015] Fix | Delete
/**
[2016] Fix | Delete
* Returns an action object signalling that the user closed the sidebar.
[2017] Fix | Delete
*
[2018] Fix | Delete
* @return {Object} Action creator.
[2019] Fix | Delete
*/
[2020] Fix | Delete
const closeGeneralSidebar = () => ({
[2021] Fix | Delete
registry
[2022] Fix | Delete
}) => {
[2023] Fix | Delete
registry.dispatch(store).disableComplementaryArea(constants_STORE_NAME);
[2024] Fix | Delete
};
[2025] Fix | Delete
[2026] Fix | Delete
/**
[2027] Fix | Delete
* Action that handles moving a block between widget areas
[2028] Fix | Delete
*
[2029] Fix | Delete
* @param {string} clientId The clientId of the block to move.
[2030] Fix | Delete
* @param {string} widgetAreaId The id of the widget area to move the block to.
[2031] Fix | Delete
*/
[2032] Fix | Delete
const moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({
[2033] Fix | Delete
dispatch,
[2034] Fix | Delete
select,
[2035] Fix | Delete
registry
[2036] Fix | Delete
}) => {
[2037] Fix | Delete
const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId(clientId);
[2038] Fix | Delete
[2039] Fix | Delete
// Search the top level blocks (widget areas) for the one with the matching
[2040] Fix | Delete
// id attribute. Makes the assumption that all top-level blocks are widget
[2041] Fix | Delete
// areas.
[2042] Fix | Delete
const widgetAreas = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks();
[2043] Fix | Delete
const destinationWidgetAreaBlock = widgetAreas.find(({
[2044] Fix | Delete
attributes
[2045] Fix | Delete
}) => attributes.id === widgetAreaId);
[2046] Fix | Delete
const destinationRootClientId = destinationWidgetAreaBlock.clientId;
[2047] Fix | Delete
[2048] Fix | Delete
// Get the index for moving to the end of the destination widget area.
[2049] Fix | Delete
const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(destinationRootClientId);
[2050] Fix | Delete
const destinationIndex = destinationInnerBlocksClientIds.length;
[2051] Fix | Delete
[2052] Fix | Delete
// Reveal the widget area, if it's not open.
[2053] Fix | Delete
const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(destinationRootClientId);
[2054] Fix | Delete
if (!isDestinationWidgetAreaOpen) {
[2055] Fix | Delete
dispatch.setIsWidgetAreaOpen(destinationRootClientId, true);
[2056] Fix | Delete
}
[2057] Fix | Delete
[2058] Fix | Delete
// Move the block.
[2059] Fix | Delete
registry.dispatch(external_wp_blockEditor_namespaceObject.store).moveBlocksToPosition([clientId], sourceRootClientId, destinationRootClientId, destinationIndex);
[2060] Fix | Delete
};
[2061] Fix | Delete
[2062] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
[2063] Fix | Delete
/**
[2064] Fix | Delete
* WordPress dependencies
[2065] Fix | Delete
*/
[2066] Fix | Delete
[2067] Fix | Delete
[2068] Fix | Delete
[2069] Fix | Delete
/**
[2070] Fix | Delete
* Internal dependencies
[2071] Fix | Delete
*/
[2072] Fix | Delete
[2073] Fix | Delete
[2074] Fix | Delete
[2075] Fix | Delete
[2076] Fix | Delete
/**
[2077] Fix | Delete
* Creates a "stub" widgets post reflecting all available widget areas. The
[2078] Fix | Delete
* post is meant as a convenient to only exists in runtime and should never be saved. It
[2079] Fix | Delete
* enables a convenient way of editing the widgets by using a regular post editor.
[2080] Fix | Delete
*
[2081] Fix | Delete
* Fetches all widgets from all widgets aras, converts them into blocks, and hydrates a new post with them.
[2082] Fix | Delete
*
[2083] Fix | Delete
* @return {Function} An action creator.
[2084] Fix | Delete
*/
[2085] Fix | Delete
const getWidgetAreas = () => async ({
[2086] Fix | Delete
dispatch,
[2087] Fix | Delete
registry
[2088] Fix | Delete
}) => {
[2089] Fix | Delete
const query = buildWidgetAreasQuery();
[2090] Fix | Delete
const widgetAreas = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query);
[2091] Fix | Delete
const widgetAreaBlocks = [];
[2092] Fix | Delete
const sortedWidgetAreas = widgetAreas.sort((a, b) => {
[2093] Fix | Delete
if (a.id === 'wp_inactive_widgets') {
[2094] Fix | Delete
return 1;
[2095] Fix | Delete
}
[2096] Fix | Delete
if (b.id === 'wp_inactive_widgets') {
[2097] Fix | Delete
return -1;
[2098] Fix | Delete
}
[2099] Fix | Delete
return 0;
[2100] Fix | Delete
});
[2101] Fix | Delete
for (const widgetArea of sortedWidgetAreas) {
[2102] Fix | Delete
widgetAreaBlocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/widget-area', {
[2103] Fix | Delete
id: widgetArea.id,
[2104] Fix | Delete
name: widgetArea.name
[2105] Fix | Delete
}));
[2106] Fix | Delete
if (!widgetArea.widgets.length) {
[2107] Fix | Delete
// If this widget area has no widgets, it won't get a post setup by
[2108] Fix | Delete
// the getWidgets resolver.
[2109] Fix | Delete
dispatch(persistStubPost(buildWidgetAreaPostId(widgetArea.id), []));
[2110] Fix | Delete
}
[2111] Fix | Delete
}
[2112] Fix | Delete
const widgetAreasOpenState = {};
[2113] Fix | Delete
widgetAreaBlocks.forEach((widgetAreaBlock, index) => {
[2114] Fix | Delete
// Defaults to open the first widget area.
[2115] Fix | Delete
widgetAreasOpenState[widgetAreaBlock.clientId] = index === 0;
[2116] Fix | Delete
});
[2117] Fix | Delete
dispatch(setWidgetAreasOpenState(widgetAreasOpenState));
[2118] Fix | Delete
dispatch(persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks));
[2119] Fix | Delete
};
[2120] Fix | Delete
[2121] Fix | Delete
/**
[2122] Fix | Delete
* Fetches all widgets from all widgets ares, and groups them by widget area Id.
[2123] Fix | Delete
*
[2124] Fix | Delete
* @return {Function} An action creator.
[2125] Fix | Delete
*/
[2126] Fix | Delete
const getWidgets = () => async ({
[2127] Fix | Delete
dispatch,
[2128] Fix | Delete
registry
[2129] Fix | Delete
}) => {
[2130] Fix | Delete
const query = buildWidgetsQuery();
[2131] Fix | Delete
const widgets = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', query);
[2132] Fix | Delete
const groupedBySidebar = {};
[2133] Fix | Delete
for (const widget of widgets) {
[2134] Fix | Delete
const block = transformWidgetToBlock(widget);
[2135] Fix | Delete
groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || [];
[2136] Fix | Delete
groupedBySidebar[widget.sidebar].push(block);
[2137] Fix | Delete
}
[2138] Fix | Delete
for (const sidebarId in groupedBySidebar) {
[2139] Fix | Delete
if (groupedBySidebar.hasOwnProperty(sidebarId)) {
[2140] Fix | Delete
// Persist the actual post containing the widget block
[2141] Fix | Delete
dispatch(persistStubPost(buildWidgetAreaPostId(sidebarId), groupedBySidebar[sidebarId]));
[2142] Fix | Delete
}
[2143] Fix | Delete
}
[2144] Fix | Delete
};
[2145] Fix | Delete
[2146] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
[2147] Fix | Delete
/**
[2148] Fix | Delete
* WordPress dependencies
[2149] Fix | Delete
*/
[2150] Fix | Delete
[2151] Fix | Delete
[2152] Fix | Delete
[2153] Fix | Delete
[2154] Fix | Delete
[2155] Fix | Delete
/**
[2156] Fix | Delete
* Internal dependencies
[2157] Fix | Delete
*/
[2158] Fix | Delete
[2159] Fix | Delete
[2160] Fix | Delete
const EMPTY_INSERTION_POINT = {
[2161] Fix | Delete
rootClientId: undefined,
[2162] Fix | Delete
insertionIndex: undefined
[2163] Fix | Delete
};
[2164] Fix | Delete
[2165] Fix | Delete
/**
[2166] Fix | Delete
* Returns all API widgets.
[2167] Fix | Delete
*
[2168] Fix | Delete
* @return {Object[]} API List of widgets.
[2169] Fix | Delete
*/
[2170] Fix | Delete
const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
[2171] Fix | Delete
const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery());
[2172] Fix | Delete
return (
[2173] Fix | Delete
// Key widgets by their ID.
[2174] Fix | Delete
widgets?.reduce((allWidgets, widget) => ({
[2175] Fix | Delete
...allWidgets,
[2176] Fix | Delete
[widget.id]: widget
[2177] Fix | Delete
}), {}) || {}
[2178] Fix | Delete
);
[2179] Fix | Delete
});
[2180] Fix | Delete
[2181] Fix | Delete
/**
[2182] Fix | Delete
* Returns API widget data for a particular widget ID.
[2183] Fix | Delete
*
[2184] Fix | Delete
* @param {number} id Widget ID.
[2185] Fix | Delete
*
[2186] Fix | Delete
* @return {Object} API widget data for a particular widget ID.
[2187] Fix | Delete
*/
[2188] Fix | Delete
const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, id) => {
[2189] Fix | Delete
const widgets = select(constants_STORE_NAME).getWidgets();
[2190] Fix | Delete
return widgets[id];
[2191] Fix | Delete
});
[2192] Fix | Delete
[2193] Fix | Delete
/**
[2194] Fix | Delete
* Returns all API widget areas.
[2195] Fix | Delete
*
[2196] Fix | Delete
* @return {Object[]} API List of widget areas.
[2197] Fix | Delete
*/
[2198] Fix | Delete
const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
[2199] Fix | Delete
const query = buildWidgetAreasQuery();
[2200] Fix | Delete
return select(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query);
[2201] Fix | Delete
});
[2202] Fix | Delete
[2203] Fix | Delete
/**
[2204] Fix | Delete
* Returns widgetArea containing a block identify by given widgetId
[2205] Fix | Delete
*
[2206] Fix | Delete
* @param {string} widgetId The ID of the widget.
[2207] Fix | Delete
* @return {Object} Containing widget area.
[2208] Fix | Delete
*/
[2209] Fix | Delete
const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, widgetId) => {
[2210] Fix | Delete
const widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
[2211] Fix | Delete
return widgetAreas.find(widgetArea => {
[2212] Fix | Delete
const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetArea.id));
[2213] Fix | Delete
const blockWidgetIds = post.blocks.map(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block));
[2214] Fix | Delete
return blockWidgetIds.includes(widgetId);
[2215] Fix | Delete
});
[2216] Fix | Delete
});
[2217] Fix | Delete
[2218] Fix | Delete
/**
[2219] Fix | Delete
* Given a child client id, returns the parent widget area block.
[2220] Fix | Delete
*
[2221] Fix | Delete
* @param {string} clientId The client id of a block in a widget area.
[2222] Fix | Delete
*
[2223] Fix | Delete
* @return {WPBlock} The widget area block.
[2224] Fix | Delete
*/
[2225] Fix | Delete
const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId) => {
[2226] Fix | Delete
const {
[2227] Fix | Delete
getBlock,
[2228] Fix | Delete
getBlockName,
[2229] Fix | Delete
getBlockParents
[2230] Fix | Delete
} = select(external_wp_blockEditor_namespaceObject.store);
[2231] Fix | Delete
const blockParents = getBlockParents(clientId);
[2232] Fix | Delete
const widgetAreaClientId = blockParents.find(parentClientId => getBlockName(parentClientId) === 'core/widget-area');
[2233] Fix | Delete
return getBlock(widgetAreaClientId);
[2234] Fix | Delete
});
[2235] Fix | Delete
[2236] Fix | Delete
/**
[2237] Fix | Delete
* Returns all edited widget area entity records.
[2238] Fix | Delete
*
[2239] Fix | Delete
* @return {Object[]} List of edited widget area entity records.
[2240] Fix | Delete
*/
[2241] Fix | Delete
const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, ids) => {
[2242] Fix | Delete
let widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
[2243] Fix | Delete
if (!widgetAreas) {
[2244] Fix | Delete
return [];
[2245] Fix | Delete
}
[2246] Fix | Delete
if (ids) {
[2247] Fix | Delete
widgetAreas = widgetAreas.filter(({
[2248] Fix | Delete
id
[2249] Fix | Delete
}) => ids.includes(id));
[2250] Fix | Delete
}
[2251] Fix | Delete
return widgetAreas.filter(({
[2252] Fix | Delete
id
[2253] Fix | Delete
}) => select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id))).map(({
[2254] Fix | Delete
id
[2255] Fix | Delete
}) => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id));
[2256] Fix | Delete
});
[2257] Fix | Delete
[2258] Fix | Delete
/**
[2259] Fix | Delete
* Returns all blocks representing reference widgets.
[2260] Fix | Delete
*
[2261] Fix | Delete
* @param {string} referenceWidgetName Optional. If given, only reference widgets with this name will be returned.
[2262] Fix | Delete
* @return {Array} List of all blocks representing reference widgets
[2263] Fix | Delete
*/
[2264] Fix | Delete
const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, referenceWidgetName = null) => {
[2265] Fix | Delete
const results = [];
[2266] Fix | Delete
const widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
[2267] Fix | Delete
for (const _widgetArea of widgetAreas) {
[2268] Fix | Delete
const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(_widgetArea.id));
[2269] Fix | Delete
for (const block of post.blocks) {
[2270] Fix | Delete
if (block.name === 'core/legacy-widget' && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) {
[2271] Fix | Delete
results.push(block);
[2272] Fix | Delete
}
[2273] Fix | Delete
}
[2274] Fix | Delete
}
[2275] Fix | Delete
return results;
[2276] Fix | Delete
});
[2277] Fix | Delete
[2278] Fix | Delete
/**
[2279] Fix | Delete
* Returns true if any widget area is currently being saved.
[2280] Fix | Delete
*
[2281] Fix | Delete
* @return {boolean} True if any widget area is currently being saved. False otherwise.
[2282] Fix | Delete
*/
[2283] Fix | Delete
const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
[2284] Fix | Delete
const widgetAreasIds = select(constants_STORE_NAME).getWidgetAreas()?.map(({
[2285] Fix | Delete
id
[2286] Fix | Delete
}) => id);
[2287] Fix | Delete
if (!widgetAreasIds) {
[2288] Fix | Delete
return false;
[2289] Fix | Delete
}
[2290] Fix | Delete
for (const id of widgetAreasIds) {
[2291] Fix | Delete
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id);
[2292] Fix | Delete
if (isSaving) {
[2293] Fix | Delete
return true;
[2294] Fix | Delete
}
[2295] Fix | Delete
}
[2296] Fix | Delete
const widgetIds = [...Object.keys(select(constants_STORE_NAME).getWidgets()), undefined // account for new widgets without an ID
[2297] Fix | Delete
];
[2298] Fix | Delete
for (const id of widgetIds) {
[2299] Fix | Delete
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('root', 'widget', id);
[2300] Fix | Delete
if (isSaving) {
[2301] Fix | Delete
return true;
[2302] Fix | Delete
}
[2303] Fix | Delete
}
[2304] Fix | Delete
return false;
[2305] Fix | Delete
});
[2306] Fix | Delete
[2307] Fix | Delete
/**
[2308] Fix | Delete
* Gets whether the widget area is opened.
[2309] Fix | Delete
*
[2310] Fix | Delete
* @param {Array} state The open state of the widget areas.
[2311] Fix | Delete
* @param {string} clientId The clientId of the widget area.
[2312] Fix | Delete
*
[2313] Fix | Delete
* @return {boolean} True if the widget area is open.
[2314] Fix | Delete
*/
[2315] Fix | Delete
const getIsWidgetAreaOpen = (state, clientId) => {
[2316] Fix | Delete
const {
[2317] Fix | Delete
widgetAreasOpenState
[2318] Fix | Delete
} = state;
[2319] Fix | Delete
return !!widgetAreasOpenState[clientId];
[2320] Fix | Delete
};
[2321] Fix | Delete
[2322] Fix | Delete
/**
[2323] Fix | Delete
* Returns true if the inserter is opened.
[2324] Fix | Delete
*
[2325] Fix | Delete
* @param {Object} state Global application state.
[2326] Fix | Delete
*
[2327] Fix | Delete
* @return {boolean} Whether the inserter is opened.
[2328] Fix | Delete
*/
[2329] Fix | Delete
function isInserterOpened(state) {
[2330] Fix | Delete
return !!state.blockInserterPanel;
[2331] Fix | Delete
}
[2332] Fix | Delete
[2333] Fix | Delete
/**
[2334] Fix | Delete
* Get the insertion point for the inserter.
[2335] Fix | Delete
*
[2336] Fix | Delete
* @param {Object} state Global application state.
[2337] Fix | Delete
*
[2338] Fix | Delete
* @return {Object} The root client ID and index to insert at.
[2339] Fix | Delete
*/
[2340] Fix | Delete
function __experimentalGetInsertionPoint(state) {
[2341] Fix | Delete
if (typeof state.blockInserterPanel === 'boolean') {
[2342] Fix | Delete
return EMPTY_INSERTION_POINT;
[2343] Fix | Delete
}
[2344] Fix | Delete
return state.blockInserterPanel;
[2345] Fix | Delete
}
[2346] Fix | Delete
[2347] Fix | Delete
/**
[2348] Fix | Delete
* Returns true if a block can be inserted into a widget area.
[2349] Fix | Delete
*
[2350] Fix | Delete
* @param {Array} state The open state of the widget areas.
[2351] Fix | Delete
* @param {string} blockName The name of the block being inserted.
[2352] Fix | Delete
*
[2353] Fix | Delete
* @return {boolean} True if the block can be inserted in a widget area.
[2354] Fix | Delete
*/
[2355] Fix | Delete
const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, blockName) => {
[2356] Fix | Delete
// Widget areas are always top-level blocks, which getBlocks will return.
[2357] Fix | Delete
const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
[2358] Fix | Delete
[2359] Fix | Delete
// Makes an assumption that a block that can be inserted into one
[2360] Fix | Delete
// widget area can be inserted into any widget area. Uses the first
[2361] Fix | Delete
// widget area for testing whether the block can be inserted.
[2362] Fix | Delete
const [firstWidgetArea] = widgetAreas;
[2363] Fix | Delete
return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(blockName, firstWidgetArea.clientId);
[2364] Fix | Delete
});
[2365] Fix | Delete
[2366] Fix | Delete
/**
[2367] Fix | Delete
* Returns true if the list view is opened.
[2368] Fix | Delete
*
[2369] Fix | Delete
* @param {Object} state Global application state.
[2370] Fix | Delete
*
[2371] Fix | Delete
* @return {boolean} Whether the list view is opened.
[2372] Fix | Delete
*/
[2373] Fix | Delete
function isListViewOpened(state) {
[2374] Fix | Delete
return state.listViewPanel;
[2375] Fix | Delete
}
[2376] Fix | Delete
[2377] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
[2378] Fix | Delete
function getListViewToggleRef(state) {
[2379] Fix | Delete
return state.listViewToggleRef;
[2380] Fix | Delete
}
[2381] Fix | Delete
function getInserterSidebarToggleRef(state) {
[2382] Fix | Delete
return state.inserterSidebarToggleRef;
[2383] Fix | Delete
}
[2384] Fix | Delete
[2385] Fix | Delete
;// CONCATENATED MODULE: external ["wp","privateApis"]
[2386] Fix | Delete
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
[2387] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js
[2388] Fix | Delete
/**
[2389] Fix | Delete
* WordPress dependencies
[2390] Fix | Delete
*/
[2391] Fix | Delete
[2392] Fix | Delete
const {
[2393] Fix | Delete
lock,
[2394] Fix | Delete
unlock
[2395] Fix | Delete
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-widgets');
[2396] Fix | Delete
[2397] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/index.js
[2398] Fix | Delete
/**
[2399] Fix | Delete
* WordPress dependencies
[2400] Fix | Delete
*/
[2401] Fix | Delete
[2402] Fix | Delete
[2403] Fix | Delete
[2404] Fix | Delete
/**
[2405] Fix | Delete
* Internal dependencies
[2406] Fix | Delete
*/
[2407] Fix | Delete
[2408] Fix | Delete
[2409] Fix | Delete
[2410] Fix | Delete
[2411] Fix | Delete
[2412] Fix | Delete
[2413] Fix | Delete
[2414] Fix | Delete
[2415] Fix | Delete
/**
[2416] Fix | Delete
* Block editor data store configuration.
[2417] Fix | Delete
*
[2418] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register
[2419] Fix | Delete
*
[2420] Fix | Delete
* @type {Object}
[2421] Fix | Delete
*/
[2422] Fix | Delete
const storeConfig = {
[2423] Fix | Delete
reducer: reducer,
[2424] Fix | Delete
selectors: store_selectors_namespaceObject,
[2425] Fix | Delete
resolvers: resolvers_namespaceObject,
[2426] Fix | Delete
actions: store_actions_namespaceObject
[2427] Fix | Delete
};
[2428] Fix | Delete
[2429] Fix | Delete
/**
[2430] Fix | Delete
* Store definition for the edit widgets namespace.
[2431] Fix | Delete
*
[2432] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
[2433] Fix | Delete
*
[2434] Fix | Delete
* @type {Object}
[2435] Fix | Delete
*/
[2436] Fix | Delete
const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig);
[2437] Fix | Delete
(0,external_wp_data_namespaceObject.register)(store_store);
[2438] Fix | Delete
[2439] Fix | Delete
// This package uses a few in-memory post types as wrappers for convenience.
[2440] Fix | Delete
// This middleware prevents any network requests related to these types as they are
[2441] Fix | Delete
// bound to fail anyway.
[2442] Fix | Delete
external_wp_apiFetch_default().use(function (options, next) {
[2443] Fix | Delete
if (options.path?.indexOf('/wp/v2/types/widget-area') === 0) {
[2444] Fix | Delete
return Promise.resolve({});
[2445] Fix | Delete
}
[2446] Fix | Delete
return next(options);
[2447] Fix | Delete
});
[2448] Fix | Delete
unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject);
[2449] Fix | Delete
[2450] Fix | Delete
;// CONCATENATED MODULE: external ["wp","hooks"]
[2451] Fix | Delete
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
[2452] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js
[2453] Fix | Delete
/**
[2454] Fix | Delete
* WordPress dependencies
[2455] Fix | Delete
*/
[2456] Fix | Delete
[2457] Fix | Delete
[2458] Fix | Delete
[2459] Fix | Delete
[2460] Fix | Delete
[2461] Fix | Delete
[2462] Fix | Delete
[2463] Fix | Delete
/**
[2464] Fix | Delete
* Internal dependencies
[2465] Fix | Delete
*/
[2466] Fix | Delete
[2467] Fix | Delete
[2468] Fix | Delete
[2469] Fix | Delete
[2470] Fix | Delete
const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
[2471] Fix | Delete
const {
[2472] Fix | Delete
clientId,
[2473] Fix | Delete
name: blockName
[2474] Fix | Delete
} = props;
[2475] Fix | Delete
const {
[2476] Fix | Delete
widgetAreas,
[2477] Fix | Delete
currentWidgetAreaId,
[2478] Fix | Delete
canInsertBlockInWidgetArea
[2479] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[2480] Fix | Delete
// Component won't display for a widget area, so don't run selectors.
[2481] Fix | Delete
if (blockName === 'core/widget-area') {
[2482] Fix | Delete
return {};
[2483] Fix | Delete
}
[2484] Fix | Delete
const selectors = select(store_store);
[2485] Fix | Delete
const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId);
[2486] Fix | Delete
return {
[2487] Fix | Delete
widgetAreas: selectors.getWidgetAreas(),
[2488] Fix | Delete
currentWidgetAreaId: widgetAreaBlock?.attributes?.id,
[2489] Fix | Delete
canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName)
[2490] Fix | Delete
};
[2491] Fix | Delete
}, [clientId, blockName]);
[2492] Fix | Delete
const {
[2493] Fix | Delete
moveBlockToWidgetArea
[2494] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
[2495] Fix | Delete
const hasMultipleWidgetAreas = widgetAreas?.length > 1;
[2496] Fix | Delete
const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea;
[2497] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[2498] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, {
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function