@wordpress/edit-site 5.12.10 → 5.12.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/build/components/global-styles/screen-revisions/index.js +8 -2
  2. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  3. package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
  4. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  5. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +31 -25
  6. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  7. package/build/components/keyboard-shortcuts/edit-mode.js +7 -5
  8. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  9. package/build/components/layout/index.js +14 -3
  10. package/build/components/layout/index.js.map +1 -1
  11. package/build/components/page-patterns/patterns-list.js +2 -1
  12. package/build/components/page-patterns/patterns-list.js.map +1 -1
  13. package/build/components/page-patterns/use-patterns.js +1 -1
  14. package/build/components/page-patterns/use-patterns.js.map +1 -1
  15. package/build/components/page-template-parts/index.js +1 -2
  16. package/build/components/page-template-parts/index.js.map +1 -1
  17. package/build/components/resizable-frame/index.js +14 -23
  18. package/build/components/resizable-frame/index.js.map +1 -1
  19. package/build/components/sidebar-edit-mode/page-panels/page-status.js +2 -7
  20. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  21. package/build/components/sidebar-navigation-screen/index.js +15 -13
  22. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  23. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +8 -0
  24. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  25. package/build/components/sidebar-navigation-screen-pages/index.js +2 -0
  26. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  27. package/build/components/sidebar-navigation-screen-patterns/index.js +0 -9
  28. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  29. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  30. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  31. package/build/components/sidebar-navigation-screen-templates/index.js +1 -10
  32. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  33. package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -0
  34. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  35. package/build/components/site-hub/index.js +16 -7
  36. package/build/components/site-hub/index.js.map +1 -1
  37. package/build/hooks/commands/use-common-commands.js +78 -20
  38. package/build/hooks/commands/use-common-commands.js.map +1 -1
  39. package/build/hooks/commands/use-edit-mode-commands.js +30 -0
  40. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  41. package/build/store/private-actions.js +2 -1
  42. package/build/store/private-actions.js.map +1 -1
  43. package/build-module/components/global-styles/screen-revisions/index.js +9 -3
  44. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  45. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
  46. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  47. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +27 -21
  48. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  49. package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -5
  50. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  51. package/build-module/components/layout/index.js +14 -3
  52. package/build-module/components/layout/index.js.map +1 -1
  53. package/build-module/components/page-patterns/patterns-list.js +3 -2
  54. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  55. package/build-module/components/page-patterns/use-patterns.js +1 -1
  56. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  57. package/build-module/components/page-template-parts/index.js +1 -2
  58. package/build-module/components/page-template-parts/index.js.map +1 -1
  59. package/build-module/components/resizable-frame/index.js +15 -24
  60. package/build-module/components/resizable-frame/index.js.map +1 -1
  61. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +2 -7
  62. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  63. package/build-module/components/sidebar-navigation-screen/index.js +13 -13
  64. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  65. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +7 -0
  66. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  67. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -0
  68. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  69. package/build-module/components/sidebar-navigation-screen-patterns/index.js +0 -7
  70. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  71. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  72. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  73. package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -8
  74. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  75. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -0
  76. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  77. package/build-module/components/site-hub/index.js +16 -7
  78. package/build-module/components/site-hub/index.js.map +1 -1
  79. package/build-module/hooks/commands/use-common-commands.js +74 -20
  80. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  81. package/build-module/hooks/commands/use-edit-mode-commands.js +29 -0
  82. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  83. package/build-module/store/private-actions.js +2 -1
  84. package/build-module/store/private-actions.js.map +1 -1
  85. package/build-style/style-rtl.css +12 -11
  86. package/build-style/style.css +12 -11
  87. package/package.json +20 -20
  88. package/src/components/global-styles/screen-revisions/index.js +76 -58
  89. package/src/components/global-styles/screen-revisions/revisions-buttons.js +17 -31
  90. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +14 -1
  91. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +63 -48
  92. package/src/components/keyboard-shortcuts/edit-mode.js +4 -5
  93. package/src/components/layout/index.js +22 -2
  94. package/src/components/layout/style.scss +1 -1
  95. package/src/components/page-patterns/patterns-list.js +5 -2
  96. package/src/components/page-patterns/style.scss +3 -0
  97. package/src/components/page-patterns/use-patterns.js +1 -0
  98. package/src/components/page-template-parts/index.js +0 -1
  99. package/src/components/resizable-frame/index.js +12 -28
  100. package/src/components/resizable-frame/style.scss +0 -17
  101. package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -4
  102. package/src/components/sidebar-navigation-screen/index.js +13 -15
  103. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +27 -15
  104. package/src/components/sidebar-navigation-screen-pages/index.js +9 -4
  105. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -8
  106. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  107. package/src/components/sidebar-navigation-screen-templates/index.js +1 -9
  108. package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -0
  109. package/src/components/site-hub/index.js +21 -7
  110. package/src/components/site-hub/style.scss +9 -2
  111. package/src/hooks/commands/use-common-commands.js +56 -23
  112. package/src/hooks/commands/use-edit-mode-commands.js +34 -3
  113. package/src/store/private-actions.js +5 -1
