diff --git a/src/core/common/index.ts b/src/core/common/index.ts new file mode 100644 index 0000000000000..51230cbbb6f78 --- /dev/null +++ b/src/core/common/index.ts @@ -0,0 +1,13 @@ +/* + * 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 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 or the Server + * Side Public License, v 1. + */ + +/** + * The class name for top level *and* nested application wrappers to ensure proper layout + * @public + */ +export const APP_WRAPPER_CLASS = 'kbnAppWrapper'; diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 9feb518bd8844..ca432d6b8269f 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -195,7 +195,6 @@ export type { DeprecationsServiceStart, ResolveDeprecationResponse } from './dep export type { MountPoint, UnmountCallback, PublicUiSettingsParams } from './types'; export { URL_MAX_LENGTH } from './core_app'; -export { APP_WRAPPER_CLASS } from './rendering'; /** * Core services exposed to the `Plugin` setup lifecycle diff --git a/src/core/public/rendering/app_containers.tsx b/src/core/public/rendering/app_containers.tsx index db97c69f1b02f..dfd5180d370ad 100644 --- a/src/core/public/rendering/app_containers.tsx +++ b/src/core/public/rendering/app_containers.tsx @@ -10,12 +10,7 @@ import React from 'react'; import { Observable } from 'rxjs'; import useObservable from 'react-use/lib/useObservable'; import classNames from 'classnames'; - -/** - * The class name for top level *and* nested application wrappers to ensure proper layout - * @public - */ -export const APP_WRAPPER_CLASS = 'kbnAppWrapper'; +import { APP_WRAPPER_CLASS } from '../../common'; export const AppWrapper: React.FunctionComponent<{ chromeVisible$: Observable; diff --git a/src/core/public/rendering/index.ts b/src/core/public/rendering/index.ts index 0944de5f6022c..37315635220ee 100644 --- a/src/core/public/rendering/index.ts +++ b/src/core/public/rendering/index.ts @@ -7,4 +7,3 @@ */ export { RenderingService } from './rendering_service'; -export { APP_WRAPPER_CLASS } from './app_containers'; diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 87d02e1e49669..2c6fa74cb54a0 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -536,8 +536,6 @@ export type { PluginOpaqueId, }; -export { APP_WRAPPER_CLASS } from '../public/rendering'; - /** * Config schemas for the platform services. * diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 855962070457e..1b9d786beaf55 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -9,6 +9,7 @@ "isolatedModules": true, }, "include": [ + "common/**/*", "public/**/*", "server/**/*", "types/**/*", diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index d97d873fdadd3..9be6f7668240a 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -12,6 +12,7 @@ import { filter, map } from 'rxjs/operators'; import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { UrlForwardingSetup, UrlForwardingStart } from 'src/plugins/url_forwarding/public'; +import { APP_WRAPPER_CLASS } from '../../../core/common'; import { App, Plugin, @@ -23,7 +24,6 @@ import { DEFAULT_APP_CATEGORIES, PluginInitializerContext, SavedObjectsClientContract, - APP_WRAPPER_CLASS, } from '../../../core/public'; import { createKbnUrlTracker } from './services/kibana_utils'; diff --git a/x-pack/plugins/reporting/server/lib/screenshots/constants.ts b/x-pack/plugins/reporting/server/lib/screenshots/constants.ts index 8d3a415e517e0..06f2cc5dffdfa 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/constants.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/constants.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { APP_WRAPPER_CLASS } from '../../../../../../src/core/server'; +import { APP_WRAPPER_CLASS } from '../../../../../../src/core/common'; export const DEFAULT_PAGELOAD_SELECTOR = `.${APP_WRAPPER_CLASS}`; export const CONTEXT_GETNUMBEROFITEMS = 'GetNumberOfItems'; diff --git a/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts b/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts index 86f79823dba21..3365510d87891 100644 --- a/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts +++ b/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts @@ -7,6 +7,7 @@ import { i18n } from '@kbn/i18n'; import { ReportingCore } from '../..'; +import { APP_WRAPPER_CLASS } from '../../../../../../src/core/common'; import { API_DIAGNOSE_URL } from '../../../common/constants'; import { omitBlockedHeaders } from '../../export_types/common'; import { getAbsoluteUrlFactory } from '../../export_types/common/get_absolute_url'; @@ -14,7 +15,6 @@ import { generatePngObservableFactory } from '../../export_types/png/lib/generat import { LevelLogger as Logger } from '../../lib'; import { authorizedUserPreRoutingFactory } from '../lib/authorized_user_pre_routing'; import { DiagnosticResponse } from './'; -import { APP_WRAPPER_CLASS } from '../../../../../../src/core/server'; export const registerDiagnoseScreenshot = (reporting: ReportingCore, logger: Logger) => { const setupDeps = reporting.getPluginSetupDeps();