From 25af7e3c49059cf57085a385f98ca99b00d195b3 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 31 Jul 2024 12:13:48 +0400 Subject: [PATCH 01/32] Plugin: Bump minimum required WordPress version to 6.5 (#64126) Co-authored-by: Mamaduka Co-authored-by: talldan Co-authored-by: ramonjd Co-authored-by: youknowriad --- .github/workflows/performance.yml | 6 +++--- gutenberg.php | 2 +- readme.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 288bef1580038f..98615b93b8a176 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -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' @@ -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 diff --git a/gutenberg.php b/gutenberg.php index dfe3e6dc8a4285..07a607327ceddd 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -3,7 +3,7 @@ * Plugin Name: Gutenberg * Plugin URI: https://github.com/WordPress/gutenberg * Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality. - * Requires at least: 6.4 + * Requires at least: 6.5 * Requires PHP: 7.2 * Version: 18.9.0-rc.1 * Author: Gutenberg Team diff --git a/readme.txt b/readme.txt index 3fe6e3aaf1dc4d..c5ef1231b183ee 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ === Gutenberg === Contributors: matveb, joen, karmatosed -Tested up to: 6.5 +Tested up to: 6.6 Stable tag: V.V.V License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From d5e7a77eb851329da16510f758bdd742099fb5ac Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Wed, 31 Jul 2024 17:59:53 +0900 Subject: [PATCH 02/32] Improve `Button` matrix in visual regression test (#64120) * Add new variants * Improve Button matrix * Add guidance in Button stylesheet --- Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo --- .../src/button/stories/e2e/index.story.tsx | 124 +++++++++++++++--- packages/components/src/button/style.scss | 7 + 2 files changed, 110 insertions(+), 21 deletions(-) diff --git a/packages/components/src/button/stories/e2e/index.story.tsx b/packages/components/src/button/stories/e2e/index.story.tsx index a4fcfdeac5ca48..d2651e8df1ec18 100644 --- a/packages/components/src/button/stories/e2e/index.story.tsx +++ b/packages/components/src/button/stories/e2e/index.story.tsx @@ -31,28 +31,110 @@ export const VariantStates: StoryFn< typeof Button > = ( 'link', ]; - return ( -
- { variants.map( ( variant ) => ( -
{ + return ( + + -
- ) ) } -
+ { name } + + { variants.map( ( variant ) => ( + + + + + + + ) } diff --git a/packages/edit-site/src/components/editor/style.scss b/packages/edit-site/src/components/editor/style.scss index b157057062c9d1..0e2e85ba9f72dd 100644 --- a/packages/edit-site/src/components/editor/style.scss +++ b/packages/edit-site/src/components/editor/style.scss @@ -1,7 +1,7 @@ .edit-site-editor__editor-interface { opacity: 1; transition: opacity 0.1s ease-out; - @include reduce-motion("transition"); + @include reduce-motion( "transition" ); &.is-loading { opacity: 0; @@ -17,3 +17,60 @@ display: flex; justify-content: center; } + +.edit-site-editor__view-mode-toggle { + /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */ + view-transition-name: toggle; + /* stylelint-enable */ + position: fixed; + top: 0; + left: 0; + height: $header-height; + width: $header-height; + z-index: 100; + + .components-button { + color: $white; + height: 100%; + width: 100%; + border-radius: 0; + overflow: hidden; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + &:hover, + &:active { + color: $white; + } + + &:focus { + box-shadow: none; + } + } + + .edit-site-editor__view-mode-toggle-icon { + svg, + img { + background: $gray-900; + display: block; + } + } +} + +.edit-site-editor__back-icon { + position: absolute; + top: 0; + left: 0; + width: 60px; + height: 60px; + display: flex; + align-items: center; + justify-content: center; + background-color: hsla(0, 0%, 80%); + pointer-events: none; + + &.has-site-icon { + background-color: hsla(0, 0%, 100%, 0.6); + } +} diff --git a/packages/edit-site/src/components/layout/style.scss b/packages/edit-site/src/components/layout/style.scss index 09898a530e445a..e4c95fed8b88b7 100644 --- a/packages/edit-site/src/components/layout/style.scss +++ b/packages/edit-site/src/components/layout/style.scss @@ -148,6 +148,14 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) { animation-delay: 255ms; } + +@media (prefers-reduced-motion) { + ::view-transition-group(*), + ::view-transition-old(*), + ::view-transition-new(*) { + animation: none !important; + } +} /* stylelint-enable */ .edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region .edit-site-layout__view-mode-toggle { diff --git a/packages/edit-site/src/components/site-icon/style.scss b/packages/edit-site/src/components/site-icon/style.scss index a461b43476fe52..a6cc7ad27fe5df 100644 --- a/packages/edit-site/src/components/site-icon/style.scss +++ b/packages/edit-site/src/components/site-icon/style.scss @@ -1,9 +1,11 @@ .edit-site-site-icon__icon { fill: currentColor; + width: 100%; + height: 100%; .edit-site-layout.is-full-canvas & { // Make the WordPress icon not so big in full canvas. - padding: $grid-unit-15 * 0.5; // 6px. + padding: $grid-unit-15; } } @@ -12,6 +14,7 @@ height: 100%; object-fit: cover; background: #333; + aspect-ratio: 1 / 1; .edit-site-layout.is-full-canvas & { border-radius: 0; From b1628c052017a3d6e2f889a0d7291c002b6badfe Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 31 Jul 2024 13:16:28 +0100 Subject: [PATCH 13/32] Update template preview dimensions in table layout (#63938) Co-authored-by: jameskoster Co-authored-by: youknowriad --- packages/edit-site/src/components/page-templates/index.js | 3 +-- packages/edit-site/src/components/page-templates/style.scss | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/page-templates/index.js b/packages/edit-site/src/components/page-templates/index.js index 05c3b9673eaf98..01b17ae76fc9dc 100644 --- a/packages/edit-site/src/components/page-templates/index.js +++ b/packages/edit-site/src/components/page-templates/index.js @@ -54,8 +54,7 @@ const defaultLayouts = { minWidth: 320, }, preview: { - minWidth: 120, - maxWidth: 120, + width: '1%', }, author: { width: '1%', diff --git a/packages/edit-site/src/components/page-templates/style.scss b/packages/edit-site/src/components/page-templates/style.scss index 067720ad9a1e97..0313da00f89944 100644 --- a/packages/edit-site/src/components/page-templates/style.scss +++ b/packages/edit-site/src/components/page-templates/style.scss @@ -37,6 +37,8 @@ .dataviews-view-table & { border-radius: $radius-block-ui; position: relative; + width: 120px; + max-height: 160px; &::after { content: ""; From 1f97f7f0bc2da82d6bc2f5e73508cc1ba1e9978d Mon Sep 17 00:00:00 2001 From: Amit Raj <77401999+amitraj2203@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:56:56 +0530 Subject: [PATCH 14/32] Long slugs breaking summary panel UI (#64053) * fix: long slugs breaking summary panel UI * refactor: Update styles for post URL to truncate the button when the URL is extremely long * Addressed feedback Co-authored-by: amitraj2203 Co-authored-by: ciampo Co-authored-by: jameskoster Co-authored-by: akasunil Co-authored-by: Mamaduka --- packages/editor/src/components/post-url/panel.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/post-url/panel.js b/packages/editor/src/components/post-url/panel.js index be32b40eaf1046..aca36566c04727 100644 --- a/packages/editor/src/components/post-url/panel.js +++ b/packages/editor/src/components/post-url/panel.js @@ -3,7 +3,11 @@ */ import { useMemo, useState } from '@wordpress/element'; import { useSelect } from '@wordpress/data'; -import { Dropdown, Button } from '@wordpress/components'; +import { + Dropdown, + Button, + __experimentalTruncate as Truncate, +} from '@wordpress/components'; import { __, sprintf } from '@wordpress/i18n'; import { safeDecodeURIComponent } from '@wordpress/url'; import { store as coreStore } from '@wordpress/core-data'; @@ -86,7 +90,9 @@ function PostURLToggle( { isOpen, onClick } ) { aria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) } onClick={ onClick } > - { isFrontPage ? postLink : <>/{ decodedSlug } } + + { isFrontPage ? postLink : `/${ decodedSlug }` } + ); } From 7b067aa68224890dc5589b38c5df85be579997d3 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:47:27 +0900 Subject: [PATCH 15/32] Font Library Modal: Remove notice context and add message when fonts updated (#64030) Co-authored-by: t-hamano Co-authored-by: mikachan Co-authored-by: madhusudhand Co-authored-by: jasmussen Co-authored-by: afercia Co-authored-by: akasunil --- .../components/global-styles/font-families.js | 4 +-- .../font-library-modal/context.js | 5 ---- .../font-library-modal/font-collection.js | 14 +++------- .../global-styles/font-library-modal/index.js | 9 ++---- .../font-library-modal/installed-fonts.js | 28 +++++++++++++++---- .../font-library-modal/upload-fonts.js | 4 +-- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/font-families.js b/packages/edit-site/src/components/global-styles/font-families.js index f6610d0457bbae..6a554b136317dd 100644 --- a/packages/edit-site/src/components/global-styles/font-families.js +++ b/packages/edit-site/src/components/global-styles/font-families.js @@ -26,7 +26,7 @@ import { unlock } from '../../lock-unlock'; const { useGlobalSetting } = unlock( blockEditorPrivateApis ); function FontFamilies() { - const { baseCustomFonts, modalTabOpen, setModalTabOpen, setNotice } = + const { baseCustomFonts, modalTabOpen, setModalTabOpen } = useContext( FontLibraryContext ); const [ fontFamilies ] = useGlobalSetting( 'typography.fontFamilies' ); const [ baseFontFamilies ] = useGlobalSetting( @@ -112,8 +112,6 @@ function FontFamilies() { variant="secondary" __next40pxDefaultSize onClick={ () => { - // Reset notice when opening the modal. - setNotice( null ); setModalTabOpen( hasInstalledFonts ? 'installed-fonts' diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/context.js b/packages/edit-site/src/components/global-styles/font-library-modal/context.js index e02dcb2e8a0af5..abfb5484e44bf5 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/context.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/context.js @@ -54,7 +54,6 @@ function FontLibraryProvider( { children } ) { const [ isInstalling, setIsInstalling ] = useState( false ); const [ refreshKey, setRefreshKey ] = useState( 0 ); - const [ notice, setNotice ] = useState( null ); const refreshLibrary = () => { setRefreshKey( Date.now() ); @@ -139,8 +138,6 @@ function FontLibraryProvider( { children } ) { }, [ modalTabOpen ] ); const handleSetLibraryFontSelected = ( font ) => { - setNotice( null ); - // If font is null, reset the selected font if ( ! font ) { setLibraryFontSelected( null ); @@ -527,8 +524,6 @@ function FontLibraryProvider( { children } ) { modalTabOpen, setModalTabOpen, refreshLibrary, - notice, - setNotice, saveFontFamilies, isResolvingLibrary, isInstalling, diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js index cf6857b30c59e6..6f8a27a8aa8927 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js @@ -63,20 +63,15 @@ function FontCollection( { slug } ) { }; const [ selectedFont, setSelectedFont ] = useState( null ); + const [ notice, setNotice ] = useState( false ); const [ fontsToInstall, setFontsToInstall ] = useState( [] ); const [ page, setPage ] = useState( 1 ); const [ filters, setFilters ] = useState( {} ); const [ renderConfirmDialog, setRenderConfirmDialog ] = useState( requiresPermission && ! getGoogleFontsPermissionFromStorage() ); - const { - collections, - getFontCollection, - installFonts, - isInstalling, - notice, - setNotice, - } = useContext( FontLibraryContext ); + const { collections, getFontCollection, installFonts, isInstalling } = + useContext( FontLibraryContext ); const selectedCollection = collections.find( ( collection ) => collection.slug === slug ); @@ -116,8 +111,7 @@ function FontCollection( { slug } ) { useEffect( () => { setSelectedFont( null ); - setNotice( null ); - }, [ slug, setNotice ] ); + }, [ slug ] ); useEffect( () => { // If the selected fonts change, reset the selected fonts to install diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/index.js b/packages/edit-site/src/components/global-styles/font-library-modal/index.js index 80edc1596f08cd..5af4be90fecdcf 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/index.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/index.js @@ -44,7 +44,7 @@ function FontLibraryModal( { onRequestClose, defaultTabId = 'installed-fonts', } ) { - const { collections, setNotice } = useContext( FontLibraryContext ); + const { collections } = useContext( FontLibraryContext ); const canUserCreate = useSelect( ( select ) => { return select( coreStore ).canUser( 'create', { kind: 'postType', @@ -59,11 +59,6 @@ function FontLibraryModal( { tabs.push( ...tabsFromCollections( collections || [] ) ); } - // Reset notice when new tab is selected. - const onSelect = () => { - setNotice( null ); - }; - return (
- + { tabs.map( ( { id, title } ) => ( diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js b/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js index 6602a778dc66c3..7ca2a9218c3bb0 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js @@ -53,14 +53,13 @@ function InstalledFonts() { isInstalling, saveFontFamilies, getFontFacesActivated, - notice, - setNotice, } = useContext( FontLibraryContext ); const [ fontFamilies, setFontFamilies ] = useGlobalSetting( 'typography.fontFamilies' ); const [ isConfirmDeleteOpen, setIsConfirmDeleteOpen ] = useState( false ); + const [ notice, setNotice ] = useState( false ); const [ baseFontFamilies ] = useGlobalSetting( 'typography.fontFamilies', undefined, @@ -120,6 +119,24 @@ function InstalledFonts() { setIsConfirmDeleteOpen( true ); }; + const handleUpdate = async () => { + setNotice( null ); + try { + await saveFontFamilies( fontFamilies ); + setNotice( { + type: 'success', + message: __( 'Font family updated successfully.' ), + } ); + } catch ( error ) { + setNotice( { + type: 'error', + message: + __( 'There was an error updating the font family. ' ) + + error.message, + } ); + } + }; + const getFontFacesToDisplay = ( font ) => { if ( ! font ) { return []; @@ -265,6 +282,7 @@ function InstalledFonts() { font ) } onClick={ () => { + setNotice( null ); handleSetLibraryFontSelected( font ); @@ -305,6 +323,7 @@ function InstalledFonts() { font ) } onClick={ () => { + setNotice( null ); handleSetLibraryFontSelected( font ); @@ -337,6 +356,7 @@ function InstalledFonts() { size="small" onClick={ () => { handleSetLibraryFontSelected( null ); + setNotice( null ); } } label={ __( 'Back' ) } /> @@ -406,9 +426,7 @@ function InstalledFonts() { ) } + + ); diff --git a/packages/format-library/src/image/style.scss b/packages/format-library/src/image/style.scss index 7e9809e52f3bf2..1e0b922fdf4c8f 100644 --- a/packages/format-library/src/image/style.scss +++ b/packages/format-library/src/image/style.scss @@ -2,7 +2,7 @@ z-index: z-index(".block-editor-format-toolbar__image-popover"); .block-editor-format-toolbar__image-container-content { - width: 200px; + width: 260px; padding: $grid-unit-20; } } diff --git a/test/e2e/specs/editor/various/adding-inline-tokens.spec.js b/test/e2e/specs/editor/various/adding-inline-tokens.spec.js index 15f9d9ea877320..c7826ebf262822 100644 --- a/test/e2e/specs/editor/various/adding-inline-tokens.spec.js +++ b/test/e2e/specs/editor/various/adding-inline-tokens.spec.js @@ -64,13 +64,16 @@ test.describe( 'adding inline tokens', () => { await pageUtils.pressKeys( 'shift+ArrowLeft' ); await page.keyboard.press( 'Tab' ); - await page.keyboard.press( 'Tab' ); - await page.fill( 'role=spinbutton[name="WIDTH"i]', '20' ); + await expect( + page.locator( 'role=spinbutton[name="Width"i]' ) + ).toBeFocused(); + await page.fill( 'role=spinbutton[name="Width"i]', '20' ); + await page.fill( 'role=textbox[name="Alternative text"i]', 'Alt' ); await page.click( 'role=button[name="Apply"i]' ); // Check the content. const contentRegex2 = new RegExp( - `a ` + `a Alt` ); await expect.poll( editor.getBlocks ).toMatchObject( [ From 635c13465a9ec710c81a782a971c60fab3329a79 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Wed, 31 Jul 2024 15:32:00 -0400 Subject: [PATCH 21/32] Tweak Tag Cloud controls and description (#64151) * improve layout of controls * update description Co-authored-by: richtabor Co-authored-by: ndiego --- docs/reference-guides/core-blocks.md | 2 +- .../block-library/src/tag-cloud/block.json | 2 +- packages/block-library/src/tag-cloud/edit.js | 79 +++++++++++-------- 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 9e56387bc66658..72281a53c3dd18 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -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 diff --git a/packages/block-library/src/tag-cloud/block.json b/packages/block-library/src/tag-cloud/block.json index b95e02204faa29..0c2095bff2a152 100644 --- a/packages/block-library/src/tag-cloud/block.json +++ b/packages/block-library/src/tag-cloud/block.json @@ -4,7 +4,7 @@ "name": "core/tag-cloud", "title": "Tag Cloud", "category": "widgets", - "description": "A cloud of your most used tags.", + "description": "A cloud of popular keywords, each sized by how often it appears.", "textdomain": "default", "attributes": { "numberOfTags": { diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index 29f4823a19b425..17ca150bc4d75f 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -12,6 +12,7 @@ import { __experimentalUseCustomUnits as useCustomUnits, __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue, Disabled, + BaseControl, } from '@wordpress/components'; import { useSelect } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; @@ -111,6 +112,7 @@ function TagCloudEdit( { attributes, setAttributes } ) { - - setAttributes( { showTagCounts: ! showTagCounts } ) - } - /> + + + + { + onFontSizeChange( + 'smallestFontSize', + value + ); + } } + units={ units } + min={ MIN_FONT_SIZE } + max={ MAX_FONT_SIZE } + size="__unstable-large" + /> + + + { + onFontSizeChange( + 'largestFontSize', + value + ); + } } + units={ units } + min={ MIN_FONT_SIZE } + max={ MAX_FONT_SIZE } + size="__unstable-large" + /> + + + - - - { - onFontSizeChange( 'smallestFontSize', value ); - } } - units={ units } - min={ MIN_FONT_SIZE } - max={ MAX_FONT_SIZE } - /> - - - { - onFontSizeChange( 'largestFontSize', value ); - } } - units={ units } - min={ MIN_FONT_SIZE } - max={ MAX_FONT_SIZE } - /> - - + + setAttributes( { showTagCounts: ! showTagCounts } ) + } + /> ); From f0874aca3313cc3275b9e16ea27daff3b74f4597 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 1 Aug 2024 04:34:00 +0900 Subject: [PATCH 22/32] TimeInput: Expose as subcomponent of TimePicker (#63145) * TimeInput: Make subcomponent of TimePicker * Add changelog * Hide Storybook controls for TimeInput story * Add explicit font-size to colon Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla Co-authored-by: ciampo Co-authored-by: t-hamano Co-authored-by: bogiii Co-authored-by: Tropicalista --- packages/components/CHANGELOG.md | 1 + packages/components/src/date-time/index.ts | 3 +- .../date-time/stories/time-input.story.tsx | 36 ------------------- .../src/date-time/stories/time.story.tsx | 17 +++++++++ .../components/src/date-time/time/index.tsx | 27 +++++++++++++- .../components/src/date-time/time/styles.ts | 1 + .../date-time/{ => time}/time-input/index.tsx | 18 +++++----- .../{ => time}/time-input/test/index.tsx | 0 8 files changed, 55 insertions(+), 48 deletions(-) delete mode 100644 packages/components/src/date-time/stories/time-input.story.tsx rename packages/components/src/date-time/{ => time}/time-input/index.tsx (91%) rename packages/components/src/date-time/{ => time}/time-input/test/index.tsx (100%) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index aff6181833b354..e6e1dbbf50a1f5 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -10,6 +10,7 @@ ### Enhancements +- `TimeInput`: Expose as subcomponent of `TimePicker` ([#63145](https://github.com/WordPress/gutenberg/pull/63145)). - `RadioControl`: add support for option help text ([#63751](https://github.com/WordPress/gutenberg/pull/63751)). ### Internal diff --git a/packages/components/src/date-time/index.ts b/packages/components/src/date-time/index.ts index 8335366bcbb73b..a103bac0d30efb 100644 --- a/packages/components/src/date-time/index.ts +++ b/packages/components/src/date-time/index.ts @@ -3,8 +3,7 @@ */ import { default as DatePicker } from './date'; import { default as TimePicker } from './time'; -import { default as TimeInput } from './time-input'; import { default as DateTimePicker } from './date-time'; -export { DatePicker, TimePicker, TimeInput }; +export { DatePicker, TimePicker }; export default DateTimePicker; diff --git a/packages/components/src/date-time/stories/time-input.story.tsx b/packages/components/src/date-time/stories/time-input.story.tsx deleted file mode 100644 index c74d886e82477c..00000000000000 --- a/packages/components/src/date-time/stories/time-input.story.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/** - * External dependencies - */ -import type { Meta, StoryFn } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; - -/** - * Internal dependencies - */ -import { TimeInput } from '../time-input'; - -const meta: Meta< typeof TimeInput > = { - title: 'Components/TimeInput', - component: TimeInput, - argTypes: { - onChange: { action: 'onChange', control: { type: null } }, - }, - tags: [ 'status-wip' ], - parameters: { - controls: { expanded: true }, - docs: { canvas: { sourceState: 'shown' } }, - }, - args: { - onChange: action( 'onChange' ), - }, -}; -export default meta; - -const Template: StoryFn< typeof TimeInput > = ( args ) => { - return ; -}; - -export const Default: StoryFn< typeof TimeInput > = Template.bind( {} ); -Default.args = { - label: 'Time', -}; diff --git a/packages/components/src/date-time/stories/time.story.tsx b/packages/components/src/date-time/stories/time.story.tsx index c48b8fb1d15922..947b5bd64d5eb1 100644 --- a/packages/components/src/date-time/stories/time.story.tsx +++ b/packages/components/src/date-time/stories/time.story.tsx @@ -16,6 +16,8 @@ import TimePicker from '../time'; const meta: Meta< typeof TimePicker > = { title: 'Components/TimePicker', component: TimePicker, + // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170 + subcomponents: { 'TimePicker.TimeInput': TimePicker.TimeInput }, argTypes: { currentTime: { control: 'date' }, onChange: { action: 'onChange', control: { type: null } }, @@ -49,3 +51,18 @@ const Template: StoryFn< typeof TimePicker > = ( { }; export const Default: StoryFn< typeof TimePicker > = Template.bind( {} ); + +const TimeInputTemplate: StoryFn< typeof TimePicker.TimeInput > = ( args ) => { + return ; +}; + +/** + * The time input can be used in isolation as ``. In this case, the `value` will be passed + * as an object in 24-hour format (`{ hours: number, minutes: number }`). + */ +export const TimeInput = TimeInputTemplate.bind( {} ); +TimeInput.args = { + label: 'Time', +}; +// Hide TimePicker controls because they don't apply to TimeInput +TimeInput.parameters = { controls: { include: [] } }; diff --git a/packages/components/src/date-time/time/index.tsx b/packages/components/src/date-time/time/index.tsx index e2877a1ded5e1f..809376d99d3036 100644 --- a/packages/components/src/date-time/time/index.tsx +++ b/packages/components/src/date-time/time/index.tsx @@ -32,7 +32,7 @@ import { validateInputElementTarget, } from '../utils'; import { TIMEZONELESS_FORMAT } from '../constants'; -import { TimeInput } from '../time-input'; +import { TimeInput } from './time-input'; const VALID_DATE_ORDERS = [ 'dmy', 'mdy', 'ymd' ]; @@ -252,4 +252,29 @@ export function TimePicker( { ); } +/** + * A component to input a time. + * + * Values are passed as an object in 24-hour format (`{ hours: number, minutes: number }`). + * + * ```jsx + * import { TimePicker } from '@wordpress/components'; + * import { useState } from '@wordpress/element'; + * + * const MyTimeInput = () => { + * const [ time, setTime ] = useState( { hours: 13, minutes: 30 } ); + * + * return ( + * + * ); + * }; + * ``` + */ +TimePicker.TimeInput = TimeInput; +Object.assign( TimePicker.TimeInput, { displayName: 'TimePicker.TimeInput' } ); + export default TimePicker; diff --git a/packages/components/src/date-time/time/styles.ts b/packages/components/src/date-time/time/styles.ts index bba0cc500e0c8a..066c8fb1d1d3cd 100644 --- a/packages/components/src/date-time/time/styles.ts +++ b/packages/components/src/date-time/time/styles.ts @@ -62,6 +62,7 @@ export const HoursInput = styled( NumberControl )` export const TimeSeparator = styled.span` border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 700 ] }; border-bottom: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 700 ] }; + font-size: ${ CONFIG.fontSize }; line-height: calc( ${ CONFIG.controlHeight } - ${ CONFIG.borderWidth } * 2 ); diff --git a/packages/components/src/date-time/time-input/index.tsx b/packages/components/src/date-time/time/time-input/index.tsx similarity index 91% rename from packages/components/src/date-time/time-input/index.tsx rename to packages/components/src/date-time/time/time-input/index.tsx index bfac1e2b604c23..b4421c601b1d6d 100644 --- a/packages/components/src/date-time/time-input/index.tsx +++ b/packages/components/src/date-time/time/time-input/index.tsx @@ -18,20 +18,20 @@ import { HoursInput, MinutesInput, Fieldset, -} from '../time/styles'; -import { HStack } from '../../h-stack'; -import Button from '../../button'; -import ButtonGroup from '../../button-group'; +} from '../styles'; +import { HStack } from '../../../h-stack'; +import Button from '../../../button'; +import ButtonGroup from '../../../button-group'; import { from12hTo24h, from24hTo12h, buildPadInputStateReducer, validateInputElementTarget, -} from '../utils'; -import type { TimeInputProps } from '../types'; -import type { InputChangeCallback } from '../../input-control/types'; -import { useControlledValue } from '../../utils'; -import BaseControl from '../../base-control'; +} from '../../utils'; +import type { TimeInputProps } from '../../types'; +import type { InputChangeCallback } from '../../../input-control/types'; +import { useControlledValue } from '../../../utils'; +import BaseControl from '../../../base-control'; export function TimeInput( { value: valueProp, diff --git a/packages/components/src/date-time/time-input/test/index.tsx b/packages/components/src/date-time/time/time-input/test/index.tsx similarity index 100% rename from packages/components/src/date-time/time-input/test/index.tsx rename to packages/components/src/date-time/time/time-input/test/index.tsx From a13c4fc0f0893db46cc9829a2031218058113725 Mon Sep 17 00:00:00 2001 From: Amit Raj <77401999+amitraj2203@users.noreply.github.com> Date: Thu, 1 Aug 2024 01:06:26 +0530 Subject: [PATCH 23/32] Update help text for sticky control in Query loop (#63999) * feat: Update help text for StickyControl in query editor * make help text more indicative of what a sticky post is --------- Co-authored-by: Rich Tabor --- .../src/query/edit/inspector-controls/sticky-control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/inspector-controls/sticky-control.js b/packages/block-library/src/query/edit/inspector-controls/sticky-control.js index 98bec75ad933b6..ee7ee31ba977a9 100644 --- a/packages/block-library/src/query/edit/inspector-controls/sticky-control.js +++ b/packages/block-library/src/query/edit/inspector-controls/sticky-control.js @@ -20,7 +20,7 @@ export default function StickyControl( { value, onChange } ) { value={ value } onChange={ onChange } help={ __( - 'Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.' + 'Sticky posts always appear first, regardless of their publish date.' ) } /> ); From f9b966b290b7ed3445b2269b3062ea1264202972 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 31 Jul 2024 19:44:10 +0000 Subject: [PATCH 24/32] Update Changelog for 18.9.0 --- changelog.txt | 163 ++++++++++++++++++++++---------------------------- 1 file changed, 73 insertions(+), 90 deletions(-) diff --git a/changelog.txt b/changelog.txt index 412d6184d76604..b7bbdf821f374e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,40 +1,14 @@ == Changelog == -= 18.9.0-rc.1 = - += 18.9.0 = ## Changelog -### Features - -- change: Updated soundcloud icon for social link block. ([63504](https://github.com/WordPress/gutenberg/pull/63504)) - -#### Global Styles -- Adding Font size presets UI. ([63057](https://github.com/WordPress/gutenberg/pull/63057)) - - ### Enhancements -- Background tool: Fix double border. ([63559](https://github.com/WordPress/gutenberg/pull/63559)) -- Core Data: Mark 'canUser' related actions resolvers as resolved. ([63435](https://github.com/WordPress/gutenberg/pull/63435)) -- Core Data: Resolve user capabilities when fetching an entity. ([63430](https://github.com/WordPress/gutenberg/pull/63430)) -- Core Data: Support entities in the 'canUser' selector. ([63322](https://github.com/WordPress/gutenberg/pull/63322)) -- Core Data: Support entity queries in the 'useResourcePermissions' hook. ([63653](https://github.com/WordPress/gutenberg/pull/63653)) -- DataViews: Update pagination icons. ([63594](https://github.com/WordPress/gutenberg/pull/63594)) -- Embeds: Add 'Embed' to title for clarity. ([63371](https://github.com/WordPress/gutenberg/pull/63371)) -- Polish "Delete" modal. ([63392](https://github.com/WordPress/gutenberg/pull/63392)) -- Run sync when issue is labeled with Sync Backport Changelog. ([63793](https://github.com/WordPress/gutenberg/pull/63793)) -- Update JSON Schemas to Draft 7. ([63583](https://github.com/WordPress/gutenberg/pull/63583)) -- Update: Grid layout: Allow users to adjust grid density. ([63367](https://github.com/WordPress/gutenberg/pull/63367)) -- Update: Include avatars on list view. ([63309](https://github.com/WordPress/gutenberg/pull/63309)) -- Update: List / Table layout – selected item stroke should be tinted blue. ([63312](https://github.com/WordPress/gutenberg/pull/63312)) -- Update: Make changing order an action on the ellipsis menu. ([62189](https://github.com/WordPress/gutenberg/pull/62189)) -- Update: Pages: Trash view should default to table layout try 2. ([63652](https://github.com/WordPress/gutenberg/pull/63652)) -- Update: Simplify some permission checks. ([63812](https://github.com/WordPress/gutenberg/pull/63812)) -- Use entity details when calling 'canUser' selectors. ([63415](https://github.com/WordPress/gutenberg/pull/63415)) - #### Block Library - Add Clear button for Overlay color option in Cover Block. ([63580](https://github.com/WordPress/gutenberg/pull/63580)) +- Embeds: Add 'Embed' to title for clarity. ([63371](https://github.com/WordPress/gutenberg/pull/63371)) - Columns block: Fix block preview. ([63609](https://github.com/WordPress/gutenberg/pull/63609)) - Gallery: Add border block support. ([63428](https://github.com/WordPress/gutenberg/pull/63428)) - Image block: Show placeholder when uploading HEIC files. ([63643](https://github.com/WordPress/gutenberg/pull/63643)) @@ -50,21 +24,10 @@ - Query Loop: Change default query loop variations. ([63353](https://github.com/WordPress/gutenberg/pull/63353)) - Set query loop to have the inherit value by default. ([63362](https://github.com/WordPress/gutenberg/pull/63362)) - Social Links: Add border block support. ([63629](https://github.com/WordPress/gutenberg/pull/63629)) +- Social Links: Updated soundcloud icon for social link block. ([63504](https://github.com/WordPress/gutenberg/pull/63504)) +- Social Links: Update Facebook's color to match brand guidelines. ([60424](https://github.com/WordPress/gutenberg/pull/60424)) - Term Description: Add border block support. ([63630](https://github.com/WordPress/gutenberg/pull/63630)) -#### Components -- CustomSelectControl V2 legacy adapter: Stabilize experimental props. ([63248](https://github.com/WordPress/gutenberg/pull/63248)) -- CustomSelectControl: Switch to ariakit-based implementation. ([63258](https://github.com/WordPress/gutenberg/pull/63258)) -- CustomSelectControlV2: Animate select popover appearance. ([63343](https://github.com/WordPress/gutenberg/pull/63343)) -- CustomSelectControlV2: Do not flip popover if legacy adapter. ([63357](https://github.com/WordPress/gutenberg/pull/63357)) -- DropdownMenuV2: Invert animation direction. ([63443](https://github.com/WordPress/gutenberg/pull/63443)) -- FontSizePicker: Tidy up internal logic. ([63553](https://github.com/WordPress/gutenberg/pull/63553)) -- FormTokenField: Deprecate bottom margin. ([63491](https://github.com/WordPress/gutenberg/pull/63491)) -- SelectControl: Add "minimal" variant. ([63265](https://github.com/WordPress/gutenberg/pull/63265)) -- Tabs: Hyphenate tab labels. ([63337](https://github.com/WordPress/gutenberg/pull/63337)) -- Tabs: Keep full opacity of focus ring on disabled tabs. ([63754](https://github.com/WordPress/gutenberg/pull/63754)) -- Update HeightControl component to label inputs. ([63761](https://github.com/WordPress/gutenberg/pull/63761)) - #### Design Tools - Background Image: Make panel appear in a consistent location. ([63551](https://github.com/WordPress/gutenberg/pull/63551)) - Buttons: Add border, color, and padding block supports. ([63538](https://github.com/WordPress/gutenberg/pull/63538)) @@ -77,15 +40,21 @@ #### Data Views - DataViews: Allow column re-ordering. ([63416](https://github.com/WordPress/gutenberg/pull/63416)) +- DataViews: Update pagination icons. ([63594](https://github.com/WordPress/gutenberg/pull/63594)) - DataViews: Rename the header property of fields to label. ([63843](https://github.com/WordPress/gutenberg/pull/63843)) - DataViews: Support combined fields. ([63236](https://github.com/WordPress/gutenberg/pull/63236)) - Dataviews List: Update item layout. ([63299](https://github.com/WordPress/gutenberg/pull/63299)) - Increase column-gap between fields in List layout. ([63603](https://github.com/WordPress/gutenberg/pull/63603)) -- Pages: Trash view should default to table layout. ([63138](https://github.com/WordPress/gutenberg/pull/63138)) - Update 'Front page' badge. ([63752](https://github.com/WordPress/gutenberg/pull/63752)) +- Update: Pages: Trash view should default to table layout try 2. ([63652](https://github.com/WordPress/gutenberg/pull/63652)) +- Update: Grid layout: Allow users to adjust grid density. ([63367](https://github.com/WordPress/gutenberg/pull/63367)) +- Update: Include avatars on list view. ([63309](https://github.com/WordPress/gutenberg/pull/63309)) +- Update: List / Table layout – selected item stroke should be tinted blue. ([63312](https://github.com/WordPress/gutenberg/pull/63312)) +- Update: Make changing order an action on the ellipsis menu. ([62189](https://github.com/WordPress/gutenberg/pull/62189)) #### Global Styles - Add colors and typograpghy to the browse styles section. ([63173](https://github.com/WordPress/gutenberg/pull/63173)) +- Adding Font size presets UI. ([63057](https://github.com/WordPress/gutenberg/pull/63057)) - Apply same styles to block previews on inserter and Global Styles. ([63177](https://github.com/WordPress/gutenberg/pull/63177)) - Background: Add background attachment to top level styles. ([61382](https://github.com/WordPress/gutenberg/pull/61382)) - Move background panel under color panel. ([63888](https://github.com/WordPress/gutenberg/pull/63888)) @@ -112,55 +81,60 @@ #### Block Locking - Tweak Block Locking UI. ([63881](https://github.com/WordPress/gutenberg/pull/63881)) -#### Icons +#### General UI +- Polish "Delete" modal. ([63392](https://github.com/WordPress/gutenberg/pull/63392)) - Update close icon. ([63597](https://github.com/WordPress/gutenberg/pull/63597)) +- Site Editor: Reduce navigation sidebar width. ([63431](https://github.com/WordPress/gutenberg/pull/63431)) #### Block bindings - Bootstrap sources defined in the server. ([63470](https://github.com/WordPress/gutenberg/pull/63470)) -#### Site Editor -- Reduce navigation sidebar width. ([63431](https://github.com/WordPress/gutenberg/pull/63431)) - #### Patterns - Limit pattern shuffling to theme and user patterns only. ([62677](https://github.com/WordPress/gutenberg/pull/62677)) +#### Components +- CustomSelectControl V2 legacy adapter: Stabilize experimental props. ([63248](https://github.com/WordPress/gutenberg/pull/63248)) +- CustomSelectControl: Switch to ariakit-based implementation. ([63258](https://github.com/WordPress/gutenberg/pull/63258)) +- CustomSelectControlV2: Animate select popover appearance. ([63343](https://github.com/WordPress/gutenberg/pull/63343)) +- CustomSelectControlV2: Do not flip popover if legacy adapter. ([63357](https://github.com/WordPress/gutenberg/pull/63357)) +- DropdownMenuV2: Invert animation direction. ([63443](https://github.com/WordPress/gutenberg/pull/63443)) +- FontSizePicker: Tidy up internal logic. ([63553](https://github.com/WordPress/gutenberg/pull/63553)) +- FormTokenField: Deprecate bottom margin. ([63491](https://github.com/WordPress/gutenberg/pull/63491)) +- SelectControl: Add "minimal" variant. ([63265](https://github.com/WordPress/gutenberg/pull/63265)) +- Tabs: Hyphenate tab labels. ([63337](https://github.com/WordPress/gutenberg/pull/63337)) +- Tabs: Keep full opacity of focus ring on disabled tabs. ([63754](https://github.com/WordPress/gutenberg/pull/63754)) +- Update HeightControl component to label inputs. ([63761](https://github.com/WordPress/gutenberg/pull/63761)) + +#### Core Data +- Core Data: Mark 'canUser' related actions resolvers as resolved. ([63435](https://github.com/WordPress/gutenberg/pull/63435)) +- Core Data: Resolve user capabilities when fetching an entity. ([63430](https://github.com/WordPress/gutenberg/pull/63430)) +- Core Data: Support entities in the 'canUser' selector. ([63322](https://github.com/WordPress/gutenberg/pull/63322)) +- Core Data: Support entity queries in the 'useResourcePermissions' hook. ([63653](https://github.com/WordPress/gutenberg/pull/63653)) + +#### JSON Schemas +- Update JSON Schemas to Draft 7. ([63583](https://github.com/WordPress/gutenberg/pull/63583)) ### New APIs #### Block bindings - Unify `getValue`/`getValues` and `setValue`/`setValues` APIs. ([63185](https://github.com/WordPress/gutenberg/pull/63185)) - ### Bug Fixes -- Add: Permission checks to avoid 403 errors on non admin roles. ([63296](https://github.com/WordPress/gutenberg/pull/63296)) -- DataViews: Do not render bulk actions Dropdown if no actions are available. ([63575](https://github.com/WordPress/gutenberg/pull/63575)) -- DataViews: Fix uncontrolled selection. ([63741](https://github.com/WordPress/gutenberg/pull/63741)) -- Disallow scrolling the block preview. ([63558](https://github.com/WordPress/gutenberg/pull/63558)) -- Discussions panel: Distinguish between verb and adjective form of open for internationalization. ([63791](https://github.com/WordPress/gutenberg/pull/63791)) -- Fix canvas issues by removing VisualEditor’s height. ([63724](https://github.com/WordPress/gutenberg/pull/63724)) -- Fix mobile styles for inserter pattern and media tab navigation. ([63451](https://github.com/WordPress/gutenberg/pull/63451)) -- Fix: Error while Calling edit-site getCurrentTemplateTemplateParts selector. ([63818](https://github.com/WordPress/gutenberg/pull/63818)) -- Footnotes: Register format within the init function. ([63554](https://github.com/WordPress/gutenberg/pull/63554)) -- InnerBlocks: Make sure blockType is set before trying to use it. ([63351](https://github.com/WordPress/gutenberg/pull/63351)) -- Prepare JSON schemas for Draft 7 update. ([63582](https://github.com/WordPress/gutenberg/pull/63582)) -- Revert "Pages: Trash view should default to table layout.". ([63481](https://github.com/WordPress/gutenberg/pull/63481)) -- Sync backport changelog action: Use outputs instead of env. ([63792](https://github.com/WordPress/gutenberg/pull/63792)) -- core-data: Fix `canUser` allowed methods handling. ([63615](https://github.com/WordPress/gutenberg/pull/63615)) -- useBlockElement: Return null until ref callback has time to clean up the old element. ([63565](https://github.com/WordPress/gutenberg/pull/63565)) - #### Data Views +- DataViews: Do not render bulk actions Dropdown if no actions are available. ([63575](https://github.com/WordPress/gutenberg/pull/63575)) - DataViews: Fix default layouts in the pages data views. ([63427](https://github.com/WordPress/gutenberg/pull/63427)) - DataViews: Fix featured image height regression. ([63424](https://github.com/WordPress/gutenberg/pull/63424)) - DataViews: Fix field rendering. ([63452](https://github.com/WordPress/gutenberg/pull/63452)) - DataViews: Fix pattens list selection. ([63733](https://github.com/WordPress/gutenberg/pull/63733)) +- DataViews: Fix uncontrolled selection. ([63741](https://github.com/WordPress/gutenberg/pull/63741)) - DataViews: Only show elligible actions in the bulk editing menu. ([63473](https://github.com/WordPress/gutenberg/pull/63473)) - Fix patterns sorting by `title`. ([63710](https://github.com/WordPress/gutenberg/pull/63710)) - Fix selected row styles in table layout. ([63811](https://github.com/WordPress/gutenberg/pull/63811)) - Fix: DataViews: Layout resets for patterns each time a new pattern category is selected. ([63711](https://github.com/WordPress/gutenberg/pull/63711)) - Fix: Inconsistent field spacing in Grid layout. ([63363](https://github.com/WordPress/gutenberg/pull/63363)) - Templates DataViews: Set the right context for the preview field. ([63488](https://github.com/WordPress/gutenberg/pull/63488)) - +- #### Block Editor - Fix user patterns disabling sync filter. ([63828](https://github.com/WordPress/gutenberg/pull/63828)) - ImageURLInputUI: Make onSetLightbox and resetLightbox optional. ([63573](https://github.com/WordPress/gutenberg/pull/63573)) @@ -169,11 +143,14 @@ - Prevent empty void at the bottom of editor when block directory results are present. ([63397](https://github.com/WordPress/gutenberg/pull/63397)) - Remove double shadow on Inserter category panel when zoomed out. ([63516](https://github.com/WordPress/gutenberg/pull/63516)) - Tabs: Vertical Tabs should be 40px min height. ([63446](https://github.com/WordPress/gutenberg/pull/63446)) -- Zoom out mode: Translate toolbar delete button. ([63476](https://github.com/WordPress/gutenberg/pull/63476)) +- Fix mobile styles for inserter pattern and media tab navigation. ([63451](https://github.com/WordPress/gutenberg/pull/63451)) +- useBlockElement: Return null until ref callback has time to clean up the old element. ([63565](https://github.com/WordPress/gutenberg/pull/63565)) +- Remove hint in the Settings tab. ([63515](https://github.com/WordPress/gutenberg/pull/63515)) #### Block Library - Avoid stripping attributes via group block migration when no layout is specified. ([63837](https://github.com/WordPress/gutenberg/pull/63837)) - Fix default unit issue for tag cloud block. ([59122](https://github.com/WordPress/gutenberg/pull/59122)) +- Footnotes: Register format within the init function. ([63554](https://github.com/WordPress/gutenberg/pull/63554)) - Image lightbox: Remove duplicate image when lightbox is opened. ([63381](https://github.com/WordPress/gutenberg/pull/63381)) - Query Loop: Fix 'block' scoped variations to get the `query` defaults. ([63477](https://github.com/WordPress/gutenberg/pull/63477)) - Query Loop: Fix passing of `namespace` when selecting from suggested patterns. ([63402](https://github.com/WordPress/gutenberg/pull/63402)) @@ -181,6 +158,7 @@ - Update Inherited Query Loop value from Template Settings changes. ([63358](https://github.com/WordPress/gutenberg/pull/63358)) #### Site Editor +- Fix: Error while Calling edit-site getCurrentTemplateTemplateParts selector. ([63818](https://github.com/WordPress/gutenberg/pull/63818)) - Fix error when duplicating a template part. ([63663](https://github.com/WordPress/gutenberg/pull/63663)) - Fix: Add Template Modal layout in mobile view. ([63627](https://github.com/WordPress/gutenberg/pull/63627)) - Make hover block outlines not present in Distraction Free. ([63819](https://github.com/WordPress/gutenberg/pull/63819)) @@ -192,6 +170,7 @@ - Ensure that we only enter zoom out mode if the experiment is enabled. ([63417](https://github.com/WordPress/gutenberg/pull/63417)) - Fix crash due to absence of selected block. ([63642](https://github.com/WordPress/gutenberg/pull/63642)) - Fix vertical toolbar position. ([63745](https://github.com/WordPress/gutenberg/pull/63745)) +- Translate toolbar delete button. ([63476](https://github.com/WordPress/gutenberg/pull/63476)) #### Components - Button: Never apply `aria-disabled` to anchor. ([63376](https://github.com/WordPress/gutenberg/pull/63376)) @@ -201,6 +180,7 @@ #### Global Styles - Disable "Reset styles" button when there are no changes. ([63562](https://github.com/WordPress/gutenberg/pull/63562)) +- Disallow scrolling the block preview. ([63558](https://github.com/WordPress/gutenberg/pull/63558)) - Ensure root selector (body) is not wrapped in :root :Where(). ([63726](https://github.com/WordPress/gutenberg/pull/63726)) - Global styles block previews: Fix scaling. ([63596](https://github.com/WordPress/gutenberg/pull/63596)) - Style variations: Don't display the default if its the only variation. ([63555](https://github.com/WordPress/gutenberg/pull/63555)) @@ -219,9 +199,11 @@ #### Design Tools - Background image block support: Fix dropzone size. ([63588](https://github.com/WordPress/gutenberg/pull/63588)) +- Background tool: Fix double border. ([63559](https://github.com/WordPress/gutenberg/pull/63559)) -#### Layout -- Don't remount the block when rendering grid tools. ([63557](https://github.com/WordPress/gutenberg/pull/63557)) +#### General interface +- Discussions panel: Distinguish between verb and adjective form of open for internationalization. ([63791](https://github.com/WordPress/gutenberg/pull/63791)) +- Fix canvas issues by removing VisualEditor’s height. ([63724](https://github.com/WordPress/gutenberg/pull/63724)) #### Block Transforms - Block Switcher Preview: Adjust the position and enable pattern list preview in mobile viewport. ([63512](https://github.com/WordPress/gutenberg/pull/63512)) @@ -232,6 +214,9 @@ #### Block Directory - Memoize store selectors. ([63346](https://github.com/WordPress/gutenberg/pull/63346)) +#### Inner blocks +- InnerBlocks: Make sure blockType is set before trying to use it. ([63351](https://github.com/WordPress/gutenberg/pull/63351)) + #### Widgets Editor - Widgets: Memoize 'getWidgets' store selector. ([63338](https://github.com/WordPress/gutenberg/pull/63338)) @@ -244,12 +229,16 @@ #### Media - Lock post saving during image uploads. ([41120](https://github.com/WordPress/gutenberg/pull/41120)) +#### JSON Schemas +- Prepare JSON schemas for Draft 7 update. ([63582](https://github.com/WordPress/gutenberg/pull/63582)) -### Accessibility +#### Security +- Add: Permission checks to avoid 403 errors on non admin roles. ([63296](https://github.com/WordPress/gutenberg/pull/63296)) -- Align checkbox, radio, and toggle input design. ([63490](https://github.com/WordPress/gutenberg/pull/63490)) +### Accessibility #### Components +- Align checkbox, radio, and toggle input design. ([63490](https://github.com/WordPress/gutenberg/pull/63490)) - Fix ComboboxControl reset button when using the keyboard. ([63410](https://github.com/WordPress/gutenberg/pull/63410)) #### Post Editor @@ -267,18 +256,17 @@ ### Experiments -#### Layout +#### Grid layout - Disable in-between inserter in Manual grids. ([63391](https://github.com/WordPress/gutenberg/pull/63391)) - Don't display default appender inside Manual grid. ([63395](https://github.com/WordPress/gutenberg/pull/63395)) - Fix responsive behaviour so both column start and column span are taken into account. ([63464](https://github.com/WordPress/gutenberg/pull/63464)) -- Grid: Better looking block movers. ([63394](https://github.com/WordPress/gutenberg/pull/63394)) -- Grid: Place new block after currently selected block when using slash inserter and splitting text. ([63333](https://github.com/WordPress/gutenberg/pull/63333)) +- Better looking block movers. ([63394](https://github.com/WordPress/gutenberg/pull/63394)) +- Place new block after currently selected block when using slash inserter and splitting text. ([63333](https://github.com/WordPress/gutenberg/pull/63333)) - Move visualizer popover to slot under the canvas. ([63389](https://github.com/WordPress/gutenberg/pull/63389)) +- Don't remount the block when rendering grid tools. ([63557](https://github.com/WordPress/gutenberg/pull/63557)) #### Data Views - Quick Edit: Support bulk selection. ([63841](https://github.com/WordPress/gutenberg/pull/63841)) - -#### Site Editor - DataViews: Bootstrap Quick Edit. ([63600](https://github.com/WordPress/gutenberg/pull/63600)) @@ -314,11 +302,15 @@ - Block editor settings: Add missing global styles links dependencies. ([63823](https://github.com/WordPress/gutenberg/pull/63823)) - Core Data: Remove leftover 'todo' comment. ([63842](https://github.com/WordPress/gutenberg/pull/63842)) - Core Data: Use meta-store actions for resolution status. ([63469](https://github.com/WordPress/gutenberg/pull/63469)) +- core-data: Fix `canUser` allowed methods handling. ([63615](https://github.com/WordPress/gutenberg/pull/63615)) - DataViews: Move PostList component to its own folder. ([63334](https://github.com/WordPress/gutenberg/pull/63334)) - JSON Schema Reorganization and Fixes. ([63591](https://github.com/WordPress/gutenberg/pull/63591)) - Update: Simplify and do not pass renderingMode on editor SidebarContent. ([63814](https://github.com/WordPress/gutenberg/pull/63814)) - Use Base Focus Styles for Region Focus. ([62881](https://github.com/WordPress/gutenberg/pull/62881)) - Use static 'key' when filtering BlockEdit components. ([63590](https://github.com/WordPress/gutenberg/pull/63590)) +- Update: Simplify some permission checks. ([63812](https://github.com/WordPress/gutenberg/pull/63812)) +- Use entity details when calling 'canUser' selectors. ([63415](https://github.com/WordPress/gutenberg/pull/63415)) +- HTML API: Backport updates from Core. ([63723](https://github.com/WordPress/gutenberg/pull/63723)) #### Block Library - Image block: Remove unnecessary variables on expand on click implementation. ([63290](https://github.com/WordPress/gutenberg/pull/63290)) @@ -375,34 +367,25 @@ #### Block Directory - Remove 'edit-post' package dependency. ([63349](https://github.com/WordPress/gutenberg/pull/63349)) - ### Tools -- Bug: Eslint `recommended-with-formatting` allows for unnecessary spaces. ([63549](https://github.com/WordPress/gutenberg/pull/63549)) +#### Project Management - Issue template: Use checkboxes instead of dropdown. ([63523](https://github.com/WordPress/gutenberg/pull/63523)) -- Scripts: Include variations paths in build. ([63098](https://github.com/WordPress/gutenberg/pull/63098)) -- Scripts: Remove now-obsolete `getRenderPropPaths()`. ([63661](https://github.com/WordPress/gutenberg/pull/63661)) +- Sync backport changelog action: Use outputs instead of env. ([63792](https://github.com/WordPress/gutenberg/pull/63792)) +- Run sync when issue is labeled with Sync Backport Changelog. ([63793](https://github.com/WordPress/gutenberg/pull/63793)) #### Testing - Downgrade node 22(.5) unit tests to 22.4. ([63728](https://github.com/WordPress/gutenberg/pull/63728)) - Font Library: Fix flaky end-to-end tests. ([63904](https://github.com/WordPress/gutenberg/pull/63904)) - Upgrade Playwright to v1.45. ([61443](https://github.com/WordPress/gutenberg/pull/61443)) +- Bug: Eslint `recommended-with-formatting` allows for unnecessary spaces. ([63549](https://github.com/WordPress/gutenberg/pull/63549)) -#### Build Tooling +#### Build Tooling & Plugin - Fix broken license check script. ([61868](https://github.com/WordPress/gutenberg/pull/61868)) - React: Restore umd builds. ([63602](https://github.com/WordPress/gutenberg/pull/63602)) - - -### Various - -- HTML API: Backport updates from Core. ([63723](https://github.com/WordPress/gutenberg/pull/63723)) - Upgrade TypeScript to 5.5. ([63012](https://github.com/WordPress/gutenberg/pull/63012)) - -#### Block Editor -- Remove hint in the Settings tab. ([63515](https://github.com/WordPress/gutenberg/pull/63515)) - -#### Block Library -- Social Links: Update Facebook's color to match brand guidelines. ([60424](https://github.com/WordPress/gutenberg/pull/60424)) +- Scripts: Remove now-obsolete `getRenderPropPaths()`. ([63661](https://github.com/WordPress/gutenberg/pull/63661)) +- Scripts: Include variations paths in build. ([63098](https://github.com/WordPress/gutenberg/pull/63098)) ## First-time contributors From dfa18c5031c2c8df5457b6fad92dd1e45fe05118 Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 31 Jul 2024 21:15:46 +0100 Subject: [PATCH 25/32] Centrally align entity in focused edit mode (#64143) Co-authored-by: jameskoster Co-authored-by: richtabor --- packages/editor/src/components/visual-editor/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/components/visual-editor/style.scss b/packages/editor/src/components/visual-editor/style.scss index 18a61827d573da..fae61eda6b8013 100644 --- a/packages/editor/src/components/visual-editor/style.scss +++ b/packages/editor/src/components/visual-editor/style.scss @@ -1,6 +1,6 @@ .editor-visual-editor { position: relative; - display: block; + display: flex; background-color: $gray-300; // Centralize the editor horizontally (flex-direction is column). From 08d3c862187a150163086f76b9ea281d522dd6ca Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Wed, 31 Jul 2024 17:48:27 -0500 Subject: [PATCH 26/32] Don't overlap canvas with inserter panel at large screens (#64110) * Don't overlap canvas with inserter panel at large screens * Always resize canvas * Cleanup * Refactor to share new -sidebar-width var * Try to improve animation -- still needs work * animate the pattern category preview panel * use the same animation for both elements * Add animate presence * only use one animated div * Pattern panel zindex * Animate pattern tab panel on open * Try to smooth entrance and exit secondary sidebar animations * remove unneeded properties so that the parent controls the animation * remove unneeded double shadow --------- Co-authored-by: Ben Dwyer Co-authored-by: Rich Tabor Co-authored-by: jeryj Co-authored-by: scruffian Co-authored-by: richtabor --- packages/base-styles/_variables.scss | 2 +- .../inserter/category-tabs/index.js | 37 ++++++++++++++++++- .../src/components/inserter/style.scss | 27 ++++++++------ .../src/components/tabbed-sidebar/style.scss | 5 +-- .../components/list-view-sidebar/style.scss | 4 ++ .../components/interface-skeleton/index.js | 16 ++++---- 6 files changed, 66 insertions(+), 25 deletions(-) diff --git a/packages/base-styles/_variables.scss b/packages/base-styles/_variables.scss index b26d70b7299f9f..97eb513cf38aeb 100644 --- a/packages/base-styles/_variables.scss +++ b/packages/base-styles/_variables.scss @@ -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. diff --git a/packages/block-editor/src/components/inserter/category-tabs/index.js b/packages/block-editor/src/components/inserter/category-tabs/index.js index a379f4719556b2..6a02cf1a170c45 100644 --- a/packages/block-editor/src/components/inserter/category-tabs/index.js +++ b/packages/block-editor/src/components/inserter/category-tabs/index.js @@ -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'; @@ -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 ( - { children } + + { children } + ) ) } diff --git a/packages/block-editor/src/components/inserter/style.scss b/packages/block-editor/src/components/inserter/style.scss index c7398aadb56ba5..960ca8b48cdf90 100644 --- a/packages/block-editor/src/components/inserter/style.scss +++ b/packages/block-editor/src/components/inserter/style.scss @@ -1,5 +1,5 @@ $block-inserter-preview-height: 350px; -$block-inserter-width: 350px; +$block-quick-inserter-width: 350px; $block-inserter-tabs-height: 44px; .block-editor-inserter { @@ -24,6 +24,12 @@ $block-inserter-tabs-height: 44px; &.show-as-tabs { gap: 0; } + + .block-editor-tabbed-sidebar { + @include break-medium() { + width: $secondary-sidebar-width; + } + } } .block-editor-inserter__popover.is-quick { @@ -85,6 +91,12 @@ $block-inserter-tabs-height: 44px; height: 100%; position: relative; overflow: visible; + + &.show-panel { + @include break-medium() { + width: $secondary-sidebar-width + $sidebar-width; + } + } } .block-editor-inserter__inline-elements { @@ -299,14 +311,13 @@ $block-inserter-tabs-height: 44px; @include break-medium { border-left: $border-width solid $gray-200; padding: 0; - left: 100%; - width: 300px; + left: $secondary-sidebar-width; + width: $sidebar-width; position: absolute; top: -$border-width; height: calc(100% + #{$border-width}); background: $gray-100; border-top: $border-width solid $gray-200; - box-shadow: $border-width $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha. .block-editor-inserter__media-list, .block-editor-block-patterns-list { @@ -366,7 +377,7 @@ $block-inserter-tabs-height: 44px; max-width: 100%; @include break-medium { - width: $block-inserter-width; + width: $block-quick-inserter-width; } } @@ -679,12 +690,6 @@ $block-inserter-tabs-height: 44px; height: 100%; } } - - // Remove doubled-up shadow that occurs when categories panel is opened, only in zoom out. - // Shadow cannot be removed from the source, as it is required when not zoomed out. - .block-editor-inserter__category-panel { - box-shadow: none; - } } .show-icon-labels { diff --git a/packages/block-editor/src/components/tabbed-sidebar/style.scss b/packages/block-editor/src/components/tabbed-sidebar/style.scss index e392cf955ed06c..374a012173e230 100644 --- a/packages/block-editor/src/components/tabbed-sidebar/style.scss +++ b/packages/block-editor/src/components/tabbed-sidebar/style.scss @@ -1,13 +1,10 @@ .block-editor-tabbed-sidebar { + background-color: $white; height: 100%; display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; - - @include break-medium() { - width: 350px; - } } .block-editor-tabbed-sidebar__tablist-and-close-button { diff --git a/packages/editor/src/components/list-view-sidebar/style.scss b/packages/editor/src/components/list-view-sidebar/style.scss index 3bf56b2c80760c..54c7376d374853 100644 --- a/packages/editor/src/components/list-view-sidebar/style.scss +++ b/packages/editor/src/components/list-view-sidebar/style.scss @@ -1,5 +1,9 @@ .editor-list-view-sidebar { height: 100%; + + @include break-medium { + width: $secondary-sidebar-width; + } } .editor-list-view-sidebar__list-view-panel-content, diff --git a/packages/interface/src/components/interface-skeleton/index.js b/packages/interface/src/components/interface-skeleton/index.js index ed4d98cdf7637f..14b2a87ba5203d 100644 --- a/packages/interface/src/components/interface-skeleton/index.js +++ b/packages/interface/src/components/interface-skeleton/index.js @@ -182,30 +182,32 @@ function InterfaceSkeleton( ariaLabel={ mergedLabels.secondarySidebar } as={ motion.div } initial="closed" - animate={ - isMobileViewport ? 'mobileOpen' : 'open' - } + animate="open" exit="closed" variants={ { open: { width: secondarySidebarSize.width }, closed: { width: 0 }, - mobileOpen: { width: '100vw' }, } } transition={ defaultTransition } > -
{ secondarySidebarResizeListener } { secondarySidebar } -
+ ) } From 720633938315f1ca42948955ac5861fb9327d7fe Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 1 Aug 2024 00:01:17 +0100 Subject: [PATCH 27/32] Global Styles: Create new public function to make it easier to expose style variations from other themes (#63318) * Global Styles: Create new public function to make it easier to expose style variations from other themes * pass scope * fix PHPCS * remove disconnected changes Co-authored-by: scruffian Co-authored-by: aaronrobertshaw Co-authored-by: carolinan --- ...class-wp-theme-json-resolver-gutenberg.php | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/class-wp-theme-json-resolver-gutenberg.php b/lib/class-wp-theme-json-resolver-gutenberg.php index a2153e639db3ba..2231cb0f11538f 100644 --- a/lib/class-wp-theme-json-resolver-gutenberg.php +++ b/lib/class-wp-theme-json-resolver-gutenberg.php @@ -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 ) ) { @@ -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 ); From ff59ffa756be03c5ad0647e91ee363d99f201312 Mon Sep 17 00:00:00 2001 From: Grant Kinney Date: Wed, 31 Jul 2024 20:29:59 -0500 Subject: [PATCH 28/32] Adds experimental blocks flag for blocks that may not be ready for general use (#64121) --- lib/experimental/editor-settings.php | 18 +++++++++++++++++- lib/experiments-page.php | 12 ++++++++++++ phpunit/bootstrap.php | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/experimental/editor-settings.php b/lib/experimental/editor-settings.php index 065264fd124e8c..c34984baa0a619 100644 --- a/lib/experimental/editor-settings.php +++ b/lib/experimental/editor-settings.php @@ -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' ); diff --git a/lib/experiments-page.php b/lib/experiments-page.php index acb095b47fde30..b27f6fc2726a2a 100644 --- a/lib/experiments-page.php +++ b/lib/experiments-page.php @@ -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.

(Warning: these blocks may have significant changes during development that cause validation errors and display issues.)

', 'gutenberg' ), + 'id' => 'gutenberg-block-experiments', + ) + ); + add_settings_field( 'gutenberg-form-blocks', __( 'Form and input blocks ', 'gutenberg' ), diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php index 295d02978f120f..55319a752b61e6 100644 --- a/phpunit/bootstrap.php +++ b/phpunit/bootstrap.php @@ -95,6 +95,7 @@ function fail_if_died( $message ) { 'gutenberg-widget-experiments' => '1', 'gutenberg-full-site-editing' => 1, 'gutenberg-form-blocks' => 1, + 'gutenberg-block-experiments' => 1, ), ); From 50e12e47b109330cc1cf12cfce01aef7b8697971 Mon Sep 17 00:00:00 2001 From: Ramon Date: Thu, 1 Aug 2024 13:55:51 +1000 Subject: [PATCH 29/32] Post: add a max length to the post password protected field (#64156) Co-authored-by: ramonjd Co-authored-by: peterwilsoncc --- packages/editor/src/components/post-status/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/editor/src/components/post-status/index.js b/packages/editor/src/components/post-status/index.js index d0b5ac93977330..ca89e40366b238 100644 --- a/packages/editor/src/components/post-status/index.js +++ b/packages/editor/src/components/post-status/index.js @@ -254,6 +254,7 @@ export default function PostStatus() { id={ passwordInputId } __next40pxDefaultSize __nextHasNoMarginBottom + maxLength={ 255 } />
) } From 30c6dfb3b872baf878dc0d8ce0f5b84d6ae6cd29 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 1 Aug 2024 08:42:50 +0400 Subject: [PATCH 30/32] Avoid errors for post types without a 'menu_icon' (#64015) Unlinked contributors: karan4official. Co-authored-by: Mamaduka Co-authored-by: t-hamano --- .../src/components/add-new-template/utils.js | 16 ++++++++++------ packages/editor/src/store/private-selectors.js | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/edit-site/src/components/add-new-template/utils.js b/packages/edit-site/src/components/add-new-template/utils.js index 1e544aeaadfe1b..a2644ec4ad4da9 100644 --- a/packages/edit-site/src/components/add-new-template/utils.js +++ b/packages/edit-site/src/components/add-new-template/utils.js @@ -166,9 +166,11 @@ export function usePostTypeArchiveMenuItems() { // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. - icon: postType.icon?.startsWith( 'dashicons-' ) - ? postType.icon.slice( 10 ) - : archive, + icon: + typeof postType.icon === 'string' && + postType.icon.startsWith( 'dashicons-' ) + ? postType.icon.slice( 10 ) + : archive, templatePrefix: 'archive', }; } ) || [], @@ -272,9 +274,11 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => { // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. - icon: icon?.startsWith( 'dashicons-' ) - ? icon.slice( 10 ) - : post, + icon: + typeof icon === 'string' && + icon.startsWith( 'dashicons-' ) + ? icon.slice( 10 ) + : post, templatePrefix: templatePrefixes[ slug ], }; const hasEntities = postTypesInfo?.[ slug ]?.hasEntities; diff --git a/packages/editor/src/store/private-selectors.js b/packages/editor/src/store/private-selectors.js index ed4672bc435cdc..6a6c8702a02217 100644 --- a/packages/editor/src/store/private-selectors.js +++ b/packages/editor/src/store/private-selectors.js @@ -110,7 +110,10 @@ export const getPostIcon = createRegistrySelector( // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. - if ( postTypeEntity?.icon?.startsWith( 'dashicons-' ) ) { + if ( + typeof postTypeEntity?.icon === 'string' && + postTypeEntity.icon.startsWith( 'dashicons-' ) + ) { return postTypeEntity.icon.slice( 10 ); } return pageIcon; From f6a9b02abaea0cdd10cb4101b6ae945dba4dd713 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 1 Aug 2024 07:06:58 +0200 Subject: [PATCH 31/32] Post content: Add clearfix (#63690) Add a CSS clearfix to the post content block, to clear aligned (floated) blocks and prevent them from overflowing the content area. Co-authored-by: carolinan Co-authored-by: MaggieCabrera Co-authored-by: colorful-tones Co-authored-by: jasmussen --- packages/block-library/src/post-content/block.json | 1 + packages/block-library/src/post-content/style.scss | 5 +++++ packages/block-library/src/style.scss | 1 + 3 files changed, 7 insertions(+) create mode 100644 packages/block-library/src/post-content/style.scss diff --git a/packages/block-library/src/post-content/block.json b/packages/block-library/src/post-content/block.json index 5ca3892f567a54..1b9de707cb3220 100644 --- a/packages/block-library/src/post-content/block.json +++ b/packages/block-library/src/post-content/block.json @@ -54,5 +54,6 @@ } } }, + "style": "wp-block-post-content", "editorStyle": "wp-block-post-content-editor" } diff --git a/packages/block-library/src/post-content/style.scss b/packages/block-library/src/post-content/style.scss new file mode 100644 index 00000000000000..96e27d04679d44 --- /dev/null +++ b/packages/block-library/src/post-content/style.scss @@ -0,0 +1,5 @@ +.wp-block-post-content::after { + content: ""; + display: table; + clear: both; +} diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index db9d033d915db8..8f17cd7a50f55c 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -30,6 +30,7 @@ @import "./paragraph/style.scss"; @import "./post-author/style.scss"; @import "./post-comments-form/style.scss"; +@import "./post-content/style.scss"; @import "./post-date/style.scss"; @import "./post-excerpt/style.scss"; @import "./post-featured-image/style.scss"; From ecfc7efaa3fccc4b6466543c50ac262ce8093934 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 1 Aug 2024 09:53:33 +0400 Subject: [PATCH 32/32] Template Part: Fix capability checks for inner blocks (#64159) Co-authored-by: Mamaduka Co-authored-by: fabiankaegy --- .../src/template-part/edit/inner-blocks.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/template-part/edit/inner-blocks.js b/packages/block-library/src/template-part/edit/inner-blocks.js index ef7d85948626dd..2c246809ab2d49 100644 --- a/packages/block-library/src/template-part/edit/inner-blocks.js +++ b/packages/block-library/src/template-part/edit/inner-blocks.js @@ -129,15 +129,17 @@ export default function TemplatePartInnerBlocks( { return { canViewTemplatePart: !! select( coreStore ).canUser( 'read', { kind: 'postType', - name: 'wp_template', + name: 'wp_template_part', + id, } ), - canEditTemplatePart: !! select( coreStore ).canUser( 'create', { + canEditTemplatePart: !! select( coreStore ).canUser( 'update', { kind: 'postType', - name: 'wp_template', + name: 'wp_template_part', + id, } ), }; }, - [] + [ id ] ); if ( ! canViewTemplatePart ) {