Skip to content

Commit

Permalink
prep build 08/01
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Aug 1, 2024
2 parents 9960d5a + ecfc7ef commit 83cfa49
Show file tree
Hide file tree
Showing 77 changed files with 1,060 additions and 571 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ jobs:
- name: Compare performance with base branch
if: github.event_name == 'push'
# The base hash used here need to be a commit that is compatible with the current WP version
# The current one is 9725060a5b18904c6cc5fdbe4b06fbde7419e02c and it needs to be updated every WP major release.
# The current one is 5f4c9c853b15092ed885d5280edefb973c37d9e9 and it needs to be updated every WP major release.
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
run: |
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA 9725060a5b18904c6cc5fdbe4b06fbde7419e02c --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA 5f4c9c853b15092ed885d5280edefb973c37d9e9 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
Expand All @@ -101,7 +101,7 @@ jobs:
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
run: |
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 9725060a5b18904c6cc5fdbe4b06fbde7419e02c $COMMITTED_AT
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 5f4c9c853b15092ed885d5280edefb973c37d9e9 $COMMITTED_AT
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
Expand Down
163 changes: 73 additions & 90 deletions changelog.txt

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Displays a title with the number of comments. ([Source](https://github.com/WordP
- **Category:** theme
- **Ancestor:** core/comments
- **Supports:** align, color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~anchor~~, ~~html~~
- **Attributes:** level, showCommentsCount, showPostTitle, textAlign
- **Attributes:** level, levelOptions, showCommentsCount, showPostTitle, textAlign

## Cover

Expand Down Expand Up @@ -410,7 +410,7 @@ Display a list of your most recent posts. ([Source](https://github.com/WordPress

## List

Create a bulleted or numbered list. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/list))
An organized collection of items displayed in a specific order. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/list))

- **Name:** core/list
- **Category:** text
Expand All @@ -420,7 +420,7 @@ Create a bulleted or numbered list. ([Source](https://github.com/WordPress/guten

## List item

Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/list-item))
An individual item within a list. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/list-item))

- **Name:** core/list-item
- **Category:** text
Expand Down Expand Up @@ -689,7 +689,7 @@ Displays the title of a post, page, or any other content-type. ([Source](https:/
- **Name:** core/post-title
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** isLink, level, linkTarget, rel, textAlign
- **Attributes:** isLink, level, levelOptions, linkTarget, rel, textAlign

## Preformatted

Expand Down Expand Up @@ -775,7 +775,7 @@ Display the query title. ([Source](https://github.com/WordPress/gutenberg/tree/t
- **Name:** core/query-title
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** level, showPrefix, showSearchTerm, textAlign, type
- **Attributes:** level, levelOptions, showPrefix, showSearchTerm, textAlign, type

## Quote

Expand Down Expand Up @@ -847,7 +847,7 @@ Describe in a few words what the site is about. The tagline can be used in searc
- **Name:** core/site-tagline
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** level, textAlign
- **Attributes:** level, levelOptions, textAlign

## Site Title

Expand All @@ -856,7 +856,7 @@ Displays the name of this site. Update the block, and the changes apply everywhe
- **Name:** core/site-title
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** isLink, level, linkTarget, textAlign
- **Attributes:** isLink, level, levelOptions, linkTarget, textAlign

## Social Icon

Expand Down Expand Up @@ -908,7 +908,7 @@ Summarize your post with a list of headings. Add HTML anchors to Heading blocks

## Tag Cloud

A cloud of your most used tags. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/tag-cloud))
A cloud of popular keywords, each sized by how often it appears. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/tag-cloud))

- **Name:** core/tag-cloud
- **Category:** widgets
Expand Down
35 changes: 34 additions & 1 deletion lib/class-wp-theme-json-resolver-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,18 @@ private static function style_variation_has_scope( $variation, $scope ) {
* @return array
*/
public static function get_style_variations( $scope = 'theme' ) {
return static::get_style_variations_from_directory( get_stylesheet_directory(), $scope );
}

/**
* Returns the style variation files defined by the theme (parent and child).
*
* @since 6.7.0
*
* @return array An array of style variation files.
*/
protected static function get_style_variation_files_from_current_theme() {
$variation_files = array();
$variations = array();
$base_directory = get_stylesheet_directory() . '/styles';
$template_directory = get_template_directory() . '/styles';
if ( is_dir( $base_directory ) ) {
Expand All @@ -783,6 +793,29 @@ public static function get_style_variations( $scope = 'theme' ) {
}
$variation_files = array_merge( $variation_files, $variation_files_parent );
}

return $variation_files;
}

/**
* Returns the style variations in the given directory.
*
* @since 6.7.0
*
* @param string $directory The directory to get the style variations from.
* @param string $scope The scope or type of style variation to retrieve e.g. theme, block etc.
* @return array
*/
public static function get_style_variations_from_directory( $directory, $scope = 'theme' ) {
$variation_files = array();
$variations = array();
if ( is_dir( $directory ) ) {
if ( get_stylesheet_directory() === $directory ) {
$variation_files = static::get_style_variation_files_from_current_theme();
} else {
$variation_files = static::recursively_iterate_json( $directory );
}
}
ksort( $variation_files );
foreach ( $variation_files as $path => $file ) {
$decoded_file = self::read_json_file( $path );
Expand Down
18 changes: 17 additions & 1 deletion lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,28 @@ function gutenberg_enable_experiments() {

/**
* Sets a global JS variable used to trigger the availability of form & input blocks.
*
* @deprecated 19.0.0 Use gutenberg_enable_block_experiments().
*/
function gutenberg_enable_form_input_blocks() {
_deprecated_function( __FUNCTION__, 'Gutenberg 19.0.0', 'gutenberg_enable_block_experiments' );
}

/**
* Sets global JS variables used to enable various block experiments.
*/
function gutenberg_enable_block_experiments() {
$gutenberg_experiments = get_option( 'gutenberg-experiments' );

// Experimental form blocks.
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-form-blocks', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableFormBlocks = true', 'before' );
}

// General experimental blocks that are not in the default block library.
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-block-experiments', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockExperiments = true', 'before' );
}
}

