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: block-editor.js
[46000] Fix | Delete
[46001] Fix | Delete
[46002] Fix | Delete
/**
[46003] Fix | Delete
* Internal dependencies
[46004] Fix | Delete
*/
[46005] Fix | Delete
[46006] Fix | Delete
[46007] Fix | Delete
[46008] Fix | Delete
[46009] Fix | Delete
[46010] Fix | Delete
[46011] Fix | Delete
[46012] Fix | Delete
[46013] Fix | Delete
[46014] Fix | Delete
[46015] Fix | Delete
[46016] Fix | Delete
function PatternsListHeader({
[46017] Fix | Delete
filterValue,
[46018] Fix | Delete
filteredBlockPatternsLength
[46019] Fix | Delete
}) {
[46020] Fix | Delete
if (!filterValue) {
[46021] Fix | Delete
return null;
[46022] Fix | Delete
}
[46023] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, {
[46024] Fix | Delete
level: 2,
[46025] Fix | Delete
lineHeight: "48px",
[46026] Fix | Delete
className: "block-editor-block-patterns-explorer__search-results-count",
[46027] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of patterns. */
[46028] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%d pattern found', '%d patterns found', filteredBlockPatternsLength), filteredBlockPatternsLength)
[46029] Fix | Delete
});
[46030] Fix | Delete
}
[46031] Fix | Delete
function PatternList({
[46032] Fix | Delete
searchValue,
[46033] Fix | Delete
selectedCategory,
[46034] Fix | Delete
patternCategories,
[46035] Fix | Delete
rootClientId
[46036] Fix | Delete
}) {
[46037] Fix | Delete
const container = (0,external_wp_element_namespaceObject.useRef)();
[46038] Fix | Delete
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
[46039] Fix | Delete
const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
[46040] Fix | Delete
rootClientId,
[46041] Fix | Delete
shouldFocusBlock: true
[46042] Fix | Delete
});
[46043] Fix | Delete
const [patterns,, onClickPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId, selectedCategory);
[46044] Fix | Delete
const registeredPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => patternCategories.map(patternCategory => patternCategory.name), [patternCategories]);
[46045] Fix | Delete
const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
[46046] Fix | Delete
const filteredPatterns = patterns.filter(pattern => {
[46047] Fix | Delete
if (selectedCategory === allPatternsCategory.name) {
[46048] Fix | Delete
return true;
[46049] Fix | Delete
}
[46050] Fix | Delete
if (selectedCategory === myPatternsCategory.name && pattern.type === INSERTER_PATTERN_TYPES.user) {
[46051] Fix | Delete
return true;
[46052] Fix | Delete
}
[46053] Fix | Delete
if (selectedCategory === 'uncategorized') {
[46054] Fix | Delete
const hasKnownCategory = pattern.categories.some(category => registeredPatternCategories.includes(category));
[46055] Fix | Delete
return !pattern.categories?.length || !hasKnownCategory;
[46056] Fix | Delete
}
[46057] Fix | Delete
return pattern.categories?.includes(selectedCategory);
[46058] Fix | Delete
});
[46059] Fix | Delete
if (!searchValue) {
[46060] Fix | Delete
return filteredPatterns;
[46061] Fix | Delete
}
[46062] Fix | Delete
return searchItems(filteredPatterns, searchValue);
[46063] Fix | Delete
}, [searchValue, patterns, selectedCategory, registeredPatternCategories]);
[46064] Fix | Delete
[46065] Fix | Delete
// Announce search results on change.
[46066] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[46067] Fix | Delete
if (!searchValue) {
[46068] Fix | Delete
return;
[46069] Fix | Delete
}
[46070] Fix | Delete
const count = filteredBlockPatterns.length;
[46071] Fix | Delete
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */
[46072] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count);
[46073] Fix | Delete
debouncedSpeak(resultsFoundMessage);
[46074] Fix | Delete
}, [searchValue, debouncedSpeak, filteredBlockPatterns.length]);
[46075] Fix | Delete
const pagingProps = usePatternsPaging(filteredBlockPatterns, selectedCategory, container);
[46076] Fix | Delete
[46077] Fix | Delete
// Reset page when search value changes.
[46078] Fix | Delete
const [previousSearchValue, setPreviousSearchValue] = (0,external_wp_element_namespaceObject.useState)(searchValue);
[46079] Fix | Delete
if (searchValue !== previousSearchValue) {
[46080] Fix | Delete
setPreviousSearchValue(searchValue);
[46081] Fix | Delete
pagingProps.changePage(1);
[46082] Fix | Delete
}
[46083] Fix | Delete
const hasItems = !!filteredBlockPatterns?.length;
[46084] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[46085] Fix | Delete
className: "block-editor-block-patterns-explorer__list",
[46086] Fix | Delete
ref: container,
[46087] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsListHeader, {
[46088] Fix | Delete
filterValue: searchValue,
[46089] Fix | Delete
filteredBlockPatternsLength: filteredBlockPatterns.length
[46090] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox, {
[46091] Fix | Delete
children: hasItems && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[46092] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_list, {
[46093] Fix | Delete
shownPatterns: pagingProps.categoryPatternsAsyncList,
[46094] Fix | Delete
blockPatterns: pagingProps.categoryPatterns,
[46095] Fix | Delete
onClickPattern: onClickPattern,
[46096] Fix | Delete
isDraggable: false
[46097] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Pagination, {
[46098] Fix | Delete
...pagingProps
[46099] Fix | Delete
})]
[46100] Fix | Delete
})
[46101] Fix | Delete
})]
[46102] Fix | Delete
});
[46103] Fix | Delete
}
[46104] Fix | Delete
/* harmony default export */ const pattern_list = (PatternList);
[46105] Fix | Delete
[46106] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js
[46107] Fix | Delete
/**
[46108] Fix | Delete
* WordPress dependencies
[46109] Fix | Delete
*/
[46110] Fix | Delete
[46111] Fix | Delete
[46112] Fix | Delete
[46113] Fix | Delete
[46114] Fix | Delete
/**
[46115] Fix | Delete
* Internal dependencies
[46116] Fix | Delete
*/
[46117] Fix | Delete
[46118] Fix | Delete
[46119] Fix | Delete
function hasRegisteredCategory(pattern, allCategories) {
[46120] Fix | Delete
if (!pattern.categories || !pattern.categories.length) {
[46121] Fix | Delete
return false;
[46122] Fix | Delete
}
[46123] Fix | Delete
return pattern.categories.some(cat => allCategories.some(category => category.name === cat));
[46124] Fix | Delete
}
[46125] Fix | Delete
function usePatternCategories(rootClientId, sourceFilter = 'all') {
[46126] Fix | Delete
const [patterns, allCategories] = use_patterns_state(undefined, rootClientId);
[46127] Fix | Delete
const filteredPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => sourceFilter === 'all' ? patterns : patterns.filter(pattern => !isPatternFiltered(pattern, sourceFilter)), [sourceFilter, patterns]);
[46128] Fix | Delete
[46129] Fix | Delete
// Remove any empty categories.
[46130] Fix | Delete
const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
[46131] Fix | Delete
const categories = allCategories.filter(category => filteredPatterns.some(pattern => pattern.categories?.includes(category.name))).sort((a, b) => a.label.localeCompare(b.label));
[46132] Fix | Delete
if (filteredPatterns.some(pattern => !hasRegisteredCategory(pattern, allCategories)) && !categories.find(category => category.name === 'uncategorized')) {
[46133] Fix | Delete
categories.push({
[46134] Fix | Delete
name: 'uncategorized',
[46135] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Uncategorized')
[46136] Fix | Delete
});
[46137] Fix | Delete
}
[46138] Fix | Delete
if (filteredPatterns.some(pattern => pattern.type === INSERTER_PATTERN_TYPES.user)) {
[46139] Fix | Delete
categories.unshift(myPatternsCategory);
[46140] Fix | Delete
}
[46141] Fix | Delete
if (filteredPatterns.length > 0) {
[46142] Fix | Delete
categories.unshift({
[46143] Fix | Delete
name: allPatternsCategory.name,
[46144] Fix | Delete
label: allPatternsCategory.label
[46145] Fix | Delete
});
[46146] Fix | Delete
}
[46147] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of categories . */
[46148] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%d category button displayed.', '%d category buttons displayed.', categories.length), categories.length));
[46149] Fix | Delete
return categories;
[46150] Fix | Delete
}, [allCategories, filteredPatterns]);
[46151] Fix | Delete
return populatedCategories;
[46152] Fix | Delete
}
[46153] Fix | Delete
[46154] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/index.js
[46155] Fix | Delete
/**
[46156] Fix | Delete
* WordPress dependencies
[46157] Fix | Delete
*/
[46158] Fix | Delete
[46159] Fix | Delete
[46160] Fix | Delete
[46161] Fix | Delete
[46162] Fix | Delete
/**
[46163] Fix | Delete
* Internal dependencies
[46164] Fix | Delete
*/
[46165] Fix | Delete
[46166] Fix | Delete
[46167] Fix | Delete
[46168] Fix | Delete
[46169] Fix | Delete
[46170] Fix | Delete
function PatternsExplorer({
[46171] Fix | Delete
initialCategory,
[46172] Fix | Delete
rootClientId
[46173] Fix | Delete
}) {
[46174] Fix | Delete
const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)('');
[46175] Fix | Delete
const [selectedCategory, setSelectedCategory] = (0,external_wp_element_namespaceObject.useState)(initialCategory?.name);
[46176] Fix | Delete
const patternCategories = usePatternCategories(rootClientId);
[46177] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[46178] Fix | Delete
className: "block-editor-block-patterns-explorer",
[46179] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_explorer_sidebar, {
[46180] Fix | Delete
selectedCategory: selectedCategory,
[46181] Fix | Delete
patternCategories: patternCategories,
[46182] Fix | Delete
onClickCategory: setSelectedCategory,
[46183] Fix | Delete
searchValue: searchValue,
[46184] Fix | Delete
setSearchValue: setSearchValue
[46185] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_list, {
[46186] Fix | Delete
searchValue: searchValue,
[46187] Fix | Delete
selectedCategory: selectedCategory,
[46188] Fix | Delete
patternCategories: patternCategories,
[46189] Fix | Delete
rootClientId: rootClientId
[46190] Fix | Delete
})]
[46191] Fix | Delete
});
[46192] Fix | Delete
}
[46193] Fix | Delete
function PatternsExplorerModal({
[46194] Fix | Delete
onModalClose,
[46195] Fix | Delete
...restProps
[46196] Fix | Delete
}) {
[46197] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
[46198] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Patterns'),
[46199] Fix | Delete
onRequestClose: onModalClose,
[46200] Fix | Delete
isFullScreen: true,
[46201] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsExplorer, {
[46202] Fix | Delete
...restProps
[46203] Fix | Delete
})
[46204] Fix | Delete
});
[46205] Fix | Delete
}
[46206] Fix | Delete
/* harmony default export */ const block_patterns_explorer = (PatternsExplorerModal);
[46207] Fix | Delete
[46208] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/mobile-tab-navigation.js
[46209] Fix | Delete
/**
[46210] Fix | Delete
* WordPress dependencies
[46211] Fix | Delete
*/
[46212] Fix | Delete
[46213] Fix | Delete
[46214] Fix | Delete
[46215] Fix | Delete
[46216] Fix | Delete
[46217] Fix | Delete
function ScreenHeader({
[46218] Fix | Delete
title
[46219] Fix | Delete
}) {
[46220] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
[46221] Fix | Delete
spacing: 0,
[46222] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, {
[46223] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {
[46224] Fix | Delete
marginBottom: 0,
[46225] Fix | Delete
paddingX: 4,
[46226] Fix | Delete
paddingY: 3,
[46227] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[46228] Fix | Delete
spacing: 2,
[46229] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, {
[46230] Fix | Delete
style:
[46231] Fix | Delete
// TODO: This style override is also used in ToolsPanelHeader.
[46232] Fix | Delete
// It should be supported out-of-the-box by Button.
[46233] Fix | Delete
{
[46234] Fix | Delete
minWidth: 24,
[46235] Fix | Delete
padding: 0
[46236] Fix | Delete
},
[46237] Fix | Delete
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
[46238] Fix | Delete
size: "small",
[46239] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Back')
[46240] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {
[46241] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, {
[46242] Fix | Delete
level: 5,
[46243] Fix | Delete
children: title
[46244] Fix | Delete
})
[46245] Fix | Delete
})]
[46246] Fix | Delete
})
[46247] Fix | Delete
})
[46248] Fix | Delete
})
[46249] Fix | Delete
});
[46250] Fix | Delete
}
[46251] Fix | Delete
function MobileTabNavigation({
[46252] Fix | Delete
categories,
[46253] Fix | Delete
children
[46254] Fix | Delete
}) {
[46255] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
[46256] Fix | Delete
initialPath: "/",
[46257] Fix | Delete
className: "block-editor-inserter__mobile-tab-navigation",
[46258] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
[46259] Fix | Delete
path: "/",
[46260] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, {
[46261] Fix | Delete
children: categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
[46262] Fix | Delete
path: `/category/${category.name}`,
[46263] Fix | Delete
as: external_wp_components_namespaceObject.__experimentalItem,
[46264] Fix | Delete
isAction: true,
[46265] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[46266] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, {
[46267] Fix | Delete
children: category.label
[46268] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[46269] Fix | Delete
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
[46270] Fix | Delete
})]
[46271] Fix | Delete
})
[46272] Fix | Delete
}, category.name))
[46273] Fix | Delete
})
[46274] Fix | Delete
}), categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
[46275] Fix | Delete
path: `/category/${category.name}`,
[46276] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenHeader, {
[46277] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Back')
[46278] Fix | Delete
}), children(category)]
[46279] Fix | Delete
}, category.name))]
[46280] Fix | Delete
});
[46281] Fix | Delete
}
[46282] Fix | Delete
[46283] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/patterns-filter.js
[46284] Fix | Delete
/**
[46285] Fix | Delete
* WordPress dependencies
[46286] Fix | Delete
*/
[46287] Fix | Delete
[46288] Fix | Delete
[46289] Fix | Delete
[46290] Fix | Delete
[46291] Fix | Delete
[46292] Fix | Delete
/**
[46293] Fix | Delete
* Internal dependencies
[46294] Fix | Delete
*/
[46295] Fix | Delete
[46296] Fix | Delete
[46297] Fix | Delete
[46298] Fix | Delete
[46299] Fix | Delete
const getShouldDisableSyncFilter = sourceFilter => sourceFilter !== 'all';
[46300] Fix | Delete
const getShouldDisableNonUserSources = category => {
[46301] Fix | Delete
return category.name === myPatternsCategory.name;
[46302] Fix | Delete
};
[46303] Fix | Delete
function PatternsFilter({
[46304] Fix | Delete
setPatternSyncFilter,
[46305] Fix | Delete
setPatternSourceFilter,
[46306] Fix | Delete
patternSyncFilter,
[46307] Fix | Delete
patternSourceFilter,
[46308] Fix | Delete
scrollContainerRef,
[46309] Fix | Delete
category
[46310] Fix | Delete
}) {
[46311] Fix | Delete
// If the category is `myPatterns` then we need to set the source filter to `user`, but
[46312] Fix | Delete
// we do this by deriving from props rather than calling setPatternSourceFilter otherwise
[46313] Fix | Delete
// the user may be confused when switching to another category if the haven't explicity set
[46314] Fix | Delete
// this filter themselves.
[46315] Fix | Delete
const currentPatternSourceFilter = category.name === myPatternsCategory.name ? INSERTER_PATTERN_TYPES.user : patternSourceFilter;
[46316] Fix | Delete
[46317] Fix | Delete
// We need to disable the sync filter option if the source filter is not 'all' or 'user'
[46318] Fix | Delete
// otherwise applying them will just result in no patterns being shown.
[46319] Fix | Delete
const shouldDisableSyncFilter = getShouldDisableSyncFilter(currentPatternSourceFilter);
[46320] Fix | Delete
[46321] Fix | Delete
// We also need to disable the directory and theme source filter options if the category
[46322] Fix | Delete
// is `myPatterns` otherwise applying them will also just result in no patterns being shown.
[46323] Fix | Delete
const shouldDisableNonUserSources = getShouldDisableNonUserSources(category);
[46324] Fix | Delete
const patternSyncMenuOptions = (0,external_wp_element_namespaceObject.useMemo)(() => [{
[46325] Fix | Delete
value: 'all',
[46326] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('All', 'patterns')
[46327] Fix | Delete
}, {
[46328] Fix | Delete
value: INSERTER_SYNC_TYPES.full,
[46329] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'patterns'),
[46330] Fix | Delete
disabled: shouldDisableSyncFilter
[46331] Fix | Delete
}, {
[46332] Fix | Delete
value: INSERTER_SYNC_TYPES.unsynced,
[46333] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Not synced', 'patterns'),
[46334] Fix | Delete
disabled: shouldDisableSyncFilter
[46335] Fix | Delete
}], [shouldDisableSyncFilter]);
[46336] Fix | Delete
const patternSourceMenuOptions = (0,external_wp_element_namespaceObject.useMemo)(() => [{
[46337] Fix | Delete
value: 'all',
[46338] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('All', 'patterns'),
[46339] Fix | Delete
disabled: shouldDisableNonUserSources
[46340] Fix | Delete
}, {
[46341] Fix | Delete
value: INSERTER_PATTERN_TYPES.directory,
[46342] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Pattern Directory'),
[46343] Fix | Delete
disabled: shouldDisableNonUserSources
[46344] Fix | Delete
}, {
[46345] Fix | Delete
value: INSERTER_PATTERN_TYPES.theme,
[46346] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Theme & Plugins'),
[46347] Fix | Delete
disabled: shouldDisableNonUserSources
[46348] Fix | Delete
}, {
[46349] Fix | Delete
value: INSERTER_PATTERN_TYPES.user,
[46350] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('User')
[46351] Fix | Delete
}], [shouldDisableNonUserSources]);
[46352] Fix | Delete
function handleSetSourceFilterChange(newSourceFilter) {
[46353] Fix | Delete
setPatternSourceFilter(newSourceFilter);
[46354] Fix | Delete
if (getShouldDisableSyncFilter(newSourceFilter)) {
[46355] Fix | Delete
setPatternSyncFilter('all');
[46356] Fix | Delete
}
[46357] Fix | Delete
}
[46358] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[46359] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
[46360] Fix | Delete
popoverProps: {
[46361] Fix | Delete
placement: 'right-end'
[46362] Fix | Delete
},
[46363] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Filter patterns'),
[46364] Fix | Delete
toggleProps: {
[46365] Fix | Delete
size: 'compact'
[46366] Fix | Delete
},
[46367] Fix | Delete
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[46368] Fix | Delete
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
[46369] Fix | Delete
width: "24",
[46370] Fix | Delete
height: "24",
[46371] Fix | Delete
viewBox: "0 0 24 24",
[46372] Fix | Delete
fill: "none",
[46373] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[46374] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
[46375] Fix | Delete
d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",
[46376] Fix | Delete
fill: "currentColor"
[46377] Fix | Delete
})
[46378] Fix | Delete
})
[46379] Fix | Delete
}),
[46380] Fix | Delete
children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[46381] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
[46382] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Source'),
[46383] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, {
[46384] Fix | Delete
choices: patternSourceMenuOptions,
[46385] Fix | Delete
onSelect: value => {
[46386] Fix | Delete
handleSetSourceFilterChange(value);
[46387] Fix | Delete
scrollContainerRef.current?.scrollTo(0, 0);
[46388] Fix | Delete
},
[46389] Fix | Delete
value: currentPatternSourceFilter
[46390] Fix | Delete
})
[46391] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
[46392] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Type'),
[46393] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, {
[46394] Fix | Delete
choices: patternSyncMenuOptions,
[46395] Fix | Delete
onSelect: value => {
[46396] Fix | Delete
setPatternSyncFilter(value);
[46397] Fix | Delete
scrollContainerRef.current?.scrollTo(0, 0);
[46398] Fix | Delete
},
[46399] Fix | Delete
value: patternSyncFilter
[46400] Fix | Delete
})
[46401] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[46402] Fix | Delete
className: "block-editor-tool-selector__help",
[46403] Fix | Delete
children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced.'), {
[46404] Fix | Delete
Link: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
[46405] Fix | Delete
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/patterns/')
[46406] Fix | Delete
})
[46407] Fix | Delete
})
[46408] Fix | Delete
})]
[46409] Fix | Delete
})
[46410] Fix | Delete
})
[46411] Fix | Delete
});
[46412] Fix | Delete
}
[46413] Fix | Delete
[46414] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js
[46415] Fix | Delete
/**
[46416] Fix | Delete
* WordPress dependencies
[46417] Fix | Delete
*/
[46418] Fix | Delete
[46419] Fix | Delete
[46420] Fix | Delete
[46421] Fix | Delete
[46422] Fix | Delete
/**
[46423] Fix | Delete
* Internal dependencies
[46424] Fix | Delete
*/
[46425] Fix | Delete
[46426] Fix | Delete
[46427] Fix | Delete
[46428] Fix | Delete
[46429] Fix | Delete
[46430] Fix | Delete
[46431] Fix | Delete
[46432] Fix | Delete
[46433] Fix | Delete
[46434] Fix | Delete
const pattern_category_previews_noop = () => {};
[46435] Fix | Delete
function PatternCategoryPreviews({
[46436] Fix | Delete
rootClientId,
[46437] Fix | Delete
onInsert,
[46438] Fix | Delete
onHover = pattern_category_previews_noop,
[46439] Fix | Delete
category,
[46440] Fix | Delete
showTitlesAsTooltip
[46441] Fix | Delete
}) {
[46442] Fix | Delete
const [allPatterns,, onClickPattern] = use_patterns_state(onInsert, rootClientId, category?.name);
[46443] Fix | Delete
const [patternSyncFilter, setPatternSyncFilter] = (0,external_wp_element_namespaceObject.useState)('all');
[46444] Fix | Delete
const [patternSourceFilter, setPatternSourceFilter] = (0,external_wp_element_namespaceObject.useState)('all');
[46445] Fix | Delete
const availableCategories = usePatternCategories(rootClientId, patternSourceFilter);
[46446] Fix | Delete
const scrollContainerRef = (0,external_wp_element_namespaceObject.useRef)();
[46447] Fix | Delete
const currentCategoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => allPatterns.filter(pattern => {
[46448] Fix | Delete
if (isPatternFiltered(pattern, patternSourceFilter, patternSyncFilter)) {
[46449] Fix | Delete
return false;
[46450] Fix | Delete
}
[46451] Fix | Delete
if (category.name === allPatternsCategory.name) {
[46452] Fix | Delete
return true;
[46453] Fix | Delete
}
[46454] Fix | Delete
if (category.name === myPatternsCategory.name && pattern.type === INSERTER_PATTERN_TYPES.user) {
[46455] Fix | Delete
return true;
[46456] Fix | Delete
}
[46457] Fix | Delete
if (category.name === 'uncategorized') {
[46458] Fix | Delete
// The uncategorized category should show all the patterns without any category...
[46459] Fix | Delete
if (!pattern.categories) {
[46460] Fix | Delete
return true;
[46461] Fix | Delete
}
[46462] Fix | Delete
[46463] Fix | Delete
// ...or with no available category.
[46464] Fix | Delete
return !pattern.categories.some(catName => availableCategories.some(c => c.name === catName));
[46465] Fix | Delete
}
[46466] Fix | Delete
return pattern.categories?.includes(category.name);
[46467] Fix | Delete
}), [allPatterns, availableCategories, category.name, patternSourceFilter, patternSyncFilter]);
[46468] Fix | Delete
const pagingProps = usePatternsPaging(currentCategoryPatterns, category, scrollContainerRef);
[46469] Fix | Delete
const {
[46470] Fix | Delete
changePage
[46471] Fix | Delete
} = pagingProps;
[46472] Fix | Delete
[46473] Fix | Delete
// Hide block pattern preview on unmount.
[46474] Fix | Delete
// eslint-disable-next-line react-hooks/exhaustive-deps
[46475] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []);
[46476] Fix | Delete
const onSetPatternSyncFilter = (0,external_wp_element_namespaceObject.useCallback)(value => {
[46477] Fix | Delete
setPatternSyncFilter(value);
[46478] Fix | Delete
changePage(1);
[46479] Fix | Delete
}, [setPatternSyncFilter, changePage]);
[46480] Fix | Delete
const onSetPatternSourceFilter = (0,external_wp_element_namespaceObject.useCallback)(value => {
[46481] Fix | Delete
setPatternSourceFilter(value);
[46482] Fix | Delete
changePage(1);
[46483] Fix | Delete
}, [setPatternSourceFilter, changePage]);
[46484] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[46485] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[46486] Fix | Delete
spacing: 2,
[46487] Fix | Delete
className: "block-editor-inserter__patterns-category-panel-header",
[46488] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[46489] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, {
[46490] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, {
[46491] Fix | Delete
className: "block-editor-inserter__patterns-category-panel-title",
[46492] Fix | Delete
size: 13,
[46493] Fix | Delete
level: 4,
[46494] Fix | Delete
as: "div",
[46495] Fix | Delete
children: category.label
[46496] Fix | Delete
})
[46497] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsFilter, {
[46498] Fix | Delete
patternSyncFilter: patternSyncFilter,
[46499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function