Skip to content

Commit

Permalink
prep build 01/13
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jan 13, 2024
2 parents 171d07c + 22617ed commit e09bc1e
Show file tree
Hide file tree
Showing 118 changed files with 1,586 additions and 1,278 deletions.
134 changes: 0 additions & 134 deletions bin/check-latest-npm.js

This file was deleted.

1 change: 0 additions & 1 deletion bin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"files": [
"./api-docs/update-api-docs.js",
"./check-latest-npm.js",
"./plugin/config.js",
"./plugin/commands/changelog.js",
"./plugin/commands/performance.js",
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ Displays the next or previous post link that is adjacent to the current post. ([
- **Name:** core/post-navigation-link
- **Category:** theme
- **Supports:** color (background, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** arrow, label, linkLabel, showTitle, textAlign, type
- **Attributes:** arrow, inSameTerm, label, linkLabel, showTitle, taxonomy, textAlign, type

## Post Template

Expand Down
21 changes: 15 additions & 6 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-block-editor',
gutenberg_url( 'build/block-editor/style.css' ),
array( 'wp-components' ),
array( 'wp-components', 'wp-preferences' ),
$version
);
$styles->add_data( 'wp-block-editor', 'rtl', 'replace' );
Expand All @@ -275,7 +275,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-editor',
gutenberg_url( 'build/editor/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-patterns', 'wp-reusable-blocks' ),
array( 'wp-components', 'wp-block-editor', 'wp-patterns', 'wp-reusable-blocks', 'wp-preferences' ),
$version
);
$styles->add_data( 'wp-editor', 'rtl', 'replace' );
Expand All @@ -284,7 +284,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-edit-post',
gutenberg_url( 'build/edit-post/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-commands' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-commands', 'wp-preferences' ),
$version
);
$styles->add_data( 'wp-edit-post', 'rtl', 'replace' );
Expand Down Expand Up @@ -409,7 +409,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-edit-site',
gutenberg_url( 'build/edit-site/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-commands' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-commands', 'wp-preferences' ),
$version
);
$styles->add_data( 'wp-edit-site', 'rtl', 'replace' );
Expand All @@ -418,7 +418,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-edit-widgets',
gutenberg_url( 'build/edit-widgets/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-patterns', 'wp-reusable-blocks', 'wp-widgets' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-patterns', 'wp-reusable-blocks', 'wp-widgets', 'wp-preferences' ),
$version
);
$styles->add_data( 'wp-edit-widgets', 'rtl', 'replace' );
Expand All @@ -436,7 +436,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-customize-widgets',
gutenberg_url( 'build/customize-widgets/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-widgets' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-widgets', 'wp-preferences' ),
$version
);
$styles->add_data( 'wp-customize-widgets', 'rtl', 'replace' );
Expand Down Expand Up @@ -466,6 +466,15 @@ function gutenberg_register_packages_styles( $styles ) {
array( 'wp-components' )
);
$styles->add_data( 'wp-widgets', 'rtl', 'replace' );

gutenberg_override_style(
$styles,
'wp-preferences',
gutenberg_url( 'build/preferences/style.css' ),
array( 'wp-components' ),
$version
);
$styles->add_data( 'wp-preferences', 'rtl', 'replace' );
}
add_action( 'wp_default_styles', 'gutenberg_register_packages_styles' );

Expand Down
9 changes: 0 additions & 9 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,6 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-web-fonts.php';
} elseif ( ! class_exists( 'WP_Fonts' ) ) {

// Disables the Font Library.
// @core-merge: this should not go to core.
add_action(
'enqueue_block_editor_assets',
function () {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDisableFontLibrary = true', 'before' );
}
);

// Turns off Font Face hooks in Core.
// @since 6.4.0.
remove_action( 'wp_head', 'wp_print_font_faces', 50 );
Expand Down
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@
"wp-scripts lint-style"
],
"package-lock.json": [
"npm run lint:lockfile",
"node ./bin/check-latest-npm.js"
"npm run lint:lockfile"
],
"packages/*/package.json": [
"wp-scripts lint-pkg-json"
Expand Down
4 changes: 2 additions & 2 deletions packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ $z-layers: (
".components-resizable-box__corner-handle": 2,

// Make sure block manager sticky category titles appear above the options
".edit-post-block-manager__category-title": 1,
".editor-block-manager__category-title": 1,
// And block manager sticky disabled block count is higher still
".edit-post-block-manager__disabled-blocks-count": 2,
".editor-block-manager__disabled-blocks-count": 2,

// Needs to appear below other color circular picker related UI elements.
".components-circular-option-picker__option-wrapper::before": -1,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ BlockListBlock = compose(
)( BlockListBlock );

// This component provides all the information we need through a single store
// subscription (useSelect mapping). Only the necesssary props are passed down
// subscription (useSelect mapping). Only the necessary props are passed down
// to the BlockListBlock component, which is a filtered component, so these
// props are public API. To avoid adding to the public API, we use a private
// context to pass the rest of the information to the filtered BlockListBlock
Expand Down
68 changes: 52 additions & 16 deletions packages/block-editor/src/components/block-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ import {
useMergeRefs,
useDebounce,
} from '@wordpress/compose';
import { createContext, useMemo, useCallback } from '@wordpress/element';
import {
createContext,
useMemo,
useCallback,
useEffect,
} from '@wordpress/element';

/**
* Internal dependencies
Expand All @@ -34,6 +39,7 @@ import {
DEFAULT_BLOCK_EDIT_CONTEXT,
} from '../block-edit/context';
import { useTypingObserver } from '../observe-typing';
import { unlock } from '../../lock-unlock';

export const IntersectionObserver = createContext();
const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
Expand Down Expand Up @@ -113,6 +119,27 @@ function Root( { className, ...settings } ) {
);
}

function StopEditingAsBlocksOnOutsideSelect( { clientId } ) {
const { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );
const isBlockOrDescendantSelected = useSelect(
( select ) => {
const { isBlockSelected, hasSelectedInnerBlock } =
select( blockEditorStore );
return (
isBlockSelected( clientId ) ||
hasSelectedInnerBlock( clientId, true )
);
},
[ clientId ]
);
useEffect( () => {
if ( ! isBlockOrDescendantSelected ) {
stopEditingAsBlocks( clientId );
}
}, [ isBlockOrDescendantSelected, clientId, stopEditingAsBlocks ] );
return null;
}

export default function BlockList( settings ) {
return (
<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>
Expand All @@ -128,21 +155,25 @@ function Items( {
__experimentalAppenderTagName,
layout = defaultLayout,
} ) {
const { order, selectedBlocks, visibleBlocks } = useSelect(
( select ) => {
const {
getBlockOrder,
getSelectedBlockClientIds,
__unstableGetVisibleBlocks,
} = select( blockEditorStore );
return {
order: getBlockOrder( rootClientId ),
selectedBlocks: getSelectedBlockClientIds(),
visibleBlocks: __unstableGetVisibleBlocks(),
};
},
[ rootClientId ]
);
const { order, selectedBlocks, visibleBlocks, temporarilyEditingAsBlocks } =
useSelect(
( select ) => {
const {
getBlockOrder,
getSelectedBlockClientIds,
__unstableGetVisibleBlocks,
__unstableGetTemporarilyEditingAsBlocks,
} = select( blockEditorStore );
return {
order: getBlockOrder( rootClientId ),
selectedBlocks: getSelectedBlockClientIds(),
visibleBlocks: __unstableGetVisibleBlocks(),
temporarilyEditingAsBlocks:
__unstableGetTemporarilyEditingAsBlocks(),
};
},
[ rootClientId ]
);

return (
<LayoutProvider value={ layout }>
Expand All @@ -163,6 +194,11 @@ function Items( {
</AsyncModeProvider>
) ) }
{ order.length < 1 && placeholder }
{ !! temporarilyEditingAsBlocks && (
<StopEditingAsBlocksOnOutsideSelect
clientId={ temporarilyEditingAsBlocks }
/>
) }
<BlockListAppender
tagName={ __experimentalAppenderTagName }
rootClientId={ rootClientId }
Expand Down
Loading

0 comments on commit e09bc1e

Please sign in to comment.