Skip to content

Commit

Permalink
prep build 6/8
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jun 8, 2024
2 parents 34391f9 + c7f51bd commit b5df6b9
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 15 deletions.
8 changes: 0 additions & 8 deletions packages/block-library/src/embed/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ const variations = [
patterns: [ /^https?:\/\/(www\.)?scribd\.com\/.+/i ],
attributes: { providerNameSlug: 'scribd', responsive: true },
},
{
name: 'slideshare',
title: 'Slideshare',
icon: embedContentIcon,
description: __( 'Embed Slideshare content.' ),
patterns: [ /^https?:\/\/(.+?\.)?slideshare\.net\/.+/i ],
attributes: { providerNameSlug: 'slideshare', responsive: true },
},
{
name: 'smugmug',
title: 'SmugMug',
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Enhancements

- Add `text-wrap: balance` fallback to all instances of `text-wrap: pretty` for greater cross browser compatibility. ([#62233](https://github.com/WordPress/gutenberg/pull/62233))
- Updates the space between input + label to `8px` in CheckboxControl and RadioControl. Also increased the space between RadioControl components to `12px` to make it consistent with CheckboxControl. ([#61696](https://github.com/WordPress/gutenberg/pull/61696))

### Bug Fixes

Expand Down
6 changes: 4 additions & 2 deletions packages/components/src/checkbox-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@include break-small() {
--checkbox-input-size: 20px;
}

--checkbox-input-margin: #{$grid-unit-10};
}

.components-checkbox-control__label {
Expand Down Expand Up @@ -55,7 +57,7 @@
.components-checkbox-control__input-container {
position: relative;
display: inline-block;
margin-right: $grid-unit-15;
margin-right: var(--checkbox-input-margin);
vertical-align: middle;
width: var(--checkbox-input-size);
aspect-ratio: 1;
Expand Down Expand Up @@ -84,5 +86,5 @@ svg.components-checkbox-control__indeterminate {

.components-checkbox-control__help {
display: inline-block;
margin-inline-start: calc(var(--checkbox-input-size) + #{$grid-unit-15});
margin-inline-start: calc(var(--checkbox-input-size) + var(--checkbox-input-margin));
}
2 changes: 1 addition & 1 deletion packages/components/src/radio-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function RadioControl(
help={ help }
className={ clsx( className, 'components-radio-control' ) }
>
<VStack spacing={ 1 }>
<VStack spacing={ 3 }>
{ options.map( ( option, index ) => (
<div
key={ `${ id }-${ index }` }
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/radio-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@include radio-control;

display: inline-flex;
margin: 0 6px 0 0;
margin: 0 $grid-unit-10 0 0;
padding: 0;
appearance: none;
cursor: pointer;
Expand Down
18 changes: 16 additions & 2 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,17 @@ Undocumented declaration.

### ThemeSupportCheck

Undocumented declaration.
Checks if the current theme supports specific features and renders the children if supported.

_Parameters_

- _props_ `Object`: The component props.
- _props.children_ `Element`: The children to render if the theme supports the specified features.
- _props.supportKeys_ `string|string[]`: The key(s) of the theme support(s) to check.

_Returns_

- `JSX.Element|null`: The rendered children if the theme supports the specified features, otherwise null.

### TimeToRead

Expand Down Expand Up @@ -1597,7 +1607,11 @@ _Returns_
### useEntitiesSavedStatesIsDirty

Undocumented declaration.
Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.

_Returns_

- `Object`: An object containing the following properties: - dirtyEntityRecords: An array of dirty entity records. - isDirty: A boolean indicating if there are any dirty entity records. - setUnselectedEntities: A function to set the unselected entities. - unselectedEntities: An array of unselected entities.

### usePostScheduleLabel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { useMemo, useState } from '@wordpress/element';

/**
* Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.
*
* @return {Object} An object containing the following properties:
* - dirtyEntityRecords: An array of dirty entity records.
* - isDirty: A boolean indicating if there are any dirty entity records.
* - setUnselectedEntities: A function to set the unselected entities.
* - unselectedEntities: An array of unselected entities.
*/
export const useIsDirty = () => {
const { editedEntities, siteEdits, siteEntityConfig } = useSelect(
( select ) => {
Expand Down
5 changes: 5 additions & 0 deletions packages/editor/src/components/post-status/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@
padding: 0;
margin-bottom: $grid-unit-10;
}

p.components-base-control__help:has(.components-checkbox-control__help) {
margin-top: $grid-unit-05;
}

}
9 changes: 9 additions & 0 deletions packages/editor/src/components/theme-support-check/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import { store as coreStore } from '@wordpress/core-data';
*/
import { store as editorStore } from '../../store';

/**
* Checks if the current theme supports specific features and renders the children if supported.
*
* @param {Object} props The component props.
* @param {Element} props.children The children to render if the theme supports the specified features.
* @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
*
* @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null.
*/
export default function ThemeSupportCheck( { children, supportKeys } ) {
const { postType, themeSupports } = useSelect( ( select ) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ test.describe( 'Dataviews List Layout', () => {
// Make sure the items have loaded before reaching for the 1st item in the list.
await expect( page.getByRole( 'grid' ) ).toBeVisible();
await page.keyboard.press( 'Tab' );
await expect( page.getByLabel( 'Privacy Policy' ) ).toBeFocused();
await expect(
page.getByRole( 'grid' ).getByRole( 'button' ).first()
).toBeFocused();
} );

test( 'Navigates from items list to preview via TAB, and vice versa', async ( {
Expand Down

0 comments on commit b5df6b9

Please sign in to comment.