Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
This brings the gallery edit changes to the v1 directory, and merges the
changes for the image block.
  • Loading branch information
mkevins committed Jun 3, 2021
1 parent e5420c6 commit e183dcb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
6 changes: 6 additions & 0 deletions packages/block-library/src/gallery/v1/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ function GalleryEdit( props ) {
return {};
}, [ isSelected, attributes.ids, imageSizes ] );

function onFocusGalleryCaption() {
setSelectedImage();
}

function setAttributes( newAttrs ) {
if ( newAttrs.ids ) {
throw new Error(
Expand Down Expand Up @@ -464,6 +468,8 @@ function GalleryEdit( props ) {
onDeselectImage={ onDeselectImage }
onSetImageAttributes={ setImageAttributes }
blockProps={ blockProps }
// This prop is used by gallery.native.js.
onFocusGalleryCaption={ onFocusGalleryCaption }
/>
</>
);
Expand Down
6 changes: 0 additions & 6 deletions packages/block-library/src/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ export function ImageEdit( {
insertBlocksAfter,
noticeOperations,
onReplace,
<<<<<<< HEAD
context,
=======
clientId,
>>>>>>> trunk
} ) {
const {
url = '',
Expand Down Expand Up @@ -304,11 +301,8 @@ export function ImageEdit( {
onSelectURL={ onSelectURL }
onUploadError={ onUploadError }
containerRef={ ref }
<<<<<<< HEAD
context={ context }
=======
clientId={ clientId }
>>>>>>> trunk
/>
) }
{ ! url && (
Expand Down
9 changes: 1 addition & 8 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,14 @@ export default function Image( {
onSelectURL,
onUploadError,
containerRef,
<<<<<<< HEAD
context,
} ) {
const captionRef = useRef();
const prevUrl = usePrevious( url );
const { allowResize = true, isGrouped = false } = context;
const { block, currentId, image, multiImageSelection } = useSelect(
=======
clientId,
} ) {
const captionRef = useRef();
const prevUrl = usePrevious( url );
const { allowResize = true, isGrouped = false } = context;
const { getBlock } = useSelect( blockEditorStore );
const { image, multiImageSelection } = useSelect(
>>>>>>> trunk
( select ) => {
const { getMedia } = select( coreStore );
const { getMultiSelectedBlockClientIds, getBlockName } = select(
Expand Down

0 comments on commit e183dcb

Please sign in to comment.