diff --git a/docs/contributors/code/coding-guidelines.md b/docs/contributors/code/coding-guidelines.md index ac89ef7f7dc873..e7ff0a40843060 100644 --- a/docs/contributors/code/coding-guidelines.md +++ b/docs/contributors/code/coding-guidelines.md @@ -211,7 +211,7 @@ import { privateHasContentRoleAttribute, ...selectors } from './selectors'; import { privateToggleFeature, ...actions } from './selectors'; // The `lock` function is exported from the internal private-apis.js file where // the opt-in function was called. -import { lock, unlock } from './private-apis'; +import { lock, unlock } from './lock-unlock'; export const store = registerStore(/* ... */); // Attach a private action to the exported store: @@ -230,7 +230,7 @@ import { store } from '@wordpress/package1'; import { useSelect } from '@wordpress/data'; // The `unlock` function is exported from the internal private-apis.js file where // the opt-in function was called. -import { unlock } from './private-apis'; +import { unlock } from './lock-unlock'; function MyComponent() { const hasRole = useSelect( ( select ) => ( @@ -251,7 +251,7 @@ function MyComponent() { ```js // In packages/package1/index.js: -import { lock } from './private-apis'; +import { lock } from './lock-unlock'; export const privateApis = {}; /* Attach private data to the exported object */ @@ -266,7 +266,7 @@ lock( privateApis, { // In packages/package2/index.js: import { privateApis } from '@wordpress/package1'; -import { unlock } from './private-apis'; +import { unlock } from './lock-unlock'; const { privateCallback, @@ -314,7 +314,7 @@ inside it: ```js // In @wordpress/package1/index.js: -import { lock } from './private-apis'; +import { lock } from './lock-unlock'; // A private function contains all the logic function privateValidateBlocks( formula, privateIsStrict ) { @@ -339,7 +339,7 @@ lock( privateApis, { privateValidateBlocks } ); // In @wordpress/package2/index.js: import { privateApis as package1PrivateApis } from '@wordpress/package1'; -import { unlock } from './private-apis'; +import { unlock } from './lock-unlock'; // The private function may be "unlocked" given the stable function: const { privateValidateBlocks } = unlock( package1PrivateApis ); @@ -355,7 +355,7 @@ inside it: ```js // In @wordpress/package1/index.js: -import { lock } from './private-apis'; +import { lock } from './lock-unlock'; // The private component contains all the logic const PrivateMyButton = ( { title, privateShowIcon = true } ) => { @@ -379,7 +379,7 @@ lock( privateApis, { PrivateMyButton } ); // In @wordpress/package2/index.js: import { privateApis } from '@wordpress/package1'; -import { unlock } from './private-apis'; +import { unlock } from './lock-unlock'; // The private component may be "unlocked" given the stable component: const { PrivateMyButton } = unlock(privateApis); diff --git a/packages/block-library/src/cover/edit/resizable-cover-popover.js b/packages/block-library/src/cover/edit/resizable-cover-popover.js index cf37294f95f018..7db8b0cc50b883 100644 --- a/packages/block-library/src/cover/edit/resizable-cover-popover.js +++ b/packages/block-library/src/cover/edit/resizable-cover-popover.js @@ -12,7 +12,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const RESIZABLE_BOX_ENABLE_OPTION = { top: false, diff --git a/packages/block-library/src/cover/transforms.js b/packages/block-library/src/cover/transforms.js index adf7bfe0997e3d..c9526c025ba9ba 100644 --- a/packages/block-library/src/cover/transforms.js +++ b/packages/block-library/src/cover/transforms.js @@ -8,7 +8,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; * Internal dependencies */ import { IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; const { cleanEmptyObject } = unlock( blockEditorPrivateApis ); diff --git a/packages/block-library/src/image/edit.js b/packages/block-library/src/image/edit.js index 95de37062c09a0..dc82b7227a701d 100644 --- a/packages/block-library/src/image/edit.js +++ b/packages/block-library/src/image/edit.js @@ -28,7 +28,7 @@ import { store as noticesStore } from '@wordpress/notices'; * Internal dependencies */ import Image from './image'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; /** * Module constants diff --git a/packages/block-library/src/private-apis.js b/packages/block-library/src/lock-unlock.js similarity index 100% rename from packages/block-library/src/private-apis.js rename to packages/block-library/src/lock-unlock.js diff --git a/packages/block-library/src/media-text/edit.js b/packages/block-library/src/media-text/edit.js index dcf8eae4ecf5a9..fffbdc71d74811 100644 --- a/packages/block-library/src/media-text/edit.js +++ b/packages/block-library/src/media-text/edit.js @@ -44,7 +44,7 @@ import { LINK_DESTINATION_ATTACHMENT, TEMPLATE, } from './constants'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; const { useBlockEditingMode } = unlock( blockEditorPrivateApis ); diff --git a/packages/block-library/src/navigation/edit/menu-inspector-controls.js b/packages/block-library/src/navigation/edit/menu-inspector-controls.js index cc8887a8785d96..52e7805c0f0fb0 100644 --- a/packages/block-library/src/navigation/edit/menu-inspector-controls.js +++ b/packages/block-library/src/navigation/edit/menu-inspector-controls.js @@ -19,7 +19,7 @@ import { __, sprintf } from '@wordpress/i18n'; * Internal dependencies */ import NavigationMenuSelector from './navigation-menu-selector'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import DeletedNavigationWarning from './deleted-navigation-warning'; import useNavigationMenu from '../use-navigation-menu'; import LeafMoreMenu from './leaf-more-menu'; diff --git a/packages/block-library/src/post-title/edit.js b/packages/block-library/src/post-title/edit.js index 96fd62178b9743..1838339dd16273 100644 --- a/packages/block-library/src/post-title/edit.js +++ b/packages/block-library/src/post-title/edit.js @@ -24,7 +24,7 @@ import { useEntityProp } from '@wordpress/core-data'; */ import HeadingLevelDropdown from '../heading/heading-level-dropdown'; import { useCanEditEntity } from '../utils/hooks'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; const { useBlockEditingMode } = unlock( blockEditorPrivateApis ); diff --git a/packages/block-library/src/query/deprecated.js b/packages/block-library/src/query/deprecated.js index 74a69a7f32baad..c821421cd35bbd 100644 --- a/packages/block-library/src/query/deprecated.js +++ b/packages/block-library/src/query/deprecated.js @@ -12,7 +12,7 @@ import { /** * Internal dependencies */ -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; const { cleanEmptyObject } = unlock( blockEditorPrivateApis ); diff --git a/packages/block-library/src/query/edit/inspector-controls/index.js b/packages/block-library/src/query/edit/inspector-controls/index.js index 0061429f4af3b1..5244a888312552 100644 --- a/packages/block-library/src/query/edit/inspector-controls/index.js +++ b/packages/block-library/src/query/edit/inspector-controls/index.js @@ -28,7 +28,7 @@ import ParentControl from './parent-control'; import { TaxonomyControls } from './taxonomy-controls'; import StickyControl from './sticky-control'; import CreateNewPostLink from './create-new-post-link'; -import { unlock } from '../../../private-apis'; +import { unlock } from '../../../lock-unlock'; import { usePostTypes, useIsPostTypeHierarchical, diff --git a/packages/block-library/src/utils/migrate-font-family.js b/packages/block-library/src/utils/migrate-font-family.js index 7edec513e94a95..8cf90eba81e580 100644 --- a/packages/block-library/src/utils/migrate-font-family.js +++ b/packages/block-library/src/utils/migrate-font-family.js @@ -6,7 +6,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; const { cleanEmptyObject } = unlock( blockEditorPrivateApis ); diff --git a/packages/blocks/src/private-apis.js b/packages/blocks/src/lock-unlock.js similarity index 100% rename from packages/blocks/src/private-apis.js rename to packages/blocks/src/lock-unlock.js diff --git a/packages/blocks/src/store/index.js b/packages/blocks/src/store/index.js index ad249fd4554709..ce69fd83d4e6c0 100644 --- a/packages/blocks/src/store/index.js +++ b/packages/blocks/src/store/index.js @@ -11,7 +11,7 @@ import * as selectors from './selectors'; import * as privateSelectors from './private-selectors'; import * as actions from './actions'; import { STORE_NAME } from './constants'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; /** * Store definition for the blocks namespace. diff --git a/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js b/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js index 25b541c3d16dbe..bbdf1ce70a15bf 100644 --- a/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js +++ b/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js @@ -9,7 +9,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import useSidebarBlockEditor from './use-sidebar-block-editor'; import useBlocksFocusControl from '../focus-control/use-blocks-focus-control'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis ); diff --git a/packages/customize-widgets/src/private-apis.js b/packages/customize-widgets/src/lock-unlock.js similarity index 100% rename from packages/customize-widgets/src/private-apis.js rename to packages/customize-widgets/src/lock-unlock.js diff --git a/packages/data/src/private-apis.js b/packages/data/src/lock-unlock.js similarity index 100% rename from packages/data/src/private-apis.js rename to packages/data/src/lock-unlock.js diff --git a/packages/data/src/redux-store/index.js b/packages/data/src/redux-store/index.js index 3e3e680d0ab0f2..7b1c0d2991e69d 100644 --- a/packages/data/src/redux-store/index.js +++ b/packages/data/src/redux-store/index.js @@ -15,7 +15,7 @@ import { compose } from '@wordpress/compose'; * Internal dependencies */ import { builtinControls } from '../controls'; -import { lock } from '../private-apis'; +import { lock } from '../lock-unlock'; import promise from '../promise-middleware'; import createResolversCacheMiddleware from '../resolvers-cache-middleware'; import createThunkMiddleware from './thunk-middleware'; diff --git a/packages/data/src/registry.js b/packages/data/src/registry.js index 7a913da488f46e..d193a50cbc392d 100644 --- a/packages/data/src/registry.js +++ b/packages/data/src/registry.js @@ -9,7 +9,7 @@ import deprecated from '@wordpress/deprecated'; import createReduxStore from './redux-store'; import coreDataStore from './store'; import { createEmitter } from './utils/emitter'; -import { lock, unlock } from './private-apis'; +import { lock, unlock } from './lock-unlock'; /** @typedef {import('./types').StoreDescriptor} StoreDescriptor */ diff --git a/packages/data/src/test/privateAPIs.js b/packages/data/src/test/privateAPIs.js index aa5a53719041d7..22118ec58caa1d 100644 --- a/packages/data/src/test/privateAPIs.js +++ b/packages/data/src/test/privateAPIs.js @@ -3,7 +3,7 @@ */ import { createRegistry } from '../registry'; import createReduxStore from '../redux-store'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; import { createRegistrySelector } from '../factory'; describe( 'Private data APIs', () => { diff --git a/packages/edit-post/src/components/header/header-toolbar/index.js b/packages/edit-post/src/components/header/header-toolbar/index.js index 337c27bed00d99..391e5473999bb7 100644 --- a/packages/edit-post/src/components/header/header-toolbar/index.js +++ b/packages/edit-post/src/components/header/header-toolbar/index.js @@ -24,7 +24,7 @@ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * Internal dependencies */ import { store as editPostStore } from '../../../store'; -import { unlock } from '../../../private-apis'; +import { unlock } from '../../../lock-unlock'; const { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-post/src/editor.js b/packages/edit-post/src/editor.js index 62e92218e878ea..f2f6e3840b8c00 100644 --- a/packages/edit-post/src/editor.js +++ b/packages/edit-post/src/editor.js @@ -23,7 +23,7 @@ import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands import Layout from './components/layout'; import EditorInitialization from './components/editor-initialization'; import { store as editPostStore } from './store'; -import { unlock } from './private-apis'; +import { unlock } from './lock-unlock'; const { ExperimentalEditorProvider } = unlock( editorPrivateApis ); const { useCommands } = unlock( coreCommandsPrivateApis ); diff --git a/packages/edit-post/src/private-apis.js b/packages/edit-post/src/lock-unlock.js similarity index 100% rename from packages/edit-post/src/private-apis.js rename to packages/edit-post/src/lock-unlock.js diff --git a/packages/edit-site/src/components/add-new-template/new-template-part.js b/packages/edit-site/src/components/add-new-template/new-template-part.js index e485dc40a87701..b43cfd3150f2ae 100644 --- a/packages/edit-site/src/components/add-new-template/new-template-part.js +++ b/packages/edit-site/src/components/add-new-template/new-template-part.js @@ -19,7 +19,7 @@ import { getUniqueTemplatePartTitle, getCleanTemplatePartSlug, } from '../../utils/template-part-create'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/add-new-template/new-template.js b/packages/edit-site/src/components/add-new-template/new-template.js index a0ea141bda52e3..16772c2a2bf5d2 100644 --- a/packages/edit-site/src/components/add-new-template/new-template.js +++ b/packages/edit-site/src/components/add-new-template/new-template.js @@ -37,7 +37,7 @@ import { import AddCustomGenericTemplateModalContent from './add-custom-generic-template-modal-content'; import TemplateActionsLoadingScreen from './template-actions-loading-screen'; import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/app/index.js b/packages/edit-site/src/components/app/index.js index 81502f23ebe735..f2b2e6ebb7e566 100644 --- a/packages/edit-site/src/components/app/index.js +++ b/packages/edit-site/src/components/app/index.js @@ -15,7 +15,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; */ import Layout from '../layout'; import { GlobalStylesProvider } from '../global-styles/global-styles-provider'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { RouterProvider } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/block-editor/back-button.js b/packages/edit-site/src/components/block-editor/back-button.js index 5b06937671a6e8..4723adc3f0a7aa 100644 --- a/packages/edit-site/src/components/block-editor/back-button.js +++ b/packages/edit-site/src/components/block-editor/back-button.js @@ -9,7 +9,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation, useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/block-editor/editor-canvas.js b/packages/edit-site/src/components/block-editor/editor-canvas.js index be07453d8fc9e9..fad43f04106400 100644 --- a/packages/edit-site/src/components/block-editor/editor-canvas.js +++ b/packages/edit-site/src/components/block-editor/editor-canvas.js @@ -21,7 +21,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; function EditorCanvas( { enableResizing, settings, children, ...props } ) { diff --git a/packages/edit-site/src/components/block-editor/index.js b/packages/edit-site/src/components/block-editor/index.js index bfc36bc27aab88..71f1ee93097e28 100644 --- a/packages/edit-site/src/components/block-editor/index.js +++ b/packages/edit-site/src/components/block-editor/index.js @@ -36,7 +36,7 @@ import { store as editSiteStore } from '../../store'; import BackButton from './back-button'; import ResizableEditor from './resizable-editor'; import EditorCanvas from './editor-canvas'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import EditorCanvasContainer from '../editor-canvas-container'; import { DisableNonPageContentBlocks, 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 3647ff2e49f43f..c28a565e960959 100644 --- a/packages/edit-site/src/components/editor-canvas-container/index.js +++ b/packages/edit-site/src/components/editor-canvas-container/index.js @@ -16,7 +16,7 @@ import { useFocusOnMount, useFocusReturn } from '@wordpress/compose'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import ResizableEditor from '../block-editor/resizable-editor'; diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index 02dee2a48c96e1..9436b79e786743 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -39,7 +39,7 @@ import { store as editSiteStore } from '../../store'; import { GlobalStylesRenderer } from '../global-styles-renderer'; import useTitle from '../routes/use-title'; import CanvasSpinner from '../canvas-spinner'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import useEditedEntityRecord from '../use-edited-entity-record'; import { SidebarFixedBottomSlot } from '../sidebar-edit-mode/sidebar-fixed-bottom'; diff --git a/packages/edit-site/src/components/global-styles-renderer/index.js b/packages/edit-site/src/components/global-styles-renderer/index.js index 14fc4adf25f7e2..eca6d9b2662e8f 100644 --- a/packages/edit-site/src/components/global-styles-renderer/index.js +++ b/packages/edit-site/src/components/global-styles-renderer/index.js @@ -9,7 +9,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; * Internal dependencies */ import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalStylesOutput } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/color-palette-panel.js b/packages/edit-site/src/components/global-styles/color-palette-panel.js index 185a46fdba4761..03401cab9f80b5 100644 --- a/packages/edit-site/src/components/global-styles/color-palette-panel.js +++ b/packages/edit-site/src/components/global-styles/color-palette-panel.js @@ -12,7 +12,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalSetting } = unlock( blockEditorPrivateApis ); const mobilePopoverProps = { placement: 'bottom-start', offset: 8 }; diff --git a/packages/edit-site/src/components/global-styles/dimensions-panel.js b/packages/edit-site/src/components/global-styles/dimensions-panel.js index 11b44cd20092f2..461ed7ab8dce8c 100644 --- a/packages/edit-site/src/components/global-styles/dimensions-panel.js +++ b/packages/edit-site/src/components/global-styles/dimensions-panel.js @@ -7,7 +7,7 @@ import { useMemo } from '@wordpress/element'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalStyle, diff --git a/packages/edit-site/src/components/global-styles/global-styles-provider.js b/packages/edit-site/src/components/global-styles/global-styles-provider.js index 7ddd518020569a..829563342e847d 100644 --- a/packages/edit-site/src/components/global-styles/global-styles-provider.js +++ b/packages/edit-site/src/components/global-styles/global-styles-provider.js @@ -15,7 +15,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; * Internal dependencies */ import CanvasSpinner from '../canvas-spinner'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { GlobalStylesContext, cleanEmptyObject } = unlock( blockEditorPrivateApis diff --git a/packages/edit-site/src/components/global-styles/gradients-palette-panel.js b/packages/edit-site/src/components/global-styles/gradients-palette-panel.js index 4c791b8e6b0117..384e033c5dbbcd 100644 --- a/packages/edit-site/src/components/global-styles/gradients-palette-panel.js +++ b/packages/edit-site/src/components/global-styles/gradients-palette-panel.js @@ -15,7 +15,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; * Internal dependencies */ import Subtitle from './subtitle'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalSetting } = unlock( blockEditorPrivateApis ); const mobilePopoverProps = { placement: 'bottom-start', offset: 8 }; diff --git a/packages/edit-site/src/components/global-styles/hooks.js b/packages/edit-site/src/components/global-styles/hooks.js index 163ae58df8dcfa..0a6702589a167a 100644 --- a/packages/edit-site/src/components/global-styles/hooks.js +++ b/packages/edit-site/src/components/global-styles/hooks.js @@ -13,7 +13,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { useSelect } from '@wordpress/data'; const { useGlobalSetting } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/palette.js b/packages/edit-site/src/components/global-styles/palette.js index c5f71cc987f043..0aea8554de8de2 100644 --- a/packages/edit-site/src/components/global-styles/palette.js +++ b/packages/edit-site/src/components/global-styles/palette.js @@ -22,7 +22,7 @@ import Subtitle from './subtitle'; import { NavigationButtonAsItem } from './navigation-button'; import { useColorRandomizer } from './hooks'; import ColorIndicatorWrapper from './color-indicator-wrapper'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalSetting } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/preview.js b/packages/edit-site/src/components/global-styles/preview.js index 1cc77c5b86132f..1bbc2b2f4d59e8 100644 --- a/packages/edit-site/src/components/global-styles/preview.js +++ b/packages/edit-site/src/components/global-styles/preview.js @@ -17,7 +17,7 @@ import { useState, useMemo } from '@wordpress/element'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalSetting, useGlobalStyle, useGlobalStylesOutput } = unlock( blockEditorPrivateApis diff --git a/packages/edit-site/src/components/global-styles/root-menu.js b/packages/edit-site/src/components/global-styles/root-menu.js index 14c5c344e5f64c..9edfd064acbf73 100644 --- a/packages/edit-site/src/components/global-styles/root-menu.js +++ b/packages/edit-site/src/components/global-styles/root-menu.js @@ -10,7 +10,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; * Internal dependencies */ import { NavigationButtonAsItem } from './navigation-button'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHasDimensionsPanel, diff --git a/packages/edit-site/src/components/global-styles/screen-block-list.js b/packages/edit-site/src/components/global-styles/screen-block-list.js index 88c826c42e0d07..1db81377ff9a3b 100644 --- a/packages/edit-site/src/components/global-styles/screen-block-list.js +++ b/packages/edit-site/src/components/global-styles/screen-block-list.js @@ -23,7 +23,7 @@ import { speak } from '@wordpress/a11y'; import { useBlockVariations } from './variations-panel'; import ScreenHeader from './header'; import { NavigationButtonAsItem } from './navigation-button'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHasDimensionsPanel, diff --git a/packages/edit-site/src/components/global-styles/screen-block.js b/packages/edit-site/src/components/global-styles/screen-block.js index fe6221dfb5a659..b24fd5eb41de15 100644 --- a/packages/edit-site/src/components/global-styles/screen-block.js +++ b/packages/edit-site/src/components/global-styles/screen-block.js @@ -18,7 +18,7 @@ import { __, sprintf } from '@wordpress/i18n'; */ import ScreenHeader from './header'; import BlockPreviewPanel from './block-preview-panel'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import Subtitle from './subtitle'; import { useBlockVariations, VariationsPanel } from './variations-panel'; diff --git a/packages/edit-site/src/components/global-styles/screen-colors.js b/packages/edit-site/src/components/global-styles/screen-colors.js index dc56bbc074b8b8..01a206009ffb80 100644 --- a/packages/edit-site/src/components/global-styles/screen-colors.js +++ b/packages/edit-site/src/components/global-styles/screen-colors.js @@ -11,7 +11,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import ScreenHeader from './header'; import Palette from './palette'; import BlockPreviewPanel from './block-preview-panel'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalStyle, diff --git a/packages/edit-site/src/components/global-styles/screen-css.js b/packages/edit-site/src/components/global-styles/screen-css.js index 50aae836ffa1c3..71d47a52a50274 100644 --- a/packages/edit-site/src/components/global-styles/screen-css.js +++ b/packages/edit-site/src/components/global-styles/screen-css.js @@ -8,7 +8,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import ScreenHeader from './header'; const { useGlobalStyle, AdvancedPanel: StylesAdvancedPanel } = unlock( diff --git a/packages/edit-site/src/components/global-styles/screen-layout.js b/packages/edit-site/src/components/global-styles/screen-layout.js index 66626fa82e7058..e0caf827f2022a 100644 --- a/packages/edit-site/src/components/global-styles/screen-layout.js +++ b/packages/edit-site/src/components/global-styles/screen-layout.js @@ -10,7 +10,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import DimensionsPanel from './dimensions-panel'; import ScreenHeader from './header'; import BlockPreviewPanel from './block-preview-panel'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHasDimensionsPanel, useGlobalSetting, useSettingsForBlockElement } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/screen-revisions/index.js b/packages/edit-site/src/components/global-styles/screen-revisions/index.js index 8a3e84e0ee41eb..c6920f3d63c24f 100644 --- a/packages/edit-site/src/components/global-styles/screen-revisions/index.js +++ b/packages/edit-site/src/components/global-styles/screen-revisions/index.js @@ -19,7 +19,7 @@ import { * Internal dependencies */ import ScreenHeader from '../header'; -import { unlock } from '../../../private-apis'; +import { unlock } from '../../../lock-unlock'; import Revisions from '../../revisions'; import SidebarFixedBottom from '../../sidebar-edit-mode/sidebar-fixed-bottom'; import { store as editSiteStore } from '../../../store'; diff --git a/packages/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js b/packages/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js index a35f9092248fde..ce3123e3fd0285 100644 --- a/packages/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +++ b/packages/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js @@ -9,7 +9,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../../private-apis'; +import { unlock } from '../../../lock-unlock'; const SITE_EDITOR_AUTHORS_QUERY = { per_page: -1, diff --git a/packages/edit-site/src/components/global-styles/screen-root.js b/packages/edit-site/src/components/global-styles/screen-root.js index 1d9be8b11b3f33..c2a7d1fc5909c7 100644 --- a/packages/edit-site/src/components/global-styles/screen-root.js +++ b/packages/edit-site/src/components/global-styles/screen-root.js @@ -25,7 +25,7 @@ import { IconWithCurrentColor } from './icon-with-current-color'; import { NavigationButtonAsItem } from './navigation-button'; import RootMenu from './root-menu'; import StylesPreview from './preview'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; function ScreenRoot() { const { useGlobalStyle } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/screen-typography.js b/packages/edit-site/src/components/global-styles/screen-typography.js index bfbff7f180ff35..cd3371576b2fc5 100644 --- a/packages/edit-site/src/components/global-styles/screen-typography.js +++ b/packages/edit-site/src/components/global-styles/screen-typography.js @@ -17,7 +17,7 @@ import ScreenHeader from './header'; import { NavigationButtonAsItem } from './navigation-button'; import Subtitle from './subtitle'; import BlockPreviewPanel from './block-preview-panel'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalStyle } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/stories/index.js b/packages/edit-site/src/components/global-styles/stories/index.js index f915794e5ecd06..f5e31cc142c0f7 100644 --- a/packages/edit-site/src/components/global-styles/stories/index.js +++ b/packages/edit-site/src/components/global-styles/stories/index.js @@ -9,7 +9,7 @@ import { useMemo, useState } from '@wordpress/element'; */ import { mergeBaseAndUserConfigs } from '../global-styles-provider'; import { default as GlobalStylesUIComponent } from '../ui'; -import { unlock } from '../../../private-apis'; +import { unlock } from '../../../lock-unlock'; const { GlobalStylesContext, ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis diff --git a/packages/edit-site/src/components/global-styles/style-variations-container.js b/packages/edit-site/src/components/global-styles/style-variations-container.js index 9ab54f6e070caf..1428d0974841b3 100644 --- a/packages/edit-site/src/components/global-styles/style-variations-container.js +++ b/packages/edit-site/src/components/global-styles/style-variations-container.js @@ -19,7 +19,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; */ import { mergeBaseAndUserConfigs } from './global-styles-provider'; import StylesPreview from './preview'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock( blockEditorPrivateApis diff --git a/packages/edit-site/src/components/global-styles/typography-panel.js b/packages/edit-site/src/components/global-styles/typography-panel.js index ce5aa95b7246e8..795a101bed839f 100644 --- a/packages/edit-site/src/components/global-styles/typography-panel.js +++ b/packages/edit-site/src/components/global-styles/typography-panel.js @@ -6,7 +6,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalStyle, diff --git a/packages/edit-site/src/components/global-styles/typography-preview.js b/packages/edit-site/src/components/global-styles/typography-preview.js index 34a64e23fc1c79..91891bb661ca8e 100644 --- a/packages/edit-site/src/components/global-styles/typography-preview.js +++ b/packages/edit-site/src/components/global-styles/typography-preview.js @@ -6,7 +6,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useGlobalStyle } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/global-styles/ui.js b/packages/edit-site/src/components/global-styles/ui.js index 7d068042ef5335..218665c682def4 100644 --- a/packages/edit-site/src/components/global-styles/ui.js +++ b/packages/edit-site/src/components/global-styles/ui.js @@ -38,7 +38,7 @@ import ScreenStyleVariations from './screen-style-variations'; import StyleBook from '../style-book'; import ScreenCSS from './screen-css'; import ScreenRevisions from './screen-revisions'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; const SLOT_FILL_NAME = 'GlobalStylesMenu'; diff --git a/packages/edit-site/src/components/header-edit-mode/index.js b/packages/edit-site/src/components/header-edit-mode/index.js index 0878cb4faae2d2..987046a6da33be 100644 --- a/packages/edit-site/src/components/header-edit-mode/index.js +++ b/packages/edit-site/src/components/header-edit-mode/index.js @@ -43,7 +43,7 @@ import { getEditorCanvasContainerTitle, useHasEditorCanvasContainer, } from '../editor-canvas-container'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/layout/index.js b/packages/edit-site/src/components/layout/index.js index 83527bae6d7e3b..eab6f08af0c655 100644 --- a/packages/edit-site/src/components/layout/index.js +++ b/packages/edit-site/src/components/layout/index.js @@ -43,7 +43,7 @@ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-e import SiteHub from '../site-hub'; import ResizableFrame from '../resizable-frame'; import useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import SavePanel from '../save-panel'; import KeyboardShortcutsRegister from '../keyboard-shortcuts/register'; import KeyboardShortcutsGlobal from '../keyboard-shortcuts/global'; diff --git a/packages/edit-site/src/components/list/index.js b/packages/edit-site/src/components/list/index.js index 0ffb67b3810e3a..cc01ad6ece7ff5 100644 --- a/packages/edit-site/src/components/list/index.js +++ b/packages/edit-site/src/components/list/index.js @@ -16,7 +16,7 @@ import useRegisterShortcuts from './use-register-shortcuts'; import Header from './header'; import Table from './table'; import useTitle from '../routes/use-title'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/page-content-focus/disable-non-page-content-blocks.js b/packages/edit-site/src/components/page-content-focus/disable-non-page-content-blocks.js index 4a022daae44c90..9bd86fb1b4e246 100644 --- a/packages/edit-site/src/components/page-content-focus/disable-non-page-content-blocks.js +++ b/packages/edit-site/src/components/page-content-focus/disable-non-page-content-blocks.js @@ -9,7 +9,7 @@ import { useEffect } from '@wordpress/element'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { PAGE_CONTENT_BLOCK_TYPES } from './constants'; const { useBlockEditingMode } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/resizable-frame/index.js b/packages/edit-site/src/components/resizable-frame/index.js index 5463cf357a31be..ecf433785faabc 100644 --- a/packages/edit-site/src/components/resizable-frame/index.js +++ b/packages/edit-site/src/components/resizable-frame/index.js @@ -16,7 +16,7 @@ import { useDispatch } from '@wordpress/data'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; // Removes the inline styles in the drag handles. diff --git a/packages/edit-site/src/components/revisions/index.js b/packages/edit-site/src/components/revisions/index.js index 221166d2d998eb..4757c9b27213ea 100644 --- a/packages/edit-site/src/components/revisions/index.js +++ b/packages/edit-site/src/components/revisions/index.js @@ -18,7 +18,7 @@ import { store as coreStore } from '@wordpress/core-data'; * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider'; import EditorCanvasContainer from '../editor-canvas-container'; diff --git a/packages/edit-site/src/components/routes/link.js b/packages/edit-site/src/components/routes/link.js index ae25f2c791c657..1f386ef0bb3dc4 100644 --- a/packages/edit-site/src/components/routes/link.js +++ b/packages/edit-site/src/components/routes/link.js @@ -7,7 +7,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { isPreviewingTheme, currentlyPreviewingTheme, diff --git a/packages/edit-site/src/components/routes/use-title.js b/packages/edit-site/src/components/routes/use-title.js index 26321721a5c452..6d06c593dd253a 100644 --- a/packages/edit-site/src/components/routes/use-title.js +++ b/packages/edit-site/src/components/routes/use-title.js @@ -12,7 +12,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/save-hub/index.js b/packages/edit-site/src/components/save-hub/index.js index 4b4d1c92442a16..bafad4b5d7cc89 100644 --- a/packages/edit-site/src/components/save-hub/index.js +++ b/packages/edit-site/src/components/save-hub/index.js @@ -15,7 +15,7 @@ import { store as noticesStore } from '@wordpress/notices'; */ import SaveButton from '../save-button'; import { isPreviewingTheme } from '../../utils/is-previewing-theme'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/save-panel/index.js b/packages/edit-site/src/components/save-panel/index.js index 04f97e2afcf0e5..418de53390cacb 100644 --- a/packages/edit-site/src/components/save-panel/index.js +++ b/packages/edit-site/src/components/save-panel/index.js @@ -21,7 +21,7 @@ import { store as coreStore } from '@wordpress/core-data'; * Internal dependencies */ import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { useActivateTheme } from '../../utils/use-activate-theme'; import { currentlyPreviewingTheme, diff --git a/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js b/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js index e4eff5ad037ddc..7a19cdc08db114 100644 --- a/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js +++ b/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js @@ -18,7 +18,7 @@ import { ESCAPE } from '@wordpress/keycodes'; * Internal dependencies */ import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { PrivateListView } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js b/packages/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js index ae124422f66ce1..b32e849d6a7541 100644 --- a/packages/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js +++ b/packages/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js @@ -15,7 +15,7 @@ import DefaultSidebar from './default-sidebar'; import { GlobalStylesUI } from '../global-styles'; import { store as editSiteStore } from '../../store'; import { GlobalStylesMenuSlot } from '../global-styles/ui'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; export default function GlobalStylesSidebar() { const { shouldClearCanvasContainerView, isStyleBookOpened } = useSelect( diff --git a/packages/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js b/packages/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js index c44b8c9c85c7fc..56e205bd330286 100644 --- a/packages/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +++ b/packages/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js @@ -6,7 +6,7 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { createPrivateSlotFill } = unlock( componentsPrivateApis ); const SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME = 'SidebarFixedBottom'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js index 926f8b8611af0d..04fd4c560e6f9c 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js @@ -21,7 +21,7 @@ import { useCallback } from '@wordpress/element'; */ import SidebarNavigationScreen from '../sidebar-navigation-screen'; import StyleVariationsContainer from '../global-styles/style-variations-container'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; import SidebarNavigationItem from '../sidebar-navigation-item'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js index 06514b6f960d71..984ef6042e0172 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js @@ -17,7 +17,7 @@ import { useEffect } from '@wordpress/element'; import SidebarNavigationScreen from '../sidebar-navigation-screen'; import SidebarNavigationItem from '../sidebar-navigation-item'; import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarNavigationScreenNavigationMenuButton from '../sidebar-navigation-screen-navigation-menus/navigator-button'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js index 35e662a23c33da..385938597da1f7 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js @@ -15,7 +15,7 @@ import { pencil } from '@wordpress/icons'; * Internal dependencies */ import SidebarNavigationScreen from '../sidebar-navigation-screen'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js index ff4b956e4ad469..06bc660057f937 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js @@ -17,7 +17,7 @@ import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import { isPreviewingTheme, diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js index 9d25db73d45b6d..f6c76b8c09d031 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js @@ -16,7 +16,7 @@ import { store as coreStore } from '@wordpress/core-data'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import LeafMoreMenu from './leaf-more-menu'; // Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js. diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js index 176470b3576b84..897c647cddae49 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-page/index.js @@ -28,7 +28,7 @@ import { escapeAttribute } from '@wordpress/escape-html'; * Internal dependencies */ import SidebarNavigationScreen from '../sidebar-navigation-screen'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; import SidebarNavigationSubtitle from '../sidebar-navigation-subtitle'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js b/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js index 52491245770348..996e1c93773144 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js @@ -17,7 +17,7 @@ import { store as coreStore, useEntityRecord } from '@wordpress/core-data'; * Internal dependencies */ import StatusLabel from './status-label'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; // Taken from packages/editor/src/components/time-to-read/index.js. diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-pages/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-pages/index.js index 25979fcd4a036b..ac71e909a01bed 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-pages/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-pages/index.js @@ -23,7 +23,7 @@ import { useLink } from '../routes/link'; import SidebarNavigationItem from '../sidebar-navigation-item'; import SidebarButton from '../sidebar-button'; import AddNewPageModal from '../add-new-page'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-template-part/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-template-part/index.js index 1823b97594f522..0ced2bcd9f36bf 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-template-part/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-template-part/index.js @@ -15,7 +15,7 @@ import { store as coreStore } from '@wordpress/core-data'; */ import SidebarNavigationScreen from '../sidebar-navigation-screen'; import useEditedEntityRecord from '../use-edited-entity-record'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; import { useAddedBy } from '../list/added-by'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js index 03cc7ecbec75bf..ecc07deceed35f 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js @@ -15,7 +15,7 @@ import { store as coreStore } from '@wordpress/core-data'; */ import SidebarNavigationScreen from '../sidebar-navigation-screen'; import useEditedEntityRecord from '../use-edited-entity-record'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; import SidebarButton from '../sidebar-button'; import { useAddedBy } from '../list/added-by'; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/index.js b/packages/edit-site/src/components/sidebar-navigation-screen/index.js index ecdd6f712ac08e..d62d95d626a879 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen/index.js @@ -16,7 +16,7 @@ import { useSelect } from '@wordpress/data'; * Internal dependencies */ import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import SidebarButton from '../sidebar-button'; import { isPreviewingTheme, diff --git a/packages/edit-site/src/components/sidebar/index.js b/packages/edit-site/src/components/sidebar/index.js index c28a93d523dce8..7e5ede23cc1638 100644 --- a/packages/edit-site/src/components/sidebar/index.js +++ b/packages/edit-site/src/components/sidebar/index.js @@ -23,7 +23,7 @@ import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen- import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles'; import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse'; import SaveHub from '../save-hub'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages'; import SidebarNavigationScreenPage from '../sidebar-navigation-screen-page'; diff --git a/packages/edit-site/src/components/site-hub/index.js b/packages/edit-site/src/components/site-hub/index.js index 5ad6376b3006b0..5162091f91d428 100644 --- a/packages/edit-site/src/components/site-hub/index.js +++ b/packages/edit-site/src/components/site-hub/index.js @@ -27,7 +27,7 @@ import { store as commandsStore } from '@wordpress/commands'; */ import { store as editSiteStore } from '../../store'; import SiteIcon from '../site-icon'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const HUB_ANIMATION_DURATION = 0.3; diff --git a/packages/edit-site/src/components/style-book/index.js b/packages/edit-site/src/components/style-book/index.js index c86d6df65045a2..b6931b8e656653 100644 --- a/packages/edit-site/src/components/style-book/index.js +++ b/packages/edit-site/src/components/style-book/index.js @@ -36,7 +36,7 @@ import { ENTER, SPACE } from '@wordpress/keycodes'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; import EditorCanvasContainer from '../editor-canvas-container'; const { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock( diff --git a/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js b/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js index 4acd381fca85f0..510932d7c4f370 100644 --- a/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +++ b/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js @@ -10,7 +10,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; * Internal dependencies */ import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js b/packages/edit-site/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js index a541ec652fee86..735c80cdb531c6 100644 --- a/packages/edit-site/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +++ b/packages/edit-site/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js @@ -9,7 +9,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; * Internal dependencies */ import { store as editSiteStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation, useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js b/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js index 04cdef425716fd..93a6db650b6dc3 100644 --- a/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js +++ b/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js @@ -8,7 +8,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; /** * Internal dependencies */ -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useLocation, useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js b/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js index 4aef33ac2b1cfc..67953b293b2aaa 100644 --- a/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js +++ b/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js @@ -14,7 +14,7 @@ import { store as editSiteStore } from '../../store'; import useEditedEntityRecord from '../../components/use-edited-entity-record'; import isTemplateRemovable from '../../utils/is-template-removable'; import isTemplateRevertable from '../../utils/is-template-revertable'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useHistory } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js b/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js index 11a765b9807d66..d82f3a86847da9 100644 --- a/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js +++ b/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js @@ -27,7 +27,7 @@ import { store as noticesStore } from '@wordpress/notices'; * Internal dependencies */ import { useSupportedStyles } from '../../components/global-styles/hooks'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { GlobalStylesContext, useBlockEditingMode } = unlock( blockEditorPrivateApis diff --git a/packages/edit-site/src/hooks/template-part-edit.js b/packages/edit-site/src/hooks/template-part-edit.js index e59cf49acefc20..07fb717b85af18 100644 --- a/packages/edit-site/src/hooks/template-part-edit.js +++ b/packages/edit-site/src/hooks/template-part-edit.js @@ -14,7 +14,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; * Internal dependencies */ import { useLink } from '../components/routes/link'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; const { useLocation } = unlock( routerPrivateApis ); diff --git a/packages/edit-site/src/private-apis.js b/packages/edit-site/src/lock-unlock.js similarity index 100% rename from packages/edit-site/src/private-apis.js rename to packages/edit-site/src/lock-unlock.js diff --git a/packages/edit-site/src/store/index.js b/packages/edit-site/src/store/index.js index b2ef96d76a8e4c..dff8d41db828c2 100644 --- a/packages/edit-site/src/store/index.js +++ b/packages/edit-site/src/store/index.js @@ -12,7 +12,7 @@ import * as privateActions from './private-actions'; import * as selectors from './selectors'; import * as privateSelectors from './private-selectors'; import { STORE_NAME } from './constants'; -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; export const storeConfig = { reducer, diff --git a/packages/edit-site/src/utils/use-activate-theme.js b/packages/edit-site/src/utils/use-activate-theme.js index 68c5e183abc68c..966705a7722e48 100644 --- a/packages/edit-site/src/utils/use-activate-theme.js +++ b/packages/edit-site/src/utils/use-activate-theme.js @@ -6,7 +6,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; /** * Internal dependencies */ -import { unlock } from '../private-apis'; +import { unlock } from '../lock-unlock'; import { isPreviewingTheme, currentlyPreviewingTheme, diff --git a/packages/edit-widgets/src/components/header/index.js b/packages/edit-widgets/src/components/header/index.js index e2691f9c74c436..d6f12bff4d5235 100644 --- a/packages/edit-widgets/src/components/header/index.js +++ b/packages/edit-widgets/src/components/header/index.js @@ -23,7 +23,7 @@ import RedoButton from './undo-redo/redo'; import MoreMenu from '../more-menu'; import useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area'; import { store as editWidgetsStore } from '../../store'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-widgets/src/components/widget-areas-block-editor-provider/index.js b/packages/edit-widgets/src/components/widget-areas-block-editor-provider/index.js index 042cd0dc9c6177..dbfeb074cd994b 100644 --- a/packages/edit-widgets/src/components/widget-areas-block-editor-provider/index.js +++ b/packages/edit-widgets/src/components/widget-areas-block-editor-provider/index.js @@ -27,7 +27,7 @@ import { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils'; import useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area'; import { store as editWidgetsStore } from '../../store'; import { ALLOW_REUSABLE_BLOCKS } from '../../constants'; -import { unlock } from '../../private-apis'; +import { unlock } from '../../lock-unlock'; const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis ); diff --git a/packages/edit-widgets/src/private-apis.js b/packages/edit-widgets/src/lock-unlock.js similarity index 100% rename from packages/edit-widgets/src/private-apis.js rename to packages/edit-widgets/src/lock-unlock.js diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index 1cff19c7daae7f..9c212b0be8a8e0 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -19,7 +19,7 @@ import { store as noticesStore } from '@wordpress/notices'; import withRegistryProvider from './with-registry-provider'; import { store as editorStore } from '../../store'; import useBlockEditorSettings from './use-block-editor-settings'; -import { unlock } from '../../lockUnlock'; +import { unlock } from '../../lock-unlock'; const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis ); diff --git a/packages/editor/src/lockUnlock.js b/packages/editor/src/lock-unlock.js similarity index 100% rename from packages/editor/src/lockUnlock.js rename to packages/editor/src/lock-unlock.js diff --git a/packages/editor/src/private-apis.js b/packages/editor/src/private-apis.js index cdec27b0ab9021..b0c2ab86c8bf2e 100644 --- a/packages/editor/src/private-apis.js +++ b/packages/editor/src/private-apis.js @@ -2,7 +2,7 @@ * Internal dependencies */ import { ExperimentalEditorProvider } from './components/provider'; -import { lock } from './lockUnlock'; +import { lock } from './lock-unlock'; import { EntitiesSavedStatesExtensible } from './components/entities-saved-states'; export const privateApis = {}; diff --git a/packages/private-apis/README.md b/packages/private-apis/README.md index 828663dc760de6..9faaada8532003 100644 --- a/packages/private-apis/README.md +++ b/packages/private-apis/README.md @@ -56,7 +56,7 @@ Use `lock()` and `unlock()` to privately distribute the `__experimental` APIs ac ```js // In packages/package1/index.js: -import { lock } from './private-apis'; +import { lock } from './lock-unlock'; export const privateApis = {}; /* Attach private data to the exported object */ @@ -66,7 +66,7 @@ lock( privateApis, { // In packages/package2/index.js: import { privateApis } from '@wordpress/package1'; -import { unlock } from './private-apis'; +import { unlock } from './lock-unlock'; const { __experimentalFunction } = unlock( privateApis ); ``` diff --git a/packages/router/src/lock-unlock.js b/packages/router/src/lock-unlock.js new file mode 100644 index 00000000000000..d148f785fe9442 --- /dev/null +++ b/packages/router/src/lock-unlock.js @@ -0,0 +1,10 @@ +/** + * WordPress dependencies + */ +import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; + +export const { lock, unlock } = + __dangerousOptInToUnstableAPIsOnlyForCoreModules( + 'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', + '@wordpress/router' + ); diff --git a/packages/router/src/private-apis.js b/packages/router/src/private-apis.js index e3c465502369bb..7b2945a24ab1a1 100644 --- a/packages/router/src/private-apis.js +++ b/packages/router/src/private-apis.js @@ -1,18 +1,8 @@ -/** - * WordPress dependencies - */ -import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; - /** * Internal dependencies */ import { useHistory, useLocation, RouterProvider } from './router'; - -export const { lock, unlock } = - __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', - '@wordpress/router' - ); +import { lock } from './lock-unlock'; export const privateApis = {}; lock( privateApis, {