Skip to content

Commit

Permalink
remove zoom out experiment, control and enable closing inspector on p…
Browse files Browse the repository at this point in the history
…attern category open
  • Loading branch information
draganescu committed May 9, 2024
1 parent e492737 commit 77c816a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 54 deletions.
3 changes: 0 additions & 3 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-sync-collaboration', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableSync = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-zoomed-out-view', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableZoomedOutView = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-custom-dataviews', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalCustomViews = true', 'before' );
}
Expand Down
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-zoomed-out-view',
__( 'Zoomed out view ', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test a new zoomed out view on the site editor (Warning: The new feature is not ready. You may experience UX issues that are being addressed)', 'gutenberg' ),
'id' => 'gutenberg-zoomed-out-view',
)
);

add_settings_field(
'gutenberg-custom-dataviews',
__( 'Custom dataviews', 'gutenberg' ),
Expand Down
12 changes: 2 additions & 10 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,13 @@ function InserterMenu(
[ onToggleInsertionPoint ]
);

const isZoomedOutViewExperimentEnabled =
window?.__experimentalEnableZoomedOutView;
const onClickPatternCategory = useCallback(
( patternCategory, filter ) => {
setSelectedPatternCategory( patternCategory );
setPatternFilter( filter );
if ( isZoomedOutViewExperimentEnabled ) {
__experimentalOnPatternCategorySelection();
}
__experimentalOnPatternCategorySelection();
},
[
setSelectedPatternCategory,
__experimentalOnPatternCategorySelection,
isZoomedOutViewExperimentEnabled,
]
[ setSelectedPatternCategory, __experimentalOnPatternCategorySelection ]
);

const showPatternPanel =
Expand Down
31 changes: 2 additions & 29 deletions packages/editor/src/components/document-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
store as blockEditorStore,
} from '@wordpress/block-editor';
import { Button, ToolbarItem } from '@wordpress/components';
import { listView, plus, chevronUpDown } from '@wordpress/icons';
import { listView, plus } from '@wordpress/icons';
import { useRef, useCallback } from '@wordpress/element';
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
import { store as preferencesStore } from '@wordpress/preferences';
Expand All @@ -39,9 +39,8 @@ function DocumentTools( {
listViewLabel = __( 'Document Overview' ),
} ) {
const inserterButton = useRef();
const { setIsInserterOpened, setIsListViewOpened, setDeviceType } =
const { setIsInserterOpened, setIsListViewOpened } =
useDispatch( editorStore );
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
const {
isDistractionFree,
isInserterOpened,
Expand All @@ -50,8 +49,6 @@ function DocumentTools( {
listViewToggleRef,
hasFixedToolbar,
showIconLabels,
isVisualMode,
isZoomedOutView,
} = useSelect( ( select ) => {
const { getSettings } = select( blockEditorStore );
const { get } = select( preferencesStore );
Expand All @@ -77,8 +74,6 @@ function DocumentTools( {

const isLargeViewport = useViewportMatch( 'medium' );
const isWideViewport = useViewportMatch( 'wide' );
const isZoomedOutViewExperimentEnabled =
window?.__experimentalEnableZoomedOutView && isVisualMode;

/* translators: accessibility text for the editor toolbar */
const toolbarAriaLabel = __( 'Document tools' );
Expand Down Expand Up @@ -185,28 +180,6 @@ function DocumentTools( {
) }
</>
) }

{ isZoomedOutViewExperimentEnabled &&
isLargeViewport &&
! isDistractionFree &&
! hasFixedToolbar && (
<ToolbarItem
as={ Button }
className="edit-site-header-edit-mode__zoom-out-view-toggle"
icon={ chevronUpDown }
isPressed={ isZoomedOutView }
/* translators: button label text should, if possible, be under 16 characters. */
label={ __( 'Zoom-out View' ) }
onClick={ () => {
setDeviceType( 'Desktop' );
__unstableSetEditorMode(
isZoomedOutView ? 'edit' : 'zoom-out'
);
} }
size="compact"
disabled={ disableBlockTools }
/>
) }
</div>
</NavigableToolbar>
);
Expand Down

0 comments on commit 77c816a

Please sign in to comment.