Skip to content

Commit

Permalink
prep build 04/10
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Apr 10, 2024
2 parents 3567f82 + e4623e1 commit b6a7fc3
Show file tree
Hide file tree
Showing 30 changed files with 905 additions and 695 deletions.
297 changes: 297 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/interactivity-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function gutenberg_reregister_interactivity_script_modules() {

wp_register_script_module(
'@wordpress/interactivity',
gutenberg_url( '/build/interactivity/index.min.js' ),
gutenberg_url( '/build/interactivity/' . ( SCRIPT_DEBUG ? 'debug.min.js' : 'index.min.js' ) ),
array(),
$default_version
);
Expand Down
74 changes: 36 additions & 38 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
"version": "18.1.0-rc.2",
"version": "18.1.0",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down
1 change: 0 additions & 1 deletion packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ $z-layers: (
// Site editor layout
".edit-site-layout__header-container": 4,
".edit-site-layout__hub": 3,
".edit-site-layout__header": 2,
".edit-site-page-header": 2,
".edit-site-page-content": 1,
".edit-site-patterns__header": 2,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"postcss-prefixwrap": "^1.41.0",
"postcss-urlrebase": "^1.0.0",
"react-autosize-textarea": "^7.1.0",
"react-easy-crop": "^4.5.1",
"react-easy-crop": "^5.0.6",
"remove-accents": "^0.5.0"
},
"peerDependencies": {
Expand Down
22 changes: 6 additions & 16 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ function Iframe( {
function onLoad() {
const { contentDocument, ownerDocument } = node;
const { documentElement } = contentDocument;
// Get any CSS classes the iframe document body may initially have
// to re-apply them later together with the ones of the main document
// body. This is necessary for some CSS classes for example the
// `is-dark-theme` class added by useDarkThemeBodyClassName.
const initialIframeBodyClasses = Array.from(
contentDocument.body.classList
);
iFrameDocument = contentDocument;

documentElement.classList.add( 'block-editor-iframe__html' );
Expand All @@ -158,15 +151,12 @@ function Iframe( {
// be added in the editor too, which we'll somehow have to get from
// the server in the future (which will run the PHP filters).
setBodyClasses(
Array.from( ownerDocument.body.classList )
.concat( initialIframeBodyClasses )
.filter(
( name ) =>
name.startsWith( 'admin-color-' ) ||
name.startsWith( 'post-type-' ) ||
name === 'wp-embed-responsive' ||
name === 'is-dark-theme'
)
Array.from( ownerDocument.body.classList ).filter(
( name ) =>
name.startsWith( 'admin-color-' ) ||
name.startsWith( 'post-type-' ) ||
name === 'wp-embed-responsive'
)
);

contentDocument.dir = ownerDocument.dir;
Expand Down
7 changes: 4 additions & 3 deletions packages/components/src/color-palette/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function ColorPalette( {

const scale = useRef( new Animated.Value( 1 ) ).current;
const opacity = useRef( new Animated.Value( 1 ) ).current;
const delayedScrollRef = useRef();

const mergedColors = [
...new Set(
Expand Down Expand Up @@ -216,11 +217,11 @@ function ColorPalette( {
}

function scrollToEndWithDelay() {
const delayedScroll = setTimeout( () => {
scrollViewRef.current.scrollToEnd();
delayedScrollRef.current = setTimeout( () => {
scrollViewRef?.current.scrollToEnd();
}, ANIMATION_DURATION );
return () => {
clearTimeout( delayedScroll );
clearTimeout( delayedScrollRef.current );
};
}

Expand Down
64 changes: 34 additions & 30 deletions packages/core-data/src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const getEditedEntityRecord = forwardResolver( 'getEntityRecord' );
*/
export const getEntityRecords =
( kind, name, query = {} ) =>
async ( { dispatch } ) => {
async ( { dispatch, registry } ) => {
const configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );
const entityConfig = configs.find(
( config ) => config.name === name && config.kind === kind
Expand Down Expand Up @@ -261,37 +261,41 @@ export const getEntityRecords =
} );
}

dispatch.receiveEntityRecords(
kind,
name,
records,
query,
false,
undefined,
meta
);
registry.batch( () => {
dispatch.receiveEntityRecords(
kind,
name,
records,
query,
false,
undefined,
meta
);

// When requesting all fields, the list of results can be used to
// resolve the `getEntityRecord` selector in addition to `getEntityRecords`.
// See https://github.com/WordPress/gutenberg/pull/26575
if ( ! query?._fields && ! query.context ) {
const key = entityConfig.key || DEFAULT_ENTITY_KEY;
const resolutionsArgs = records
.filter( ( record ) => record[ key ] )
.map( ( record ) => [ kind, name, record[ key ] ] );
// When requesting all fields, the list of results can be used to
// resolve the `getEntityRecord` selector in addition to `getEntityRecords`.
// See https://github.com/WordPress/gutenberg/pull/26575
if ( ! query?._fields && ! query.context ) {
const key = entityConfig.key || DEFAULT_ENTITY_KEY;
const resolutionsArgs = records
.filter( ( record ) => record[ key ] )
.map( ( record ) => [ kind, name, record[ key ] ] );

dispatch( {
type: 'START_RESOLUTIONS',
selectorName: 'getEntityRecord',
args: resolutionsArgs,
} );
dispatch( {
type: 'FINISH_RESOLUTIONS',
selectorName: 'getEntityRecord',
args: resolutionsArgs,
} );
}

dispatch( {
type: 'START_RESOLUTIONS',
selectorName: 'getEntityRecord',
args: resolutionsArgs,
} );
dispatch( {
type: 'FINISH_RESOLUTIONS',
selectorName: 'getEntityRecord',
args: resolutionsArgs,
} );
}
} finally {
dispatch.__unstableReleaseStoreLock( lock );
} );
} catch ( e ) {
dispatch.__unstableReleaseStoreLock( lock );
}
};
Expand Down
7 changes: 4 additions & 3 deletions packages/core-data/src/test/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe( 'getEntityRecords', () => {
baseURLParams: { context: 'edit' },
},
];
const registry = { batch: ( callback ) => callback() };

beforeEach( async () => {
triggerFetch.mockReset();
Expand All @@ -160,7 +161,7 @@ describe( 'getEntityRecords', () => {
// Provide response
triggerFetch.mockImplementation( () => POST_TYPES );

await getEntityRecords( 'root', 'postType' )( { dispatch } );
await getEntityRecords( 'root', 'postType' )( { dispatch, registry } );

// Fetch request should have been issued.
expect( triggerFetch ).toHaveBeenCalledWith( {
Expand Down Expand Up @@ -191,7 +192,7 @@ describe( 'getEntityRecords', () => {
// Provide response
triggerFetch.mockImplementation( () => POST_TYPES );

await getEntityRecords( 'root', 'postType' )( { dispatch } );
await getEntityRecords( 'root', 'postType' )( { dispatch, registry } );

// Fetch request should have been issued.
expect( triggerFetch ).toHaveBeenCalledWith( {
Expand Down Expand Up @@ -221,7 +222,7 @@ describe( 'getEntityRecords', () => {
// Provide response
triggerFetch.mockImplementation( () => POST_TYPES );

await getEntityRecords( 'root', 'postType' )( { dispatch } );
await getEntityRecords( 'root', 'postType' )( { dispatch, registry } );

// Fetch request should have been issued.
expect( triggerFetch ).toHaveBeenCalledWith( {
Expand Down
2 changes: 1 addition & 1 deletion packages/dataviews/src/search-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function ListBox( { view, filter, onChangeView } ) {
const compositeStore = useCompositeStore( {
virtualFocus: true,
focusLoop: true,
// When we have no or just one operators, we can set the first item as active.
// When we have no or just one operator, we can set the first item as active.
// We do that by passing `undefined` to `defaultActiveId`. Otherwise, we set it to `null`,
// so the first item is not selected, since the focus is on the operators control.
defaultActiveId: filter.operators?.length === 1 ? undefined : null,
Expand Down
Loading

0 comments on commit b6a7fc3

Please sign in to comment.