Skip to content

Commit

Permalink
prep build 1/21
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jan 21, 2025
2 parents bb6aa8c + 05ef404 commit 6d53885
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: ruby/setup-ruby@7a6302104fbeea3c6aaa43b1b91e08f7d6623279 # v1.209.0
- uses: ruby/setup-ruby@28c4deda893d5a96a6b2d958c5b47fc18d65c9d3 # v1.213.0
with:
# `.ruby-version` file location
working-directory: packages/react-native-editor/ios
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-issue-gardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Update issues
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: ${{ matrix.message }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ You can access the Dashboard at: `http://localhost:8888/wp-admin/` using **Usern

#### Accessing the MySQL Database

To access the MySQL database on the `wp-env` instance you will first need the connection details. To do this:
phpMyAdmin is available by default for the Gutenberg project. You can access the MySQL Database at: `http://localhost:9000/`.

If you want to access the database through another tool, you will first need the connection details. To do this:

1. In a terminal, navigate to your local Gutenberg repo.
2. Run `npm run wp-env start` - various information about the `wp-env` environment should be logged into the terminal.
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 @@ -25,7 +25,6 @@ $z-layers: (
".components-popover__close": 5,
".block-editor-block-list__insertion-point": 6,
".block-editor-warning": 5,
".block-library-gallery-item__inline-menu": 20,
".block-editor-url-input__suggestions": 30,
".edit-post-layout__footer": 30,
".interface-interface-skeleton__header": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* WordPress dependencies
*/
import {
PanelBody,
__experimentalUseSlotFills as useSlotFills,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { useLayoutEffect, useState } from '@wordpress/element';
import { useDispatch, useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
Expand All @@ -15,40 +15,75 @@ import { __ } from '@wordpress/i18n';
import InspectorControlsGroups from '../inspector-controls/groups';
import { default as InspectorControls } from '../inspector-controls';
import { store as blockEditorStore } from '../../store';
import { useToolsPanelDropdownMenuProps } from '../global-styles/utils';
import { cleanEmptyObject } from '../../hooks/utils';

const PositionControlsPanel = () => {
const [ initialOpen, setInitialOpen ] = useState();
const { selectedClientIds, selectedBlocks, hasPositionAttribute } =
useSelect( ( select ) => {
const { getBlocksByClientId, getSelectedBlockClientIds } =
select( blockEditorStore );

// Determine whether the panel should be expanded.
const { multiSelectedBlocks } = useSelect( ( select ) => {
const { getBlocksByClientId, getSelectedBlockClientIds } =
select( blockEditorStore );
const clientIds = getSelectedBlockClientIds();
return {
multiSelectedBlocks: getBlocksByClientId( clientIds ),
};
}, [] );
const selectedBlockClientIds = getSelectedBlockClientIds();
const _selectedBlocks = getBlocksByClientId(
selectedBlockClientIds
);

useLayoutEffect( () => {
// If any selected block has a position set, open the panel by default.
// The first block's value will still be used within the control though.
if ( initialOpen === undefined ) {
setInitialOpen(
multiSelectedBlocks.some(
return {
selectedClientIds: selectedBlockClientIds,
selectedBlocks: _selectedBlocks,
hasPositionAttribute: _selectedBlocks?.some(
( { attributes } ) => !! attributes?.style?.position?.type
)
);
),
};
}, [] );

const { updateBlockAttributes } = useDispatch( blockEditorStore );
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

function resetPosition() {
if ( ! selectedClientIds?.length || ! selectedBlocks?.length ) {
return;
}
}, [ initialOpen, multiSelectedBlocks, setInitialOpen ] );

const attributesByClientId = Object.fromEntries(
selectedBlocks?.map( ( { clientId, attributes } ) => [
clientId,
{
style: cleanEmptyObject( {
...attributes?.style,
position: {
...attributes?.style?.position,
type: undefined,
top: undefined,
right: undefined,
bottom: undefined,
left: undefined,
},
} ),
},
] )
);

updateBlockAttributes( selectedClientIds, attributesByClientId, true );
}

return (
<PanelBody
<ToolsPanel
className="block-editor-block-inspector__position"
title={ __( 'Position' ) }
initialOpen={ initialOpen ?? false }
label={ __( 'Position' ) }
resetAll={ resetPosition }
dropdownMenuProps={ dropdownMenuProps }
>
<InspectorControls.Slot group="position" />
</PanelBody>
<ToolsPanelItem
isShownByDefault={ hasPositionAttribute }
label={ __( 'Position' ) }
hasValue={ () => hasPositionAttribute }
onDeselect={ resetPosition }
>
<InspectorControls.Slot group="position" />
</ToolsPanelItem>
</ToolsPanel>
);
};

Expand Down
56 changes: 0 additions & 56 deletions packages/block-library/src/gallery/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@
opacity: 0.3;
}

.is-selected .block-library-gallery-item__inline-menu {
display: inline-flex;
}

.block-editor-media-placeholder {
margin: 0;
height: 100%;
Expand All @@ -131,58 +127,6 @@
}
}

.block-library-gallery-item__inline-menu {
display: none;
position: absolute;
top: -2px;
margin: $grid-unit-10;
z-index: z-index(".block-library-gallery-item__inline-menu");
border-radius: $radius-small;
background: $white;
border: $border-width solid $gray-900;

@media not (prefers-reduced-motion) {
transition: box-shadow 0.2s ease-out;
}

&:hover {
box-shadow: $elevation-x-small;
}

@include break-small() {
// Use smaller buttons to fit when there are many columns.
.columns-7 &,
.columns-8 & {
padding: $grid-unit-05 * 0.5;
}
}

.components-button.has-icon {
&:not(:focus) {
border: none;
box-shadow: none;
}

@include break-small() {
// Use smaller buttons to fit when there are many columns.
.columns-7 &,
.columns-8 & {
padding: 0;
width: inherit;
height: inherit;
}
}
}

&.is-left {
left: -2px;
}

&.is-right {
right: -2px;
}
}

.wp-block-gallery ul.blocks-gallery-grid {
padding: 0;
// Some themes give all <ul> default margin instead of padding.
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/latest-posts/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const MIN_EXCERPT_LENGTH = 10;
export const MAX_EXCERPT_LENGTH = 100;
export const MAX_POSTS_COLUMNS = 6;
export const DEFAULT_EXCERPT_LENGTH = 55;
Loading

0 comments on commit 6d53885

Please sign in to comment.