@grafana/scenes-react 5.25.1--canary.967.11837797508.0 → 5.25.1--canary.858.11930656504.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -91,7 +91,7 @@
91
91
 
92
92
  #### UrlSync: Support browser history steps, remove singleton ([#878](https://github.com/grafana/scenes/pull/878))
93
93
 
94
- getUrlSyncManager is no longer exported as UrlSyncManager is now no longer global singleton but local to the UrlSyncContextProvider.
94
+ getUrlSyncManager is no longer exported as UrlSyncManager is now no longer global singleton but local to the UrlSyncContextProvider.
95
95
  If you called getUrlSyncManager().getUrlState that util function is available via the exported object sceneUtils.
96
96
 
97
97
  ---
@@ -239,4 +239,4 @@ If you called getUrlSyncManager().getUrlState that util function is available vi
239
239
 
240
240
  ---
241
241
 
242
- Work in progress
242
+ Work in progress
@@ -1 +1 @@
1
- {"version":3,"file":"DataSourceVariable.js","sources":["../../../src/variables/DataSourceVariable.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { DataSourceVariable as DataSourceVariableObject } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\n\nexport interface DataSourceVariableProps extends VariableProps {\n pluginId: string;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function DataSourceVariable({\n pluginId,\n regex,\n name,\n label,\n hide,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: DataSourceVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: DataSourceVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new DataSourceVariableObject({ \n pluginId,\n regex,\n name,\n label,\n value: initialValue, \n isMulti,\n hide, \n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n variable.state.pluginId === pluginId &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll\n ) {\n return;\n }\n\n variable.setState({\n pluginId,\n regex,\n label,\n hide, \n includeAll,\n })\n\n variable.refreshOptions();\n }, [hide, includeAll, label, pluginId, regex, variable, variableAdded])\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n"],"names":["DataSourceVariableObject"],"mappings":";;;;AAgBO,SAAS,kBAAmB,CAAA;AAAA,EACjC,QAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AACF,CAA6C,EAAA;AAC3C,EAAA,MAAM,QAAQ,eAAgB,EAAA,CAAA;AAC9B,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAkB,EAAA,CAAA;AAE5D,EAAI,IAAA,QAAA,GAAiD,KAAM,CAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AAE5E,EAAA,IAAI,CAAC,QAAU,EAAA;AACb,IAAA,QAAA,GAAW,IAAIA,oBAAyB,CAAA;AAAA,MACtC,QAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAO,EAAA,YAAA;AAAA,MACP,OAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,KACA,CAAA,CAAA;AAAA,GACJ;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,QAAA,GAAW,KAAM,CAAA,WAAA,CAAY,QAAQ,CAAA,CAAA;AAC3C,IAAA,gBAAA,CAAiB,IAAI,CAAA,CAAA;AACrB,IAAO,OAAA,QAAA,CAAA;AAAA,GACN,EAAA,CAAC,QAAU,EAAA,KAAA,EAAO,IAAI,CAAC,CAAA,CAAA;AAE1B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,aAAe,EAAA;AAClB,MAAA,OAAA;AAAA,KACF;AAEA,IAAA,IACE,SAAS,KAAM,CAAA,QAAA,KAAc,YAC7B,QAAS,CAAA,KAAA,CAAM,UAAU,KACzB,IAAA,QAAA,CAAS,MAAM,KAAU,KAAA,KAAA,IACzB,SAAS,KAAM,CAAA,IAAA,KAAS,QACxB,QAAS,CAAA,KAAA,CAAM,eAAe,UAC9B,EAAA;AACA,MAAA,OAAA;AAAA,KACF;AAEA,IAAA,QAAA,CAAS,QAAS,CAAA;AAAA,MAChB,QAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,QAAA,CAAS,cAAe,EAAA,CAAA;AAAA,GAC1B,EAAG,CAAC,IAAM,EAAA,UAAA,EAAY,OAAO,QAAU,EAAA,KAAA,EAAO,QAAU,EAAA,aAAa,CAAC,CAAA,CAAA;AAGtE,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,QAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"DataSourceVariable.js","sources":["../../../src/variables/DataSourceVariable.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { DataSourceVariable as DataSourceVariableObject } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\n\nexport interface DataSourceVariableProps extends VariableProps {\n pluginId: string;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function DataSourceVariable({\n pluginId,\n regex,\n name,\n label,\n hide,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: DataSourceVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: DataSourceVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new DataSourceVariableObject({\n pluginId,\n regex,\n name,\n label,\n value: initialValue,\n isMulti,\n hide,\n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n variable.state.pluginId === pluginId &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll\n ) {\n return;\n }\n\n variable.setState({\n pluginId,\n regex,\n label,\n hide,\n includeAll,\n });\n\n variable.refreshOptions();\n }, [hide, includeAll, label, pluginId, regex, variable, variableAdded]);\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n"],"names":["DataSourceVariableObject"],"mappings":";;;;AAgBO,SAAS,kBAAmB,CAAA;AAAA,EACjC,QAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AACF,CAA6C,EAAA;AAC3C,EAAA,MAAM,QAAQ,eAAgB,EAAA,CAAA;AAC9B,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAkB,EAAA,CAAA;AAE5D,EAAI,IAAA,QAAA,GAAiD,KAAM,CAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AAE5E,EAAA,IAAI,CAAC,QAAU,EAAA;AACb,IAAA,QAAA,GAAW,IAAIA,oBAAyB,CAAA;AAAA,MACtC,QAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAO,EAAA,YAAA;AAAA,MACP,OAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,QAAA,GAAW,KAAM,CAAA,WAAA,CAAY,QAAQ,CAAA,CAAA;AAC3C,IAAA,gBAAA,CAAiB,IAAI,CAAA,CAAA;AACrB,IAAO,OAAA,QAAA,CAAA;AAAA,GACN,EAAA,CAAC,QAAU,EAAA,KAAA,EAAO,IAAI,CAAC,CAAA,CAAA;AAE1B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,aAAe,EAAA;AAClB,MAAA,OAAA;AAAA,KACF;AAEA,IAAA,IACE,SAAS,KAAM,CAAA,QAAA,KAAa,YAC5B,QAAS,CAAA,KAAA,CAAM,UAAU,KACzB,IAAA,QAAA,CAAS,MAAM,KAAU,KAAA,KAAA,IACzB,SAAS,KAAM,CAAA,IAAA,KAAS,QACxB,QAAS,CAAA,KAAA,CAAM,eAAe,UAC9B,EAAA;AACA,MAAA,OAAA;AAAA,KACF;AAEA,IAAA,QAAA,CAAS,QAAS,CAAA;AAAA,MAChB,QAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,QAAA,CAAS,cAAe,EAAA,CAAA;AAAA,GAC1B,EAAG,CAAC,IAAM,EAAA,UAAA,EAAY,OAAO,QAAU,EAAA,KAAA,EAAO,QAAU,EAAA,aAAa,CAAC,CAAA,CAAA;AAGtE,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,QAAA,CAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryVariable.js","sources":["../../../src/variables/QueryVariable.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { QueryVariable as QueryVariableObject, SceneDataQuery } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { DataSourceRef, VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\nimport { isEqual } from 'lodash';\n\nexport interface QueryVariableProps extends VariableProps {\n query: string | SceneDataQuery;\n datasource: DataSourceRef | null;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function QueryVariable({\n query,\n name,\n datasource,\n label,\n hide,\n regex,\n refresh,\n sort,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: QueryVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: QueryVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new QueryVariableObject({ \n name,\n label,\n query,\n datasource, \n refresh, \n sort, \n regex, \n value: initialValue, \n isMulti,\n hide, \n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n isEqual(variable.state.query, query) &&\n isEqual(variable.state.datasource, datasource) &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll &&\n variable.state.refresh === refresh &&\n variable.state.sort === sort\n ) {\n return;\n }\n\n variable.setState({\n label,\n query,\n datasource, \n refresh, \n sort, \n regex, \n hide, \n includeAll,\n });\n\n variable.refreshOptions();\n }, [datasource, hide, includeAll, label, query, refresh, regex, sort, variable, variableAdded]);\n \n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n"],"names":["QueryVariableObject"],"mappings":";;;;;AAkBO,SAAS,aAAc,CAAA;AAAA,EAC5B,KAAA;AAAA,EACA,IAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA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,QAAS,CAAA,KAAA,CAAM,IAAS,KAAA,IAAA,IACxB,SAAS,KAAM,CAAA,UAAA,KAAe,UAC9B,IAAA,QAAA,CAAS,MAAM,OAAY,KAAA,OAAA,IAC3B,QAAS,CAAA,KAAA,CAAM,SAAS,IACxB,EAAA;AACA,MAAA,OAAA;AAAA,KACF;AAEA,IAAA,QAAA,CAAS,QAAS,CAAA;AAAA,MAChB,KAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,QAAA,CAAS,cAAe,EAAA,CAAA;AAAA,GACvB,EAAA,CAAC,UAAY,EAAA,IAAA,EAAM,UAAY,EAAA,KAAA,EAAO,KAAO,EAAA,OAAA,EAAS,KAAO,EAAA,IAAA,EAAM,QAAU,EAAA,aAAa,CAAC,CAAA,CAAA;AAI9F,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,QAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"QueryVariable.js","sources":["../../../src/variables/QueryVariable.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { QueryVariable as QueryVariableObject, SceneDataQuery } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { DataSourceRef, VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\nimport { isEqual } from 'lodash';\n\nexport interface QueryVariableProps extends VariableProps {\n query: string | SceneDataQuery;\n datasource: DataSourceRef | null;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function QueryVariable({\n query,\n name,\n datasource,\n label,\n hide,\n regex,\n refresh,\n sort,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: QueryVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: QueryVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new QueryVariableObject({\n name,\n label,\n query,\n datasource,\n refresh,\n sort,\n regex,\n value: initialValue,\n isMulti,\n hide,\n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n isEqual(variable.state.query, query) &&\n isEqual(variable.state.datasource, datasource) &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll &&\n variable.state.refresh === refresh &&\n variable.state.sort === sort\n ) {\n return;\n }\n\n variable.setState({\n label,\n query,\n datasource,\n refresh,\n sort,\n regex,\n hide,\n includeAll,\n });\n\n variable.refreshOptions();\n }, [datasource, hide, includeAll, label, query, refresh, regex, sort, variable, variableAdded]);\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n"],"names":["QueryVariableObject"],"mappings":";;;;;AAkBO,SAAS,aAAc,CAAA;AAAA,EAC5B,KAAA;AAAA,EACA,IAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AACF,CAAwC,EAAA;AACtC,EAAA,MAAM,QAAQ,eAAgB,EAAA,CAAA;AAC9B,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAkB,EAAA,CAAA;AAE5D,EAAI,IAAA,QAAA,GAA4C,KAAM,CAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AAEvE,EAAA,IAAI,CAAC,QAAU,EAAA;AACb,IAAA,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,CAAA;AAED,IAAA,QAAA,CAAS,cAAe,EAAA,CAAA;AAAA,GACvB,EAAA,CAAC,UAAY,EAAA,IAAA,EAAM,UAAY,EAAA,KAAA,EAAO,KAAO,EAAA,OAAA,EAAS,KAAO,EAAA,IAAA,EAAM,QAAU,EAAA,aAAa,CAAC,CAAA,CAAA;AAG9F,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,QAAA,CAAA;AACT;;;;"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/contexts/SceneContextObject.tsx","../src/contexts/SceneContextProvider.tsx","../src/hooks/hooks.ts","../src/caching/SceneObjectCache.ts","../src/hooks/useSceneObject.ts","../src/hooks/useQueryRunner.ts","../src/hooks/useDataTransformer.ts","../src/components/TimeRangePicker.tsx","../src/components/VariableControl.tsx","../src/components/VizPanel.tsx","../src/components/RefreshPicker.tsx","../src/components/DataLayerControl.tsx","../src/variables/CustomVariable.tsx","../src/variables/DataSourceVariable.tsx","../src/variables/QueryVariable.tsx","../src/contexts/BreadcrumbContext.tsx","../src/hooks/useVariableValues.ts","../src/hooks/useQueryVariable.ts","../src/hooks/useVariableValue.ts","../src/components/AnnotationLayer.tsx","../src/interoperability/EmbeddedSceneWithContext.tsx","../src/components/VizGridLayout.tsx"],"sourcesContent":["export function writeSceneLog(logger: string, message: string, ...rest: unknown[]) {\n let loggingEnabled = false;\n\n if (typeof window !== 'undefined') {\n loggingEnabled = localStorage.getItem('grafana.debug.scenes') === 'true';\n }\n\n if (loggingEnabled) {\n console.log(`${logger}: `, message, ...rest);\n }\n}\n","import {\n SceneObjectBase,\n SceneObject,\n SceneObjectState,\n SceneVariable,\n SceneVariableSet,\n NewSceneObjectAddedEvent,\n} from '@grafana/scenes';\nimport { writeSceneLog } from '../utils';\n\nexport interface SceneContextObjectState extends SceneObjectState {\n childContexts?: SceneContextObject[];\n children: SceneObject[];\n}\n\nexport class SceneContextObject extends SceneObjectBase<SceneContextObjectState> {\n public constructor(state?: Partial<SceneContextObjectState>) {\n super({\n ...state,\n children: state?.children ?? [],\n childContexts: state?.childContexts ?? [],\n });\n }\n\n public addToScene(obj: SceneObject) {\n this.publishEvent(new NewSceneObjectAddedEvent(obj), true);\n\n this.setState({ children: [...this.state.children, obj] });\n writeSceneLog('SceneContext', `Adding to scene: ${obj.constructor.name} key: ${obj.state.key}`);\n\n const deactivate = obj.activate();\n\n return () => {\n writeSceneLog('SceneContext', `Removing from scene: ${obj.constructor.name} key: ${obj.state.key}`);\n this.setState({ children: this.state.children.filter((x) => x !== obj) });\n\n deactivate();\n };\n }\n\n public findByKey<T>(key: string): T | undefined {\n return this.state.children.find((x) => x.state.key === key) as T;\n }\n\n public findVariable<T>(name: string): T | undefined {\n const variables = this.state.$variables as SceneVariableSet;\n if (!variables) {\n return;\n }\n\n return variables.getByName(name) as T;\n }\n\n public addVariable(variable: SceneVariable) {\n let set = this.state.$variables as SceneVariableSet;\n\n this.publishEvent(new NewSceneObjectAddedEvent(variable), true);\n\n if (set) {\n set.setState({ variables: [...set.state.variables, variable] });\n } else {\n set = new SceneVariableSet({ variables: [variable] });\n this.setState({ $variables: set });\n }\n\n writeSceneLog('SceneContext', `Adding variable: ${variable.constructor.name} key: ${variable.state.key}`);\n\n return () => {\n set.setState({ variables: set.state.variables.filter((x) => x !== variable) });\n writeSceneLog('SceneContext', `Removing variable: ${variable.constructor.name} key: ${variable.state.key}`);\n };\n }\n\n public addChildContext(ctx: SceneContextObject) {\n this.publishEvent(new NewSceneObjectAddedEvent(ctx), true);\n\n this.setState({ childContexts: [...(this.state.childContexts ?? []), ctx] });\n\n writeSceneLog('SceneContext', `Adding child context: ${ctx.constructor.name} key: ${ctx.state.key}`);\n }\n\n public removeChildContext(ctx: SceneContextObject) {\n this.setState({\n childContexts: this.state.childContexts?.filter((context) => ctx !== context),\n });\n\n writeSceneLog('SceneContext', `Remvoing child context: ${ctx.constructor.name} key: ${ctx.state.key}`);\n }\n}\n","import React, { createContext, useContext, useEffect, useState } from 'react';\nimport { SceneTimeRangeState, SceneTimeRange, behaviors, UrlSyncContextProvider } from '@grafana/scenes';\n\nimport { SceneContextObject, SceneContextObjectState } from './SceneContextObject';\n\nexport const SceneContext = createContext<SceneContextObject | null>(null);\n\nexport interface SceneContextProviderProps {\n /**\n * Only the initial time range, cannot be used to update time range\n **/\n timeRange?: Partial<SceneTimeRangeState>;\n /**\n * This makes it possbile to view running state of queries via\n * refresh picker and also cancel all queries in the scene.\n */\n withQueryController?: boolean;\n /**\n * Children\n */\n children: React.ReactNode;\n}\n\n/**\n * Wrapps the react children in a SceneContext\n */\nexport function SceneContextProvider({ children, timeRange, withQueryController }: SceneContextProviderProps) {\n const parentContext = useContext(SceneContext);\n const [childContext, setChildContext] = useState<SceneContextObject | undefined>();\n\n // Becasue timeRange is not part of useEffect dependencies\n const initialTimeRange = timeRange;\n\n useEffect(() => {\n const state: SceneContextObjectState = { children: [] };\n\n if (withQueryController) {\n state.$behaviors = [new behaviors.SceneQueryController()];\n }\n\n if (initialTimeRange) {\n state.$timeRange = new SceneTimeRange(initialTimeRange);\n }\n\n const childContext = new SceneContextObject(state);\n\n if (parentContext) {\n parentContext.addChildContext(childContext);\n }\n\n const deactivate = childContext.activate();\n setChildContext(childContext);\n\n return () => {\n deactivate();\n\n if (parentContext) {\n parentContext.removeChildContext(childContext);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentContext, withQueryController]);\n\n if (!childContext) {\n return null;\n }\n\n const innerProvider = <SceneContext.Provider value={childContext}>{children}</SceneContext.Provider>;\n\n if (parentContext) {\n return innerProvider;\n }\n\n // For root context we wrap the provider in a UrlSyncWrapper that handles the hook that updates state on location changes\n return (\n <UrlSyncContextProvider scene={childContext} updateUrlOnInit={true} createBrowserHistorySteps={true}>\n {innerProvider}\n </UrlSyncContextProvider>\n );\n}\n","import { useCallback, useContext, useEffect, useState } from 'react';\nimport { SceneContext } from '../contexts/SceneContextProvider';\nimport { TimeRange } from '@grafana/data';\nimport {\n SceneVariable,\n SceneVariableValueChangedEvent,\n VariableValue,\n sceneGraph,\n SceneTimeRangeLike,\n} from '@grafana/scenes';\nimport { Subscription } from 'rxjs';\n\nexport function useSceneContext() {\n const scene = useContext(SceneContext);\n if (!scene) {\n throw new Error('Cannot find a SceneContext');\n }\n\n return scene;\n}\n\nexport function useTimeRange(): [TimeRange, SceneTimeRangeLike] {\n const scene = useSceneContext();\n const sceneTimeRange = sceneGraph.getTimeRange(scene);\n const { value } = sceneTimeRange.useState();\n\n return [value, sceneTimeRange];\n}\n\n/**\n * Only returns the variables on the closest context level.\n * We could modify it to extract all variables from the full context tree.\n */\nexport function useVariables(): SceneVariable[] {\n const scene = useSceneContext();\n const variables = sceneGraph.getVariables(scene);\n return variables.useState().variables;\n}\n\nexport interface UseUpdateWhenSceneChangesOptions {\n /** Variable names */\n variables?: string[];\n timeRange?: boolean;\n}\n\nexport interface UseUpdateWhenSceneChangesReason {\n variableName?: string;\n variableValue?: VariableValue | undefined | null;\n timeRange?: TimeRange;\n}\n\n/**\n * A utility hook to re-render the calling react component when specified variables or time range changes\n */\nexport function useUpdateWhenSceneChanges({ timeRange, variables = [] }: UseUpdateWhenSceneChangesOptions) {\n const scene = useSceneContext();\n const [updateReason, setUpdateReason] = useState<UseUpdateWhenSceneChangesReason>();\n\n useEffect(() => {\n const subscriptions = new Subscription();\n\n if (variables && variables.length > 0) {\n for (const v of variables) {\n const variable = sceneGraph.lookupVariable(v, scene);\n if (variable) {\n subscriptions.add(\n variable.subscribeToEvent(SceneVariableValueChangedEvent, () => {\n setUpdateReason({ variableName: variable.state.name, variableValue: variable.getValue() });\n })\n );\n }\n }\n }\n\n if (timeRange) {\n const tr = sceneGraph.getTimeRange(scene);\n tr.subscribeToState((newState, oldState) => {\n if (newState.value !== oldState.value) {\n setUpdateReason({ timeRange: newState.value });\n }\n });\n }\n\n return () => subscriptions.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scene, timeRange, ...variables]);\n\n return updateReason;\n}\n\n/**\n * Mainly a utility hook to re-render the calling react component when specified variables or time range changes\n */\nexport function useVariableInterpolator(options: UseUpdateWhenSceneChangesOptions) {\n const scene = useSceneContext();\n\n useUpdateWhenSceneChanges(options);\n\n return useCallback(\n (str: string) => {\n return sceneGraph.interpolate(scene, str);\n },\n [scene]\n );\n}\n","import { SceneObject } from '@grafana/scenes';\nimport { isPlainObject } from 'lodash';\nimport { LRUCache } from 'lru-cache';\n\nexport type CacheKey = CacheKeyPart | CacheKeyPart[];\n\nexport type CacheKeyPart = string | number | object | boolean;\n\nexport type SceneObjectConstructor = { new (...args: never[]): SceneObject };\n\nexport class SceneObjectCache {\n #cache: LRUCache<string, SceneObject>;\n #objectRefIds = new WeakMap<any, number>();\n #objectRefIdCounter = 0;\n\n public constructor() {\n this.#cache = new LRUCache({\n max: 500,\n ttl: 1000 * 60 * 5,\n });\n }\n\n public add(keyHash: string, object: SceneObject) {\n this.#cache.set(keyHash, object);\n }\n\n public get<T>(keyHash: string): T | undefined {\n return this.#cache.get(keyHash) as T;\n }\n\n public getHashKey(key: CacheKey, type: SceneObjectConstructor): string {\n if (Array.isArray(key)) {\n return `${type.name}-${key.map((k) => this.getHashKeyElement(k)).join()}`;\n }\n\n return `${type.name}-${this.getHashKeyElement(key)}`;\n }\n\n public getByRefHashKey(obj: unknown) {\n let objectRefId = this.#objectRefIds.get(obj);\n if (objectRefId == null) {\n objectRefId = this.#objectRefIdCounter++;\n this.#objectRefIds.set(obj, objectRefId);\n }\n\n return objectRefId;\n }\n\n private getHashKeyElement<T>(key: CacheKey) {\n if (typeof key === 'string' || typeof key === 'boolean' || typeof key === 'number') {\n return key;\n }\n\n return getObjectHash(key);\n }\n}\n\nlet cache: SceneObjectCache | undefined;\n\nexport function getSceneObjectCache(): SceneObjectCache {\n if (cache) {\n return cache;\n }\n\n return (cache = new SceneObjectCache());\n}\n\n/**\n * Returns a unique hash key string for the given object reference.\n */\nexport function cacheByRef(value: unknown) {\n const cache = getSceneObjectCache();\n return cache.getByRefHashKey(value);\n}\n\nexport function getObjectHash(obj: unknown): string {\n return JSON.stringify(obj, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {} as any)\n : val\n );\n}\n","import { useEffect, useId } from 'react';\nimport { SceneObject, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\nimport { CacheKey, SceneObjectConstructor, getSceneObjectCache } from '../caching/SceneObjectCache';\n\nexport interface UseSceneObjectProps<T extends SceneObject> {\n factory: (key: string) => T;\n cacheKey?: CacheKey;\n objectConstructor: SceneObjectConstructor;\n}\n\n/**\n * Helper hook that handles adding and removing the scene object from the scene object graph.\n * Also handles the lookup of the object from the cache if a cache key is provided.\n */\nexport function useSceneObject<T extends SceneObject>(options: UseSceneObjectProps<T>) {\n const scene = useSceneContext();\n const key = useId();\n const cache = getSceneObjectCache();\n let cacheKeyHash = options.cacheKey ? cache.getHashKey(options.cacheKey, options.objectConstructor) : undefined;\n\n let obj = scene.findByKey<T>(key);\n\n if (!obj && cacheKeyHash) {\n obj = cache.get<T>(cacheKeyHash);\n\n if (obj && obj.parent !== scene) {\n // Before clearing parent make sure the object is not already in the scene\n if (sceneGraph.findObject(scene, (sceneObj) => sceneObj === obj)) {\n console.error('A scene object cache key matched an object that is already in the scene');\n obj = undefined;\n // Setting this to undefined so that we later do not add/overwrite the object that is already in the scene\n cacheKeyHash = undefined;\n } else {\n obj.clearParent();\n }\n }\n }\n\n if (!obj) {\n obj = options.factory(key);\n if (cacheKeyHash) {\n cache.add(cacheKeyHash, obj);\n }\n }\n\n useEffect(() => scene.addToScene(obj), [obj, scene]);\n\n return obj;\n}\n","import { useEffect } from 'react';\nimport { SceneDataQuery, SceneQueryRunner } from '@grafana/scenes';\nimport { DataSourceRef } from '@grafana/schema';\nimport { isEqual } from 'lodash';\nimport { CacheKey } from '../caching/SceneObjectCache';\nimport { useSceneObject } from './useSceneObject';\n\nexport interface UseQueryOptions {\n queries: SceneDataQuery[];\n maxDataPoints?: number;\n datasource?: DataSourceRef;\n cacheKey?: CacheKey;\n liveStreaming?: boolean;\n maxDataPointsFromWidth?: boolean;\n}\n\n/**\n * Maintains the state of SceneQueryRunner in the scene\n *\n * @example // To access query results do\n * const query = useQueryRunner(...);\n * const { data } = query.useState();\n */\nexport function useQueryRunner(options: UseQueryOptions): SceneQueryRunner {\n const queryRunner = useSceneObject({\n factory: (key) =>\n new SceneQueryRunner({\n key: key,\n queries: options.queries,\n maxDataPoints: options.maxDataPoints,\n datasource: options.datasource,\n liveStreaming: options.liveStreaming,\n maxDataPointsFromWidth: options.maxDataPointsFromWidth,\n }),\n objectConstructor: SceneQueryRunner,\n cacheKey: options.cacheKey,\n });\n\n // Update queries when they change\n useEffect(() => {\n if (!isEqual(queryRunner.state.queries, options.queries)) {\n queryRunner.setState({ queries: options.queries });\n queryRunner.runQueries();\n }\n }, [queryRunner, options]);\n\n return queryRunner;\n}\n","import {\n CustomTransformerDefinition,\n DataProviderProxy,\n SceneDataProvider,\n SceneDataTransformer,\n} from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\nimport { useEffect, useId } from 'react';\nimport { isEqual } from 'lodash';\nimport { DataTransformerConfig } from '@grafana/schema';\n\nexport interface UseDataTransformerOptions {\n transformations: Array<DataTransformerConfig | CustomTransformerDefinition>;\n data: SceneDataProvider;\n}\n\nexport function useDataTransformer(options: UseDataTransformerOptions) {\n const scene = useSceneContext();\n const key = useId();\n\n let dataTransformer = scene.findByKey<SceneDataTransformer>(key);\n\n if (!dataTransformer) {\n dataTransformer = new SceneDataTransformer({\n key: key,\n $data: new DataProviderProxy({ source: options.data.getRef() }),\n transformations: options.transformations,\n });\n }\n\n useEffect(() => scene.addToScene(dataTransformer), [dataTransformer, scene]);\n\n useEffect(() => {\n if (!isEqual(dataTransformer.state.transformations, options.transformations)) {\n dataTransformer.setState({ transformations: options.transformations });\n dataTransformer.reprocessTransformations();\n }\n }, [dataTransformer, options.transformations]);\n\n return dataTransformer;\n}\n","import { TimeRangePicker as TimeRangePickerUI } from '@grafana/ui';\nimport React from 'react';\nimport { useTimeRange } from '../hooks/hooks';\n\nexport interface Props {}\n\nexport function TimeRangePicker(props: Props) {\n const [value, sceneTimeRange] = useTimeRange();\n\n return (\n <TimeRangePickerUI\n isOnCanvas={true}\n value={value}\n onChange={sceneTimeRange.onTimeRangeChange}\n timeZone={sceneTimeRange.getTimeZone()}\n onMoveBackward={() => {}}\n onMoveForward={() => {}}\n onZoom={() => {}}\n onChangeTimeZone={() => {}}\n onChangeFiscalYearStartMonth={() => {}}\n />\n );\n}\n","import React from 'react';\nimport { ControlsLayout, sceneGraph, VariableValueSelectWrapper } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\n\nexport interface Props {\n name: string;\n hideLabel?: boolean;\n layout?: ControlsLayout;\n}\n\nexport function VariableControl({ name, hideLabel, layout }: Props) {\n const scene = useSceneContext();\n const variable = sceneGraph.lookupVariable(name, scene);\n\n if (!variable) {\n return <div>Variable {name} not found</div>;\n }\n\n return (\n <VariableValueSelectWrapper key={variable.state.key} variable={variable} hideLabel={hideLabel} layout={layout} />\n );\n}\n","import React, { useEffect, useId } from 'react';\nimport {\n SceneDataProvider,\n VizPanel as VizPanelObject,\n VizPanelState,\n VizConfig,\n DataProviderProxy,\n SceneDataNode,\n} from '@grafana/scenes';\nimport { usePrevious } from 'react-use';\nimport { getPanelOptionsWithDefaults } from '@grafana/data';\nimport { writeSceneLog } from '../utils';\nimport { useSceneContext } from '../hooks/hooks';\n\nexport interface VizPanelProps {\n title: string;\n dataProvider?: SceneDataProvider;\n viz: VizConfig;\n headerActions?: React.ReactNode;\n}\n\nexport function VizPanel(props: VizPanelProps) {\n const { title, viz, dataProvider, headerActions } = props;\n const scene = useSceneContext();\n const key = useId();\n const prevProps = usePrevious(props);\n\n let panel = scene.findByKey<VizPanelObject>(key);\n\n if (!panel) {\n panel = new VizPanelObject({\n key: key,\n title: title,\n pluginId: viz.pluginId,\n pluginVersion: viz.pluginVersion,\n options: viz.options,\n fieldConfig: viz.fieldConfig,\n $data: getDataProviderForVizPanel(dataProvider),\n headerActions: headerActions,\n });\n }\n\n useEffect(() => scene.addToScene(panel), [panel, scene]);\n\n // Update options\n useEffect(() => {\n const stateUpdate: Partial<VizPanelState> = {};\n\n if (!prevProps) {\n return;\n }\n\n if (title !== prevProps.title) {\n stateUpdate.title = title;\n }\n\n if (headerActions !== prevProps.headerActions) {\n stateUpdate.headerActions = headerActions;\n }\n\n if (dataProvider !== prevProps.dataProvider) {\n stateUpdate.$data = getDataProviderForVizPanel(dataProvider);\n }\n\n if (viz !== prevProps.viz) {\n if (viz.pluginId === prevProps.viz.pluginId) {\n const plugin = panel.getPlugin();\n if (plugin) {\n const optionsWithDefaults = getPanelOptionsWithDefaults({\n plugin,\n currentOptions: viz.options,\n currentFieldConfig: viz.fieldConfig,\n isAfterPluginChange: false,\n });\n stateUpdate.options = optionsWithDefaults.options;\n stateUpdate.fieldConfig = optionsWithDefaults.fieldConfig;\n\n panel.clearFieldConfigCache();\n }\n }\n }\n\n if (Object.keys(stateUpdate).length > 0) {\n panel.setState(stateUpdate);\n writeSceneLog('VizPanel', 'Updating VizPanel state', stateUpdate);\n }\n }, [panel, title, headerActions, viz, dataProvider, prevProps]);\n\n return <panel.Component model={panel} />;\n}\n\n/**\n * Since the useQueryRunner attaches query runners to the scene context their parent is already set\n * This proxy is to work around that.\n * TODO: Figure out a better way to handle this'\n */\nfunction getDataProviderForVizPanel(data: SceneDataProvider | undefined): SceneDataProvider | undefined {\n if (data && !(data instanceof SceneDataNode)) {\n return new DataProviderProxy({ source: data.getRef() });\n }\n return data;\n}\n","import React, { useEffect, useId } from 'react';\nimport { useSceneContext } from '../hooks/hooks';\nimport { SceneRefreshPicker, SceneRefreshPickerState } from '@grafana/scenes';\nimport { usePrevious } from 'react-use';\n\nexport interface Props {\n refresh?: string;\n withText?: boolean;\n}\n\nexport function RefreshPicker(props: Props) {\n const scene = useSceneContext();\n const key = useId();\n const prevProps = usePrevious(props);\n\n let picker = scene.findByKey<SceneRefreshPicker>(key);\n\n if (!picker) {\n picker = new SceneRefreshPicker({\n key: key,\n ...props,\n });\n }\n\n useEffect(() => scene.addToScene(picker), [picker, scene]);\n\n // Update options\n useEffect(() => {\n const stateUpdate: Partial<SceneRefreshPickerState> = {};\n\n if (!prevProps) {\n return;\n }\n\n if (props.refresh !== prevProps.refresh) {\n stateUpdate.refresh = props.refresh;\n }\n\n if (props.withText !== prevProps.withText) {\n stateUpdate.withText = props.withText;\n }\n\n picker.setState(stateUpdate);\n }, [picker, props, prevProps]);\n\n return <picker.Component model={picker} />;\n}\n","import React from 'react';\nimport { SceneDataLayerProvider, SceneDataLayerSet, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\n\nexport interface Props {\n name: string;\n}\n\nexport function DataLayerControl({ name }: Props) {\n const scene = useSceneContext();\n const layerSets = sceneGraph.getDataLayers(scene);\n\n const layer = getLayer(layerSets, name);\n\n if (!layer) {\n return <div>Annotation {name} not found</div>;\n }\n\n return <layer.Component model={layer} />;\n}\n\nfunction getLayer(layers: SceneDataLayerProvider[], name: string): SceneDataLayerProvider | undefined {\n for (let i = 0; i < layers.length; i++) {\n const layer = (layers[i] as SceneDataLayerSet).state.layers.find((layer) => layer.state.name === name);\n\n if (layer) {\n return layer;\n }\n }\n\n return undefined;\n}\n","import React, { useEffect, useState } from 'react';\nimport { CustomVariable as CustomVariableObject } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { VariableProps } from './types';\n\nexport interface CustomVariableProps extends VariableProps {\n query: string;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function CustomVariable({\n query,\n name,\n label,\n hide,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: CustomVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: CustomVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new CustomVariableObject({ name, label, query, value: initialValue, isMulti, includeAll, hide});\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n variable?.setState({\n label,\n query,\n hide,\n isMulti,\n includeAll\n })\n }, [hide, includeAll, isMulti, label, query, variable]);\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n","import React, { useEffect, useState } from 'react';\nimport { DataSourceVariable as DataSourceVariableObject } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\n\nexport interface DataSourceVariableProps extends VariableProps {\n pluginId: string;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function DataSourceVariable({\n pluginId,\n regex,\n name,\n label,\n hide,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: DataSourceVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: DataSourceVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new DataSourceVariableObject({ \n pluginId,\n regex,\n name,\n label,\n value: initialValue, \n isMulti,\n hide, \n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n variable.state.pluginId === pluginId &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll\n ) {\n return;\n }\n\n variable.setState({\n pluginId,\n regex,\n label,\n hide, \n includeAll,\n })\n\n variable.refreshOptions();\n }, [hide, includeAll, label, pluginId, regex, variable, variableAdded])\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n","import React, { useEffect, useState } from 'react';\nimport { QueryVariable as QueryVariableObject, SceneDataQuery } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { DataSourceRef, VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\nimport { isEqual } from 'lodash';\n\nexport interface QueryVariableProps extends VariableProps {\n query: string | SceneDataQuery;\n datasource: DataSourceRef | null;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function QueryVariable({\n query,\n name,\n datasource,\n label,\n hide,\n regex,\n refresh,\n sort,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: QueryVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: QueryVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new QueryVariableObject({ \n name,\n label,\n query,\n datasource, \n refresh, \n sort, \n regex, \n value: initialValue, \n isMulti,\n hide, \n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n isEqual(variable.state.query, query) &&\n isEqual(variable.state.datasource, datasource) &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll &&\n variable.state.refresh === refresh &&\n variable.state.sort === sort\n ) {\n return;\n }\n\n variable.setState({\n label,\n query,\n datasource, \n refresh, \n sort, \n regex, \n hide, \n includeAll,\n });\n\n variable.refreshOptions();\n }, [datasource, hide, includeAll, label, query, refresh, regex, sort, variable, variableAdded]);\n \n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n","import { NavModelItem, UrlQueryMap, urlUtil } from '@grafana/data';\nimport { locationSearchToObject, locationService } from '@grafana/runtime';\nimport React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { useTimeRange, useVariables } from '../hooks/hooks';\n\n/**\n * Code and concepts copied from https://github.com/grafana/hackathon-2023-12-grafana-react/blob/main/src/grafana-react\n *\n * These contexts & components needs some more thought and naming considerations, just a quick proof of concept for now.\n */\n\ntype BreadcrumbItem = Pick<NavModelItem, 'text' | 'url'>;\n\nexport interface BreadcrumbContextValue {\n breadcrumbs: BreadcrumbItem[];\n addBreadcrumb(breadcrumb: BreadcrumbItem): void;\n removeBreadcrumb(breadcrumb: BreadcrumbItem): void;\n}\n\nexport const BreadcrumbContext = createContext<BreadcrumbContextValue>({\n breadcrumbs: [],\n addBreadcrumb: () => {},\n removeBreadcrumb: () => {},\n});\n\nexport function BreadcrumbProvider({ children }: { children: React.ReactNode }) {\n const [breadcrumbs, setBreadcrumbs] = useState<BreadcrumbItem[]>([]);\n\n return (\n <BreadcrumbContext.Provider\n value={{\n breadcrumbs,\n addBreadcrumb: useCallback((breadcrumb: BreadcrumbItem) => setBreadcrumbs((prev) => [...prev, breadcrumb]), []),\n removeBreadcrumb: useCallback(\n (breadcrumb: BreadcrumbItem) => setBreadcrumbs((prev) => prev.filter((b) => b.url !== breadcrumb.url)),\n []\n ),\n }}\n >\n {children}\n </BreadcrumbContext.Provider>\n );\n}\n\nexport interface BreadcrumbProps {\n text: string;\n path: string;\n extraKeys?: string[];\n}\n\nexport function Breadcrumb({ text, path, extraKeys }: BreadcrumbProps): React.ReactNode {\n const { addBreadcrumb, removeBreadcrumb } = useContext(BreadcrumbContext);\n\n const buildUrl = useUrlBuilder();\n\n useEffect(() => {\n const breadcrumb = {\n text,\n url: buildUrl(path, extraKeys),\n };\n\n addBreadcrumb(breadcrumb);\n\n return () => {\n removeBreadcrumb(breadcrumb);\n };\n }, [text, path, extraKeys, addBreadcrumb, buildUrl, removeBreadcrumb]);\n\n return null;\n}\n\nfunction useUrlBuilder() {\n const queryParams = useQueryParams()[0];\n const variables = useVariables();\n const [_, timeRange] = useTimeRange();\n\n return useCallback(\n (urlBase: string, extraKeys: string[] | undefined) => {\n const params: UrlQueryMap = {};\n\n for (const v of variables) {\n if (v.urlSync && !v.state.skipUrlSync) {\n const state = v.urlSync.getUrlState();\n Object.assign(params, state);\n }\n }\n\n if (timeRange.urlSync) {\n const state = timeRange.urlSync.getUrlState();\n Object.assign(params, state);\n }\n\n if (extraKeys) {\n for (const extra of extraKeys) {\n if (queryParams[extra]) {\n params[extra] = queryParams[extra];\n }\n }\n }\n\n return urlUtil.renderUrl(urlBase, params);\n },\n [variables, queryParams, timeRange]\n );\n}\n\nfunction useQueryParams(): [UrlQueryMap, (values: UrlQueryMap, replace?: boolean) => void] {\n const { search } = useLocation();\n const queryParams = useMemo(() => locationSearchToObject(search || ''), [search]);\n const update = useCallback((values: UrlQueryMap, replace?: boolean) => locationService.partial(values, replace), []);\n return [queryParams, update];\n}\n","import { SceneVariables, VariableValueSingle, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\n\nexport function useVariableValues<T = VariableValueSingle>(name: string): [T[] | undefined, boolean] {\n const scene = useSceneContext();\n const variable = sceneGraph.lookupVariable(name, scene);\n\n if (!variable) {\n return [undefined, false];\n }\n\n variable.useState();\n\n const set = variable.parent as SceneVariables;\n const isLoading = set.isVariableLoadingOrWaitingToUpdate(variable);\n let value = variable.getValue();\n\n if (value == null) {\n return [undefined, isLoading];\n }\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n return [value as T[], isLoading];\n}\n","import { QueryVariable, SceneDataQuery, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\nimport { useEffect } from 'react';\nimport { isEqual } from 'lodash';\n\ninterface QueryVariableOptions {\n name: string;\n datasource: string;\n query: string | SceneDataQuery;\n regex?: string;\n}\n\n/**\n * A custom hook that creates or updates a `QueryVariable` in the scene context.\n * \n * @param {QueryVariableOptions} options - Options for configuring the `QueryVariable`.\n * @returns {QueryVariable | null} The `QueryVariable` instance or `null`.\n * \n * @example\n * // Usage example\n * const variable = useQueryVariable({\n * name: \"myQueryVariable\",\n * datasource: \"gdev-testdata\",\n * query: \"*\",\n * regex: \".*someFilter.*\"\n * });\n * \n * // Returns a QueryVariable instance or null if not a valid QueryVariable\n * if (variable) {\n * console.log(\"Variable added to the scene:\", variable);\n * }\n */\nexport function useQueryVariable(options: QueryVariableOptions): QueryVariable | null {\n const scene = useSceneContext();\n let variable = sceneGraph.lookupVariable(options.name, scene);\n\n if (!variable) {\n variable = new QueryVariable({ name: options.name, datasource: { uid: options.datasource }, query: options.query, regex: options.regex });\n }\n\n if (!(variable instanceof QueryVariable)) {\n variable = null;\n }\n\n useEffect(() => {\n if (variable) {\n scene.addVariable(variable)\n }\n }, [variable, scene]);\n\n useEffect(() => {\n if (\n variable?.state.datasource?.uid !== options.datasource ||\n !isEqual(variable?.state.query, options.query) ||\n variable?.state.regex !== options.regex\n ) {\n variable?.setState({ datasource: { uid: options.datasource }, query: options.query, regex: options.regex });\n variable?.refreshOptions();\n }\n }, [options, variable]);\n\n return variable;\n}\n","import { MultiValueVariable, SceneVariables, VariableValueSingle, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\n\nexport function useVariableValue<T = VariableValueSingle>(name: string): [T | undefined, boolean] {\n const scene = useSceneContext();\n const variable = sceneGraph.lookupVariable(name, scene);\n\n if (!variable || (variable instanceof MultiValueVariable && variable.state.isMulti === true)) {\n return [undefined, false];\n }\n\n variable.useState();\n\n const set = variable.parent as SceneVariables;\n const isLoading = set.isVariableLoadingOrWaitingToUpdate(variable);\n let value = variable.getValue();\n\n if (value == null) {\n return [undefined, isLoading];\n }\n\n return [value as T, isLoading];\n}\n","import React, { useEffect, useState } from 'react';\nimport { useSceneContext } from '../hooks/hooks';\nimport { AnnotationQuery } from '@grafana/data';\nimport { SceneDataLayerSet, dataLayers } from '@grafana/scenes';\nimport { SceneContextObject } from '../contexts/SceneContextObject';\nimport { writeSceneLog } from '../utils';\n\nexport interface AnnotationLayerSetProps {\n name: string;\n query: AnnotationQuery;\n children: React.ReactNode;\n}\n\nexport function AnnotationLayer({ name, query, children }: AnnotationLayerSetProps): React.ReactNode {\n const scene = useSceneContext();\n const [annotationAdded, setAnnotationAdded] = useState<boolean>();\n\n let annotation: dataLayers.AnnotationsDataLayer | undefined = findAnnotationLayer(scene, name);\n\n if (!annotation) {\n annotation = new dataLayers.AnnotationsDataLayer({ name, query });\n }\n\n useEffect(() => {\n const removeFn = addAnnotationLayer(scene, annotation);\n setAnnotationAdded(true);\n return removeFn;\n }, [scene, name, annotation]);\n\n useEffect(() => {\n // Handle prop changes\n }, [annotationAdded]);\n\n if (!annotationAdded) {\n return null;\n }\n\n return children;\n}\n\nfunction findAnnotationLayer<T>(scene: SceneContextObject, name: string): T | undefined {\n const annotations = scene.state.$data as SceneDataLayerSet;\n\n if (!annotations) {\n return;\n }\n\n return annotations.state.layers.find((anno) => anno.state.name === name) as T;\n}\n\nfunction addAnnotationLayer(scene: SceneContextObject, layer: dataLayers.AnnotationsDataLayer) {\n let set = scene.state.$data as SceneDataLayerSet;\n\n if (set) {\n set.setState({ layers: [...set.state.layers, layer] });\n } else {\n set = new SceneDataLayerSet({ layers: [layer] });\n scene.setState({ $data: set });\n }\n\n writeSceneLog('SceneContext', `Adding annotation data layer: ${layer.state.name} key: ${layer.state.key}`);\n\n return () => {\n set.setState({ layers: set.state.layers.filter((x) => x !== layer) });\n writeSceneLog('SceneContext', `Removing annotation data layer: ${layer.state.name} key: ${layer.state.key}`);\n };\n}\n","import React from 'react';\nimport { EmbeddedScene, EmbeddedSceneState, SceneComponentProps } from '@grafana/scenes';\nimport { SceneContext } from '../contexts/SceneContextProvider';\nimport { SceneContextObject } from '../contexts/SceneContextObject';\n\nexport class EmbeddedSceneWithContext extends EmbeddedScene {\n public constructor(state: EmbeddedSceneState) {\n super({ ...state, context: new SceneContextObject() });\n }\n\n public static Component = ({ model }: SceneComponentProps<EmbeddedSceneWithContext>) => {\n return (\n <SceneContext.Provider value={model.state.context as SceneContextObject}>\n <EmbeddedScene.Component model={model} />\n </SceneContext.Provider>\n );\n };\n}\n","import { useTheme2 } from '@grafana/ui';\nimport React, { CSSProperties } from 'react';\n\nexport interface Props {\n minWidth?: number;\n minHeight?: number;\n children: React.ReactNode;\n}\n\n/**\n * Simple css grid layout for visualizations\n */\nexport function VizGridLayout({ children, minWidth = 400, minHeight = 320 }: Props) {\n const theme = useTheme2();\n const style: CSSProperties = {\n display: 'grid',\n flexGrow: 1,\n gridTemplateColumns: `repeat(auto-fit, minmax(${minWidth}px, 1fr))`,\n gridAutoRows: `minmax(${minHeight}px, auto)`,\n columnGap: theme.spacing(1),\n rowGap: theme.spacing(1),\n };\n\n return <div style={style}>{children}</div>;\n}\n"],"names":["SceneObjectBase","__spreadProps","NewSceneObjectAddedEvent","SceneVariableSet","createContext","useContext","useState","useEffect","behaviors","SceneTimeRange","childContext","React","UrlSyncContextProvider","sceneGraph","Subscription","SceneVariableValueChangedEvent","useCallback","LRUCache","isPlainObject","useId","SceneQueryRunner","isEqual","SceneDataTransformer","DataProviderProxy","TimeRangePickerUI","VariableValueSelectWrapper","usePrevious","VizPanelObject","getPanelOptionsWithDefaults","SceneDataNode","SceneRefreshPicker","__spreadValues","layer","CustomVariableObject","DataSourceVariableObject","QueryVariableObject","urlUtil","useLocation","useMemo","locationSearchToObject","locationService","QueryVariable","MultiValueVariable","dataLayers","SceneDataLayerSet","EmbeddedScene","useTheme2"],"mappings":";;;;;;;;;;;;;;;;;;;AAAgB,SAAA,aAAA,CAAc,MAAgB,EAAA,OAAA,EAAA,GAAoB,IAAiB,EAAA;AACjF,EAAA,IAAI,cAAiB,GAAA,KAAA,CAAA;AA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A,IACV,qBAAqB,CAA2B,wBAAA,EAAA,QAAA,CAAA,SAAA,CAAA;AAAA,IAChD,cAAc,CAAU,OAAA,EAAA,SAAA,CAAA,SAAA,CAAA;AAAA,IACxB,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,MAAA,EAAQ,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GACzB,CAAA;AAEA,EAAA,uBAAQnC,yBAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,IAAI,KAAA;AAAA,GAAA,EAAe,QAAS,CAAA,CAAA;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/contexts/SceneContextObject.tsx","../src/contexts/SceneContextProvider.tsx","../src/hooks/hooks.ts","../src/caching/SceneObjectCache.ts","../src/hooks/useSceneObject.ts","../src/hooks/useQueryRunner.ts","../src/hooks/useDataTransformer.ts","../src/components/TimeRangePicker.tsx","../src/components/VariableControl.tsx","../src/components/VizPanel.tsx","../src/components/RefreshPicker.tsx","../src/components/DataLayerControl.tsx","../src/variables/CustomVariable.tsx","../src/variables/DataSourceVariable.tsx","../src/variables/QueryVariable.tsx","../src/contexts/BreadcrumbContext.tsx","../src/hooks/useVariableValues.ts","../src/hooks/useQueryVariable.ts","../src/hooks/useVariableValue.ts","../src/components/AnnotationLayer.tsx","../src/interoperability/EmbeddedSceneWithContext.tsx","../src/components/VizGridLayout.tsx"],"sourcesContent":["export function writeSceneLog(logger: string, message: string, ...rest: unknown[]) {\n let loggingEnabled = false;\n\n if (typeof window !== 'undefined') {\n loggingEnabled = localStorage.getItem('grafana.debug.scenes') === 'true';\n }\n\n if (loggingEnabled) {\n console.log(`${logger}: `, message, ...rest);\n }\n}\n","import {\n SceneObjectBase,\n SceneObject,\n SceneObjectState,\n SceneVariable,\n SceneVariableSet,\n NewSceneObjectAddedEvent,\n} from '@grafana/scenes';\nimport { writeSceneLog } from '../utils';\n\nexport interface SceneContextObjectState extends SceneObjectState {\n childContexts?: SceneContextObject[];\n children: SceneObject[];\n}\n\nexport class SceneContextObject extends SceneObjectBase<SceneContextObjectState> {\n public constructor(state?: Partial<SceneContextObjectState>) {\n super({\n ...state,\n children: state?.children ?? [],\n childContexts: state?.childContexts ?? [],\n });\n }\n\n public addToScene(obj: SceneObject) {\n this.publishEvent(new NewSceneObjectAddedEvent(obj), true);\n\n this.setState({ children: [...this.state.children, obj] });\n writeSceneLog('SceneContext', `Adding to scene: ${obj.constructor.name} key: ${obj.state.key}`);\n\n const deactivate = obj.activate();\n\n return () => {\n writeSceneLog('SceneContext', `Removing from scene: ${obj.constructor.name} key: ${obj.state.key}`);\n this.setState({ children: this.state.children.filter((x) => x !== obj) });\n\n deactivate();\n };\n }\n\n public findByKey<T>(key: string): T | undefined {\n return this.state.children.find((x) => x.state.key === key) as T;\n }\n\n public findVariable<T>(name: string): T | undefined {\n const variables = this.state.$variables as SceneVariableSet;\n if (!variables) {\n return;\n }\n\n return variables.getByName(name) as T;\n }\n\n public addVariable(variable: SceneVariable) {\n let set = this.state.$variables as SceneVariableSet;\n\n this.publishEvent(new NewSceneObjectAddedEvent(variable), true);\n\n if (set) {\n set.setState({ variables: [...set.state.variables, variable] });\n } else {\n set = new SceneVariableSet({ variables: [variable] });\n this.setState({ $variables: set });\n }\n\n writeSceneLog('SceneContext', `Adding variable: ${variable.constructor.name} key: ${variable.state.key}`);\n\n return () => {\n set.setState({ variables: set.state.variables.filter((x) => x !== variable) });\n writeSceneLog('SceneContext', `Removing variable: ${variable.constructor.name} key: ${variable.state.key}`);\n };\n }\n\n public addChildContext(ctx: SceneContextObject) {\n this.publishEvent(new NewSceneObjectAddedEvent(ctx), true);\n\n this.setState({ childContexts: [...(this.state.childContexts ?? []), ctx] });\n\n writeSceneLog('SceneContext', `Adding child context: ${ctx.constructor.name} key: ${ctx.state.key}`);\n }\n\n public removeChildContext(ctx: SceneContextObject) {\n this.setState({\n childContexts: this.state.childContexts?.filter((context) => ctx !== context),\n });\n\n writeSceneLog('SceneContext', `Remvoing child context: ${ctx.constructor.name} key: ${ctx.state.key}`);\n }\n}\n","import React, { createContext, useContext, useEffect, useState } from 'react';\nimport { SceneTimeRangeState, SceneTimeRange, behaviors, UrlSyncContextProvider } from '@grafana/scenes';\n\nimport { SceneContextObject, SceneContextObjectState } from './SceneContextObject';\n\nexport const SceneContext = createContext<SceneContextObject | null>(null);\n\nexport interface SceneContextProviderProps {\n /**\n * Only the initial time range, cannot be used to update time range\n **/\n timeRange?: Partial<SceneTimeRangeState>;\n /**\n * This makes it possbile to view running state of queries via\n * refresh picker and also cancel all queries in the scene.\n */\n withQueryController?: boolean;\n /**\n * Children\n */\n children: React.ReactNode;\n}\n\n/**\n * Wrapps the react children in a SceneContext\n */\nexport function SceneContextProvider({ children, timeRange, withQueryController }: SceneContextProviderProps) {\n const parentContext = useContext(SceneContext);\n const [childContext, setChildContext] = useState<SceneContextObject | undefined>();\n\n // Becasue timeRange is not part of useEffect dependencies\n const initialTimeRange = timeRange;\n\n useEffect(() => {\n const state: SceneContextObjectState = { children: [] };\n\n if (withQueryController) {\n state.$behaviors = [new behaviors.SceneQueryController()];\n }\n\n if (initialTimeRange) {\n state.$timeRange = new SceneTimeRange(initialTimeRange);\n }\n\n const childContext = new SceneContextObject(state);\n\n if (parentContext) {\n parentContext.addChildContext(childContext);\n }\n\n const deactivate = childContext.activate();\n setChildContext(childContext);\n\n return () => {\n deactivate();\n\n if (parentContext) {\n parentContext.removeChildContext(childContext);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentContext, withQueryController]);\n\n if (!childContext) {\n return null;\n }\n\n const innerProvider = <SceneContext.Provider value={childContext}>{children}</SceneContext.Provider>;\n\n if (parentContext) {\n return innerProvider;\n }\n\n // For root context we wrap the provider in a UrlSyncWrapper that handles the hook that updates state on location changes\n return (\n <UrlSyncContextProvider scene={childContext} updateUrlOnInit={true} createBrowserHistorySteps={true}>\n {innerProvider}\n </UrlSyncContextProvider>\n );\n}\n","import { useCallback, useContext, useEffect, useState } from 'react';\nimport { SceneContext } from '../contexts/SceneContextProvider';\nimport { TimeRange } from '@grafana/data';\nimport {\n SceneVariable,\n SceneVariableValueChangedEvent,\n VariableValue,\n sceneGraph,\n SceneTimeRangeLike,\n} from '@grafana/scenes';\nimport { Subscription } from 'rxjs';\n\nexport function useSceneContext() {\n const scene = useContext(SceneContext);\n if (!scene) {\n throw new Error('Cannot find a SceneContext');\n }\n\n return scene;\n}\n\nexport function useTimeRange(): [TimeRange, SceneTimeRangeLike] {\n const scene = useSceneContext();\n const sceneTimeRange = sceneGraph.getTimeRange(scene);\n const { value } = sceneTimeRange.useState();\n\n return [value, sceneTimeRange];\n}\n\n/**\n * Only returns the variables on the closest context level.\n * We could modify it to extract all variables from the full context tree.\n */\nexport function useVariables(): SceneVariable[] {\n const scene = useSceneContext();\n const variables = sceneGraph.getVariables(scene);\n return variables.useState().variables;\n}\n\nexport interface UseUpdateWhenSceneChangesOptions {\n /** Variable names */\n variables?: string[];\n timeRange?: boolean;\n}\n\nexport interface UseUpdateWhenSceneChangesReason {\n variableName?: string;\n variableValue?: VariableValue | undefined | null;\n timeRange?: TimeRange;\n}\n\n/**\n * A utility hook to re-render the calling react component when specified variables or time range changes\n */\nexport function useUpdateWhenSceneChanges({ timeRange, variables = [] }: UseUpdateWhenSceneChangesOptions) {\n const scene = useSceneContext();\n const [updateReason, setUpdateReason] = useState<UseUpdateWhenSceneChangesReason>();\n\n useEffect(() => {\n const subscriptions = new Subscription();\n\n if (variables && variables.length > 0) {\n for (const v of variables) {\n const variable = sceneGraph.lookupVariable(v, scene);\n if (variable) {\n subscriptions.add(\n variable.subscribeToEvent(SceneVariableValueChangedEvent, () => {\n setUpdateReason({ variableName: variable.state.name, variableValue: variable.getValue() });\n })\n );\n }\n }\n }\n\n if (timeRange) {\n const tr = sceneGraph.getTimeRange(scene);\n tr.subscribeToState((newState, oldState) => {\n if (newState.value !== oldState.value) {\n setUpdateReason({ timeRange: newState.value });\n }\n });\n }\n\n return () => subscriptions.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scene, timeRange, ...variables]);\n\n return updateReason;\n}\n\n/**\n * Mainly a utility hook to re-render the calling react component when specified variables or time range changes\n */\nexport function useVariableInterpolator(options: UseUpdateWhenSceneChangesOptions) {\n const scene = useSceneContext();\n\n useUpdateWhenSceneChanges(options);\n\n return useCallback(\n (str: string) => {\n return sceneGraph.interpolate(scene, str);\n },\n [scene]\n );\n}\n","import { SceneObject } from '@grafana/scenes';\nimport { isPlainObject } from 'lodash';\nimport { LRUCache } from 'lru-cache';\n\nexport type CacheKey = CacheKeyPart | CacheKeyPart[];\n\nexport type CacheKeyPart = string | number | object | boolean;\n\nexport type SceneObjectConstructor = { new (...args: never[]): SceneObject };\n\nexport class SceneObjectCache {\n #cache: LRUCache<string, SceneObject>;\n #objectRefIds = new WeakMap<any, number>();\n #objectRefIdCounter = 0;\n\n public constructor() {\n this.#cache = new LRUCache({\n max: 500,\n ttl: 1000 * 60 * 5,\n });\n }\n\n public add(keyHash: string, object: SceneObject) {\n this.#cache.set(keyHash, object);\n }\n\n public get<T>(keyHash: string): T | undefined {\n return this.#cache.get(keyHash) as T;\n }\n\n public getHashKey(key: CacheKey, type: SceneObjectConstructor): string {\n if (Array.isArray(key)) {\n return `${type.name}-${key.map((k) => this.getHashKeyElement(k)).join()}`;\n }\n\n return `${type.name}-${this.getHashKeyElement(key)}`;\n }\n\n public getByRefHashKey(obj: unknown) {\n let objectRefId = this.#objectRefIds.get(obj);\n if (objectRefId == null) {\n objectRefId = this.#objectRefIdCounter++;\n this.#objectRefIds.set(obj, objectRefId);\n }\n\n return objectRefId;\n }\n\n private getHashKeyElement<T>(key: CacheKey) {\n if (typeof key === 'string' || typeof key === 'boolean' || typeof key === 'number') {\n return key;\n }\n\n return getObjectHash(key);\n }\n}\n\nlet cache: SceneObjectCache | undefined;\n\nexport function getSceneObjectCache(): SceneObjectCache {\n if (cache) {\n return cache;\n }\n\n return (cache = new SceneObjectCache());\n}\n\n/**\n * Returns a unique hash key string for the given object reference.\n */\nexport function cacheByRef(value: unknown) {\n const cache = getSceneObjectCache();\n return cache.getByRefHashKey(value);\n}\n\nexport function getObjectHash(obj: unknown): string {\n return JSON.stringify(obj, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {} as any)\n : val\n );\n}\n","import { useEffect, useId } from 'react';\nimport { SceneObject, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\nimport { CacheKey, SceneObjectConstructor, getSceneObjectCache } from '../caching/SceneObjectCache';\n\nexport interface UseSceneObjectProps<T extends SceneObject> {\n factory: (key: string) => T;\n cacheKey?: CacheKey;\n objectConstructor: SceneObjectConstructor;\n}\n\n/**\n * Helper hook that handles adding and removing the scene object from the scene object graph.\n * Also handles the lookup of the object from the cache if a cache key is provided.\n */\nexport function useSceneObject<T extends SceneObject>(options: UseSceneObjectProps<T>) {\n const scene = useSceneContext();\n const key = useId();\n const cache = getSceneObjectCache();\n let cacheKeyHash = options.cacheKey ? cache.getHashKey(options.cacheKey, options.objectConstructor) : undefined;\n\n let obj = scene.findByKey<T>(key);\n\n if (!obj && cacheKeyHash) {\n obj = cache.get<T>(cacheKeyHash);\n\n if (obj && obj.parent !== scene) {\n // Before clearing parent make sure the object is not already in the scene\n if (sceneGraph.findObject(scene, (sceneObj) => sceneObj === obj)) {\n console.error('A scene object cache key matched an object that is already in the scene');\n obj = undefined;\n // Setting this to undefined so that we later do not add/overwrite the object that is already in the scene\n cacheKeyHash = undefined;\n } else {\n obj.clearParent();\n }\n }\n }\n\n if (!obj) {\n obj = options.factory(key);\n if (cacheKeyHash) {\n cache.add(cacheKeyHash, obj);\n }\n }\n\n useEffect(() => scene.addToScene(obj), [obj, scene]);\n\n return obj;\n}\n","import { useEffect } from 'react';\nimport { SceneDataQuery, SceneQueryRunner } from '@grafana/scenes';\nimport { DataSourceRef } from '@grafana/schema';\nimport { isEqual } from 'lodash';\nimport { CacheKey } from '../caching/SceneObjectCache';\nimport { useSceneObject } from './useSceneObject';\n\nexport interface UseQueryOptions {\n queries: SceneDataQuery[];\n maxDataPoints?: number;\n datasource?: DataSourceRef;\n cacheKey?: CacheKey;\n liveStreaming?: boolean;\n maxDataPointsFromWidth?: boolean;\n}\n\n/**\n * Maintains the state of SceneQueryRunner in the scene\n *\n * @example // To access query results do\n * const query = useQueryRunner(...);\n * const { data } = query.useState();\n */\nexport function useQueryRunner(options: UseQueryOptions): SceneQueryRunner {\n const queryRunner = useSceneObject({\n factory: (key) =>\n new SceneQueryRunner({\n key: key,\n queries: options.queries,\n maxDataPoints: options.maxDataPoints,\n datasource: options.datasource,\n liveStreaming: options.liveStreaming,\n maxDataPointsFromWidth: options.maxDataPointsFromWidth,\n }),\n objectConstructor: SceneQueryRunner,\n cacheKey: options.cacheKey,\n });\n\n // Update queries when they change\n useEffect(() => {\n if (!isEqual(queryRunner.state.queries, options.queries)) {\n queryRunner.setState({ queries: options.queries });\n queryRunner.runQueries();\n }\n }, [queryRunner, options]);\n\n return queryRunner;\n}\n","import {\n CustomTransformerDefinition,\n DataProviderProxy,\n SceneDataProvider,\n SceneDataTransformer,\n} from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\nimport { useEffect, useId } from 'react';\nimport { isEqual } from 'lodash';\nimport { DataTransformerConfig } from '@grafana/schema';\n\nexport interface UseDataTransformerOptions {\n transformations: Array<DataTransformerConfig | CustomTransformerDefinition>;\n data: SceneDataProvider;\n}\n\nexport function useDataTransformer(options: UseDataTransformerOptions) {\n const scene = useSceneContext();\n const key = useId();\n\n let dataTransformer = scene.findByKey<SceneDataTransformer>(key);\n\n if (!dataTransformer) {\n dataTransformer = new SceneDataTransformer({\n key: key,\n $data: new DataProviderProxy({ source: options.data.getRef() }),\n transformations: options.transformations,\n });\n }\n\n useEffect(() => scene.addToScene(dataTransformer), [dataTransformer, scene]);\n\n useEffect(() => {\n if (!isEqual(dataTransformer.state.transformations, options.transformations)) {\n dataTransformer.setState({ transformations: options.transformations });\n dataTransformer.reprocessTransformations();\n }\n }, [dataTransformer, options.transformations]);\n\n return dataTransformer;\n}\n","import { TimeRangePicker as TimeRangePickerUI } from '@grafana/ui';\nimport React from 'react';\nimport { useTimeRange } from '../hooks/hooks';\n\nexport interface Props {}\n\nexport function TimeRangePicker(props: Props) {\n const [value, sceneTimeRange] = useTimeRange();\n\n return (\n <TimeRangePickerUI\n isOnCanvas={true}\n value={value}\n onChange={sceneTimeRange.onTimeRangeChange}\n timeZone={sceneTimeRange.getTimeZone()}\n onMoveBackward={() => {}}\n onMoveForward={() => {}}\n onZoom={() => {}}\n onChangeTimeZone={() => {}}\n onChangeFiscalYearStartMonth={() => {}}\n />\n );\n}\n","import React from 'react';\nimport { ControlsLayout, sceneGraph, VariableValueSelectWrapper } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\n\nexport interface Props {\n name: string;\n hideLabel?: boolean;\n layout?: ControlsLayout;\n}\n\nexport function VariableControl({ name, hideLabel, layout }: Props) {\n const scene = useSceneContext();\n const variable = sceneGraph.lookupVariable(name, scene);\n\n if (!variable) {\n return <div>Variable {name} not found</div>;\n }\n\n return (\n <VariableValueSelectWrapper key={variable.state.key} variable={variable} hideLabel={hideLabel} layout={layout} />\n );\n}\n","import React, { useEffect, useId } from 'react';\nimport {\n SceneDataProvider,\n VizPanel as VizPanelObject,\n VizPanelState,\n VizConfig,\n DataProviderProxy,\n SceneDataNode,\n} from '@grafana/scenes';\nimport { usePrevious } from 'react-use';\nimport { getPanelOptionsWithDefaults } from '@grafana/data';\nimport { writeSceneLog } from '../utils';\nimport { useSceneContext } from '../hooks/hooks';\n\nexport interface VizPanelProps {\n title: string;\n dataProvider?: SceneDataProvider;\n viz: VizConfig;\n headerActions?: React.ReactNode;\n}\n\nexport function VizPanel(props: VizPanelProps) {\n const { title, viz, dataProvider, headerActions } = props;\n const scene = useSceneContext();\n const key = useId();\n const prevProps = usePrevious(props);\n\n let panel = scene.findByKey<VizPanelObject>(key);\n\n if (!panel) {\n panel = new VizPanelObject({\n key: key,\n title: title,\n pluginId: viz.pluginId,\n pluginVersion: viz.pluginVersion,\n options: viz.options,\n fieldConfig: viz.fieldConfig,\n $data: getDataProviderForVizPanel(dataProvider),\n headerActions: headerActions,\n });\n }\n\n useEffect(() => scene.addToScene(panel), [panel, scene]);\n\n // Update options\n useEffect(() => {\n const stateUpdate: Partial<VizPanelState> = {};\n\n if (!prevProps) {\n return;\n }\n\n if (title !== prevProps.title) {\n stateUpdate.title = title;\n }\n\n if (headerActions !== prevProps.headerActions) {\n stateUpdate.headerActions = headerActions;\n }\n\n if (dataProvider !== prevProps.dataProvider) {\n stateUpdate.$data = getDataProviderForVizPanel(dataProvider);\n }\n\n if (viz !== prevProps.viz) {\n if (viz.pluginId === prevProps.viz.pluginId) {\n const plugin = panel.getPlugin();\n if (plugin) {\n const optionsWithDefaults = getPanelOptionsWithDefaults({\n plugin,\n currentOptions: viz.options,\n currentFieldConfig: viz.fieldConfig,\n isAfterPluginChange: false,\n });\n stateUpdate.options = optionsWithDefaults.options;\n stateUpdate.fieldConfig = optionsWithDefaults.fieldConfig;\n\n panel.clearFieldConfigCache();\n }\n }\n }\n\n if (Object.keys(stateUpdate).length > 0) {\n panel.setState(stateUpdate);\n writeSceneLog('VizPanel', 'Updating VizPanel state', stateUpdate);\n }\n }, [panel, title, headerActions, viz, dataProvider, prevProps]);\n\n return <panel.Component model={panel} />;\n}\n\n/**\n * Since the useQueryRunner attaches query runners to the scene context their parent is already set\n * This proxy is to work around that.\n * TODO: Figure out a better way to handle this'\n */\nfunction getDataProviderForVizPanel(data: SceneDataProvider | undefined): SceneDataProvider | undefined {\n if (data && !(data instanceof SceneDataNode)) {\n return new DataProviderProxy({ source: data.getRef() });\n }\n return data;\n}\n","import React, { useEffect, useId } from 'react';\nimport { useSceneContext } from '../hooks/hooks';\nimport { SceneRefreshPicker, SceneRefreshPickerState } from '@grafana/scenes';\nimport { usePrevious } from 'react-use';\n\nexport interface Props {\n refresh?: string;\n withText?: boolean;\n}\n\nexport function RefreshPicker(props: Props) {\n const scene = useSceneContext();\n const key = useId();\n const prevProps = usePrevious(props);\n\n let picker = scene.findByKey<SceneRefreshPicker>(key);\n\n if (!picker) {\n picker = new SceneRefreshPicker({\n key: key,\n ...props,\n });\n }\n\n useEffect(() => scene.addToScene(picker), [picker, scene]);\n\n // Update options\n useEffect(() => {\n const stateUpdate: Partial<SceneRefreshPickerState> = {};\n\n if (!prevProps) {\n return;\n }\n\n if (props.refresh !== prevProps.refresh) {\n stateUpdate.refresh = props.refresh;\n }\n\n if (props.withText !== prevProps.withText) {\n stateUpdate.withText = props.withText;\n }\n\n picker.setState(stateUpdate);\n }, [picker, props, prevProps]);\n\n return <picker.Component model={picker} />;\n}\n","import React from 'react';\nimport { SceneDataLayerProvider, SceneDataLayerSet, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\n\nexport interface Props {\n name: string;\n}\n\nexport function DataLayerControl({ name }: Props) {\n const scene = useSceneContext();\n const layerSets = sceneGraph.getDataLayers(scene);\n\n const layer = getLayer(layerSets, name);\n\n if (!layer) {\n return <div>Annotation {name} not found</div>;\n }\n\n return <layer.Component model={layer} />;\n}\n\nfunction getLayer(layers: SceneDataLayerProvider[], name: string): SceneDataLayerProvider | undefined {\n for (let i = 0; i < layers.length; i++) {\n const layer = (layers[i] as SceneDataLayerSet).state.layers.find((layer) => layer.state.name === name);\n\n if (layer) {\n return layer;\n }\n }\n\n return undefined;\n}\n","import React, { useEffect, useState } from 'react';\nimport { CustomVariable as CustomVariableObject } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { VariableProps } from './types';\n\nexport interface CustomVariableProps extends VariableProps {\n query: string;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function CustomVariable({\n query,\n name,\n label,\n hide,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: CustomVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: CustomVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new CustomVariableObject({ name, label, query, value: initialValue, isMulti, includeAll, hide});\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n variable?.setState({\n label,\n query,\n hide,\n isMulti,\n includeAll\n })\n }, [hide, includeAll, isMulti, label, query, variable]);\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n","import React, { useEffect, useState } from 'react';\nimport { DataSourceVariable as DataSourceVariableObject } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\n\nexport interface DataSourceVariableProps extends VariableProps {\n pluginId: string;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function DataSourceVariable({\n pluginId,\n regex,\n name,\n label,\n hide,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: DataSourceVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: DataSourceVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new DataSourceVariableObject({\n pluginId,\n regex,\n name,\n label,\n value: initialValue,\n isMulti,\n hide,\n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n variable.state.pluginId === pluginId &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll\n ) {\n return;\n }\n\n variable.setState({\n pluginId,\n regex,\n label,\n hide,\n includeAll,\n });\n\n variable.refreshOptions();\n }, [hide, includeAll, label, pluginId, regex, variable, variableAdded]);\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n","import React, { useEffect, useState } from 'react';\nimport { QueryVariable as QueryVariableObject, SceneDataQuery } from '@grafana/scenes';\nimport { useSceneContext } from '../hooks/hooks';\nimport { DataSourceRef, VariableRefresh, VariableSort } from '@grafana/schema';\nimport { VariableProps } from './types';\nimport { isEqual } from 'lodash';\n\nexport interface QueryVariableProps extends VariableProps {\n query: string | SceneDataQuery;\n datasource: DataSourceRef | null;\n regex?: string;\n refresh?: VariableRefresh;\n sort?: VariableSort;\n isMulti?: boolean;\n includeAll?: boolean;\n children: React.ReactNode;\n}\n\nexport function QueryVariable({\n query,\n name,\n datasource,\n label,\n hide,\n regex,\n refresh,\n sort,\n initialValue,\n isMulti,\n includeAll,\n children,\n}: QueryVariableProps): React.ReactNode {\n const scene = useSceneContext();\n const [variableAdded, setVariableAdded] = useState<boolean>();\n\n let variable: QueryVariableObject | undefined = scene.findVariable(name);\n\n if (!variable) {\n variable = new QueryVariableObject({\n name,\n label,\n query,\n datasource,\n refresh,\n sort,\n regex,\n value: initialValue,\n isMulti,\n hide,\n includeAll,\n });\n }\n\n useEffect(() => {\n const removeFn = scene.addVariable(variable);\n setVariableAdded(true);\n return removeFn;\n }, [variable, scene, name]);\n\n useEffect(() => {\n if (!variableAdded) {\n return;\n }\n\n if (\n isEqual(variable.state.query, query) &&\n isEqual(variable.state.datasource, datasource) &&\n variable.state.regex === regex &&\n variable.state.label === label &&\n variable.state.hide === hide &&\n variable.state.includeAll === includeAll &&\n variable.state.refresh === refresh &&\n variable.state.sort === sort\n ) {\n return;\n }\n\n variable.setState({\n label,\n query,\n datasource,\n refresh,\n sort,\n regex,\n hide,\n includeAll,\n });\n\n variable.refreshOptions();\n }, [datasource, hide, includeAll, label, query, refresh, regex, sort, variable, variableAdded]);\n\n // Need to block child rendering until the variable is added so that child components like RVariableSelect find the variable\n if (!variableAdded) {\n return null;\n }\n\n return children;\n}\n","import { NavModelItem, UrlQueryMap, urlUtil } from '@grafana/data';\nimport { locationSearchToObject, locationService } from '@grafana/runtime';\nimport React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { useTimeRange, useVariables } from '../hooks/hooks';\n\n/**\n * Code and concepts copied from https://github.com/grafana/hackathon-2023-12-grafana-react/blob/main/src/grafana-react\n *\n * These contexts & components needs some more thought and naming considerations, just a quick proof of concept for now.\n */\n\ntype BreadcrumbItem = Pick<NavModelItem, 'text' | 'url'>;\n\nexport interface BreadcrumbContextValue {\n breadcrumbs: BreadcrumbItem[];\n addBreadcrumb(breadcrumb: BreadcrumbItem): void;\n removeBreadcrumb(breadcrumb: BreadcrumbItem): void;\n}\n\nexport const BreadcrumbContext = createContext<BreadcrumbContextValue>({\n breadcrumbs: [],\n addBreadcrumb: () => {},\n removeBreadcrumb: () => {},\n});\n\nexport function BreadcrumbProvider({ children }: { children: React.ReactNode }) {\n const [breadcrumbs, setBreadcrumbs] = useState<BreadcrumbItem[]>([]);\n\n return (\n <BreadcrumbContext.Provider\n value={{\n breadcrumbs,\n addBreadcrumb: useCallback((breadcrumb: BreadcrumbItem) => setBreadcrumbs((prev) => [...prev, breadcrumb]), []),\n removeBreadcrumb: useCallback(\n (breadcrumb: BreadcrumbItem) => setBreadcrumbs((prev) => prev.filter((b) => b.url !== breadcrumb.url)),\n []\n ),\n }}\n >\n {children}\n </BreadcrumbContext.Provider>\n );\n}\n\nexport interface BreadcrumbProps {\n text: string;\n path: string;\n extraKeys?: string[];\n}\n\nexport function Breadcrumb({ text, path, extraKeys }: BreadcrumbProps): React.ReactNode {\n const { addBreadcrumb, removeBreadcrumb } = useContext(BreadcrumbContext);\n\n const buildUrl = useUrlBuilder();\n\n useEffect(() => {\n const breadcrumb = {\n text,\n url: buildUrl(path, extraKeys),\n };\n\n addBreadcrumb(breadcrumb);\n\n return () => {\n removeBreadcrumb(breadcrumb);\n };\n }, [text, path, extraKeys, addBreadcrumb, buildUrl, removeBreadcrumb]);\n\n return null;\n}\n\nfunction useUrlBuilder() {\n const queryParams = useQueryParams()[0];\n const variables = useVariables();\n const [_, timeRange] = useTimeRange();\n\n return useCallback(\n (urlBase: string, extraKeys: string[] | undefined) => {\n const params: UrlQueryMap = {};\n\n for (const v of variables) {\n if (v.urlSync && !v.state.skipUrlSync) {\n const state = v.urlSync.getUrlState();\n Object.assign(params, state);\n }\n }\n\n if (timeRange.urlSync) {\n const state = timeRange.urlSync.getUrlState();\n Object.assign(params, state);\n }\n\n if (extraKeys) {\n for (const extra of extraKeys) {\n if (queryParams[extra]) {\n params[extra] = queryParams[extra];\n }\n }\n }\n\n return urlUtil.renderUrl(urlBase, params);\n },\n [variables, queryParams, timeRange]\n );\n}\n\nfunction useQueryParams(): [UrlQueryMap, (values: UrlQueryMap, replace?: boolean) => void] {\n const { search } = useLocation();\n const queryParams = useMemo(() => locationSearchToObject(search || ''), [search]);\n const update = useCallback((values: UrlQueryMap, replace?: boolean) => locationService.partial(values, replace), []);\n return [queryParams, update];\n}\n","import { SceneVariables, VariableValueSingle, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\n\nexport function useVariableValues<T = VariableValueSingle>(name: string): [T[] | undefined, boolean] {\n const scene = useSceneContext();\n const variable = sceneGraph.lookupVariable(name, scene);\n\n if (!variable) {\n return [undefined, false];\n }\n\n variable.useState();\n\n const set = variable.parent as SceneVariables;\n const isLoading = set.isVariableLoadingOrWaitingToUpdate(variable);\n let value = variable.getValue();\n\n if (value == null) {\n return [undefined, isLoading];\n }\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n return [value as T[], isLoading];\n}\n","import { QueryVariable, SceneDataQuery, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\nimport { useEffect } from 'react';\nimport { isEqual } from 'lodash';\n\ninterface QueryVariableOptions {\n name: string;\n datasource: string;\n query: string | SceneDataQuery;\n regex?: string;\n}\n\n/**\n * A custom hook that creates or updates a `QueryVariable` in the scene context.\n * \n * @param {QueryVariableOptions} options - Options for configuring the `QueryVariable`.\n * @returns {QueryVariable | null} The `QueryVariable` instance or `null`.\n * \n * @example\n * // Usage example\n * const variable = useQueryVariable({\n * name: \"myQueryVariable\",\n * datasource: \"gdev-testdata\",\n * query: \"*\",\n * regex: \".*someFilter.*\"\n * });\n * \n * // Returns a QueryVariable instance or null if not a valid QueryVariable\n * if (variable) {\n * console.log(\"Variable added to the scene:\", variable);\n * }\n */\nexport function useQueryVariable(options: QueryVariableOptions): QueryVariable | null {\n const scene = useSceneContext();\n let variable = sceneGraph.lookupVariable(options.name, scene);\n\n if (!variable) {\n variable = new QueryVariable({ name: options.name, datasource: { uid: options.datasource }, query: options.query, regex: options.regex });\n }\n\n if (!(variable instanceof QueryVariable)) {\n variable = null;\n }\n\n useEffect(() => {\n if (variable) {\n scene.addVariable(variable)\n }\n }, [variable, scene]);\n\n useEffect(() => {\n if (\n variable?.state.datasource?.uid !== options.datasource ||\n !isEqual(variable?.state.query, options.query) ||\n variable?.state.regex !== options.regex\n ) {\n variable?.setState({ datasource: { uid: options.datasource }, query: options.query, regex: options.regex });\n variable?.refreshOptions();\n }\n }, [options, variable]);\n\n return variable;\n}\n","import { MultiValueVariable, SceneVariables, VariableValueSingle, sceneGraph } from '@grafana/scenes';\nimport { useSceneContext } from './hooks';\n\nexport function useVariableValue<T = VariableValueSingle>(name: string): [T | undefined, boolean] {\n const scene = useSceneContext();\n const variable = sceneGraph.lookupVariable(name, scene);\n\n if (!variable || (variable instanceof MultiValueVariable && variable.state.isMulti === true)) {\n return [undefined, false];\n }\n\n variable.useState();\n\n const set = variable.parent as SceneVariables;\n const isLoading = set.isVariableLoadingOrWaitingToUpdate(variable);\n let value = variable.getValue();\n\n if (value == null) {\n return [undefined, isLoading];\n }\n\n return [value as T, isLoading];\n}\n","import React, { useEffect, useState } from 'react';\nimport { useSceneContext } from '../hooks/hooks';\nimport { AnnotationQuery } from '@grafana/data';\nimport { SceneDataLayerSet, dataLayers } from '@grafana/scenes';\nimport { SceneContextObject } from '../contexts/SceneContextObject';\nimport { writeSceneLog } from '../utils';\n\nexport interface AnnotationLayerSetProps {\n name: string;\n query: AnnotationQuery;\n children: React.ReactNode;\n}\n\nexport function AnnotationLayer({ name, query, children }: AnnotationLayerSetProps): React.ReactNode {\n const scene = useSceneContext();\n const [annotationAdded, setAnnotationAdded] = useState<boolean>();\n\n let annotation: dataLayers.AnnotationsDataLayer | undefined = findAnnotationLayer(scene, name);\n\n if (!annotation) {\n annotation = new dataLayers.AnnotationsDataLayer({ name, query });\n }\n\n useEffect(() => {\n const removeFn = addAnnotationLayer(scene, annotation);\n setAnnotationAdded(true);\n return removeFn;\n }, [scene, name, annotation]);\n\n useEffect(() => {\n // Handle prop changes\n }, [annotationAdded]);\n\n if (!annotationAdded) {\n return null;\n }\n\n return children;\n}\n\nfunction findAnnotationLayer<T>(scene: SceneContextObject, name: string): T | undefined {\n const annotations = scene.state.$data as SceneDataLayerSet;\n\n if (!annotations) {\n return;\n }\n\n return annotations.state.layers.find((anno) => anno.state.name === name) as T;\n}\n\nfunction addAnnotationLayer(scene: SceneContextObject, layer: dataLayers.AnnotationsDataLayer) {\n let set = scene.state.$data as SceneDataLayerSet;\n\n if (set) {\n set.setState({ layers: [...set.state.layers, layer] });\n } else {\n set = new SceneDataLayerSet({ layers: [layer] });\n scene.setState({ $data: set });\n }\n\n writeSceneLog('SceneContext', `Adding annotation data layer: ${layer.state.name} key: ${layer.state.key}`);\n\n return () => {\n set.setState({ layers: set.state.layers.filter((x) => x !== layer) });\n writeSceneLog('SceneContext', `Removing annotation data layer: ${layer.state.name} key: ${layer.state.key}`);\n };\n}\n","import React from 'react';\nimport { EmbeddedScene, EmbeddedSceneState, SceneComponentProps } from '@grafana/scenes';\nimport { SceneContext } from '../contexts/SceneContextProvider';\nimport { SceneContextObject } from '../contexts/SceneContextObject';\n\nexport class EmbeddedSceneWithContext extends EmbeddedScene {\n public constructor(state: EmbeddedSceneState) {\n super({ ...state, context: new SceneContextObject() });\n }\n\n public static Component = ({ model }: SceneComponentProps<EmbeddedSceneWithContext>) => {\n return (\n <SceneContext.Provider value={model.state.context as SceneContextObject}>\n <EmbeddedScene.Component model={model} />\n </SceneContext.Provider>\n );\n };\n}\n","import { useTheme2 } from '@grafana/ui';\nimport React, { CSSProperties } from 'react';\n\nexport interface Props {\n minWidth?: number;\n minHeight?: number;\n children: React.ReactNode;\n}\n\n/**\n * Simple css grid layout for visualizations\n */\nexport function VizGridLayout({ children, minWidth = 400, minHeight = 320 }: Props) {\n const theme = useTheme2();\n const style: CSSProperties = {\n display: 'grid',\n flexGrow: 1,\n gridTemplateColumns: `repeat(auto-fit, minmax(${minWidth}px, 1fr))`,\n gridAutoRows: `minmax(${minHeight}px, auto)`,\n columnGap: theme.spacing(1),\n rowGap: theme.spacing(1),\n };\n\n return <div style={style}>{children}</div>;\n}\n"],"names":["SceneObjectBase","__spreadProps","NewSceneObjectAddedEvent","SceneVariableSet","createContext","useContext","useState","useEffect","behaviors","SceneTimeRange","childContext","React","UrlSyncContextProvider","sceneGraph","Subscription","SceneVariableValueChangedEvent","useCallback","LRUCache","isPlainObject","useId","SceneQueryRunner","isEqual","SceneDataTransformer","DataProviderProxy","TimeRangePickerUI","VariableValueSelectWrapper","usePrevious","VizPanelObject","getPanelOptionsWithDefaults","SceneDataNode","SceneRefreshPicker","__spreadValues","layer","CustomVariableObject","DataSourceVariableObject","QueryVariableObject","urlUtil","useLocation","useMemo","locationSearchToObject","locationService","QueryVariable","MultiValueVariable","dataLayers","SceneDataLayerSet","EmbeddedScene","useTheme2"],"mappings":";;;;;;;;;;;;;;;;;;;AAAgB,SAAA,aAAA,CAAc,MAAgB,EAAA,OAAA,EAAA,GAAoB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IAC3B,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,CAAA;AAAA,IACV,qBAAqB,CAA2B,wBAAA,EAAA,QAAA,CAAA,SAAA,CAAA;AAAA,IAChD,cAAc,CAAU,OAAA,EAAA,SAAA,CAAA,SAAA,CAAA;AAAA,IACxB,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,MAAA,EAAQ,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GACzB,CAAA;AAEA,EAAA,uBAAQnC,yBAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,IAAI,KAAA;AAAA,GAAA,EAAe,QAAS,CAAA,CAAA;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/scenes-react",
3
- "version": "5.25.1--canary.967.11837797508.0",
3
+ "version": "5.25.1--canary.858.11930656504.0",
4
4
  "description": "Grafana framework for building dynamic dashboards",
5
5
  "author": "Grafana Labs",
6
6
  "license": "AGPL-3.0-only",
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/grafana/scenes/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@grafana/scenes": "5.25.1--canary.967.11837797508.0",
40
+ "@grafana/scenes": "5.25.1--canary.858.11930656504.0",
41
41
  "lru-cache": "^10.2.2",
42
42
  "react-use": "^17.4.0"
43
43
  },
@@ -113,5 +113,5 @@
113
113
  "prettier --write"
114
114
  ]
115
115
  },
116
- "gitHead": "7e8b28226e6f294b2e6cfaf2b3ce39982b231e66"
116
+ "gitHead": "bdfd751c0202c9120d26bb35ffd16e39abedb9aa"
117
117
  }