techdocs: hide Router emptyState prop in non-alpha public api

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2024-09-16 12:08:06 +01:00
parent 0e9dbf8d64
commit 7120d77a33
4 changed files with 22 additions and 20 deletions
+11 -5
View File
@@ -56,11 +56,6 @@ export const Router = () => {
);
};
/**
* Responsible for registering route to view docs on Entity page
*
* @public
*/
export const EmbeddedDocsRouter = (
props: PropsWithChildren<{ emptyState?: React.ReactElement }>,
) => {
@@ -95,3 +90,14 @@ export const EmbeddedDocsRouter = (
return element;
};
/**
* Responsible for registering route to view docs on Entity page
*
* @public
*/
export const LegacyEmbeddedDocsRouter = (props: PropsWithChildren<{}>) => {
// Wrap the Router to avoid exposing the emptyState prop in the non-alpha
// public API and make it easier for us to change later.
return <EmbeddedDocsRouter children={props.children} />;
};
+5 -1
View File
@@ -41,7 +41,11 @@ export {
techdocsPlugin as plugin,
techdocsPlugin,
} from './plugin';
export * from './Router';
export {
isTechDocsAvailable,
LegacyEmbeddedDocsRouter as EmbeddedDocsRouter,
Router,
} from './Router';
export type { TechDocsSearchResultListItemProps } from './search/components/TechDocsSearchResultListItem';
+1 -1
View File
@@ -103,7 +103,7 @@ export const TechdocsPage = techdocsPlugin.provide(
export const EntityTechdocsContent = techdocsPlugin.provide(
createRoutableExtension({
name: 'EntityTechdocsContent',
component: () => import('./Router').then(m => m.EmbeddedDocsRouter),
component: () => import('./Router').then(m => m.LegacyEmbeddedDocsRouter),
mountPoint: rootCatalogDocsRouteRef,
}),
);