From f5c6a98c832b4fe6172f9f538cc65d89b3b0ee11 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 7 Sep 2026 12:19:24 +0100 Subject: [PATCH 1/3] Remove the content-only inspector fields experiment Drops the `gutenberg-content-only-inspector-fields` experiment and everything that hung off it: the `block-fields` hook in block-editor (DataForm-driven content tab with its rich text, media and link controls), the private `fieldsKey`/`formKey` block settings in `@wordpress/blocks`, the per-block field declarations in block-library, the experiment toggles in PHP, and the e2e spec that exercised the panel. The experiment needs a lot more work to land and is not a current priority. Anyone is welcome to restart it from the history when they want to own it. Co-Authored-By: Claude Fable 5.1 --- lib/experimental/editor-settings.php | 3 - lib/experimental/experiments/load.php | 5 - .../inspector-controls-tabs/content-tab.jsx | 21 +- .../use-inspector-controls-tabs.js | 9 +- .../block-fields/fields-dropdown-menu.jsx | 47 --- .../src/hooks/block-fields/index.jsx | 302 ------------------ .../src/hooks/block-fields/link/index.jsx | 155 --------- .../src/hooks/block-fields/link/styles.scss | 18 -- .../src/hooks/block-fields/media/index.jsx | 271 ---------------- .../src/hooks/block-fields/media/styles.scss | 77 ----- .../hooks/block-fields/rich-text/index.jsx | 123 ------- .../hooks/block-fields/rich-text/styles.scss | 24 -- .../src/hooks/block-fields/styles.scss | 33 -- .../use-inspector-popover-placement.js | 16 - .../hooks/generate-fields-from-attributes.js | 2 +- packages/block-editor/src/hooks/index.js | 2 - packages/block-editor/src/style.scss | 1 - packages/block-library/src/audio/index.js | 37 --- packages/block-library/src/button/index.js | 34 -- packages/block-library/src/code/index.js | 18 -- packages/block-library/src/cover/index.js | 39 --- packages/block-library/src/details/index.js | 18 -- packages/block-library/src/file/index.js | 44 +-- packages/block-library/src/heading/index.js | 23 +- packages/block-library/src/image/image.jsx | 5 +- packages/block-library/src/image/index.js | 80 ----- packages/block-library/src/list-item/index.js | 18 -- .../block-library/src/media-text/index.js | 50 --- packages/block-library/src/more/index.js | 19 -- .../src/navigation-link/index.js | 34 +- .../src/navigation-submenu/index.js | 34 +- packages/block-library/src/paragraph/index.js | 18 -- .../block-library/src/preformatted/index.js | 18 -- packages/block-library/src/pullquote/index.js | 24 -- packages/block-library/src/search/index.js | 30 -- .../block-library/src/social-link/index.js | 32 -- packages/block-library/src/verse/index.js | 18 -- packages/block-library/src/video/index.js | 40 --- packages/blocks/src/api/index.ts | 6 - .../block-fields-pattern-overrides.spec.js | 77 ----- .../various/block-bindings/post-meta.spec.js | 11 - test/e2e/timings.json | 28 -- 42 files changed, 14 insertions(+), 1850 deletions(-) delete mode 100644 packages/block-editor/src/hooks/block-fields/fields-dropdown-menu.jsx delete mode 100644 packages/block-editor/src/hooks/block-fields/index.jsx delete mode 100644 packages/block-editor/src/hooks/block-fields/link/index.jsx delete mode 100644 packages/block-editor/src/hooks/block-fields/link/styles.scss delete mode 100644 packages/block-editor/src/hooks/block-fields/media/index.jsx delete mode 100644 packages/block-editor/src/hooks/block-fields/media/styles.scss delete mode 100644 packages/block-editor/src/hooks/block-fields/rich-text/index.jsx delete mode 100644 packages/block-editor/src/hooks/block-fields/rich-text/styles.scss delete mode 100644 packages/block-editor/src/hooks/block-fields/styles.scss delete mode 100644 packages/block-editor/src/hooks/block-fields/use-inspector-popover-placement.js delete mode 100644 test/e2e/specs/editor/various/block-bindings/block-fields-pattern-overrides.spec.js diff --git a/lib/experimental/editor-settings.php b/lib/experimental/editor-settings.php index 141ca9807f0c9b..37b60287fc4044 100644 --- a/lib/experimental/editor-settings.php +++ b/lib/experimental/editor-settings.php @@ -20,9 +20,6 @@ function gutenberg_enable_experiments() { if ( gutenberg_is_experiment_enabled( 'gutenberg-dataviews-media-modal' ) ) { wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDataViewsMediaModal = true', 'before' ); } - if ( gutenberg_is_experiment_enabled( 'gutenberg-content-only-inspector-fields' ) ) { - wp_add_inline_script( 'wp-block-editor', 'window.__experimentalContentOnlyInspectorFields = true', 'before' ); - } if ( gutenberg_is_experiment_enabled( 'gutenberg-extensible-site-editor' ) ) { wp_add_inline_script( 'wp-block-editor', 'window.__experimentalExtensibleSiteEditor = true', 'before' ); } diff --git a/lib/experimental/experiments/load.php b/lib/experimental/experiments/load.php index 5e3d494c0736a9..e3186f044bcc52 100644 --- a/lib/experimental/experiments/load.php +++ b/lib/experimental/experiments/load.php @@ -56,11 +56,6 @@ function gutenberg_initialize_experiments_settings() { 'slug' => 'data-views', 'label' => _x( 'Data Views', 'experiments group name', 'gutenberg' ), 'items' => array( - array( - 'id' => 'gutenberg-content-only-inspector-fields', - 'label' => __( 'Block fields: Show dataform driven inspector fields on blocks that support them', 'gutenberg' ), - 'description' => __( 'Enables editable block inspector fields that are generated using a dataform.', 'gutenberg' ), - ), array( 'id' => 'gutenberg-dataform-inspector', 'label' => __( 'Editor Inspector: Use DataForm', 'gutenberg' ), diff --git a/packages/block-editor/src/components/inspector-controls-tabs/content-tab.jsx b/packages/block-editor/src/components/inspector-controls-tabs/content-tab.jsx index 0bb8e3b8da4945..02b86ba0610bbe 100644 --- a/packages/block-editor/src/components/inspector-controls-tabs/content-tab.jsx +++ b/packages/block-editor/src/components/inspector-controls-tabs/content-tab.jsx @@ -11,21 +11,14 @@ const ContentTab = ( { return null; } - const shouldShowBlockFields = - window?.__experimentalContentOnlyInspectorFields; - return ( - <> - { ! shouldShowBlockFields && ( - - - - ) } - + + + ); }; diff --git a/packages/block-editor/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js b/packages/block-editor/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js index 4720fdc5954655..de069330f1f34a 100644 --- a/packages/block-editor/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +++ b/packages/block-editor/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js @@ -79,14 +79,7 @@ export default function useInspectorControlsTabs( ...( hasListFills && hasStyleFills > 1 ? advancedFills : [] ), ]; - // When the block fields experiment is active, only rely on `hasContentFills` - // to determine whether the content tab to be shown. The tab purely uses slot - // fills in this situation. - const shouldShowBlockFields = - window?.__experimentalContentOnlyInspectorFields; - const hasContentTab = - hasContentFills || - ( ! shouldShowBlockFields && contentClientIds?.length ); + const hasContentTab = hasContentFills || contentClientIds?.length; if ( hasContentTab ) { tabs.push( TAB_CONTENT ); diff --git a/packages/block-editor/src/hooks/block-fields/fields-dropdown-menu.jsx b/packages/block-editor/src/hooks/block-fields/fields-dropdown-menu.jsx deleted file mode 100644 index 2e2015b7e1ea7d..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/fields-dropdown-menu.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components'; -import { moreVertical, check } from '@wordpress/icons'; -import { __ } from '@wordpress/i18n'; -import { useInspectorPopoverPlacement } from './use-inspector-popover-placement'; - -export default function FieldsDropdownMenu( { - fields, - visibleFields, - onToggleField, -} ) { - const { popoverProps } = useInspectorPopoverPlacement(); - - if ( ! fields || fields.length === 0 ) { - return null; - } - - return ( - - { ( { onClose } ) => ( - - { fields.map( ( field ) => { - const isVisible = visibleFields.includes( field.id ); - return ( - { - onToggleField( field.id ); - onClose(); - } } - role="menuitemcheckbox" - icon={ isVisible ? check : null } - > - { field.label } - - ); - } ) } - - ) } - - ); -} diff --git a/packages/block-editor/src/hooks/block-fields/index.jsx b/packages/block-editor/src/hooks/block-fields/index.jsx deleted file mode 100644 index 374edd7fe6aa17..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/index.jsx +++ /dev/null @@ -1,302 +0,0 @@ -import { - privateApis as blocksPrivateApis, - getBlockType, - store as blocksStore, -} from '@wordpress/blocks'; -import { useDebounce } from '@wordpress/compose'; -import { - __experimentalHStack as HStack, - __experimentalTruncate as Truncate, -} from '@wordpress/components'; -import { useDispatch, useSelect } from '@wordpress/data'; -import { DataForm } from '@wordpress/dataviews'; -import { useContext, useState, useMemo } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; -import { store as blockEditorStore } from '../../store'; -import { unlock } from '../../lock-unlock'; -import { replacePatternOverridesDefaultBinding } from '../../utils/block-bindings'; -import BlockContext from '../../components/block-context'; -import BlockIcon from '../../components/block-icon'; -import useBlockDisplayTitle from '../../components/block-title/use-block-display-title'; -import useBlockDisplayInformation from '../../components/use-block-display-information'; -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); -import FieldsDropdownMenu from './fields-dropdown-menu'; -import { PrivateBlockContext } from '../../components/block-list/private-block-context'; -import InspectorControls from '../../components/inspector-controls/fill'; -// controls -import RichText from './rich-text'; -import Media from './media'; -import Link from './link'; - -/** - * Creates a configured control component that wraps a custom control - * and passes configuration as props. - * - * @param {Component} ControlComponent The React component for the control. - * @param {Object} config The control configuration passed as a prop. - * - * @return {Function} A wrapped control component - */ -function createConfiguredControl( ControlComponent, config = {} ) { - return function ConfiguredControl( props ) { - return ; - }; -} - -/** - * Component that renders a DataForm for a single block's attributes - * @param {Object} props - * @param {string} props.clientId The clientId of the block. - * @param {Object} props.blockType The blockType definition. - * @param {Function} props.setAttributes Action to set the block's attributes. - * @param {boolean} props.isMultiBlock Whether forms for multiple blocks are shown at the same time. - * This changes the behavior of the component: - * - Only the first field is shown for each block. - * - A dropdown is rendered allowing display of additional fields. - * - Hovering the block fields highlights the block in the canvas - * - Focusing a block field soft-selects the block in the canvas. - */ -function BlockFields( { - clientId, - blockType, - setAttributes, - isMultiBlock = false, -} ) { - const blockTitle = useBlockDisplayTitle( { - clientId, - context: 'list-view', - } ); - const blockInformation = useBlockDisplayInformation( clientId ); - - const blockTypeFields = blockType?.[ fieldsKey ]; - - const blockContext = useContext( BlockContext ); - - const attributes = useSelect( - ( select ) => { - const _attributes = - select( blockEditorStore ).getBlockAttributes( clientId ); - if ( ! _attributes?.metadata?.bindings ) { - return _attributes; - } - - /* - * The pattern overrides `__default` binding is a placeholder, not - * a real attribute: expand it to the block's bindable attributes - * before resolving values, as other bindings consumers do. - */ - const { __experimentalBlockBindingsSupportedAttributes } = - select( blockEditorStore ).getSettings(); - const bindableAttributes = - __experimentalBlockBindingsSupportedAttributes?.[ - blockType?.name - ]; - const bindings = bindableAttributes - ? replacePatternOverridesDefaultBinding( - _attributes.metadata.bindings, - bindableAttributes - ) - : _attributes.metadata.bindings; - - const { getBlockBindingsSource } = unlock( select( blocksStore ) ); - return Object.entries( bindings ).reduce( - ( acc, [ attribute, binding ] ) => { - // Skip a `__default` binding that could not be expanded: - // it is not a real block attribute. - if ( attribute === '__default' ) { - return acc; - } - const source = getBlockBindingsSource( binding.source ); - if ( ! source ) { - return acc; - } - const values = source.getValues( { - select, - clientId, - context: blockContext, - bindings: { [ attribute ]: binding }, - } ); - return { ...acc, ...values }; - }, - _attributes - ); - }, - [ blockContext, clientId, blockType?.name ] - ); - const { selectBlock, toggleBlockHighlight } = - useDispatch( blockEditorStore ); - - const debouncedToggleBlockHighlight = useDebounce( - toggleBlockHighlight, - 50 - ); - - const computedForm = useMemo( () => { - if ( ! isMultiBlock ) { - return blockType?.[ formKey ]; - } - - // For a collapsed form only show the first field by default. - return { - ...blockType?.[ formKey ], - fields: [ blockType?.[ formKey ]?.fields?.[ 0 ] ], - }; - }, [ blockType, isMultiBlock ] ); - - const [ form, setForm ] = useState( computedForm ); - - // Build DataForm fields with proper structure - const dataFormFields = useMemo( () => { - if ( ! blockTypeFields?.length ) { - return []; - } - - return blockTypeFields.map( ( fieldDef ) => { - const field = { - ...fieldDef, - }; - - // These should be custom Edit components, not replaced here. - // - // - rich-text control: it needs clientId - // - link control: does not need anything extra - // - media control: needs the Edit config - if ( - 'string' === typeof fieldDef.Edit && - fieldDef.Edit === 'rich-text' - ) { - field.Edit = createConfiguredControl( RichText, { - clientId, - } ); - } else if ( - 'string' === typeof fieldDef.Edit && - fieldDef.Edit === 'link' - ) { - field.Edit = createConfiguredControl( Link ); - } else if ( - 'object' === typeof fieldDef.Edit && - fieldDef.Edit.control === 'media' - ) { - field.Edit = createConfiguredControl( Media, { - ...fieldDef.Edit, - } ); - } - - return field; - } ); - }, [ blockTypeFields, clientId ] ); - - if ( ! blockTypeFields?.length ) { - // TODO - we might still want to show a placeholder for blocks with no fields. - // for example, a way to select the block. - return null; - } - - const handleToggleField = ( fieldId ) => { - setForm( ( prev ) => { - if ( prev.fields?.includes( fieldId ) ) { - return { - ...prev, - fields: prev.fields.filter( ( id ) => id !== fieldId ), - }; - } - - return { - ...prev, - fields: [ ...( prev.fields || [] ), fieldId ], - }; - } ); - }; - - return ( -
debouncedToggleBlockHighlight( clientId, true ) - : undefined - } - onMouseLeave={ () => - isMultiBlock - ? debouncedToggleBlockHighlight( clientId, false ) - : undefined - } - onFocus={ - isMultiBlock - ? () => { - selectBlock( - clientId, - null /* null to avoid focus on the block in the canvas */ - ); - } - : undefined - } - > -
- - { isMultiBlock && ( - <> - -

- - { blockTitle } - -

- - - ) } - { ! isMultiBlock && ( -

- { __( 'Content' ) } -

- ) } -
-
- -
- ); -} - -function hasBlockFieldsSupport( blockName ) { - return !! ( - window?.__experimentalContentOnlyInspectorFields && - getBlockType( blockName )?.[ fieldsKey ] - ); -} - -export function BlockFieldsPanel( props ) { - const { blockType, isSelectionWithinCurrentSection } = - useContext( PrivateBlockContext ); - - return ( - - - - ); -} - -/** - * Export block support definition. - */ -export default { - edit: BlockFieldsPanel, - hasSupport: hasBlockFieldsSupport, - attributeKeys: [], - supportsPatternEditing: true, -}; diff --git a/packages/block-editor/src/hooks/block-fields/link/index.jsx b/packages/block-editor/src/hooks/block-fields/link/index.jsx deleted file mode 100644 index cc7269647379ac..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/link/index.jsx +++ /dev/null @@ -1,155 +0,0 @@ -import { - Button, - Icon as WCIcon, - __experimentalGrid as Grid, - Popover, -} from '@wordpress/components'; -import { useMemo, useState } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; -import { link } from '@wordpress/icons'; -import { prependHTTP } from '@wordpress/url'; -import LinkControl from '../../../components/link-control'; -import { useInspectorPopoverPlacement } from '../use-inspector-popover-placement'; - -export const NEW_TAB_REL = 'noopener'; -export const NEW_TAB_TARGET = '_blank'; -export const NOFOLLOW_REL = 'nofollow'; - -/** - * Updates the link attributes. - * - * @param {Object} attributes The current block attributes. - * @param {string} attributes.rel The current link rel attribute. - * @param {string} attributes.url The current link url. - * @param {boolean} attributes.opensInNewTab Whether the link should open in a new window. - * @param {boolean} attributes.nofollow Whether the link should be marked as nofollow. - */ -export function getUpdatedLinkAttributes( { - rel = '', - url = '', - opensInNewTab, - nofollow, -} ) { - let newLinkTarget; - // Since `rel` is editable attribute, we need to check for existing values and proceed accordingly. - let updatedRel = rel; - - if ( opensInNewTab ) { - newLinkTarget = NEW_TAB_TARGET; - updatedRel = updatedRel?.includes( NEW_TAB_REL ) - ? updatedRel - : updatedRel + ` ${ NEW_TAB_REL }`; - } else { - const relRegex = new RegExp( `\\b${ NEW_TAB_REL }\\s*`, 'g' ); - updatedRel = updatedRel?.replace( relRegex, '' ).trim(); - } - - if ( nofollow ) { - updatedRel = updatedRel?.includes( NOFOLLOW_REL ) - ? updatedRel - : ( updatedRel + ` ${ NOFOLLOW_REL }` ).trim(); - } else { - const relRegex = new RegExp( `\\b${ NOFOLLOW_REL }\\s*`, 'g' ); - updatedRel = updatedRel?.replace( relRegex, '' ).trim(); - } - - return { - url: prependHTTP( url ), - linkTarget: newLinkTarget, - rel: updatedRel || undefined, - }; -} - -export default function Link( { data, field, onChange } ) { - const [ isLinkControlOpen, setIsLinkControlOpen ] = useState( false ); - const { popoverProps } = useInspectorPopoverPlacement( { - isControl: true, - } ); - const value = field.getValue( { item: data } ); - const url = value?.url; - const rel = value?.rel || ''; - const target = value?.linkTarget; - - const opensInNewTab = target === NEW_TAB_TARGET; - const nofollow = rel === NOFOLLOW_REL; - - // Memoize link value to avoid overriding the LinkControl's internal state. - // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256. - const linkValue = useMemo( - () => ( { url, opensInNewTab, nofollow } ), - [ url, opensInNewTab, nofollow ] - ); - - return ( - <> - - { isLinkControlOpen && ( - { - setIsLinkControlOpen( false ); - } } - { ...( popoverProps ?? {} ) } - > - { - const updatedAttrs = getUpdatedLinkAttributes( { - rel, - ...newValues, - } ); - - onChange( - field.setValue( { - item: data, - value: updatedAttrs, - } ) - ); - } } - onRemove={ () => { - onChange( - field.setValue( { - item: data, - value: {}, - } ) - ); - } } - /> - - ) } - - ); -} diff --git a/packages/block-editor/src/hooks/block-fields/link/styles.scss b/packages/block-editor/src/hooks/block-fields/link/styles.scss deleted file mode 100644 index e8998f0998fc30..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/link/styles.scss +++ /dev/null @@ -1,18 +0,0 @@ -@use "@wordpress/base-styles/colors" as *; -@use "@wordpress/base-styles/variables" as *; - -.block-editor-content-only-controls__link { - width: 100%; - border-color: $gray-400; -} - -.block-editor-content-only-controls__link-row { - align-items: center; -} - -.block-editor-content-only-controls__link-title { - width: 100%; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; -} diff --git a/packages/block-editor/src/hooks/block-fields/media/index.jsx b/packages/block-editor/src/hooks/block-fields/media/index.jsx deleted file mode 100644 index f3e74ea787e684..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/media/index.jsx +++ /dev/null @@ -1,271 +0,0 @@ -import { - Button, - Icon as WCIcon, - __experimentalGrid as Grid, -} from '@wordpress/components'; -import { useSelect } from '@wordpress/data'; -import { focus } from '@wordpress/dom'; -import { useRef } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; -import { - audio as audioIcon, - image as imageIcon, - media as mediaIcon, - video as videoIcon, - reset as resetIcon, -} from '@wordpress/icons'; -import MediaReplaceFlow from '../../../components/media-replace-flow'; -import MediaUploadCheck from '../../../components/media-upload/check'; -import { useInspectorPopoverPlacement } from '../use-inspector-popover-placement'; -import { getMediaSelectKey } from '../../../store/private-keys'; -import { store as blockEditorStore } from '../../../store'; - -/** - * Focuses the toggle button. - * - * @param {Object} containerRef - ref object containing current element - */ -const focusToggleButton = ( containerRef ) => { - // Use requestAnimationFrame to ensure DOM updates are complete. - window.requestAnimationFrame( () => { - const [ toggleButton ] = focus.tabbable.find( containerRef?.current ); - if ( ! toggleButton ) { - return; - } - - toggleButton.focus(); - } ); -}; - -function MediaThumbnail( { data, field, attachment, config } ) { - const { allowedTypes = [], multiple = false } = config || {}; - - if ( multiple ) { - return 'todo multiple'; - } - - if ( attachment?.media_type === 'image' || attachment?.poster ) { - return ( -
- -
- ); - } - - if ( allowedTypes.length === 1 ) { - const value = field.getValue( { item: data } ); - const url = value?.url; - - if ( allowedTypes[ 0 ] === 'image' && url ) { - return ( -
- -
- ); - } - - let icon; - if ( allowedTypes[ 0 ] === 'image' ) { - icon = imageIcon; - } else if ( allowedTypes[ 0 ] === 'video' ) { - icon = videoIcon; - } else if ( allowedTypes[ 0 ] === 'audio' ) { - icon = audioIcon; - } else { - icon = mediaIcon; - } - - if ( icon ) { - return ; - } - } - - return ; -} - -export default function Media( { data, field, onChange, config = {} } ) { - const { popoverProps } = useInspectorPopoverPlacement( { - isControl: true, - } ); - const value = field.getValue( { item: data } ); - const { - allowedTypes = [], - multiple = false, - useFeaturedImage = false, - } = config; - - const id = value?.id; - const url = value?.url; - - const attachment = useSelect( - ( select ) => { - if ( ! id ) { - return; - } - - const settings = select( blockEditorStore ).getSettings(); - const getMedia = settings[ getMediaSelectKey ]; - - if ( ! getMedia ) { - return; - } - - return getMedia( select, id ); - }, - [ id ] - ); - - // TODO - pluralize when multiple. - let chooseItemLabel; - if ( allowedTypes.length === 1 ) { - const allowedType = allowedTypes[ 0 ]; - if ( allowedType === 'image' ) { - chooseItemLabel = __( 'Image' ); - } else if ( allowedType === 'video' ) { - chooseItemLabel = __( 'Video' ); - } else if ( allowedType === 'audio' ) { - chooseItemLabel = __( 'Audio' ); - } else if ( allowedType === 'application' ) { - chooseItemLabel = __( 'File' ); - } else { - chooseItemLabel = __( 'Media' ); - } - } else { - chooseItemLabel = __( 'Media' ); - } - const containerRef = useRef(); - - return ( - -
- { - onChange( - field.setValue( { - item: data, - value: {}, - } ) - ); - } } - { ...( useFeaturedImage && { - useFeaturedImage: !! value?.featuredImage, - onToggleFeaturedImage: () => { - onChange( - field.setValue( { - item: data, - value: { - featuredImage: ! value?.featuredImage, - }, - } ) - ); - }, - } ) } - onSelect={ ( selectedMedia ) => { - if ( selectedMedia.id && selectedMedia.url ) { - const newValue = { - ...selectedMedia, - mediaType: selectedMedia.media_type, - }; - - // Turn off featured image when manually selecting media - if ( useFeaturedImage ) { - newValue.featuredImage = false; - } - - onChange( - field.setValue( { - item: data, - value: newValue, - } ) - ); - } - } } - renderToggle={ ( buttonProps ) => ( - - ) } - /> - { url && ( -
-
- ); -} diff --git a/packages/block-editor/src/hooks/block-fields/media/styles.scss b/packages/block-editor/src/hooks/block-fields/media/styles.scss deleted file mode 100644 index 0555c698df2c81..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/media/styles.scss +++ /dev/null @@ -1,77 +0,0 @@ -@use "@wordpress/base-styles/colors" as *; -@use "@wordpress/base-styles/variables" as *; - -.block-editor-content-only-controls__media { - width: 100%; - border-color: $gray-400; - padding-right: $grid-unit-40; -} - -.block-editor-content-only-controls__media-replace-flow { - // Required, otherwise the width collapses. - display: block; -} - -.block-editor-content-only-controls__media-row { - align-items: center; -} - -.block-editor-content-only-controls__media-placeholder { - width: 24px; - height: 24px; - border-radius: $radius-small; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); - display: inline-block; - padding: 0; - background: - $white - linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%); -} - -.block-editor-content-only-controls__media-title { - width: 100%; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; -} - -.block-editor-content-only-controls__media-thumbnail { - width: 20px; - height: 20px; - border-radius: $radius-small; - align-self: center; - overflow: hidden; - - img { - width: 100% !important; - height: 100% !important; - object-fit: cover; - } -} - -.block-editor-content-only-controls { - position: relative; -} - -.block-editor-content-only-controls__media-reset { - position: absolute; - right: 0; - top: $grid-unit; - margin: auto $grid-unit auto; - opacity: 0; - border-radius: $radius-small; - @media not ( prefers-reduced-motion ) { - transition: opacity 0.1s ease-in-out; - } - - .block-editor-content-only-controls:hover &, - &:focus, - &:hover { - opacity: 1; - } - - @media (hover: none) { - // Show reset button on devices that do not support hover. - opacity: 1; - } -} diff --git a/packages/block-editor/src/hooks/block-fields/rich-text/index.jsx b/packages/block-editor/src/hooks/block-fields/rich-text/index.jsx deleted file mode 100644 index 8eb72f8cadb8e9..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/rich-text/index.jsx +++ /dev/null @@ -1,123 +0,0 @@ -import { BaseControl, useBaseControlProps } from '@wordpress/components'; -import { useMergeRefs } from '@wordpress/compose'; -import { useRegistry } from '@wordpress/data'; -import { useMemo, useRef, useState } from '@wordpress/element'; -import { privateApis as richTextPrivateApis } from '@wordpress/rich-text'; -import { getAllowedFormats } from '../../../components/rich-text/utils'; -import { useEventListeners } from '../../../components/rich-text/event-listeners'; -import FormatEdit from '../../../components/rich-text/format-edit'; -import { unlock } from '../../../lock-unlock'; - -const { useRichText, KeyboardShortcutContext, InputEventContext } = - unlock( richTextPrivateApis ); - -export default function RichTextControl( { - data, - field, - hideLabelFromVision, - onChange, - config = {}, -} ) { - const registry = useRegistry(); - const attrValue = field.getValue( { item: data } ); - const fieldConfig = field.config || {}; - const { clientId } = config; - const [ selection, setSelection ] = useState( { - start: undefined, - end: undefined, - } ); - const [ isSelected, setIsSelected ] = useState( false ); - const anchorRef = useRef(); - const inputEvents = useRef( new Set() ); - const keyboardShortcuts = useRef( new Set() ); - - const adjustedAllowedFormats = getAllowedFormats( { - allowedFormats: fieldConfig?.allowedFormats, - disableFormats: fieldConfig?.disableFormats, - } ); - - function onFocus() { - anchorRef.current?.focus(); - } - - const { - value, - getValue, - onChange: onRichTextChange, - ref: richTextRef, - formatTypes, - } = useRichText( { - value: attrValue, - onChange( html ) { - onChange( field.setValue( { item: data, value: html } ) ); - }, - selectionStart: selection.start, - selectionEnd: selection.end, - onSelectionChange: ( start, end ) => setSelection( { start, end } ), - __unstableIsSelected: isSelected, - preserveWhiteSpace: !! fieldConfig?.preserveWhiteSpace, - placeholder: fieldConfig?.placeholder, - __unstableDisableFormats: fieldConfig?.disableFormats, - allowedFormats: adjustedAllowedFormats, - withoutInteractiveFormatting: fieldConfig?.withoutInteractiveFormatting, - __unstableFormatTypeHandlerContext: useMemo( - () => ( { richTextIdentifier: field.id, blockClientId: clientId } ), - [ field.id, clientId ] - ), - } ); - - const { baseControlProps, controlProps } = useBaseControlProps( { - hideLabelFromVision: hideLabelFromVision ?? field.hideLabelFromVision, - label: field.label, - } ); - - return ( - <> - { isSelected && ( - - -
- -
-
-
- ) } - -
setIsSelected( true ) } - onBlur={ () => setIsSelected( false ) } - contentEditable - { ...controlProps } - /> - - - ); -} diff --git a/packages/block-editor/src/hooks/block-fields/rich-text/styles.scss b/packages/block-editor/src/hooks/block-fields/rich-text/styles.scss deleted file mode 100644 index d42f60af2bcd32..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/rich-text/styles.scss +++ /dev/null @@ -1,24 +0,0 @@ -@use "@wordpress/base-styles/colors" as *; -@use "@wordpress/base-styles/mixins" as *; -@use "@wordpress/base-styles/variables" as *; - -.block-editor-content-only-controls__rich-text { - width: 100%; - // Override input style margin in WP forms.css. - margin: 0; - background: $white; - color: $gray-900; - @include input-control; - border-color: $gray-600; - - &::placeholder { - color: color-mix(in srgb, $gray-900, transparent 38%); - } - - min-height: $grid-unit-50; - - // Subtract 1px to account for the border, which isn't included on the element - // on newer components like InputControl, SelectControl, etc. - // These values should be shared with the `controlPaddingX` in ./utils/config-values.js - padding: $grid-unit-15; -} diff --git a/packages/block-editor/src/hooks/block-fields/styles.scss b/packages/block-editor/src/hooks/block-fields/styles.scss deleted file mode 100644 index d135348d747a63..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/styles.scss +++ /dev/null @@ -1,33 +0,0 @@ -@use "@wordpress/base-styles/colors" as *; -@use "@wordpress/base-styles/variables" as *; -@use "./link/styles.scss" as *; -@use "./media/styles.scss" as *; -@use "./rich-text/styles.scss" as *; - -.block-editor-block-fields__container { - padding: 0 $grid-unit-20 $grid-unit-20; - - &:first-of-type { - padding-block-start: $grid-unit-10; - /* - * Add border for the entire content controls and remove the similar border - * for tools panel. - */ - border-block-start: $border-width solid $gray-200; - } -} - -.block-editor-block-fields__header { - padding: $grid-unit-10 0; - margin-bottom: $grid-unit-05; -} - -.block-editor-block-fields__header-icon { - flex: 0 0 $icon-size; -} - -.block-editor-block-fields__header-title { - flex: 1; - /* Override the default margin on a h2 element. */ - margin: 0 !important; -} diff --git a/packages/block-editor/src/hooks/block-fields/use-inspector-popover-placement.js b/packages/block-editor/src/hooks/block-fields/use-inspector-popover-placement.js deleted file mode 100644 index 2f1cc64a2845c5..00000000000000 --- a/packages/block-editor/src/hooks/block-fields/use-inspector-popover-placement.js +++ /dev/null @@ -1,16 +0,0 @@ -import { useViewportMatch } from '@wordpress/compose'; - -export function useInspectorPopoverPlacement( - { isControl } = { isControl: false } -) { - const isMobile = useViewportMatch( 'medium', '<' ); - return ! isMobile - ? { - popoverProps: { - placement: 'left-start', - // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) - offset: isControl ? 35 : 259, - }, - } - : {}; -} diff --git a/packages/block-editor/src/hooks/generate-fields-from-attributes.js b/packages/block-editor/src/hooks/generate-fields-from-attributes.js index 6f370293d27581..3cea1150f97a8d 100644 --- a/packages/block-editor/src/hooks/generate-fields-from-attributes.js +++ b/packages/block-editor/src/hooks/generate-fields-from-attributes.js @@ -10,7 +10,7 @@ * See https://github.com/WordPress/wordpress-develop/blob/8f6d31266deecd7eea258bd3d45597355cce13d0/src/wp-includes/block-supports/auto-register.php#L30 * * @param {Object} attributes - Block type attributes from block registration - * @return {{ fields: Array, form: Object }} fieldsKey and formKey values + * @return {{ fields: Array, form: Object }} DataForm fields and form definitions */ export function generateFieldsFromAttributes( attributes ) { const fields = []; diff --git a/packages/block-editor/src/hooks/index.js b/packages/block-editor/src/hooks/index.js index 814c57043d82a6..6f9c14b7679d1c 100644 --- a/packages/block-editor/src/hooks/index.js +++ b/packages/block-editor/src/hooks/index.js @@ -11,7 +11,6 @@ import './lock'; import allowedBlocks from './allowed-blocks'; import anchor from './anchor'; import ariaLabel from './aria-label'; -import blockFields from './block-fields'; import customClassName from './custom-class-name'; import './generated-class-name'; import style from './style'; @@ -53,7 +52,6 @@ createBlockEditFilter( blockBindingsPanel, childLayout, allowedBlocks, - blockFields, listView, AutoRegisterControls, ].filter( Boolean ) diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index 24bf53bb6ad495..39c8397c782f8b 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -59,7 +59,6 @@ @use "./components/url-input/style.scss" as *; @use "./components/url-popover/style.scss" as *; @use "./hooks/background.scss" as *; -@use "./hooks/block-fields/styles.scss" as *; @use "./hooks/block-hooks.scss" as *; @use "./hooks/block-bindings.scss" as *; @use "./hooks/border.scss" as *; diff --git a/packages/block-library/src/audio/index.js b/packages/block-library/src/audio/index.js index a9ff29f0cda377..2911f5a31b2349 100644 --- a/packages/block-library/src/audio/index.js +++ b/packages/block-library/src/audio/index.js @@ -1,15 +1,10 @@ -import { __ } from '@wordpress/i18n'; import { audio as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -29,36 +24,4 @@ export const settings = { save, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'audio', - label: __( 'Audio' ), - type: 'media', - Edit: { - control: 'media', // TODO: replace with custom component - allowedTypes: [ 'audio' ], - multiple: false, - }, - getValue: ( { item } ) => ( { - id: item.id, - url: item.src, - } ), - setValue: ( { value } ) => ( { - id: value.id, - src: value.url, - } ), - }, - { - id: 'caption', - label: __( 'Caption' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'audio', 'caption' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/button/index.js b/packages/block-library/src/button/index.js index acf316f507a87c..5068f9f617aa5e 100644 --- a/packages/block-library/src/button/index.js +++ b/packages/block-library/src/button/index.js @@ -1,14 +1,10 @@ import { __ } from '@wordpress/i18n'; import { button as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; import metadata from './block.json'; import save from './save'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -47,34 +43,4 @@ export const settings = { }, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'text', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - { - id: 'link', - label: __( 'Link' ), - type: 'url', - Edit: 'link', // TODO: replace with custom component - getValue: ( { item } ) => ( { - url: item.url, - rel: item.rel, - linkTarget: item.linkTarget, - } ), - setValue: ( { value } ) => ( { - url: value.url, - rel: value.rel, - linkTarget: value.linkTarget, - } ), - }, - ]; - settings[ formKey ] = { - fields: [ 'text', 'link' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/code/index.js b/packages/block-library/src/code/index.js index a00e5946876662..0258fad82a3e76 100644 --- a/packages/block-library/src/code/index.js +++ b/packages/block-library/src/code/index.js @@ -1,14 +1,10 @@ import { __ } from '@wordpress/i18n'; import { code as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -36,18 +32,4 @@ export const settings = { save, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'content', - label: __( 'Code' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'content' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/cover/index.js b/packages/block-library/src/cover/index.js index aae53f2d92b1f2..3aca168ce1ea63 100644 --- a/packages/block-library/src/cover/index.js +++ b/packages/block-library/src/cover/index.js @@ -1,6 +1,5 @@ import { __ } from '@wordpress/i18n'; import { cover as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; @@ -8,9 +7,6 @@ import metadata from './block.json'; import save from './save'; import transforms from './transforms'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -53,39 +49,4 @@ export const settings = { variations, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'background', - label: __( 'Background' ), - type: 'media', - Edit: { - control: 'media', // TODO: replace with custom component - // TODO - How to support custom gradient? - // Build it into Media, or use a custom control? - allowedTypes: [ 'image', 'video' ], - multiple: false, - useFeaturedImage: true, - }, - getValue: ( { item } ) => ( { - id: item.id, - url: item.url, - alt: item.alt, - mediaType: item.backgroundType, - featuredImage: item.useFeaturedImage, - } ), - setValue: ( { value } ) => ( { - id: value.id, - url: value.url, - alt: value.alt, - mediaType: value.backgroundType, - useFeaturedImage: value.featuredImage, - } ), - }, - ]; - settings[ formKey ] = { - fields: [ 'background' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/details/index.js b/packages/block-library/src/details/index.js index aa297213c0dc34..5ba770ac48f807 100644 --- a/packages/block-library/src/details/index.js +++ b/packages/block-library/src/details/index.js @@ -1,14 +1,10 @@ import { details as icon } from '@wordpress/icons'; import { __, sprintf } from '@wordpress/i18n'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import metadata from './block.json'; import edit from './edit'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; export { metadata, name }; @@ -72,18 +68,4 @@ export const settings = { transforms, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'summary', - label: __( 'Summary' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'summary' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/file/index.js b/packages/block-library/src/file/index.js index accc6c8288d210..24b9844dfa7840 100644 --- a/packages/block-library/src/file/index.js +++ b/packages/block-library/src/file/index.js @@ -1,6 +1,5 @@ -import { _x, __ } from '@wordpress/i18n'; +import { _x } from '@wordpress/i18n'; import { file as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; @@ -8,9 +7,6 @@ import metadata from './block.json'; import save from './save'; import transforms from './transforms'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -31,42 +27,4 @@ export const settings = { variations, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'file', - label: __( 'File' ), - type: 'media', - Edit: { - control: 'media', // TODO: replace with custom component - allowedTypes: [], - multiple: false, - }, - getValue: ( { item } ) => ( { - id: item.id, - url: item.href, - } ), - setValue: ( { value } ) => ( { - id: value.id, - href: value.url, - } ), - }, - { - id: 'fileName', - label: __( 'Filename' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - { - id: 'downloadButtonText', - label: __( 'Button Text' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'file', 'fileName', 'downloadButtonText' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/heading/index.js b/packages/block-library/src/heading/index.js index 0b7b868ec2dde2..ead32312ea5164 100644 --- a/packages/block-library/src/heading/index.js +++ b/packages/block-library/src/heading/index.js @@ -1,10 +1,6 @@ import { heading as icon } from '@wordpress/icons'; import { __, sprintf } from '@wordpress/i18n'; -import { - privateApis as blocksPrivateApis, - getBlockType, - unregisterBlockVariation, -} from '@wordpress/blocks'; +import { getBlockType, unregisterBlockVariation } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; @@ -12,9 +8,6 @@ import metadata from './block.json'; import save from './save'; import transforms from './transforms'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -78,20 +71,6 @@ export const settings = { variations, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'content', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'content' ], - }; -} - export const init = () => { const block = initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/image/image.jsx b/packages/block-library/src/image/image.jsx index 1070a3018259f8..670909f277a516 100644 --- a/packages/block-library/src/image/image.jsx +++ b/packages/block-library/src/image/image.jsx @@ -893,9 +893,6 @@ export default function Image( { ); - const hasDataFormBlockFields = - window?.__experimentalContentOnlyInspectorFields; - const controls = ( <> { showBlockControls && ( @@ -964,7 +961,7 @@ export default function Image( { /> ) } - { ! hasDataFormBlockFields && isSingleSelected && ( + { isSingleSelected && ( ( { - id: item.id, - url: item.url, - alt: item.alt, - caption: item.caption, - } ), - setValue: ( { value } ) => ( { - id: value.id, - url: value.url, - alt: value.alt, - caption: value.caption, - } ), - }, - { - id: 'link', - label: __( 'Link' ), - type: 'url', - Edit: 'link', // TODO: replace with custom component - getValue: ( { item } ) => ( { - url: item.href, - rel: item.rel, - linkTarget: item.linkTarget, - } ), - setValue: ( { value } ) => ( { - href: value.url, - rel: value.rel, - linkTarget: value.linkTarget, - } ), - isVisible: ( item ) => ! item.isDecorative, - }, - { - id: 'caption', - label: __( 'Caption' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - isVisible: ( item ) => ! item.isDecorative, - }, - { - id: 'alt', - label: __( 'Alt text' ), - type: 'text', - isVisible: ( item ) => ! item.isDecorative, - }, - { - id: 'isDecorative', - label: __( 'Mark as decorative' ), - type: 'boolean', - setValue: ( { value } ) => ( { - isDecorative: value || undefined, - ...( value && { - alt: '', - caption: undefined, - href: undefined, - linkDestination: undefined, - linkTarget: undefined, - rel: undefined, - } ), - } ), - }, - ]; - settings[ formKey ] = { - fields: [ 'image', 'link', 'caption', 'alt', 'isDecorative' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/list-item/index.js b/packages/block-library/src/list-item/index.js index 49dc4de4a877bf..1daa40847beb7b 100644 --- a/packages/block-library/src/list-item/index.js +++ b/packages/block-library/src/list-item/index.js @@ -1,7 +1,5 @@ -import { __ } from '@wordpress/i18n'; import { listItem as icon } from '@wordpress/icons'; import { privateApis } from '@wordpress/block-editor'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import metadata from './block.json'; import edit from './edit'; @@ -9,8 +7,6 @@ import save from './save'; import transforms from './transforms'; import { unlock } from '../lock-unlock'; -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); - const { name } = metadata; export { metadata, name }; @@ -45,18 +41,4 @@ export const settings = { }, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'content', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'content' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/media-text/index.js b/packages/block-library/src/media-text/index.js index 2751ca8953aab4..f3152f36b88c78 100644 --- a/packages/block-library/src/media-text/index.js +++ b/packages/block-library/src/media-text/index.js @@ -1,6 +1,5 @@ import { __ } from '@wordpress/i18n'; import { mediaAndText as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import { TEMPLATE } from './constants'; import deprecated from './deprecated'; @@ -8,9 +7,6 @@ import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -49,50 +45,4 @@ export const settings = { deprecated, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'media', - label: __( 'Media' ), - type: 'media', - Edit: { - control: 'media', // TODO: replace with custom component - allowedTypes: [ 'image', 'video' ], - multiple: false, - }, - getValue: ( { item } ) => ( { - id: item.mediaId, - url: item.mediaUrl, - mediaType: item.mediaType, - link: item.mediaLink, - } ), - setValue: ( { value } ) => ( { - mediaId: value.id, - mediaUrl: value.url, - mediaType: value.mediaType, - mediaLink: value.link, - } ), - }, - { - id: 'link', - label: __( 'Link' ), - type: 'url', - Edit: 'link', // TODO: replace with custom component - getValue: ( { item } ) => ( { - url: item.href, - rel: item.rel, - linkTarget: item.linkTarget, - } ), - setValue: ( { value } ) => ( { - href: value.url, - rel: value.rel, - linkTarget: value.linkTarget, - } ), - }, - ]; - settings[ formKey ] = { - fields: [ 'media', 'link' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/more/index.js b/packages/block-library/src/more/index.js index bff5e8690b4758..2fe4989d43b2ae 100644 --- a/packages/block-library/src/more/index.js +++ b/packages/block-library/src/more/index.js @@ -1,14 +1,9 @@ import { more as icon } from '@wordpress/icons'; -import { __ } from '@wordpress/i18n'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -36,18 +31,4 @@ export const settings = { save, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'customText', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'customText' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/navigation-link/index.js b/packages/block-library/src/navigation-link/index.js index cdfa5f74f37436..86123864454803 100644 --- a/packages/block-library/src/navigation-link/index.js +++ b/packages/block-library/src/navigation-link/index.js @@ -1,7 +1,6 @@ -import { _x, __, sprintf } from '@wordpress/i18n'; +import { _x, sprintf } from '@wordpress/i18n'; import { customLink as linkIcon } from '@wordpress/icons'; import { addFilter } from '@wordpress/hooks'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import deprecated from './deprecated'; import initBlock from '../utils/init-block'; import metadata from './block.json'; @@ -10,9 +9,6 @@ import save from './save'; import { enhanceNavigationLinkVariations } from './hooks'; import transforms from './transforms'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -62,34 +58,6 @@ export const settings = { variations, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'label', - label: __( 'Label' ), - type: 'text', - Edit: 'rich-text', - }, - { - id: 'link', - label: __( 'Link' ), - type: 'url', - Edit: 'link', - getValue: ( { item } ) => ( { - url: item.url, - rel: item.rel, - } ), - setValue: ( { value } ) => ( { - url: value.url, - rel: value.rel, - } ), - }, - ]; - settings[ formKey ] = { - fields: [ 'label', 'link' ], - }; -} - export const init = () => { addFilter( 'blocks.registerBlockType', diff --git a/packages/block-library/src/navigation-submenu/index.js b/packages/block-library/src/navigation-submenu/index.js index 8351ba209d05f4..e172edf0b3b82e 100644 --- a/packages/block-library/src/navigation-submenu/index.js +++ b/packages/block-library/src/navigation-submenu/index.js @@ -1,14 +1,10 @@ import { page, addSubmenu } from '@wordpress/icons'; -import { _x, __ } from '@wordpress/i18n'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; +import { _x } from '@wordpress/i18n'; import initBlock from '../utils/init-block'; import metadata from './block.json'; import edit from './edit'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -48,32 +44,4 @@ export const settings = { transforms, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'label', - label: __( 'Label' ), - type: 'text', - Edit: 'rich-text', //TODO: replace with custom component - }, - { - id: 'link', - label: __( 'Link' ), - type: 'url', - Edit: 'link', // TODO: replace with custom component - getValue: ( { item } ) => ( { - url: item.url, - rel: item.rel, - } ), - setValue: ( { value } ) => ( { - url: value.url, - rel: value.rel, - } ), - }, - ]; - settings[ formKey ] = { - fields: [ 'label', 'link' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/paragraph/index.js b/packages/block-library/src/paragraph/index.js index 4e5e6ec8c68351..96ea8f4bd99232 100644 --- a/packages/block-library/src/paragraph/index.js +++ b/packages/block-library/src/paragraph/index.js @@ -1,15 +1,11 @@ import { __ } from '@wordpress/i18n'; import { paragraph as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -56,18 +52,4 @@ export const settings = { save, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'content', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'content' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/preformatted/index.js b/packages/block-library/src/preformatted/index.js index 412f299f09fe64..ed0b88b6430581 100644 --- a/packages/block-library/src/preformatted/index.js +++ b/packages/block-library/src/preformatted/index.js @@ -1,14 +1,10 @@ import { __ } from '@wordpress/i18n'; import { preformatted as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -36,18 +32,4 @@ export const settings = { }, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'content', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'content' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/pullquote/index.js b/packages/block-library/src/pullquote/index.js index 21352cd38c5f08..efc26571056f15 100644 --- a/packages/block-library/src/pullquote/index.js +++ b/packages/block-library/src/pullquote/index.js @@ -1,15 +1,11 @@ import { __ } from '@wordpress/i18n'; import { pullquote as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -33,24 +29,4 @@ export const settings = { deprecated, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'value', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - { - id: 'citation', - label: __( 'Citation' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'value', 'citation' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/search/index.js b/packages/block-library/src/search/index.js index f0103276bfca62..252ea9e9ff93bb 100644 --- a/packages/block-library/src/search/index.js +++ b/packages/block-library/src/search/index.js @@ -1,13 +1,9 @@ import { __ } from '@wordpress/i18n'; import { search as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import metadata from './block.json'; import edit from './edit'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -23,30 +19,4 @@ export const settings = { edit, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'label', - label: __( 'Label' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - { - id: 'buttonText', - label: __( 'Button text' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - { - id: 'placeholder', - label: __( 'Placeholder' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'label', 'buttonText', 'placeholder' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/social-link/index.js b/packages/block-library/src/social-link/index.js index bb5fb227febbf6..15fb9115037a36 100644 --- a/packages/block-library/src/social-link/index.js +++ b/packages/block-library/src/social-link/index.js @@ -1,13 +1,8 @@ -import { __ } from '@wordpress/i18n'; import { share as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import edit from './edit'; import metadata from './block.json'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -19,31 +14,4 @@ export const settings = { variations, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'link', - label: __( 'Link' ), - type: 'url', - Edit: 'link', // TODO: replace with custom component - getValue: ( { item } ) => ( { - url: item.url, - rel: item.rel, - } ), - setValue: ( { value } ) => ( { - url: value.url, - rel: value.rel, - } ), - }, - { - id: 'label', - label: __( 'Label' ), - type: 'text', - }, - ]; - settings[ formKey ] = { - fields: [ 'link', 'label' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/verse/index.js b/packages/block-library/src/verse/index.js index ae6f7ecf358b59..1f92dfeac18241 100644 --- a/packages/block-library/src/verse/index.js +++ b/packages/block-library/src/verse/index.js @@ -1,15 +1,11 @@ import { __ } from '@wordpress/i18n'; import { verse as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; import metadata from './block.json'; import save from './save'; import transforms from './transforms'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -38,18 +34,4 @@ export const settings = { save, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'content', - label: __( 'Content' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'content' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/video/index.js b/packages/block-library/src/video/index.js index 8be890b314c514..1f3774b692921d 100644 --- a/packages/block-library/src/video/index.js +++ b/packages/block-library/src/video/index.js @@ -1,6 +1,5 @@ import { __ } from '@wordpress/i18n'; import { video as icon } from '@wordpress/icons'; -import { privateApis as blocksPrivateApis } from '@wordpress/blocks'; import initBlock from '../utils/init-block'; import deprecated from './deprecated'; import edit from './edit'; @@ -8,9 +7,6 @@ import metadata from './block.json'; import save from './save'; import transforms from './transforms'; import variations from './variations'; -import { unlock } from '../lock-unlock'; - -const { fieldsKey, formKey } = unlock( blocksPrivateApis ); const { name } = metadata; @@ -32,40 +28,4 @@ export const settings = { save, }; -if ( window.__experimentalContentOnlyInspectorFields ) { - settings[ fieldsKey ] = [ - { - id: 'video', - label: __( 'Video' ), - type: 'media', - Edit: { - control: 'media', // TODO: replace with custom component - allowedTypes: [ 'video' ], - multiple: false, - }, - getValue: ( { item } ) => ( { - id: item.id, - url: item.src, - caption: item.caption, - poster: item.poster, - } ), - setValue: ( { value } ) => ( { - id: value.id, - src: value.url, - caption: value.caption, - poster: value.poster, - } ), - }, - { - id: 'caption', - label: __( 'Caption' ), - type: 'text', - Edit: 'rich-text', // TODO: replace with custom component - }, - ]; - settings[ formKey ] = { - fields: [ 'video', 'caption' ], - }; -} - export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/blocks/src/api/index.ts b/packages/blocks/src/api/index.ts index b625665151ffec..2c8e3944b3dfb1 100644 --- a/packages/blocks/src/api/index.ts +++ b/packages/blocks/src/api/index.ts @@ -167,10 +167,6 @@ export { __EXPERIMENTAL_ELEMENTS, __EXPERIMENTAL_PATHS_WITH_OVERRIDE, } from './constants'; -// Allows blocks to declare private keys (fields form) -// that we can use to generate UI controls for them via DataForm. -const fieldsKey = Symbol( 'fields' ); -const formKey = Symbol( 'form' ); // A private block setting, opted into by core text blocks, that makes the // editor canvas the contentEditable editing host (see `useEditableRoot`). It's // a Symbol rather than a `supports` key so it stays private for now: it can't @@ -182,8 +178,6 @@ import { parseRawBlock as _parseRawBlock } from './parser'; export const privateApis = {}; lock( privateApis, { isContentBlock, - fieldsKey, - formKey, editableRootKey, parseRawBlock: _parseRawBlock, } ); diff --git a/test/e2e/specs/editor/various/block-bindings/block-fields-pattern-overrides.spec.js b/test/e2e/specs/editor/various/block-bindings/block-fields-pattern-overrides.spec.js deleted file mode 100644 index 39231e62a852b9..00000000000000 --- a/test/e2e/specs/editor/various/block-bindings/block-fields-pattern-overrides.spec.js +++ /dev/null @@ -1,77 +0,0 @@ -const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); - -// The Block Fields panel resolves bound attribute values when rendering the -// inspector. A `core/pattern-overrides` binding used to crash it with -// "TypeError: Cannot read properties of null". These tests rely on the e2e -// fixtures failing any test that logs a console error. -// See https://github.com/WordPress/gutenberg/issues/79090. -test.describe( 'Block Fields with pattern overrides bindings', () => { - test.beforeAll( async ( { requestUtils } ) => { - await requestUtils.setGutenbergExperiments( [ - 'gutenberg-content-only-inspector-fields', - ] ); - } ); - - test.beforeEach( async ( { admin } ) => { - await admin.createNewPost( { title: 'Block Fields bindings' } ); - } ); - - test.afterEach( async ( { requestUtils } ) => { - await requestUtils.deleteAllPosts(); - } ); - - test.afterAll( async ( { requestUtils } ) => { - await requestUtils.setGutenbergExperiments( [] ); - } ); - - test( 'renders the panel for a `__default` binding without crashing', async ( { - editor, - } ) => { - await editor.insertBlock( { - name: 'core/paragraph', - attributes: { - content: 'Overridable paragraph', - metadata: { - name: 'Editable Paragraph', - bindings: { - __default: { source: 'core/pattern-overrides' }, - }, - }, - }, - } ); - - const paragraph = editor.canvas.getByRole( 'document', { - name: 'Block: Paragraph', - } ); - await paragraph.click(); - await editor.openDocumentSettingsSidebar(); - - // The canvas keeps rendering the block: no crash boundary fallback. - await expect( paragraph ).toHaveText( 'Overridable paragraph' ); - } ); - - test( 'renders the panel for an expanded binding without crashing', async ( { - editor, - } ) => { - await editor.insertBlock( { - name: 'core/paragraph', - attributes: { - content: 'Expanded binding paragraph', - metadata: { - name: 'Editable Paragraph', - bindings: { - content: { source: 'core/pattern-overrides' }, - }, - }, - }, - } ); - - const paragraph = editor.canvas.getByRole( 'document', { - name: 'Block: Paragraph', - } ); - await paragraph.click(); - await editor.openDocumentSettingsSidebar(); - - await expect( paragraph ).toHaveText( 'Expanded binding paragraph' ); - } ); -} ); diff --git a/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js b/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js index e066bc6dcfc5f0..7c278ceffcefb6 100644 --- a/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js +++ b/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js @@ -373,12 +373,6 @@ test.describe( 'Post Meta source', () => { } ); test.describe( 'Movie CPT post', () => { - test.beforeAll( async ( { requestUtils } ) => { - await requestUtils.setGutenbergExperiments( [ - 'gutenberg-content-only-inspector-fields', - ] ); - } ); - test.beforeEach( async ( { admin } ) => { // CHECK HOW TO CREATE A MOVIE. await admin.createNewPost( { @@ -387,11 +381,6 @@ test.describe( 'Post Meta source', () => { } ); } ); - test.afterAll( async ( { requestUtils } ) => { - // Ensure experiments are disabled after test. - await requestUtils.setGutenbergExperiments( [] ); - } ); - test( 'should show the custom field value of that specific post', async ( { editor, } ) => { diff --git a/test/e2e/timings.json b/test/e2e/timings.json index 46e9a3b772918f..6c5ff0e38fed6a 100644 --- a/test/e2e/timings.json +++ b/test/e2e/timings.json @@ -8283,34 +8283,6 @@ } ] }, - { - "title": "editor/various/block-bindings/block-fields-pattern-overrides.spec.js", - "type": "file", - "suites": [ - { - "title": "Block Fields with pattern overrides bindings", - "type": "suite", - "tests": [ - { - "title": "renders the panel for a `__default` binding without crashing", - "attempts": [ - { - "duration": 6323 - } - ] - }, - { - "title": "renders the panel for an expanded binding without crashing", - "attempts": [ - { - "duration": 3364 - } - ] - } - ] - } - ] - }, { "title": "editor/various/block-bindings/custom-sources.spec.js", "type": "file", From e7704b53da6999ad212843201e9879e3bdb0567d Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 9 Sep 2026 09:44:31 +0100 Subject: [PATCH 2/3] Prune stale suppressions and fix the Movie CPT bindings tests - Drop the ESLint suppressions for the deleted block-fields files; CI's local-changes check flagged them as stale. - Remove the Movie CPT e2e test that targeted the removed Block Fields panel, and open the settings sidebar in the suite's beforeEach like the sibling suites do, so the attributes panel tests can find the Settings tab. Co-Authored-By: Claude Fable 5.1 --- .../various/block-bindings/post-meta.spec.js | 43 +------------------ test/e2e/timings.json | 8 ---- tools/eslint/suppressions.json | 37 ---------------- 3 files changed, 2 insertions(+), 86 deletions(-) diff --git a/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js b/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js index 7c278ceffcefb6..96b5d37983e124 100644 --- a/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js +++ b/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js @@ -373,12 +373,13 @@ test.describe( 'Post Meta source', () => { } ); test.describe( 'Movie CPT post', () => { - test.beforeEach( async ( { admin } ) => { + test.beforeEach( async ( { admin, editor } ) => { // CHECK HOW TO CREATE A MOVIE. await admin.createNewPost( { postType: 'movie', title: 'Test bindings', } ); + await editor.openDocumentSettingsSidebar(); } ); test( 'should show the custom field value of that specific post', async ( { @@ -546,46 +547,6 @@ test.describe( 'Post Meta source', () => { ).toHaveText( 'new value' ); } ); - test( 'should be possible to edit the value of the connected custom fields in the inspector control registered by Block Fields experiment', async ( { - editor, - page, - } ) => { - await editor.insertBlock( { - name: 'core/paragraph', - attributes: { - anchor: 'connected-paragraph', - content: 'fallback content', - metadata: { - bindings: { - content: { - source: 'core/post-meta', - args: { - key: 'movie_field', - }, - }, - }, - }, - }, - } ); - const contentInput = page.getByRole( 'textbox', { - label: 'Content', - } ); - await expect( contentInput ).toHaveText( - 'Movie field default value' - ); - await contentInput.fill( 'new value' ); - // Check that the paragraph content attribute didn't change. - const [ paragraphBlockObject ] = await editor.getBlocks(); - expect( paragraphBlockObject.attributes.content ).toBe( - 'fallback content' - ); - // Check the value of the custom field is being updated by visiting the frontend. - const previewPage = await editor.openPreviewPage(); - await expect( - previewPage.locator( '#connected-paragraph' ) - ).toHaveText( 'new value' ); - } ); - test( 'should be possible to connect movie fields through the attributes panel', async ( { editor, page, diff --git a/test/e2e/timings.json b/test/e2e/timings.json index 6c5ff0e38fed6a..00751cb40d2184 100644 --- a/test/e2e/timings.json +++ b/test/e2e/timings.json @@ -8887,14 +8887,6 @@ } ] }, - { - "title": "should be possible to edit the value of the connected custom fields in the inspector control registered by Block Fields experiment", - "attempts": [ - { - "duration": 3627 - } - ] - }, { "title": "should be possible to connect movie fields through the attributes panel", "attempts": [ diff --git a/tools/eslint/suppressions.json b/tools/eslint/suppressions.json index 0192c0400611b2..19087ea781a5d2 100644 --- a/tools/eslint/suppressions.json +++ b/tools/eslint/suppressions.json @@ -2193,43 +2193,6 @@ "count": 1 } }, - "packages/block-editor/src/hooks/block-fields/fields-dropdown-menu.jsx": { - "react/jsx-filename-extension": { - "count": 1 - } - }, - "packages/block-editor/src/hooks/block-fields/index.jsx": { - "@wordpress/use-recommended-components": { - "count": 1 - }, - "react/jsx-filename-extension": { - "count": 1 - } - }, - "packages/block-editor/src/hooks/block-fields/link/index.jsx": { - "@wordpress/use-recommended-components": { - "count": 1 - }, - "react/jsx-filename-extension": { - "count": 1 - } - }, - "packages/block-editor/src/hooks/block-fields/media/index.jsx": { - "@wordpress/use-recommended-components": { - "count": 1 - }, - "react/jsx-filename-extension": { - "count": 1 - } - }, - "packages/block-editor/src/hooks/block-fields/rich-text/index.jsx": { - "@wordpress/use-recommended-components": { - "count": 1 - }, - "react/jsx-filename-extension": { - "count": 1 - } - }, "packages/block-editor/src/hooks/block-hooks.jsx": { "react/jsx-filename-extension": { "count": 1 From 2beb3d76e38e2ef4422894daaf82b89bb0f0d3e5 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 9 Sep 2026 11:09:32 +0100 Subject: [PATCH 3/3] E2E: Reach the bindings attributes panel without a Settings tab The two Movie CPT attributes panel tests predate the block fields experiment; that experiment's PR added a Settings tab click because the extra Content fill it registered turned the inspector into tabs. With the experiment gone a bare paragraph renders a single panel again, so drop the clicks and go straight to the Attributes options button, as the custom-sources spec does. Co-Authored-By: Claude Fable 5.1 --- test/e2e/specs/editor/various/block-bindings/post-meta.spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js b/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js index 96b5d37983e124..534132d7d6e29b 100644 --- a/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js +++ b/test/e2e/specs/editor/various/block-bindings/post-meta.spec.js @@ -554,7 +554,6 @@ test.describe( 'Post Meta source', () => { await editor.insertBlock( { name: 'core/paragraph', } ); - await page.getByRole( 'tab', { name: 'Settings' } ).click(); await page.getByLabel( 'Attributes options' ).click(); await page .getByRole( 'menuitemcheckbox', { @@ -584,7 +583,6 @@ test.describe( 'Post Meta source', () => { await editor.insertBlock( { name: 'core/paragraph', } ); - await page.getByRole( 'tab', { name: 'Settings' } ).click(); await page.getByLabel( 'Attributes options' ).click(); await page .getByRole( 'menuitemcheckbox', {