docusaurus/packages/docusaurus-theme-common/src/internal.ts
Sébastien Lorber 59e9eb20fa
Some checks are pending
Argos CI / take-screenshots (push) Waiting to run
Build Hash Router / Build Hash Router (push) Waiting to run
Canary Release / Publish Canary (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Continuous Releases / Continuous Releases (push) Waiting to run
E2E Tests / E2E — Yarn v1 (18.0) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (20) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (22) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -st) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -st) (push) Waiting to run
E2E Tests / E2E — npm (push) Waiting to run
E2E Tests / E2E — pnpm (push) Waiting to run
fix(theme): restore former code block theme-common internal APIs (#11153)
Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-05-06 11:34:19 +02:00

112 lines
3.2 KiB
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// This re-export permits to handle some level of retro-compatibility. Users
// might swizzle unsafe components and expose these internal imports. When we
// move an API from internal to public, former internal imports should keep
// working, so that the change doesn't become breaking.
//
// Important: this line is removed from build output with the
// "removeThemeInternalReexport" script for CI checks. This ensures that none of
// our internal code relies on this re-export and that we don't forget to
// migrate theme internal imports to public imports.
//
// eslint-disable-next-line no-restricted-syntax
export * from './index';
export {
AnnouncementBarProvider,
useAnnouncementBar,
} from './contexts/announcementBar';
export {useTabs, sanitizeTabsChildren} from './utils/tabsUtils';
export type {TabValue, TabsProps, TabItemProps} from './utils/tabsUtils';
export {useNavbarMobileSidebar} from './contexts/navbarMobileSidebar';
export {useNavbarSecondaryMenu} from './contexts/navbarSecondaryMenu/display';
export {ColorModeProvider} from './contexts/colorMode';
export {useAlternatePageUtils} from './utils/useAlternatePageUtils';
export {
type CodeBlockMetadata,
createCodeBlockMetadata,
getPrismCssVariables,
CodeBlockContextProvider,
useCodeBlockContext,
// TODO Docusaurus v4: remove, only kept for internal retro-compatibility
// See https://github.com/facebook/docusaurus/pull/11153
parseCodeBlockTitle,
parseClassNameLanguage as parseLanguage,
parseLines,
getLineNumbersStart,
containsLineNumbers,
} from './utils/codeBlockUtils';
export {DEFAULT_SEARCH_TAG} from './utils/searchUtils';
export {
TitleFormatterProvider,
useTitleFormatter,
} from './utils/titleFormatterUtils';
export {useLocationChange} from './utils/useLocationChange';
export {useLocalPathname} from './utils/useLocalPathname';
export {
useHistoryPopHandler,
useHistorySelector,
useQueryStringValue,
} from './utils/historyUtils';
export {
useFilteredAndTreeifiedTOC,
useTreeifiedTOC,
type TOCTreeNode,
} from './utils/tocUtils';
export {
ScrollControllerProvider,
useScrollController,
useScrollPosition,
useScrollPositionBlocker,
useSmoothScrollTo,
} from './utils/scrollUtils';
export {useHomePageRoute, isSamePath} from './utils/routesUtils';
export {PluginHtmlClassNameProvider} from './utils/metadataUtils';
export {splitNavbarItems, NavbarProvider} from './utils/navbarUtils';
export {
useTOCHighlight,
type TOCHighlightConfig,
} from './hooks/useTOCHighlight';
export {useDateTimeFormat} from './utils/IntlUtils';
export {useHideableNavbar} from './hooks/useHideableNavbar';
export {
useKeyboardNavigation,
keyboardFocusedClassName,
} from './hooks/useKeyboardNavigation';
export {useLockBodyScroll} from './hooks/useLockBodyScroll';
export {useCodeWordWrap} from './hooks/useCodeWordWrap';
export {useBackToTopButton} from './hooks/useBackToTopButton';
export {
useBlogTagsPostsPageTitle,
useBlogAuthorPageTitle,
translateBlogAuthorsListPageTitle,
BlogAuthorsListViewAllLabel,
BlogAuthorNoPostsLabel,
} from './translations/blogTranslations';