Skip to content

Commit

Permalink
Merge branch 'WordPress:trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
eduwass authored Dec 10, 2024
2 parents efe3c12 + 84f29ea commit 4a5d7fc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ concurrency:

jobs:
test:
runs-on: macos-12
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
runs-on: macos-13
if: false
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
matrix:
native-test-name: [gutenberg-editor-rendering]
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ concurrency:

jobs:
test:
runs-on: macos-12
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
runs-on: macos-13
if: false
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
matrix:
xcode: ['14.2']
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ class="wp-lightbox-overlay zoom"
data-wp-on-async--click="actions.hideLightbox"
data-wp-on-async-window--resize="callbacks.setOverlayStyles"
data-wp-on-async-window--scroll="actions.handleScroll"
data-wp-bind--style="state.overlayStyles"
tabindex="-1"
>
<button type="button" aria-label="$close_button_label" style="fill: $close_button_color" class="close-button">
Expand All @@ -306,7 +307,6 @@ class="wp-lightbox-overlay zoom"
</figure>
</div>
<div class="scrim" style="background-color: $background_color" aria-hidden="true"></div>
<style data-wp-text="state.overlayStyles"></style>
</div>
HTML;
}
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/image/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ const { state, actions, callbacks } = store(
// adding 1 pixel to the container width and height solves the problem,
// though this can be removed if the issue is fixed in the future.
state.overlayStyles = `
:root {
--wp--lightbox-initial-top-position: ${ screenPosY }px;
--wp--lightbox-initial-left-position: ${ screenPosX }px;
--wp--lightbox-container-width: ${ containerWidth + 1 }px;
Expand All @@ -352,8 +351,7 @@ const { state, actions, callbacks } = store(
--wp--lightbox-scrollbar-width: ${
window.innerWidth - document.documentElement.clientWidth
}px;
}
`;
`;
},
setButtonStyles() {
const { imageId } = getContext();
Expand Down
35 changes: 21 additions & 14 deletions packages/edit-site/src/components/post-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,22 @@ const fieldsWithBulkEditSupport = [

function PostEditForm( { postType, postId } ) {
const ids = useMemo( () => postId.split( ',' ), [ postId ] );
const { record } = useSelect(
const { record, hasFinishedResolution } = useSelect(
( select ) => {
const args = [ 'postType', postType, ids[ 0 ] ];

const {
getEditedEntityRecord,
hasFinishedResolution: hasFinished,
} = select( coreDataStore );

return {
record:
ids.length === 1
? select( coreDataStore ).getEditedEntityRecord(
'postType',
postType,
ids[ 0 ]
)
: null,
ids.length === 1 ? getEditedEntityRecord( ...args ) : null,
hasFinishedResolution: hasFinished(
'getEditedEntityRecord',
args
),
};
},
[ postType, ids ]
Expand Down Expand Up @@ -159,12 +164,14 @@ function PostEditForm( { postType, postId } ) {
return (
<VStack spacing={ 4 }>
<PostCardPanel postType={ postType } postId={ ids } />
<DataForm
data={ ids.length === 1 ? record : multiEdits }
fields={ fieldsWithDependency }
form={ form }
onChange={ onChange }
/>
{ hasFinishedResolution && (
<DataForm
data={ ids.length === 1 ? record : multiEdits }
fields={ fieldsWithDependency }
form={ form }
onChange={ onChange }
/>
) }
</VStack>
);
}
Expand Down

0 comments on commit 4a5d7fc

Please sign in to comment.