add_action( 'admin_init', 'gutenberg_enable_form_input_blocks' );
add_action( 'admin_init', 'gutenberg_enable_block_experiments' );
12 changes: 12 additions & 0 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-block-experiments',
__( 'Experimental blocks', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable experimental blocks.<p class="description">(Warning: these blocks may have significant changes during development that cause validation errors and display issues.)</p>', 'gutenberg' ),
'id' => 'gutenberg-block-experiments',
)
);

add_settings_field(
'gutenberg-form-blocks',
__( 'Form and input blocks ', 'gutenberg' ),
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
"version": "18.9.0-rc.1",
"version": "18.9.0",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down
2 changes: 1 addition & 1 deletion packages/base-styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ $sidebar-width: 280px;
$content-width: 840px;
$wide-content-width: 1100px;
$widget-area-width: 700px;

$secondary-sidebar-width: 350px;

/**
* Block & Editor UI.
Expand Down
24 changes: 9 additions & 15 deletions packages/block-editor/src/components/grid/grid-item-resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,22 @@ function GridItemResizerInner( {
} }
bounds={ bounds }
boundsByDirection
onPointerDown={ ( { target, pointerId } ) => {
/*
* Captures the pointer to avoid hiccups while dragging over objects
* like iframes and ensures that the event to end the drag is
* captured by the target (resize handle) whether or not it’s under
* the pointer.
*/
target.setPointerCapture( pointerId );
} }
onResizeStart={ ( event, direction ) => {
/*
* The container justification and alignment need to be set
* according to the direction the resizer is being dragged in,
* so that it resizes in the right direction.
*/
setResizeDirection( direction );

/*
* The mouseup event on the resize handle doesn't trigger if the mouse
* isn't directly above the handle, so we try to detect if it happens
* outside the grid and dispatch a mouseup event on the handle.
*/
blockElement.ownerDocument.addEventListener(
'mouseup',
() => {
event.target.dispatchEvent(
new Event( 'mouseup', { bubbles: true } )
);
},
{ once: true }
);
} }
onResizeStop={ ( event, direction, boxElement ) => {
const columnGap = parseFloat(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/**
* WordPress dependencies
*/
import { usePrevious, useReducedMotion } from '@wordpress/compose';
import { isRTL } from '@wordpress/i18n';
import {
__experimentalHStack as HStack,
FlexBlock,
privateApis as componentsPrivateApis,
__unstableMotion as motion,
} from '@wordpress/components';
import { Icon, chevronRight, chevronLeft } from '@wordpress/icons';

Expand All @@ -22,6 +24,17 @@ function CategoryTabs( {
onSelectCategory,
children,
} ) {
// Copied from InterfaceSkeleton.
const ANIMATION_DURATION = 0.25;
const disableMotion = useReducedMotion();
const defaultTransition = {
type: 'tween',
duration: disableMotion ? 0 : ANIMATION_DURATION,
ease: [ 0.6, 0, 0.4, 1 ],
};

const previousSelectedCategory = usePrevious( selectedCategory );

return (
<Tabs
className="block-editor-inserter__category-tabs"
Expand Down Expand Up @@ -62,9 +75,29 @@ function CategoryTabs( {
key={ category.name }
tabId={ category.name }
focusable={ false }
className="block-editor-inserter__category-panel"
>
{ children }
<motion.div
className="block-editor-inserter__category-panel"
initial={
! previousSelectedCategory ? 'closed' : 'open'
}
animate="open"
variants={ {
open: {
transform: 'translateX( 0 )',
transitionEnd: {
zIndex: '1',
},
},
closed: {
transform: 'translateX( -100% )',
zIndex: '-1',
},
} }
transition={ defaultTransition }
>
{ children }
</motion.div>
</Tabs.TabPanel>
) ) }
</Tabs>
Expand Down
Loading

0 comments on commit 83cfa49

Please sign in to comment.