@@ -18,7 +18,6 @@ export interface SceneObjectStatePlain {
18
18
key ?: string ;
19
19
$timeRange ?: SceneTimeRangeLike ;
20
20
$data ?: SceneDataProvider ;
21
- $editor ?: SceneEditor ;
22
21
$variables ?: SceneVariables ;
23
22
}
24
23
@@ -43,10 +42,15 @@ export interface SceneLayoutChildOptions {
43
42
44
43
export interface SceneComponentProps < T > {
45
44
model : T ;
46
- isEditing ?: boolean ;
47
45
}
48
46
49
- export type SceneComponent < TModel > = React . FunctionComponent < SceneComponentProps < TModel > > ;
47
+ export interface SceneComponentWrapperProps {
48
+ model : SceneObject ;
49
+ children : React . ReactNode ;
50
+ }
51
+
52
+ export type SceneComponent < TModel > = ( props : SceneComponentProps < TModel > ) => React . ReactElement | null ;
53
+ export type SceneComponentCustomWrapper = ( props : SceneComponentWrapperProps ) => React . ReactElement | null ;
50
54
51
55
export interface SceneDataState extends SceneObjectStatePlain {
52
56
data ?: PanelData ;
@@ -68,6 +72,9 @@ export interface SceneObject<TState extends SceneObjectState = SceneObjectState>
68
72
/** This abstraction declares URL sync dependencies of a scene object. **/
69
73
readonly urlSync ?: SceneObjectUrlSyncHandler < TState > ;
70
74
75
+ /** Component wrapper, can be used to for edit modes, to wrap some objecs in an edit wrappers */
76
+ readonly componentWrapper ?: SceneComponentCustomWrapper ;
77
+
71
78
/** Subscribe to state changes */
72
79
subscribeToState ( handler : SceneStateChangedHandler < TState > ) : Unsubscribable ;
73
80
@@ -103,9 +110,6 @@ export interface SceneObject<TState extends SceneObjectState = SceneObjectState>
103
110
/** A React component to use for rendering the object */
104
111
Component ( props : SceneComponentProps < SceneObject < TState > > ) : React . ReactElement | null ;
105
112
106
- /** To be replaced by declarative method */
107
- Editor ( props : SceneComponentProps < SceneObject < TState > > ) : React . ReactElement | null ;
108
-
109
113
/** Force a re-render, should only be needed when variable values change */
110
114
forceRender ( ) : void ;
111
115
@@ -131,24 +135,6 @@ export interface SceneLayout<T extends SceneLayoutState = SceneLayoutState> exte
131
135
getDragClassCancel ?( ) : string ;
132
136
}
133
137
134
- export interface SceneEditorState extends SceneObjectStatePlain {
135
- hoverObject ?: SceneObjectRef ;
136
- selectedObject ?: SceneObjectRef ;
137
- }
138
-
139
- export interface SceneEditor extends SceneObject < SceneEditorState > {
140
- onMouseEnterObject ( model : SceneObject ) : void ;
141
- onMouseLeaveObject ( model : SceneObject ) : void ;
142
- onSelectObject ( model : SceneObject ) : void ;
143
- getEditComponentWrapper ( ) : React . ComponentType < SceneComponentEditWrapperProps > ;
144
- }
145
-
146
- interface SceneComponentEditWrapperProps {
147
- editor : SceneEditor ;
148
- model : SceneObject ;
149
- children : React . ReactNode ;
150
- }
151
-
152
138
export interface SceneTimeRangeState extends SceneObjectStatePlain {
153
139
from : string ;
154
140
to : string ;
0 commit comments