Skip to content

Commit

Permalink
prep build 1/15
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jan 15, 2025
2 parents b6cca47 + 5a5455c commit 893c624
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ $swatch-size: 28px;
$swatch-gap: 12px;

$popover-width: 260px;
$popover-padding: $grid-unit-20;
$popover-padding: $grid-unit-10;

$swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover-padding, $swatch-size + $swatch-gap));

.block-editor-duotone-control__popover {
.block-editor-duotone-control__popover.components-popover {
> .components-popover__content {
padding: $popover-padding;
width: $popover-width;
Expand Down
8 changes: 1 addition & 7 deletions packages/block-library/src/navigation-link/link-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function getSuggestionsQuery( type, kind ) {
}
}

function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
function LinkUIBlockInserter( { clientId, onBack } ) {
const { rootBlockClientId } = useSelect(
( select ) => {
const { getBlockRootClientId } = select( blockEditorStore );
Expand Down Expand Up @@ -140,7 +140,6 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
prioritizePatterns={ false }
selectBlockOnInsert
hasSearch={ false }
onSelect={ onSelectBlock }
/>
</div>
);
Expand Down Expand Up @@ -203,10 +202,6 @@ function UnforwardedLinkUI( props, ref ) {
`link-ui-link-control__description`
);

// Selecting a block should close the popover and also remove the (previously) automatically inserted
// link block so that the newly selected block can be inserted in its place.
const { onClose: onSelectBlock } = props;

return (
<Popover
ref={ ref }
Expand Down Expand Up @@ -287,7 +282,6 @@ function UnforwardedLinkUI( props, ref ) {
setAddingBlock( false );
setFocusAddBlockButton( true );
} }
onSelectBlock={ onSelectBlock }
/>
) }
</Popover>
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/social-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function render_block_core_social_link( $attributes, $content, $block ) {

/**
* Prepend URL with https:// if it doesn't appear to contain a scheme
* and it's not a relative link starting with //.
* and it's not a relative link or a fragment.
*/
if ( ! parse_url( $url, PHP_URL_SCHEME ) && ! str_starts_with( $url, '//' ) ) {
if ( ! parse_url( $url, PHP_URL_SCHEME ) && ! str_starts_with( $url, '//' ) && ! str_starts_with( $url, '#' ) ) {
$url = 'https://' . $url;
}

Expand Down
27 changes: 17 additions & 10 deletions packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,22 @@ export async function visitSiteEditor(
'.edit-site-canvas-loader, .edit-site-canvas-spinner'
);

// Wait for the canvas loader to appear first, so that the locator that
// waits for the hidden state doesn't resolve prematurely.
await canvasLoader.waitFor( { state: 'visible', timeout: 60_000 } );
await canvasLoader.waitFor( {
state: 'hidden',
// Bigger timeout is needed for larger entities, like the Large Post
// HTML fixture that we load for performance tests, which often
// doesn't make it under the default timeout value.
timeout: 60_000,
} );
try {
// Wait for the canvas loader to appear first, so that the locator that
// waits for the hidden state doesn't resolve prematurely.
await canvasLoader.waitFor( { state: 'visible', timeout: 60_000 } );
await canvasLoader.waitFor( {
state: 'hidden',
// Bigger timeout is needed for larger entities, like the Large Post
// HTML fixture that we load for performance tests, which often
// doesn't make it under the default timeout value.
timeout: 60_000,
} );
} catch ( error ) {
// If the canvas loader is already disappeared, skip the waiting.
await this.page
.getByRole( 'region', { name: 'Editor content' } )
.waitFor();
}
}
}
6 changes: 5 additions & 1 deletion packages/editor/src/components/post-preview-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@ export default function PostPreviewButton( {
const postType = core.getPostType(
editor.getCurrentPostType( 'type' )
);
const canView = postType?.viewable ?? false;
if ( ! canView ) {
return { isViewable: canView };
}

return {
postId: editor.getCurrentPostId(),
currentPostLink: editor.getCurrentPostAttribute( 'link' ),
previewLink: editor.getEditedPostPreviewLink(),
isSaveable: editor.isEditedPostSaveable(),
isViewable: postType?.viewable ?? false,
isViewable: canView,
};
}, [] );

Expand Down
23 changes: 15 additions & 8 deletions packages/editor/src/store/private-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getEntityFields as _getEntityFields,
isEntityReady as _isEntityReady,
} from '../dataviews/store/private-selectors';
import { getTemplatePartIcon } from '../utils';

const EMPTY_INSERTION_POINT = {
rootClientId: undefined,
Expand Down Expand Up @@ -97,15 +98,21 @@ export const getPostIcon = createRegistrySelector(
postType === 'wp_template_part' ||
postType === 'wp_template'
) {
return (
(
select( coreStore ).getEntityRecord(
'root',
'__unstableBase'
)?.default_template_part_areas || []
).find( ( item ) => options.area === item.area )?.icon ||
layout
const templateAreas =
select( coreStore ).getEntityRecord(
'root',
'__unstableBase'
)?.default_template_part_areas || [];

const areaData = templateAreas.find(
( item ) => options.area === item.area
);

if ( areaData?.icon ) {
return getTemplatePartIcon( areaData.icon );
}

return layout;
}
if ( CARD_ICONS[ postType ] ) {
return CARD_ICONS[ postType ];
Expand Down
5 changes: 4 additions & 1 deletion packages/nux/src/components/dot-tip/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ $dot-scale: 3; // How much the pulse animation should scale up by in size
}

&::before {
animation: nux-pulse 1.6s infinite cubic-bezier(0.17, 0.67, 0.92, 0.62);
background: rgba(#00739c, 0.9);
opacity: 0.9;
height: $dot-size * $dot-scale;
left: -($dot-size * $dot-scale) * 0.5;
top: -($dot-size * $dot-scale) * 0.5;
transform: scale(math.div(1, $dot-scale));
width: $dot-size * $dot-scale;

@media not (prefers-reduced-motion) {
animation: nux-pulse 1.6s infinite cubic-bezier(0.17, 0.67, 0.92, 0.62);
}
}

&::after {
Expand Down

0 comments on commit 893c624

Please sign in to comment.