File tree Expand file tree Collapse file tree 5 files changed +12
-4
lines changed
block-editor/src/components/inserter Expand file tree Collapse file tree 5 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ function InserterLibrary(
27
27
onSelect = noop ,
28
28
shouldFocusBlock = false ,
29
29
onClose,
30
+ isEditorIframed,
30
31
} ,
31
32
ref
32
33
) {
@@ -58,6 +59,7 @@ function InserterLibrary(
58
59
shouldFocusBlock = { shouldFocusBlock }
59
60
ref = { ref }
60
61
onClose = { onClose }
62
+ isEditorIframed = { isEditorIframed }
61
63
/>
62
64
) ;
63
65
}
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ function InserterMenu(
49
49
shouldFocusBlock = true ,
50
50
onPatternCategorySelection,
51
51
onClose,
52
+ isEditorIframed,
52
53
__experimentalInitialTab,
53
54
__experimentalInitialCategory,
54
55
} ,
@@ -93,7 +94,7 @@ function InserterMenu(
93
94
hasSectionRootClientId &&
94
95
( selectedTab === 'patterns' || selectedTab === 'media' ) ;
95
96
96
- useZoomOut ( shouldUseZoomOut && isLargeViewport ) ;
97
+ useZoomOut ( shouldUseZoomOut && isLargeViewport && isEditorIframed ) ;
97
98
98
99
const [ destinationRootClientId , onInsertBlocks , onToggleInsertionPoint ] =
99
100
useInsertionPoint ( {
Original file line number Diff line number Diff line change @@ -128,14 +128,17 @@ export default function EditorInterface( {
128
128
customSaveButton = { customSaveButton }
129
129
forceDisableBlockTools = { forceDisableBlockTools }
130
130
title = { title }
131
+ isEditorIframed = { ! disableIframe }
131
132
/>
132
133
)
133
134
}
134
135
editorNotices = { < EditorNotices /> }
135
136
secondarySidebar = {
136
137
! isPreviewMode &&
137
138
mode === 'visual' &&
138
- ( ( isInserterOpened && < InserterSidebar /> ) ||
139
+ ( ( isInserterOpened && (
140
+ < InserterSidebar isEditorIframed = { ! disableIframe } />
141
+ ) ) ||
139
142
( isListViewOpened && < ListViewSidebar /> ) )
140
143
}
141
144
sidebar = {
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ function Header( {
57
57
forceDisableBlockTools,
58
58
setEntitiesSavedStatesCallback,
59
59
title,
60
+ isEditorIframed,
60
61
} ) {
61
62
const isWideViewport = useViewportMatch ( 'large' ) ;
62
63
const isLargeViewport = useViewportMatch ( 'medium' ) ;
@@ -179,7 +180,7 @@ function Header( {
179
180
forceIsAutosaveable = { forceIsDirty }
180
181
/>
181
182
182
- { isWideViewport && canBeZoomedOut && (
183
+ { isWideViewport && canBeZoomedOut && isEditorIframed && (
183
184
< ZoomOutToggle disabled = { forceDisableBlockTools } />
184
185
) }
185
186
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { store as editorStore } from '../../store';
20
20
21
21
const { PrivateInserterLibrary } = unlock ( blockEditorPrivateApis ) ;
22
22
23
- export default function InserterSidebar ( ) {
23
+ export default function InserterSidebar ( { isEditorIframed } ) {
24
24
const {
25
25
blockSectionRootClientId,
26
26
inserterSidebarToggleRef,
@@ -97,6 +97,7 @@ export default function InserterSidebar() {
97
97
}
98
98
ref = { libraryRef }
99
99
onClose = { closeInserterSidebar }
100
+ isEditorIframed = { isEditorIframed }
100
101
/>
101
102
</ div >
102
103
) ;
You can’t perform that action at this time.
0 commit comments