@@ -21,34 +21,40 @@ const EMPTY_ARRAY = [];
21
21
  const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
22
22
  export default function useGlobalStylesRevisions() {
23
23
  const { user: userConfig } = useContext( GlobalStylesContext );
24
- const { authors, currentUser, isDirty, revisions } = useSelect(
25
- ( select ) => {
26
- const {
27
- __experimentalGetDirtyEntityRecords,
28
- getCurrentUser,
29
- getUsers,
30
- getCurrentThemeGlobalStylesRevisions,
31
- } = select( coreStore );
32
- const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
33
- const _currentUser = getCurrentUser();
34
- const _isDirty = dirtyEntityRecords.length > 0;
35
- const globalStylesRevisions =
36
- getCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;
37
- const _authors =
38
- getUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;
24
+ const {
25
+ authors,
26
+ currentUser,
27
+ isDirty,
28
+ revisions,
29
+ isLoadingGlobalStylesRevisions,
30
+ } = useSelect( ( select ) => {
31
+ const {
32
+ __experimentalGetDirtyEntityRecords,
33
+ getCurrentUser,
34
+ getUsers,
35
+ getCurrentThemeGlobalStylesRevisions,
36
+ isResolving,
37
+ } = select( coreStore );
38
+ const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
39
+ const _currentUser = getCurrentUser();
40
+ const _isDirty = dirtyEntityRecords.length > 0;
41
+ const globalStylesRevisions =
42
+ getCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;
43
+ const _authors = getUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;
39
44
 
40
- return {
41
- authors: _authors,
42
- currentUser: _currentUser,
43
- isDirty: _isDirty,
44
- revisions: globalStylesRevisions,
45
- };
46
- },
47
- []
48
- );
45
+ return {
46
+ authors: _authors,
47
+ currentUser: _currentUser,
48
+ isDirty: _isDirty,
49
+ revisions: globalStylesRevisions,
50
+ isLoadingGlobalStylesRevisions: isResolving(
51
+ 'getCurrentThemeGlobalStylesRevisions'
52
+ ),
53
+ };
54
+ }, [] );
49
55
  return useMemo( () => {
50
56
  let _modifiedRevisions = [];
51
- if ( ! authors.length || ! revisions.length ) {
57
+ if ( ! authors.length || isLoadingGlobalStylesRevisions ) {
52
58
  return {
53
59
  revisions: _modifiedRevisions,
54
60
  hasUnsavedChanges: isDirty,
@@ -66,30 +72,32 @@ export default function useGlobalStylesRevisions() {
66
72
  };
67
73
  } );
68
74
 
69
- // Flags the most current saved revision.
70
- if ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {
71
- _modifiedRevisions[ 0 ].isLatest = true;
72
- }
75
+ if ( _modifiedRevisions.length ) {
76
+ // Flags the most current saved revision.
77
+ if ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {
78
+ _modifiedRevisions[ 0 ].isLatest = true;
79
+ }
73
80
 
74
- // Adds an item for unsaved changes.
75
- if (
76
- isDirty &&
77
- userConfig &&
78
- Object.keys( userConfig ).length > 0 &&
79
- currentUser
80
- ) {
81
- const unsavedRevision = {
82
- id: 'unsaved',
83
- styles: userConfig?.styles,
84
- settings: userConfig?.settings,
85
- author: {
86
- name: currentUser?.name,
87
- avatar_urls: currentUser?.avatar_urls,
88
- },
89
- modified: new Date(),
90
- };
81
+ // Adds an item for unsaved changes.
82
+ if (
83
+ isDirty &&
84
+ userConfig &&
85
+ Object.keys( userConfig ).length > 0 &&
86
+ currentUser
87
+ ) {
88
+ const unsavedRevision = {
89
+ id: 'unsaved',
90
+ styles: userConfig?.styles,
91
+ settings: userConfig?.settings,
92
+ author: {
93
+ name: currentUser?.name,
94
+ avatar_urls: currentUser?.avatar_urls,
95
+ },
96
+ modified: new Date(),
97
+ };
91
98
 
92
- _modifiedRevisions.unshift( unsavedRevision );
99
+ _modifiedRevisions.unshift( unsavedRevision );
100
+ }
93
101
  }
94
102
 
95
103
  return {
@@ -97,5 +105,12 @@ export default function useGlobalStylesRevisions() {
97
105
  hasUnsavedChanges: isDirty,
98
106
  isLoading: false,
99
107
  };
100
- }, [ isDirty, revisions, currentUser, authors, userConfig ] );
108
+ }, [
109
+ isDirty,
110
+ revisions,
111
+ currentUser,
112
+ authors,
113
+ userConfig,
114
+ isLoadingGlobalStylesRevisions,
115
+ ] );
101
116
  }
@@ -33,10 +33,8 @@ function KeyboardShortcutsEditMode() {
33
33
  );
34
34
  const { redo, undo } = useDispatch( coreStore );
35
35
  const {
36
- isFeatureActive,
37
36
  setIsListViewOpened,
38
37
  switchEditorMode,
39
- toggleFeature,
40
38
  setIsInserterOpened,
41
39
  closeGeneralSidebar,
42
40
  } = useDispatch( editSiteStore );
@@ -47,7 +45,8 @@ function KeyboardShortcutsEditMode() {
47
45
  const { getBlockName, getSelectedBlockClientId, getBlockAttributes } =
48
46
  useSelect( blockEditorStore );
49
47
 
50
- const { set: setPreference } = useDispatch( preferencesStore );
48
+ const { get: getPreference } = useSelect( preferencesStore );
49
+ const { set: setPreference, toggle } = useDispatch( preferencesStore );
51
50
  const { createInfoNotice } = useDispatch( noticesStore );
52
51
 
53
52
  const toggleDistractionFree = () => {
@@ -135,9 +134,9 @@ function KeyboardShortcutsEditMode() {
135
134
 
136
135
  useShortcut( 'core/edit-site/toggle-distraction-free', () => {
137
136
  toggleDistractionFree();
138
- toggleFeature( 'distractionFree' );
137
+ toggle( 'core/edit-site', 'distractionFree' );
139
138
  createInfoNotice(
140
- isFeatureActive( 'distractionFree' )
139
+ getPreference( 'core/edit-site', 'distractionFree' )
141
140
  ? __( 'Distraction free mode turned on.' )
142
141
  : __( 'Distraction free mode turned off.' ),
143
142
  {
@@ -121,6 +121,8 @@ export default function Layout() {
121
121
  const [ fullResizer ] = useResizeObserver();
122
122
  const [ isResizing ] = useState( false );
123
123
  const isEditorLoading = useIsSiteEditorLoading();
124
+ const [ isResizableFrameOversized, setIsResizableFrameOversized ] =
125
+ useState( false );
124
126
 
125
127
  // This determines which animation variant should apply to the header.
126
128
  // There is also a `isDistractionFreeHovering` state that gets priority
@@ -218,6 +220,7 @@ export default function Layout() {
218
220
  edit: { x: 0 },
219
221
  } }
220
222
  ref={ hubRef }
223
+ isTransparent={ isResizableFrameOversized }
221
224
  className="edit-site-layout__hub"
222
225
  />
223
226
 
@@ -315,7 +318,13 @@ export default function Layout() {
315
318
  }
316
319
  initial={ false }
317
320
  layout="position"
318
- className="edit-site-layout__canvas"
321
+ className={ classnames(
322
+ 'edit-site-layout__canvas',
323
+ {
324
+ 'is-right-aligned':
325
+ isResizableFrameOversized,
326
+ }
327
+ ) }
319
328
  transition={ {
320
329
  type: 'tween',
321
330
  duration:
@@ -331,7 +340,18 @@ export default function Layout() {
331
340
  ! isEditorLoading
332
341
  }
333
342
  isFullWidth={ isEditing }
334
- oversizedClassName="edit-site-layout__resizable-frame-oversized"
343
+ defaultSize={ {
344
+ width:
345
+ canvasSize.width -
346
+ 24 /* $canvas-padding */,
347
+ height: canvasSize.height,
348
+ } }
349
+ isOversized={
350
+ isResizableFrameOversized
351
+ }
352
+ setIsOversized={
353
+ setIsResizableFrameOversized
354
+ }
335
355
  innerContentStyle={ {
336
356
  background:
337
357
  gradientValue ??
@@ -121,7 +121,7 @@
121
121
  justify-content: center;
122
122
  align-items: center;
123
123
 
124
- &:has(.edit-site-layout__resizable-frame-oversized) {
124
+ &.is-right-aligned {
125
125
  justify-content: flex-end;
126
126
  }
127
127
 
@@ -27,7 +27,7 @@ import usePatterns from './use-patterns';
27
27
  import SidebarButton from '../sidebar-button';
28
28
  import useDebouncedInput from '../../utils/use-debounced-input';
29
29
  import { unlock } from '../../lock-unlock';
30
- import { SYNC_TYPES, USER_PATTERN_CATEGORY } from './utils';
30
+ import { SYNC_TYPES, USER_PATTERN_CATEGORY, PATTERNS } from './utils';
31
31
 
32
32
  const { useLocation, useHistory } = unlock( routerPrivateApis );
33
33
 
@@ -58,9 +58,12 @@ export default function PatternsList( { categoryId, type } ) {
58
58
  const [ syncFilter, setSyncFilter ] = useState( 'all' );
59
59
  const deferredSyncedFilter = useDeferredValue( syncFilter );
60
60
 
61
+ const isUncategorizedThemePatterns =
62
+ type === PATTERNS && categoryId === 'uncategorized';
63
+
61
64
  const { patterns, isResolving } = usePatterns(
62
65
  type,
63
- categoryId !== 'uncategorized' ? categoryId : '',
66
+ isUncategorizedThemePatterns ? '' : categoryId,
64
67
  {
65
68
  search: deferredFilterValue,
66
69
  syncStatus:
@@ -57,6 +57,9 @@
57
57
  width: 300px;
58
58
  }
59
59
  }
60
+ .edit-site-patterns__sync-status-filter-option:not([aria-checked="true"]) {
61
+ color: $gray-600;
62
+ }
60
63
  .edit-site-patterns__sync-status-filter-option:active {
61
64
  background: $gray-700;
62
65
  color: $gray-100;
@@ -86,6 +86,7 @@ const selectThemePatterns = ( select, { categoryId, search = '' } = {} ) => {
86
86
  ( pattern ) => ! CORE_PATTERN_SOURCES.includes( pattern.source )
87
87
  )
88
88
  .filter( filterOutDuplicatesByName )
89
+ .filter( ( pattern ) => pattern.inserter !== false )
89
90
  .map( ( pattern ) => ( {
90
91
  ...pattern,
91
92
  keywords: pattern.keywords || [],
@@ -39,7 +39,6 @@ export default function PageTemplateParts() {
39
39
  params={ {
40
40
  postId: templatePart.id,
41
41
  postType: templatePart.type,
42
- canvas: 'view',
43
42
  } }
44
43
  state={ { backPath: '/wp_template_part/all' } }
45
44
  >
@@ -6,7 +6,7 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useState, useRef, useEffect } from '@wordpress/element';
9
+ import { useState, useRef } from '@wordpress/element';
10
10
  import {
11
11
  ResizableBox,
12
12
  Tooltip,
@@ -78,9 +78,12 @@ function calculateNewHeight( width, initialAspectRatio ) {
78
78
 
79
79
  function ResizableFrame( {
80
80
  isFullWidth,
81
+ isOversized,
82
+ setIsOversized,
81
83
  isReady,
82
84
  children,
83
- oversizedClassName,
85
+ /** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */
86
+ defaultSize,
84
87
  innerContentStyle,
85
88
  } ) {
86
89
  const [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );
@@ -88,29 +91,19 @@ function ResizableFrame( {
88
91
  const [ startingWidth, setStartingWidth ] = useState();
89
92
  const [ isResizing, setIsResizing ] = useState( false );
90
93
  const [ shouldShowHandle, setShouldShowHandle ] = useState( false );
91
- const [ isOversized, setIsOversized ] = useState( false );
92
94
  const [ resizeRatio, setResizeRatio ] = useState( 1 );
93
95
  const canvasMode = useSelect(
94
96
  ( select ) => unlock( select( editSiteStore ) ).getCanvasMode(),
95
97
  []
96
98
  );
97
99
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
98
- const initialAspectRatioRef = useRef( null );
99
- // The width of the resizable frame on initial render.
100
- const initialComputedWidthRef = useRef( null );
101
100
  const FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };
102
101
  const frameRef = useRef( null );
103
102
  const resizableHandleHelpId = useInstanceId(
104
103
  ResizableFrame,
105
104
  'edit-site-resizable-frame-handle-help'
106
105
  );
107
-
108
- // Remember frame dimensions on initial render.
109
- useEffect( () => {
110
- const { offsetWidth, offsetHeight } = frameRef.current.resizable;
111
- initialComputedWidthRef.current = offsetWidth;
112
- initialAspectRatioRef.current = offsetWidth / offsetHeight;
113
- }, [] );
106
+ const defaultAspectRatio = defaultSize.width / defaultSize.height;
114
107
 
115
108
  const handleResizeStart = ( _event, _direction, ref ) => {
116
109
  // Remember the starting width so we don't have to get `ref.offsetWidth` on
@@ -126,7 +119,7 @@ function ResizableFrame( {
126
119
  const maxDoubledDelta =
127
120
  delta.width < 0 // is shrinking
128
121
  ? deltaAbs
129
- : ( initialComputedWidthRef.current - startingWidth ) / 2;
122
+ : ( defaultSize.width - startingWidth ) / 2;
130
123
  const deltaToDouble = Math.min( deltaAbs, maxDoubledDelta );
131
124
  const doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;
132
125
  const singleSegment = 1 - doubleSegment;
@@ -135,17 +128,14 @@ function ResizableFrame( {
135
128
 
136
129
  const updatedWidth = startingWidth + delta.width;
137
130
 
138
- setIsOversized( updatedWidth > initialComputedWidthRef.current );
131
+ setIsOversized( updatedWidth > defaultSize.width );
139
132
 
140
133
  // Width will be controlled by the library (via `resizeRatio`),
141
134
  // so we only need to update the height.
142
135
  setFrameSize( {
143
136
  height: isOversized
144
137
  ? '100%'
145
- : calculateNewHeight(
146
- updatedWidth,
147
- initialAspectRatioRef.current
148
- ),
138
+ : calculateNewHeight( updatedWidth, defaultAspectRatio ),
149
139
  } );
150
140
  };
151
141
 
@@ -186,15 +176,12 @@ function ResizableFrame( {
186
176
  FRAME_MIN_WIDTH,
187
177
  frameRef.current.resizable.offsetWidth + delta
188
178
  ),
189
- initialComputedWidthRef.current
179
+ defaultSize.width
190
180
  );
191
181
 
192
182
  setFrameSize( {
193
183
  width: newWidth,
194
- height: calculateNewHeight(
195
- newWidth,
196
- initialAspectRatioRef.current
197
- ),
184
+ height: calculateNewHeight( newWidth, defaultAspectRatio ),
198
185
  } );
199
186
  };
200
187
 
@@ -291,9 +278,7 @@ function ResizableFrame( {
291
278
  undefined
292
279
  }
293
280
  aria-valuemin={ FRAME_MIN_WIDTH }
294
- aria-valuemax={
295
- initialComputedWidthRef.current
296
- }
281
+ aria-valuemax={ defaultSize.width }
297
282
  onKeyDown={ handleResizableHandleKeyDown }
298
283
  initial="hidden"
299
284
  exit="hidden"
@@ -314,7 +299,6 @@ function ResizableFrame( {
314
299
  onResizeStop={ handleResizeStop }
315
300
  className={ classnames( 'edit-site-resizable-frame__inner', {
316
301
  'is-resizing': isResizing,
317
- [ oversizedClassName ]: isOversized,
318
302
  } ) }
319
303
  >
320
304
  <motion.div
@@ -1,23 +1,6 @@
1
1
  .edit-site-resizable-frame__inner {
2
2
  position: relative;
3
3
 
4
- &.edit-site-layout__resizable-frame-oversized {
5
- @at-root {
6
- body:has(&) {
7
- .edit-site-site-hub {
8
- .edit-site-site-hub__site-title,
9
- .edit-site-site-hub_toggle-command-center {
10
- opacity: 0 !important;
11
- }
12
-
13
- .edit-site-site-hub__view-mode-toggle-container {
14
- background-color: transparent;
15
- }
16
- }
17
- }
18
- }
19
- }
20
-
21
4
  &.is-resizing {
22
5
  @at-root {
23
6
  body:has(&) {
@@ -212,11 +212,8 @@ export default function PageStatus( {
212
212
  } )
213
213
  }
214
214
  value={ password }
215
- /* eslint-disable jsx-a11y/no-autofocus */
216
- autoFocus={ ! password }
217
- /* eslint-enable jsx-a11y/no-autofocus */
218
215
  placeholder={ __(
219
- 'Enter a secure password'
216
+ 'Use a secure password'
220
217
  ) }
221
218
  type="text"
222
219
  />
@@ -11,6 +11,7 @@ import { isRTL, __, sprintf } from '@wordpress/i18n';
11
11
  import { chevronRight, chevronLeft } from '@wordpress/icons';
12
12
  import { store as coreStore } from '@wordpress/core-data';
13
13
  import { useSelect } from '@wordpress/data';
14
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
14
15
 
15
16
  /**
16
17
  * Internal dependencies
@@ -23,6 +24,8 @@ import {
23
24
  currentlyPreviewingTheme,
24
25
  } from '../../utils/is-previewing-theme';
25
26
 
27
+ const { useLocation } = unlock( routerPrivateApis );
28
+
26
29
  export default function SidebarNavigationScreen( {
27
30
  isRoot,
28
31
  title,
@@ -31,7 +34,7 @@ export default function SidebarNavigationScreen( {
31
34
  content,
32
35
  footer,
33
36
  description,
34
- backPath,
37
+ backPath: backPathProp,
35
38
  } ) {
36
39
  const { dashboardLink } = useSelect( ( select ) => {
37
40
  const { getSettings } = unlock( select( editSiteStore ) );
@@ -40,6 +43,7 @@ export default function SidebarNavigationScreen( {
40
43
  };
41
44
  }, [] );
42
45
  const { getTheme } = useSelect( coreStore );
46
+ const location = useLocation();
43
47
  const navigator = useNavigator();
44
48
  const theme = getTheme( currentlyPreviewingTheme() );
45
49
  const icon = isRTL() ? chevronRight : chevronLeft;
@@ -56,13 +60,17 @@ export default function SidebarNavigationScreen( {
56
60
  alignment="flex-start"
57
61
  className="edit-site-sidebar-navigation-screen__title-icon"
58
62
  >
59
- { ! isRoot && ! backPath && (
63
+ { ! isRoot && (
60
64
  <SidebarButton
61
65
  onClick={ () => {
62
- if ( navigator.location.isInitial ) {
63
- navigator.goToParent( { replace: true } );
66
+ const backPath =
67
+ backPathProp ?? location.state?.backPath;
68
+ if ( backPath ) {
69
+ navigator.goTo( backPath, {
70
+ isBack: true,
71
+ } );
64
72
  } else {
65
- navigator.goBack();
73
+ navigator.goToParent();
66
74
  }
67
75
  } }
68
76
  icon={ icon }
@@ -70,16 +78,6 @@ export default function SidebarNavigationScreen( {
70
78
  showTooltip={ false }
71
79
  />
72
80
  ) }
73
- { ! isRoot && backPath && (
74
- <SidebarButton
75
- onClick={ () =>
76
- navigator.goTo( backPath, { isBack: true } )
77
- }
78
- icon={ icon }
79
- label={ __( 'Back' ) }
80
- showTooltip={ false }
81
- />
82
- ) }
83
81
  { isRoot && (
84
82
  <SidebarButton
85
83
  icon={ icon }
@@ -23,10 +23,12 @@ import {
23
23
  currentlyPreviewingTheme,
24
24
  } from '../../utils/is-previewing-theme';
25
25
  import { unlock } from '../../lock-unlock';
26
+ import { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
26
27
 
27
- const { useHistory } = unlock( routerPrivateApis );
28
+ const { useLocation, useHistory } = unlock( routerPrivateApis );
28
29
 
29
30
  export default function LeafMoreMenu( props ) {
31
+ const location = useLocation();
30
32
  const history = useHistory();
31
33
  const { block } = props;
32
34
  const { clientId } = block;
@@ -63,22 +65,32 @@ export default function LeafMoreMenu( props ) {
63
65
  attributes.type &&
64
66
  history
65
67
  ) {
66
- history.push( {
67
- postType: attributes.type,
68
- postId: attributes.id,
69
- ...( isPreviewingTheme() && {
70
- wp_theme_preview: currentlyPreviewingTheme(),
71
- } ),
72
- } );
68
+ history.push(
69
+ {
70
+ postType: attributes.type,
71
+ postId: attributes.id,
72
+ ...( isPreviewingTheme() && {
73
+ wp_theme_preview: currentlyPreviewingTheme(),
74
+ } ),
75
+ },
76
+ {
77
+ backPath: getPathFromURL( location.params ),
78
+ }
79
+ );
73
80
  }
74
81
  if ( name === 'core/page-list-item' && attributes.id && history ) {
75
- history.push( {
76
- postType: 'page',
77
- postId: attributes.id,
78
- ...( isPreviewingTheme() && {
79
- wp_theme_preview: currentlyPreviewingTheme(),
80
- } ),
81
- } );
82
+ history.push(
83
+ {
84
+ postType: 'page',
85
+ postId: attributes.id,
86
+ ...( isPreviewingTheme() && {
87
+ wp_theme_preview: currentlyPreviewingTheme(),
88
+ } ),
89
+ },
90
+ {
91
+ backPath: getPathFromURL( location.params ),
92
+ }
93
+ );
82
94
  }
83
95
  },
84
96
  [ history ]
@@ -28,10 +28,15 @@ import { unlock } from '../../lock-unlock';
28
28
  const { useHistory } = unlock( routerPrivateApis );
29
29
 
30
30
  const PageItem = ( { postType = 'page', postId, ...props } ) => {
31
- const linkInfo = useLink( {
32
- postType,
33
- postId,
34
- } );
31
+ const linkInfo = useLink(
32
+ {
33
+ postType,
34
+ postId,
35
+ },
36
+ {
37
+ backPath: '/page',
38
+ }
39
+ );
35
40
  return <SidebarNavigationItem { ...linkInfo } { ...props } />;
36
41
  };
37
42
 
@@ -10,7 +10,6 @@ import {
10
10
  __experimentalHeading as Heading,
11
11
  } from '@wordpress/components';
12
12
  import { useViewportMatch } from '@wordpress/compose';
13
- import { useSelect } from '@wordpress/data';
14
13
  import { getTemplatePartIcon } from '@wordpress/editor';
15
14
  import { __ } from '@wordpress/i18n';
16
15
  import { getQueryArgs } from '@wordpress/url';
@@ -24,7 +23,6 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
24
23
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
25
24
  import CategoryItem from './category-item';
26
25
  import { DEFAULT_CATEGORY, DEFAULT_TYPE } from '../page-patterns/utils';
27
- import { store as editSiteStore } from '../../store';
28
26
  import { useLink } from '../routes/link';
29
27
  import usePatternCategories from './use-pattern-categories';
30
28
  import useMyPatterns from './use-my-patterns';
@@ -106,11 +104,6 @@ export default function SidebarNavigationScreenPatterns() {
106
104
  const { patternCategories, hasPatterns } = usePatternCategories();
107
105
  const { myPatterns } = useMyPatterns();
108
106
 
109
- const isTemplatePartsMode = useSelect( ( select ) => {
110
- const settings = select( editSiteStore ).getSettings();
111
- return !! settings.supportsTemplatePartsMode;
112
- }, [] );
113
-
114
107
  const templatePartsLink = useLink( { path: '/wp_template_part/all' } );
115
108
  const footer = ! isMobileViewport ? (
116
109
  <ItemGroup>
@@ -129,7 +122,6 @@ export default function SidebarNavigationScreenPatterns() {
129
122
 
130
123
  return (
131
124
  <SidebarNavigationScreen
132
- isRoot={ isTemplatePartsMode }
133
125
  title={ __( 'Patterns' ) }
134
126
  description={ __(
135
127
  'Manage what patterns are available when editing the site.'
@@ -36,7 +36,8 @@ export default function useThemePatterns() {
36
36
  ( pattern ) =>
37
37
  ! CORE_PATTERN_SOURCES.includes( pattern.source )
38
38
  )
39
- .filter( filterOutDuplicatesByName ),
39
+ .filter( filterOutDuplicatesByName )
40
+ .filter( ( pattern ) => pattern.inserter !== false ),
40
41
  [ blockPatterns, restBlockPatterns ]
41
42
  );
42
43