From b2a2a70ff643fa3a8a32d144c9f37d2cb2e1214e Mon Sep 17 00:00:00 2001 From: ramon Date: Mon, 24 Apr 2023 09:29:38 +1000 Subject: [PATCH] Make the slot private. --- .../src/components/editor-canvas-container/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/editor-canvas-container/index.js b/packages/edit-site/src/components/editor-canvas-container/index.js index b684eb34956ef6..043c1f633fa44b 100644 --- a/packages/edit-site/src/components/editor-canvas-container/index.js +++ b/packages/edit-site/src/components/editor-canvas-container/index.js @@ -2,7 +2,10 @@ * WordPress dependencies */ import { Children, cloneElement, useState, useMemo } from '@wordpress/element'; -import { createSlotFill, Button } from '@wordpress/components'; +import { + Button, + privateApis as componentsPrivateApis, +} from '@wordpress/components'; import { ESCAPE } from '@wordpress/keycodes'; import { __ } from '@wordpress/i18n'; import { useDispatch, useSelect } from '@wordpress/data'; @@ -31,9 +34,11 @@ export function getEditorCanvasContainerTitle( view ) { } } +// Creates a private slot fill. +const { createPrivateSlotFill } = unlock( componentsPrivateApis ); const SLOT_FILL_NAME = 'EditSiteEditorCanvasContainerSlot'; const { Slot: EditorCanvasContainerSlot, Fill: EditorCanvasContainerFill } = - createSlotFill( SLOT_FILL_NAME ); + createPrivateSlotFill( SLOT_FILL_NAME ); function EditorCanvasContainer( { children,