diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 056971aa5e98..c9c37108acef 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -49,7 +49,7 @@ pageLoadAssetSize: lists: 202261 logstash: 53548 management: 46112 - maps: 183610 + maps: 80000 mapsLegacy: 87859 mapsLegacyLicensing: 20214 ml: 82187 diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.tsx index ef67501ec761..1e368b2eb536 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.tsx @@ -24,7 +24,7 @@ import { import { useLayerList } from './useLayerList'; import { useUrlParams } from '../../../../context/url_params_context/use_url_params'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; -import { RenderTooltipContentParams } from '../../../../../../maps/public'; +import type { RenderTooltipContentParams } from '../../../../../../maps/public'; import { MapToolTip } from './MapToolTip'; import { useMapFilters } from './useMapFilters'; import { EmbeddableStart } from '../../../../../../../../src/plugins/embeddable/public'; diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.tsx index 7e6c8ddd493b..7501d5bfaa2c 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.tsx @@ -20,7 +20,7 @@ import { TRANSACTION_DURATION_COUNTRY, TRANSACTION_DURATION_REGION, } from './useLayerList'; -import { RenderTooltipContentParams } from '../../../../../../maps/public'; +import type { RenderTooltipContentParams } from '../../../../../../maps/public'; import { I18LABELS } from '../translations'; type MapToolTipProps = Partial; diff --git a/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts b/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts index 5f81a74ab03c..a8bc5b9a821f 100644 --- a/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts +++ b/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts @@ -7,7 +7,7 @@ import _ from 'lodash'; import { Filter } from '../../../../../../src/plugins/data/public'; -import { TooltipFeature } from '../../../../../plugins/maps/common/descriptor_types'; +import type { TooltipFeature } from '../../../../../plugins/maps/common/descriptor_types'; export interface ITooltipProperty { getPropertyKey(): string; diff --git a/x-pack/plugins/maps/public/embeddable/map_embeddable_factory.ts b/x-pack/plugins/maps/public/embeddable/map_embeddable_factory.ts index b1944f813670..a4ce76b702d1 100644 --- a/x-pack/plugins/maps/public/embeddable/map_embeddable_factory.ts +++ b/x-pack/plugins/maps/public/embeddable/map_embeddable_factory.ts @@ -11,7 +11,6 @@ import { EmbeddableFactoryDefinition, IContainer, } from '../../../../../src/plugins/embeddable/public'; -import '../index.scss'; import { MAP_SAVED_OBJECT_TYPE, APP_ICON } from '../../common/constants'; import { getMapEmbeddableDisplayName } from '../../common/i18n_getters'; import { MapByReferenceInput, MapEmbeddableInput, MapByValueInput } from './types'; diff --git a/x-pack/plugins/maps/public/index.ts b/x-pack/plugins/maps/public/index.ts index 3e6cd8d14ad3..dc9cb2d594fe 100644 --- a/x-pack/plugins/maps/public/index.ts +++ b/x-pack/plugins/maps/public/index.ts @@ -19,6 +19,8 @@ export const plugin: PluginInitializer = ( export { MAP_SAVED_OBJECT_TYPE } from '../common/constants'; -export { RenderTooltipContentParams } from './classes/tooltips/tooltip_property'; +export type { RenderTooltipContentParams } from './classes/tooltips/tooltip_property'; export { MapsStartApi } from './api'; + +export type { MapEmbeddable, MapEmbeddableInput } from './embeddable'; diff --git a/x-pack/plugins/maps/public/kibana_services.ts b/x-pack/plugins/maps/public/kibana_services.ts index 6fd14d8d42e1..e4b9397fab8e 100644 --- a/x-pack/plugins/maps/public/kibana_services.ts +++ b/x-pack/plugins/maps/public/kibana_services.ts @@ -5,13 +5,12 @@ * 2.0. */ -import _ from 'lodash'; -import { CoreStart } from 'kibana/public'; +import type { CoreStart } from 'kibana/public'; import type { MapsEmsConfig } from '../../../../src/plugins/maps_ems/public'; -import { MapsConfigType } from '../config'; -import { MapsPluginStartDependencies } from './plugin'; -import { EMSSettings } from '../common/ems_settings'; -import { PaletteRegistry } from '../../../../src/plugins/charts/public'; +import type { MapsConfigType } from '../config'; +import type { MapsPluginStartDependencies } from './plugin'; +import type { EMSSettings } from '../common/ems_settings'; +import type { PaletteRegistry } from '../../../../src/plugins/charts/public'; let kibanaVersion: string; export const setKibanaVersion = (version: string) => (kibanaVersion = version); @@ -75,8 +74,22 @@ export const getEMSSettings = () => { export const getEmsTileLayerId = () => getKibanaCommonConfig().emsTileLayerId; -export const getRegionmapLayers = () => _.get(getKibanaCommonConfig(), 'regionmap.layers', []); -export const getTilemap = () => _.get(getKibanaCommonConfig(), 'tilemap', []); +export const getRegionmapLayers = () => { + const config = getKibanaCommonConfig(); + if (config.regionmap && config.regionmap.layers) { + return config.regionmap.layers; + } else { + return []; + } +}; +export const getTilemap = () => { + const config = getKibanaCommonConfig(); + if (config.tilemap) { + return config.tilemap; + } else { + return {}; + } +}; export const getShareService = () => pluginsStart.share; diff --git a/x-pack/plugins/maps/public/lazy_load_bundle/lazy/index.ts b/x-pack/plugins/maps/public/lazy_load_bundle/lazy/index.ts index 0d908356b714..85b58da0ab09 100644 --- a/x-pack/plugins/maps/public/lazy_load_bundle/lazy/index.ts +++ b/x-pack/plugins/maps/public/lazy_load_bundle/lazy/index.ts @@ -5,6 +5,7 @@ * 2.0. */ +import '../../index.scss'; export * from '../../embeddable/map_embeddable'; export * from '../../kibana_services'; export { renderApp } from '../../render_app'; diff --git a/x-pack/plugins/maps/public/maps_vis_type_alias.ts b/x-pack/plugins/maps/public/maps_vis_type_alias.ts index a3a8b55745d8..194b4595c0c9 100644 --- a/x-pack/plugins/maps/public/maps_vis_type_alias.ts +++ b/x-pack/plugins/maps/public/maps_vis_type_alias.ts @@ -6,12 +6,12 @@ */ import { i18n } from '@kbn/i18n'; -import { +import type { VisualizationsSetup, VisualizationStage, } from '../../../../src/plugins/visualizations/public'; -import { SavedObject } from '../../../../src/core/types/saved_objects'; -import { MapSavedObject } from '../common/map_saved_object_type'; +import type { SavedObject } from '../../../../src/core/types/saved_objects'; +import type { MapSavedObject } from '../common/map_saved_object_type'; import { APP_ID, APP_ICON, diff --git a/x-pack/plugins/maps/public/plugin.ts b/x-pack/plugins/maps/public/plugin.ts index be2e097c71dc..7ddab6bf509f 100644 --- a/x-pack/plugins/maps/public/plugin.ts +++ b/x-pack/plugins/maps/public/plugin.ts @@ -5,19 +5,19 @@ * 2.0. */ -import { Setup as InspectorSetupContract } from 'src/plugins/inspector/public'; -import { UiActionsStart } from 'src/plugins/ui_actions/public'; -import { NavigationPublicPluginStart } from 'src/plugins/navigation/public'; -import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; -import { DashboardStart } from 'src/plugins/dashboard/public'; -import { +import type { Setup as InspectorSetupContract } from 'src/plugins/inspector/public'; +import type { UiActionsStart } from 'src/plugins/ui_actions/public'; +import type { NavigationPublicPluginStart } from 'src/plugins/navigation/public'; +import type { Start as InspectorStartContract } from 'src/plugins/inspector/public'; +import type { DashboardStart } from 'src/plugins/dashboard/public'; +import type { AppMountParameters, CoreSetup, CoreStart, Plugin, PluginInitializerContext, - DEFAULT_APP_CATEGORIES, } from '../../../../src/core/public'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; // @ts-ignore import { MapView } from './inspector/views/map_view'; import { @@ -29,8 +29,8 @@ import { } from './kibana_services'; import { featureCatalogueEntry } from './feature_catalogue_entry'; import { getMapsVisTypeAlias } from './maps_vis_type_alias'; -import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; -import { +import type { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; +import type { VisualizationsSetup, VisualizationsStart, } from '../../../../src/plugins/visualizations/public'; @@ -43,28 +43,27 @@ import { } from './url_generator'; import { visualizeGeoFieldAction } from './trigger_actions/visualize_geo_field_action'; import { MapEmbeddableFactory } from './embeddable/map_embeddable_factory'; -import { EmbeddableSetup } from '../../../../src/plugins/embeddable/public'; +import type { EmbeddableSetup, EmbeddableStart } from '../../../../src/plugins/embeddable/public'; import { MapsXPackConfig, MapsConfigType } from '../config'; import { getAppTitle } from '../common/i18n_getters'; import { lazyLoadMapModules } from './lazy_load_bundle'; import { MapsStartApi } from './api'; import { createLayerDescriptors, registerLayerWizard, registerSource } from './api'; -import { SharePluginSetup, SharePluginStart } from '../../../../src/plugins/share/public'; -import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import type { SharePluginSetup, SharePluginStart } from '../../../../src/plugins/share/public'; import type { MapsEmsPluginSetup } from '../../../../src/plugins/maps_ems/public'; -import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; -import { LicensingPluginSetup, LicensingPluginStart } from '../../licensing/public'; -import { FileUploadPluginStart } from '../../file_upload/public'; -import { SavedObjectsStart } from '../../../../src/plugins/saved_objects/public'; -import { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public'; +import type { DataPublicPluginStart } from '../../../../src/plugins/data/public'; +import type { LicensingPluginSetup, LicensingPluginStart } from '../../licensing/public'; +import type { FileUploadPluginStart } from '../../file_upload/public'; +import type { SavedObjectsStart } from '../../../../src/plugins/saved_objects/public'; +import type { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public'; import { getIsEnterprisePlus, registerLicensedFeatures, setLicensingPluginStart, } from './licensed_features'; import { EMSSettings } from '../common/ems_settings'; -import { SavedObjectTaggingPluginStart } from '../../saved_objects_tagging/public'; -import { ChartsPluginStart } from '../../../../src/plugins/charts/public'; +import type { SavedObjectTaggingPluginStart } from '../../saved_objects_tagging/public'; +import type { ChartsPluginStart } from '../../../../src/plugins/charts/public'; export interface MapsPluginSetupDependencies { inspector: InspectorSetupContract; diff --git a/x-pack/plugins/maps/public/url_generator.ts b/x-pack/plugins/maps/public/url_generator.ts index c82af369fe11..9f28b388c475 100644 --- a/x-pack/plugins/maps/public/url_generator.ts +++ b/x-pack/plugins/maps/public/url_generator.ts @@ -6,17 +6,17 @@ */ import rison from 'rison-node'; -import { +import type { TimeRange, Filter, Query, - esFilters, QueryState, RefreshInterval, } from '../../../../src/plugins/data/public'; +import { esFilters } from '../../../../src/plugins/data/public'; import { setStateToKbnUrl } from '../../../../src/plugins/kibana_utils/public'; -import { UrlGeneratorsDefinition } from '../../../../src/plugins/share/public'; -import { LayerDescriptor } from '../common/descriptor_types'; +import type { UrlGeneratorsDefinition } from '../../../../src/plugins/share/public'; +import type { LayerDescriptor } from '../common/descriptor_types'; import { INITIAL_LAYERS_KEY } from '../common/constants'; import { lazyLoadMapModules } from './lazy_load_bundle'; diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx index eceea1de4edc..297746fd2363 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx @@ -12,15 +12,11 @@ import minimatch from 'minimatch'; import { IndexPatternMapping } from './types'; import { getLayerList } from './map_config'; import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/public'; -import { +import type { + RenderTooltipContentParams, MapEmbeddable, MapEmbeddableInput, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from '../../../../../../plugins/maps/public/embeddable'; -import { - RenderTooltipContentParams, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from '../../../../../../plugins/maps/public/classes/tooltips/tooltip_property'; +} from '../../../../../../plugins/maps/public'; import * as i18n from './translations'; import { Query, Filter } from '../../../../../../../src/plugins/data/public'; import { diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/types.ts b/x-pack/plugins/security_solution/public/network/components/embeddables/types.ts index 7d9c66261924..6317cad7f8d9 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/types.ts +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/types.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { RenderTooltipContentParams } from '../../../../../maps/public/classes/tooltips/tooltip_property'; +import type { RenderTooltipContentParams } from '../../../../../maps/public'; export interface IndexPatternMapping { title: string; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/embedded_map.tsx index f2da38091e37..6706a435c7b6 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/embedded_map.tsx @@ -26,7 +26,7 @@ import { import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../maps/public'; import { MapToolTipComponent } from './map_tool_tip'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { RenderTooltipContentParams } from '../../../../../../../maps/public/classes/tooltips/tooltip_property'; +import type { RenderTooltipContentParams } from '../../../../../../../maps/public/classes/tooltips/tooltip_property'; export interface EmbeddedMapProps { upPoints: LocationPoint[]; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/map_tool_tip.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/map_tool_tip.tsx index f2d1227fe870..c03ed94f8c54 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/map_tool_tip.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/location_map/embeddables/map_tool_tip.tsx @@ -22,8 +22,7 @@ import { AppState } from '../../../../../state'; import { monitorLocationsSelector } from '../../../../../state/selectors'; import { useMonitorId } from '../../../../../hooks'; import { MonitorLocation } from '../../../../../../common/runtime_types/monitor'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { RenderTooltipContentParams } from '../../../../../../../maps/public/classes/tooltips/tooltip_property'; +import type { RenderTooltipContentParams } from '../../../../../../../maps/public'; import { formatAvailabilityValue } from '../../availability_reporting/availability_reporting'; import { LastCheckLabel } from '../../translations';