Skip to content

Commit

Permalink
prep build 09/06
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Sep 6, 2024
2 parents 78d8170 + 0fc06de commit fa99e35
Show file tree
Hide file tree
Showing 37 changed files with 933 additions and 269 deletions.
356 changes: 356 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ function BlockBreadcrumb( { rootLabelText } ) {
>
{ hasSelection && (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
size="small"
className="block-editor-block-breadcrumb__button"
variant="tertiary"
onClick={ () => {
// Find the block editor wrapper for the selected block
const blockEditor = blockRef.current?.closest(
Expand All @@ -96,10 +94,8 @@ function BlockBreadcrumb( { rootLabelText } ) {
{ parents.map( ( parentClientId ) => (
<li key={ parentClientId }>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
size="small"
className="block-editor-block-breadcrumb__button"
variant="tertiary"
onClick={ () => selectBlock( parentClientId ) }
>
<BlockTitle
Expand Down
31 changes: 1 addition & 30 deletions packages/block-editor/src/components/block-breadcrumb/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,11 @@
}
}

.block-editor-block-breadcrumb__button.components-button {
height: $button-size-small;
line-height: $button-size-small;
padding: 0;
position: relative;

&:hover:not(:disabled) {
text-decoration: underline;
box-shadow: none;
}

&:focus {
box-shadow: none;
}

&:focus::before {
content: "";
display: block;
position: absolute;
border-radius: $radius-small;
top: $border-width;
right: $border-width;
bottom: $border-width;
left: $border-width;

@include button-style__focus();
}
}

.block-editor-block-breadcrumb__current {
cursor: default;
}

.block-editor-block-breadcrumb__button.components-button,
.block-editor-block-breadcrumb__button.block-editor-block-breadcrumb__button,
.block-editor-block-breadcrumb__current {
color: $gray-900;
padding: 0 $grid-unit-10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export default function BlockView( {

<div className="block-editor-block-compare__action">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="secondary"
tabIndex="0"
onClick={ action }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`BlockView should match snapshot 1`] = `
class="block-editor-block-compare__action"
>
<button
class="components-button is-secondary"
class="components-button is-next-40px-default-size is-secondary"
tabindex="0"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ export function MultipleUsageWarning( {
<Warning
actions={ [
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
key="find-original"
variant="secondary"
onClick={ () => selectBlock( originalBlockClientId ) }
>
{ __( 'Find original' ) }
</Button>,
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
key="remove"
variant="secondary"
onClick={ () => onReplace( [] ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export default function BlockInvalidWarning( { clientId } ) {
<Warning
actions={ [
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
key="recover"
onClick={ convert.toRecoveredBlock }
variant="primary"
Expand Down
3 changes: 1 addition & 2 deletions packages/block-editor/src/components/block-mover/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ const BlockMoverButton = forwardRef(
return (
<>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
ref={ ref }
className={ clsx(
'block-editor-block-mover-button',
Expand Down
3 changes: 1 addition & 2 deletions packages/block-editor/src/components/block-mover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ function BlockMover( {
<BlockDraggable clientIds={ clientIds } fadeWhenDisabled>
{ ( draggableProps ) => (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
icon={ dragHandle }
className="block-editor-block-mover__drag-handle"
label={ __( 'Drag' ) }
Expand Down
14 changes: 4 additions & 10 deletions packages/block-editor/src/components/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import clsx from 'clsx';
import { speak } from '@wordpress/a11y';
import { __, _x, sprintf } from '@wordpress/i18n';
import { Dropdown, Button } from '@wordpress/components';
import { forwardRef, Component } from '@wordpress/element';
import { Component } from '@wordpress/element';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose, ifCondition } from '@wordpress/compose';
import { createBlock, store as blocksStore } from '@wordpress/blocks';
Expand Down Expand Up @@ -76,7 +76,7 @@ const defaultRenderToggle = ( {
);
};

class PrivateInserter extends Component {
class Inserter extends Component {
constructor() {
super( ...arguments );

Expand Down Expand Up @@ -222,7 +222,7 @@ class PrivateInserter extends Component {
}
}

export const ComposedPrivateInserter = compose( [
export default compose( [
withSelect(
( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {
const {
Expand Down Expand Up @@ -418,10 +418,4 @@ export const ComposedPrivateInserter = compose( [
( { hasItems, isAppender, rootClientId, clientId } ) =>
hasItems || ( ! isAppender && ! rootClientId && ! clientId )
),
] )( PrivateInserter );

const Inserter = forwardRef( ( props, ref ) => {
return <ComposedPrivateInserter ref={ ref } { ...props } />;
} );

export default Inserter;
] )( Inserter );
2 changes: 0 additions & 2 deletions packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ExperimentalBlockEditorProvider } from './components/provider';
import { lock } from './lock-unlock';
import { getRichTextValues } from './components/rich-text/get-rich-text-values';
import ResizableBoxPopover from './components/resizable-box-popover';
import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
import { default as PrivateQuickInserter } from './components/inserter/quick-inserter';
import {
extractWords,
Expand Down Expand Up @@ -60,7 +59,6 @@ lock( privateApis, {
ExperimentalBlockEditorProvider,
getDuotoneFilter,
getRichTextValues,
PrivateInserter,
PrivateQuickInserter,
extractWords,
getNormalizedSearchTerms,
Expand Down
5 changes: 3 additions & 2 deletions packages/block-library/src/cover/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,9 @@ const v12 = {
supports: v12BlockSupports,
isEligible( attributes ) {
return (
attributes.customOverlayColor !== undefined ||
attributes.overlayColor !== undefined
( attributes.customOverlayColor !== undefined ||
attributes.overlayColor !== undefined ) &&
attributes.isUserOverlayColor === undefined
);
},
migrate( attributes ) {
Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/cover/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ function CoverEdit( {
averageBackgroundColor
);
__unstableMarkNextChangeAsNotPersistent();
setAttributes( { isDark: newIsDark } );
setAttributes( {
isDark: newIsDark,
isUserOverlayColor: isUserOverlayColor || false,
} );
} )();
// Disable reason: Update the block only when the featured image changes.
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -201,6 +204,7 @@ function CoverEdit( {
useFeaturedImage: undefined,
dimRatio: newDimRatio,
isDark: newIsDark,
isUserOverlayColor: isUserOverlayColor || false,
} );
};

Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@
}
}
},
"style": "wp-block-post-title"
"style": "wp-block-post-title",
"selectors": {
"typography": ".wp-block-post-title, .wp-block-post-title > a"
}
}
24 changes: 24 additions & 0 deletions packages/block-library/src/post-title/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

&[style*="font-weight"] :where(a) {
font-weight: inherit;
}
&[class*="-font-family"] :where(a),
&[style*="font-family"] :where(a) {
font-family: inherit;
}
&[class*="-font-size"] :where(a),
&[style*="font-size"] :where(a) {
font-size: inherit;
}
&[style*="line-height"] :where(a) {
line-height: inherit;
}
&[style*="font-style"] :where(a) {
font-style: inherit;
}
&[style*="letter-spacing"] :where(a) {
letter-spacing: inherit;
}
&[style*="text-decoration"] :where(a) {
text-decoration: inherit;
}

a {
display: inline-block;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function EnhancedPaginationModal( {
};

let notice = __(
'If you still want to prevent full page reloads, remove that block, then disable "Force page reload" again in the Query Block settings.'
'If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.'
);
if ( hasBlocksFromPlugins ) {
notice =
Expand All @@ -63,7 +63,7 @@ export default function EnhancedPaginationModal( {
return (
isOpen && (
<Modal
title={ __( 'Query block: Force page reload enabled' ) }
title={ __( 'Query block: Reload full page enabled' ) }
className="wp-block-query__enhanced-pagination-modal"
aria={ {
describedby: modalDescriptionId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ export default function EnhancedPaginationControl( {
);
} else if ( enhancedPagination ) {
help = __(
"Browsing between pages won't require a full page reload, unless non-compatible blocks are detected."
'Reload the full page—instead of just the posts list—when visitors navigate between pages.'
);
} else if ( hasUnsupportedBlocks ) {
help = __(
"Force page reload can't be disabled because there are non-compatible blocks inside the Query block."
'Enhancement disabled because there are non-compatible blocks inside the Query block.'
);
}

return (
<>
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Force page reload' ) }
label={ __( 'Reload full page' ) }
help={ help }
checked={
! enhancedPagination && ! fullPageClientSideNavigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import AuthorControl from './author-control';
import ParentControl from './parent-control';
import { TaxonomyControls } from './taxonomy-controls';
import StickyControl from './sticky-control';
import EnhancedPaginationControl from './enhanced-pagination-control';
import CreateNewPostLink from './create-new-post-link';
import PerPageControl from './per-page-control';
import OffsetControl from './offset-controls';
Expand All @@ -43,9 +42,8 @@ import { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';
const { BlockInfo } = unlock( blockEditorPrivateApis );

export default function QueryInspectorControls( props ) {
const { attributes, setQuery, setDisplayLayout, setAttributes, clientId } =
props;
const { query, displayLayout, enhancedPagination } = attributes;
const { attributes, setQuery, setDisplayLayout } = props;
const { query, displayLayout } = attributes;
const {
order,
orderBy,
Expand Down Expand Up @@ -262,11 +260,6 @@ export default function QueryInspectorControls( props ) {
}
/>
) }
<EnhancedPaginationControl
enhancedPagination={ enhancedPagination }
setAttributes={ setAttributes }
clientId={ clientId }
/>
</PanelBody>
) }
{ ! inherit && showDisplayPanel && (
Expand Down
7 changes: 7 additions & 0 deletions packages/block-library/src/query/edit/query-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { store as coreStore } from '@wordpress/core-data';
/**
* Internal dependencies
*/
import EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';
import QueryToolbar from './query-toolbar';
import QueryInspectorControls from './inspector-controls';
import EnhancedPaginationModal from './enhanced-pagination-modal';
Expand All @@ -36,6 +37,7 @@ export default function QueryContent( {
queryId,
query,
displayLayout,
enhancedPagination,
tagName: TagName = 'div',
query: { inherit } = {},
} = attributes;
Expand Down Expand Up @@ -161,6 +163,11 @@ export default function QueryContent( {
}
help={ htmlElementMessages[ TagName ] }
/>
<EnhancedPaginationControl
enhancedPagination={ enhancedPagination }
setAttributes={ setAttributes }
clientId={ clientId }
/>
</InspectorControls>
<TagName { ...innerBlocksProps } />
</>
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/site-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@
}
},
"editorStyle": "wp-block-site-title-editor",
"style": "wp-block-site-title"
"style": "wp-block-site-title",
"selectors": {
"typography": ".wp-block-site-title > span, .wp-block-site-title > a"
}
}
Loading

0 comments on commit fa99e35

Please sign in to comment.