@@ -23,7 +23,10 @@ import { IContainer } from '../containers';
2323import { IEmbeddable , EmbeddableInput , EmbeddableOutput } from './i_embeddable' ;
2424import { ViewMode } from '../types' ;
2525import { EmbeddableActionStorage } from './embeddable_action_storage' ;
26- import { UiActionsStart } from '../ui_actions' ;
26+ import {
27+ UiActionsStart ,
28+ UiActionsDynamicActionManager ,
29+ } from '../../../../../plugins/ui_actions/public' ;
2730
2831function getPanelTitle ( input : EmbeddableInput , output : EmbeddableOutput ) {
2932 return input . hidePanelTitles ? '' : input . title === undefined ? output . defaultTitle : input . title ;
@@ -55,9 +58,18 @@ export abstract class Embeddable<
5558 // TODO: Rename to destroyed.
5659 private destoyed : boolean = false ;
5760
58- private __actionStorage ?: EmbeddableActionStorage ;
59- public get actionStorage ( ) : EmbeddableActionStorage {
60- return this . __actionStorage || ( this . __actionStorage = new EmbeddableActionStorage ( this ) ) ;
61+ private __dynamicActions ?: UiActionsDynamicActionManager ;
62+ public get dynamicActions ( ) : UiActionsDynamicActionManager | undefined {
63+ if ( ! this . params . uiActions ) return undefined ;
64+ if ( ! this . __dynamicActions ) {
65+ this . __dynamicActions = new UiActionsDynamicActionManager ( {
66+ isCompatible : async ( ) => true ,
67+ storage : new EmbeddableActionStorage ( this ) ,
68+ uiActions : this . params . uiActions ,
69+ } ) ;
70+ }
71+
72+ return this . __dynamicActions ;
6173 }
6274
6375 constructor (
@@ -66,6 +78,7 @@ export abstract class Embeddable<
6678 parent ?: IContainer ,
6779 public readonly params : EmbeddableParams = { }
6880 ) {
81+ window . emb = this ;
6982 this . id = input . id ;
7083 this . output = {
7184 title : getPanelTitle ( input , output ) ,
@@ -89,6 +102,10 @@ export abstract class Embeddable<
89102 this . onResetInput ( newInput ) ;
90103 } ) ;
91104 }
105+
106+ if ( this . dynamicActions ) {
107+ this . dynamicActions . start ( ) ;
108+ }
92109 }
93110
94111 public getIsContainer ( ) : this is IContainer {
0 commit comments