import { i18n } from '@kbn/i18n' ; import { EmbeddableFactoryDefinition , EmbeddableInput , IContainer , } from '../../../services/embeddable' ; import { PlaceholderEmbeddable , PlaceholderEmbeddableServices , PLACEHOLDER_EMBEDDABLE , } from './placeholder_embeddable' ; export class PlaceholderEmbeddableFactory implements EmbeddableFactoryDefinition { public readonly type = PLACEHOLDER_EMBEDDABLE ; constructor ( private readonly getStartServices ) { } public async isEditable ( ) { return false ; } public canCreateNew ( ) { return false ; } public async create ( initialInput , parent ? ) { const services = await this . getStartServices ( ) ; return new PlaceholderEmbeddable ( initialInput , services , parent ) ; } public getDisplayName ( ) { return i18n . translate ( 'dashboard.placeholder.factory.displayName' , { defaultMessage : 'placeholder' , } ) ; } }