kibana/examples/embeddable_examples/public/app/setup_app.ts
Nathan Reese 32c9913c2f
[embeddables] state management example (#192587)
Extend embeddable examples with a state management example. PR also
refactors embeddable examples to use side nav instead of tabs.

<img width="800" alt="Screenshot 2024-09-11 at 8 38 28 AM"
src="https://github.com/user-attachments/assets/ac46600f-2c45-4f9e-b4f8-a5c03f4eef2f">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-12 09:50:27 -06:00

33 lines
1.3 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { AppMountParameters, CoreSetup } from '@kbn/core/public';
import { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public';
import type { StartDeps } from '../plugin';
const APP_ID = 'embeddablesApp';
const title = 'Embeddables';
export function setupApp(core: CoreSetup<StartDeps>, developerExamples: DeveloperExamplesSetup) {
core.application.register({
id: APP_ID,
title,
visibleIn: [],
async mount(mountParams: AppMountParameters) {
const { renderApp } = await import('./app');
const [coreStart, deps] = await core.getStartServices();
return renderApp(coreStart, deps, mountParams);
},
});
developerExamples.register({
appId: APP_ID,
title,
description: `Learn how to create new embeddable types and use embeddables in your application.`,
});
}