Skip to content

Commit

Permalink
Editor: Update packages for 6.6.2 RC1.
Browse files Browse the repository at this point in the history
Updates the versions from the [WordPress/gutenberg@a74a70e released packages] for the following bugfixes:

* [WordPress/gutenberg#63980 Global Styles: Fix block custom CSS pseudo element selectors]
* [WordPress/gutenberg#64463 Featured Image Block: Reduce CSS specificity]
* [WordPress/gutenberg#64076 Fix bumped specificity for layout styles in non-iframed editor]
* [WordPress/gutenberg#64379 Don't allow duplicating template parts in non-block-based themes]
* [WordPress/gutenberg#64250 Data Views: Don't render action modal when there are no eligible items]
* [WordPress/gutenberg#63724 Fix canvas issues by removing VisualEditor’s height]
* [WordPress/gutenberg#64992 Post Editor: fix click space after post content to append]
* [WordPress/gutenberg#63939 Post Editor: Prevent popover from being hidden by metabox]
* [WordPress/gutenberg#64639 Post editor: apply space below content using a pseudo-element instead of padding-bottom]
* [WordPress/gutenberg#64015 Avoid errors for post types without a 'menu_icon']
* [WordPress/gutenberg#64458 Update postcss-prefixwrap dependency to 1.51.0 to fix prefixing in :where selectors]

Props vcanales.
Fixes #61982.
See #61704, #61769, #61829.
Built from https://develop.svn.wordpress.org/trunk@58988


git-svn-id: https://core.svn.wordpress.org/trunk@58384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
hellofromtonya committed Sep 4, 2024
1 parent 153f076 commit 960e601
Show file tree
Hide file tree
Showing 27 changed files with 137 additions and 101 deletions.
2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/blocks/post-featured-image/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
display:block;
height:100%;
}
.wp-block-post-featured-image img{
.wp-block-post-featured-image :where(img){
box-sizing:border-box;
height:auto;
max-width:100%;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/blocks/post-featured-image/style-rtl.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wp-includes/blocks/post-featured-image/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
display:block;
height:100%;
}
.wp-block-post-featured-image img{
.wp-block-post-featured-image :where(img){
box-sizing:border-box;
height:auto;
max-width:100%;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/blocks/post-featured-image/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
display:block;
height:100%;
}
.wp-block-post-featured-image img{
.wp-block-post-featured-image :where(img){
box-sizing:border-box;
height:auto;
max-width:100%;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
display:block;
height:100%;
}
.wp-block-post-featured-image img{
.wp-block-post-featured-image :where(img){
box-sizing:border-box;
height:auto;
max-width:100%;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style.min.css

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions wp-includes/css/dist/edit-post/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@
content:none;
}

.edit-post-visual-editor:not(.is-iframed){
flex:1 0 auto;
height:auto;
}

.edit-post-layout__metaboxes{
clear:both;
flex-shrink:0;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/edit-post/style-rtl.min.css

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions wp-includes/css/dist/edit-post/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@
content:none;
}

.edit-post-visual-editor:not(.is-iframed){
flex:1 0 auto;
height:auto;
}

.edit-post-layout__metaboxes{
clear:both;
flex-shrink:0;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/edit-post/style.min.css

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions wp-includes/css/dist/editor/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,14 @@ body.is-fullscreen-mode .interface-interface-skeleton{
height:61px;
}

.editor-editor-interface .interface-interface-skeleton__content{
isolation:isolate;
}

.editor-visual-editor{
flex:1 0 auto;
}

.components-editor-notices__dismissible,.components-editor-notices__pinned{
color:#1e1e1e;
left:0;
Expand Down Expand Up @@ -2458,8 +2466,6 @@ h3.components-heading.editor-template-areas__title{
align-items:center;
background-color:#ddd;
display:block;
height:100%;
isolation:isolate;
position:relative;
}
.editor-visual-editor.is-resizable{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/editor/style-rtl.min.css

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions wp-includes/css/dist/editor/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,14 @@ body.is-fullscreen-mode .interface-interface-skeleton{
height:61px;
}

.editor-editor-interface .interface-interface-skeleton__content{
isolation:isolate;
}

.editor-visual-editor{
flex:1 0 auto;
}

.components-editor-notices__dismissible,.components-editor-notices__pinned{
color:#1e1e1e;
left:0;
Expand Down Expand Up @@ -2458,8 +2466,6 @@ h3.components-heading.editor-template-areas__title{
align-items:center;
background-color:#ddd;
display:block;
height:100%;
isolation:isolate;
position:relative;
}
.editor-visual-editor.is-resizable{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/editor/style.min.css

Large diffs are not rendered by default.

123 changes: 80 additions & 43 deletions wp-includes/js/dist/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1574,9 +1574,7 @@ const CSSSelector_1 = __webpack_require__(3467);
const prefixWrapCSSRule = (cssRule, nested, ignoredSelectors, prefixSelector, prefixRootTags) => {
// Check each rule to see if it exactly matches our prefix selector, when
// this happens, don't try to prefix that selector.
const rules = cssRule.selector
.split(",")
.filter((selector) => !(0, CSSSelector_1.cssRuleMatchesPrefixSelector)({ selector: selector }, prefixSelector));
const rules = cssRule.selectors.filter((selector) => !(0, CSSSelector_1.cssRuleMatchesPrefixSelector)({ selector: selector }, prefixSelector));
if (rules.length === 0) {
return;
}
Expand Down Expand Up @@ -10465,13 +10463,48 @@ const {
const STORE_NAME = 'core/block-editor';

;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/utils.js
/**
* WordPress dependencies
*/


/**
* Internal dependencies
*/



const withRootClientIdOptionKey = Symbol('withRootClientId');
const parsedPatternCache = new WeakMap();
function parsePattern(pattern) {
const blocks = (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
__unstableSkipMigrationLogs: true
});
if (blocks.length === 1) {
blocks[0].attributes = {
...blocks[0].attributes,
metadata: {
...(blocks[0].attributes.metadata || {}),
categories: pattern.categories,
patternName: pattern.name,
name: blocks[0].attributes.metadata?.name || pattern.title
}
};
}
return {
...pattern,
blocks
};
}
function getParsedPattern(pattern) {
let parsedPattern = parsedPatternCache.get(pattern);
if (parsedPattern) {
return parsedPattern;
}
parsedPattern = parsePattern(pattern);
parsedPatternCache.set(pattern, parsedPattern);
return parsedPattern;
}
const checkAllowList = (list, item, defaultResult = null) => {
if (typeof list === 'boolean') {
return list;
Expand Down Expand Up @@ -11056,23 +11089,22 @@ const getInserterMediaCategories = (0,external_wp_data_namespaceObject.createSel
*/
const hasAllowedPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null) => {
const {
getAllPatterns,
__experimentalGetParsedPattern
getAllPatterns
} = unlock(select(STORE_NAME));
const patterns = getAllPatterns();
const {
allowedBlockTypes
} = getSettings(state);
return patterns.some(({
name,
inserter = true
}) => {
return patterns.some(pattern => {
const {
inserter = true
} = pattern;
if (!inserter) {
return false;
}
const {
blocks
} = __experimentalGetParsedPattern(name);
} = getParsedPattern(pattern);
return checkAllowListRecursive(blocks, allowedBlockTypes) && blocks.every(({
name: blockName
}) => canInsertBlockType(state, blockName, rootClientId));
Expand Down Expand Up @@ -13179,30 +13211,10 @@ function __experimentalGetDirectInsertBlock(state, rootClientId = null) {
});
return getDirectInsertBlock(state, rootClientId);
}
const __experimentalGetParsedPattern = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, patternName) => {
const __experimentalGetParsedPattern = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, patternName) => {
const pattern = unlock(select(STORE_NAME)).getPatternBySlug(patternName);
if (!pattern) {
return null;
}
const blocks = (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
__unstableSkipMigrationLogs: true
});
if (blocks.length === 1) {
blocks[0].attributes = {
...blocks[0].attributes,
metadata: {
...(blocks[0].attributes.metadata || {}),
categories: pattern.categories,
patternName: pattern.name,
name: blocks[0].attributes.metadata?.name || pattern.title
}
};
}
return {
...pattern,
blocks
};
}, (state, patternName) => [unlock(select(STORE_NAME)).getPatternBySlug(patternName)]));
return pattern ? getParsedPattern(pattern) : null;
});
const getAllowedPatternsDependants = select => (state, rootClientId) => [...getAllPatternsDependants(select)(state), ...getInsertBlockTypeDependants(state, rootClientId)];

/**
Expand All @@ -13216,18 +13228,15 @@ const getAllowedPatternsDependants = select => (state, rootClientId) => [...getA
const __experimentalGetAllowedPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => {
return (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null) => {
const {
getAllPatterns,
__experimentalGetParsedPattern: getParsedPattern
getAllPatterns
} = unlock(select(STORE_NAME));
const patterns = getAllPatterns();
const {
allowedBlockTypes
} = getSettings(state);
const parsedPatterns = patterns.filter(({
inserter = true
}) => !!inserter).map(({
name
}) => getParsedPattern(name));
}) => !!inserter).map(getParsedPattern);
const availableParsedPatterns = parsedPatterns.filter(({
blocks
}) => checkAllowListRecursive(blocks, allowedBlockTypes));
Expand Down Expand Up @@ -34098,7 +34107,7 @@ function getLayoutStyles({
// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.
combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:where(.${className}${spacingStyle?.selector || ''})` : `:where(${selector}.${className}${spacingStyle?.selector || ''})`;
} else {
combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `.${className}${spacingStyle?.selector || ''}` : `${selector}-${className}${spacingStyle?.selector || ''}`;
combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:root :where(.${className})${spacingStyle?.selector || ''}` : `:root :where(${selector}-${className})${spacingStyle?.selector || ''}`;
}
ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`;
}
Expand Down Expand Up @@ -34163,7 +34172,10 @@ const getNodesWithStyles = (tree, blockSelectors) => {
if (styles) {
nodes.push({
styles,
selector: ROOT_BLOCK_SELECTOR
selector: ROOT_BLOCK_SELECTOR,
// Root selector (body) styles should not be wrapped in `:root where()` to keep
// specificity at (0,0,1) and maintain backwards compatibility.
skipSelectorWrapper: true
});
}
Object.entries(external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS).forEach(([name, selector]) => {
Expand Down Expand Up @@ -34614,10 +34626,16 @@ function updateConfigWithSeparator(config) {
}
function processCSSNesting(css, blockSelector) {
let processedCSS = '';
if (!css || css.trim() === '') {
return processedCSS;
}

// Split CSS nested rules.
const parts = css.split('&');
parts.forEach(part => {
if (!part || part.trim() === '') {
return;
}
const isRootCss = !part.includes('{');
if (isRootCss) {
// If the part doesn't contain braces, it applies to the root level.
Expand All @@ -34629,8 +34647,27 @@ function processCSSNesting(css, blockSelector) {
return;
}
const [nestedSelector, cssValue] = splittedPart;
const combinedSelector = nestedSelector.startsWith(' ') ? scopeSelector(blockSelector, nestedSelector) : appendToSelector(blockSelector, nestedSelector);
processedCSS += `:root :where(${combinedSelector}){${cssValue.trim()}}`;

// Handle pseudo elements such as ::before, ::after, etc. Regex will also
// capture any leading combinator such as >, +, or ~, as well as spaces.
// This allows pseudo elements as descendants e.g. `.parent ::before`.
const matches = nestedSelector.match(/([>+~\s]*::[a-zA-Z-]+)/);
const pseudoPart = matches ? matches[1] : '';
const withoutPseudoElement = matches ? nestedSelector.replace(pseudoPart, '').trim() : nestedSelector.trim();
let combinedSelector;
if (withoutPseudoElement === '') {
// Only contained a pseudo element to use the block selector to form
// the final `:root :where()` selector.
combinedSelector = blockSelector;
} else {
// If the nested selector is a descendant of the block scope it with the
// block selector. Otherwise append it to the block selector.
combinedSelector = nestedSelector.startsWith(' ') ? scopeSelector(blockSelector, withoutPseudoElement) : appendToSelector(blockSelector, withoutPseudoElement);
}

// Build final rule, re-adding any pseudo element outside the `:where()`
// to maintain valid CSS selector.
processedCSS += `:root :where(${combinedSelector})${pseudoPart}{${cssValue.trim()}}`;
}
});
return processedCSS;
Expand Down Expand Up @@ -38494,7 +38531,7 @@ function createBlockCompleter() {
prioritizedBlocks: getBlockListSettings(_rootClientId)?.prioritizedInserterBlocks
};
}, []);
const [items, categories, collections] = use_block_types_state(rootClientId, block_noop);
const [items, categories, collections] = use_block_types_state(rootClientId, block_noop, true);
const filteredItems = (0,external_wp_element_namespaceObject.useMemo)(() => {
const initialFilteredItems = !!filterValue.trim() ? searchBlockItems(items, categories, collections, filterValue) : orderInserterBlockItems(orderBy(items, 'frecency', 'desc'), prioritizedBlocks);
return initialFilteredItems.filter(item => item.name !== selectedBlockName).slice(0, SHOWN_BLOCK_TYPES);
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/block-editor.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 960e601

Please sign in to comment.