@grafana/scenes 6.1.2--canary.990.13540617999.0 → 6.1.3--canary.1063.13548554287.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/esm/behaviors/SceneQueryController.js +2 -2
  3. package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
  4. package/dist/esm/components/SceneApp/SceneApp.js +3 -9
  5. package/dist/esm/components/SceneApp/SceneApp.js.map +1 -1
  6. package/dist/esm/components/SceneApp/SceneAppPage.js +0 -16
  7. package/dist/esm/components/SceneApp/SceneAppPage.js.map +1 -1
  8. package/dist/esm/components/SceneRefreshPicker.js +2 -2
  9. package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
  10. package/dist/esm/core/SceneTimeRange.js +1 -1
  11. package/dist/esm/core/SceneTimeRange.js.map +1 -1
  12. package/dist/esm/core/sceneGraph/index.js +2 -3
  13. package/dist/esm/core/sceneGraph/index.js.map +1 -1
  14. package/dist/esm/core/sceneGraph/sceneGraph.js +1 -6
  15. package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
  16. package/dist/esm/core/sceneGraph/utils.js +10 -4
  17. package/dist/esm/core/sceneGraph/utils.js.map +1 -1
  18. package/dist/esm/index.js +0 -1
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/querying/SceneQueryRunner.js +8 -33
  21. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  22. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js +4 -10
  23. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
  24. package/dist/esm/variables/components/VariableValueSelect.js +2 -2
  25. package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
  26. package/dist/esm/variables/groupby/GroupByVariable.js +2 -3
  27. package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
  28. package/dist/index.d.ts +22 -58
  29. package/dist/index.js +34 -190
  30. package/dist/index.js.map +1 -1
  31. package/package.json +2 -2
  32. package/dist/esm/core/SceneScopesBridge.js +0 -111
  33. package/dist/esm/core/SceneScopesBridge.js.map +0 -1
package/dist/index.js CHANGED
@@ -537,23 +537,28 @@ function cloneSceneObjectState(sceneState, withState) {
537
537
  continue;
538
538
  }
539
539
  const propValue = clonedState[key];
540
- if (propValue instanceof SceneObjectBase) {
541
- clonedState[key] = propValue.clone();
542
- }
543
540
  if (propValue instanceof SceneObjectRef) {
544
541
  console.warn("Cloning object with SceneObjectRef");
545
542
  continue;
546
543
  }
547
- if (Array.isArray(propValue)) {
544
+ if (propValue instanceof SceneObjectBase) {
545
+ clonedState[key] = propValue.clone();
546
+ } else if (Array.isArray(propValue)) {
548
547
  const newArray = [];
549
548
  for (const child of propValue) {
550
549
  if (child instanceof SceneObjectBase) {
551
550
  newArray.push(child.clone());
551
+ } else if (typeof child === "object") {
552
+ newArray.push(lodash.cloneDeep(child));
552
553
  } else {
553
554
  newArray.push(child);
554
555
  }
555
556
  }
556
557
  clonedState[key] = newArray;
558
+ } else if (typeof propValue === "object") {
559
+ clonedState[key] = lodash.cloneDeep(propValue);
560
+ } else {
561
+ clonedState[key] = propValue;
557
562
  }
558
563
  }
559
564
  return clonedState;
@@ -861,11 +866,11 @@ class SceneQueryController extends SceneObjectBase {
861
866
  return () => __privateGet$2(this, _running).clear();
862
867
  });
863
868
  }
864
- startProfile(source) {
869
+ startProfile(name) {
865
870
  if (!this.state.enableProfiling) {
866
871
  return;
867
872
  }
868
- this.profiler.startProfile(source.constructor.name);
873
+ this.profiler.startProfile(name);
869
874
  }
870
875
  queryStarted(entry) {
871
876
  __privateGet$2(this, _running).add(entry);
@@ -1137,7 +1142,7 @@ class SceneTimeRange extends SceneObjectBase {
1137
1142
  );
1138
1143
  if (update.from !== this.state.from || update.to !== this.state.to) {
1139
1144
  const queryController = getQueryController(this);
1140
- queryController == null ? void 0 : queryController.startProfile(this);
1145
+ queryController == null ? void 0 : queryController.startProfile("SceneTimeRange");
1141
1146
  this._urlSync.performBrowserHistoryAction(() => {
1142
1147
  this.setState(update);
1143
1148
  });
@@ -2931,7 +2936,7 @@ function VariableValueSelect({ model }) {
2931
2936
  "data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`),
2932
2937
  onChange: (newValue) => {
2933
2938
  model.changeValueTo(newValue.value, newValue.label, true);
2934
- queryController == null ? void 0 : queryController.startProfile(model);
2939
+ queryController == null ? void 0 : queryController.startProfile("VariableValueSelect");
2935
2940
  if (hasCustomValue !== newValue.__isNew__) {
2936
2941
  setHasCustomValue(newValue.__isNew__);
2937
2942
  }
@@ -2998,7 +3003,7 @@ function VariableValueSelectMulti({ model }) {
2998
3003
  onInputChange,
2999
3004
  onBlur: () => {
3000
3005
  model.changeValueTo(uncommittedValue, void 0, true);
3001
- queryController == null ? void 0 : queryController.startProfile(model);
3006
+ queryController == null ? void 0 : queryController.startProfile("VariableValueSelectMulti");
3002
3007
  },
3003
3008
  filterOption: filterNoOp$2,
3004
3009
  "data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`),
@@ -3228,7 +3233,7 @@ class GroupByVariable extends MultiValueVariable {
3228
3233
  this.isLazy = true;
3229
3234
  this._urlSync = new GroupByVariableUrlSyncHandler(this);
3230
3235
  this._getKeys = async (ds) => {
3231
- var _a, _b, _c, _d;
3236
+ var _a, _b, _c;
3232
3237
  const override = await ((_b = (_a = this.state).getTagKeysProvider) == null ? void 0 : _b.call(_a, this, null));
3233
3238
  if (override && override.replace) {
3234
3239
  return override.values;
@@ -3245,8 +3250,7 @@ class GroupByVariable extends MultiValueVariable {
3245
3250
  const response = await ds.getTagKeys(__spreadValues$F({
3246
3251
  filters: otherFilters,
3247
3252
  queries,
3248
- timeRange,
3249
- scopes: (_d = this._scopesBridge) == null ? void 0 : _d.getValue()
3253
+ timeRange
3250
3254
  }, getEnrichedFiltersRequest(this)));
3251
3255
  if (responseHasError(response)) {
3252
3256
  this.setState({ error: response.error.message });
@@ -5384,13 +5388,9 @@ class AdHocFiltersVariable extends SceneObjectBase {
5384
5388
  this._scopedVars = { __sceneObject: wrapInSafeSerializableSceneObject(this) };
5385
5389
  this._dataSourceSrv = runtime.getDataSourceSrv();
5386
5390
  this._urlSync = new AdHocFiltersVariableUrlSyncHandler(this);
5387
- this._activationHandler = () => {
5388
- this._scopesBridge = sceneGraph.getScopesBridge(this);
5389
- };
5390
5391
  if (this.state.applyMode === "auto") {
5391
5392
  patchGetAdhocFilters(this);
5392
5393
  }
5393
- this.addActivationHandler(this._activationHandler);
5394
5394
  }
5395
5395
  setState(update) {
5396
5396
  let filterExpressionChanged = false;
@@ -5474,7 +5474,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
5474
5474
  }
5475
5475
  }
5476
5476
  async _getKeys(currentKey) {
5477
- var _a, _b, _c, _d;
5477
+ var _a, _b, _c;
5478
5478
  const override = await ((_b = (_a = this.state).getTagKeysProvider) == null ? void 0 : _b.call(_a, this, currentKey));
5479
5479
  if (override && override.replace) {
5480
5480
  return dataFromResponse(override.values).map(toSelectableValue);
@@ -5492,8 +5492,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
5492
5492
  const response = await ds.getTagKeys(__spreadValues$z({
5493
5493
  filters: otherFilters,
5494
5494
  queries,
5495
- timeRange,
5496
- scopes: (_d = this._scopesBridge) == null ? void 0 : _d.getValue()
5495
+ timeRange
5497
5496
  }, getEnrichedFiltersRequest(this)));
5498
5497
  if (responseHasError(response)) {
5499
5498
  this.setState({ error: response.error.message });
@@ -5509,7 +5508,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
5509
5508
  return keys.map(toSelectableValue);
5510
5509
  }
5511
5510
  async _getValuesFor(filter) {
5512
- var _a, _b, _c, _d;
5511
+ var _a, _b, _c;
5513
5512
  const override = await ((_b = (_a = this.state).getTagValuesProvider) == null ? void 0 : _b.call(_a, this, filter));
5514
5513
  if (override && override.replace) {
5515
5514
  return dataFromResponse(override.values).map(toSelectableValue);
@@ -5525,8 +5524,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
5525
5524
  key: filter.key,
5526
5525
  filters: otherFilters,
5527
5526
  timeRange,
5528
- queries,
5529
- scopes: (_d = this._scopesBridge) == null ? void 0 : _d.getValue()
5527
+ queries
5530
5528
  }, getEnrichedFiltersRequest(this)));
5531
5529
  if (responseHasError(response)) {
5532
5530
  this.setState({ error: response.error.message });
@@ -5714,7 +5712,6 @@ class SceneQueryRunner extends SceneObjectBase {
5714
5712
  _onActivate() {
5715
5713
  if (this.isQueryModeAuto()) {
5716
5714
  const timeRange = sceneGraph.getTimeRange(this);
5717
- const scopesBridge = sceneGraph.getScopesBridge(this);
5718
5715
  const providers = this.getClosestExtraQueryProviders();
5719
5716
  for (const provider of providers) {
5720
5717
  this._subs.add(
@@ -5725,7 +5722,6 @@ class SceneQueryRunner extends SceneObjectBase {
5725
5722
  })
5726
5723
  );
5727
5724
  }
5728
- this.subscribeToScopesChanges(scopesBridge);
5729
5725
  this.subscribeToTimeRangeChanges(timeRange);
5730
5726
  if (this.shouldRunQueriesOnActivate()) {
5731
5727
  this.runQueries();
@@ -5871,21 +5867,6 @@ class SceneQueryRunner extends SceneObjectBase {
5871
5867
  isDataReadyToDisplay() {
5872
5868
  return Boolean(this.state._hasFetchedData);
5873
5869
  }
5874
- subscribeToScopesChanges(scopesBridge) {
5875
- if (!scopesBridge) {
5876
- return;
5877
- }
5878
- if (this._scopesSubBridge === scopesBridge) {
5879
- return;
5880
- }
5881
- if (this._scopesSub) {
5882
- this._scopesSub.unsubscribe();
5883
- }
5884
- this._scopesSubBridge = scopesBridge;
5885
- this._scopesSub = scopesBridge.subscribeToValue(() => {
5886
- this.runWithTimeRangeAndScopes(sceneGraph.getTimeRange(this), scopesBridge);
5887
- });
5888
- }
5889
5870
  subscribeToTimeRangeChanges(timeRange) {
5890
5871
  if (this._timeSubRange === timeRange) {
5891
5872
  return;
@@ -5895,17 +5876,15 @@ class SceneQueryRunner extends SceneObjectBase {
5895
5876
  }
5896
5877
  this._timeSubRange = timeRange;
5897
5878
  this._timeSub = timeRange.subscribeToState(() => {
5898
- this.runWithTimeRangeAndScopes(timeRange, sceneGraph.getScopesBridge(this));
5879
+ this.runWithTimeRange(timeRange);
5899
5880
  });
5900
5881
  }
5901
5882
  runQueries() {
5902
5883
  const timeRange = sceneGraph.getTimeRange(this);
5903
- const scopesBridge = sceneGraph.getScopesBridge(this);
5904
5884
  if (this.isQueryModeAuto()) {
5905
5885
  this.subscribeToTimeRangeChanges(timeRange);
5906
- this.subscribeToScopesChanges(scopesBridge);
5907
5886
  }
5908
- this.runWithTimeRangeAndScopes(timeRange, scopesBridge);
5887
+ this.runWithTimeRange(timeRange);
5909
5888
  }
5910
5889
  getMaxDataPoints() {
5911
5890
  var _a;
@@ -5925,8 +5904,8 @@ class SceneQueryRunner extends SceneObjectBase {
5925
5904
  data: __spreadProps$m(__spreadValues$y({}, this.state.data), { state: schema.LoadingState.Done })
5926
5905
  });
5927
5906
  }
5928
- async runWithTimeRangeAndScopes(timeRange, scopesBridge) {
5929
- var _a, _b, _c, _d;
5907
+ async runWithTimeRange(timeRange) {
5908
+ var _a, _b, _c;
5930
5909
  if (!this.state.maxDataPoints && this.state.maxDataPointsFromWidth && !this._containerWidth) {
5931
5910
  return;
5932
5911
  }
@@ -5939,22 +5918,17 @@ class SceneQueryRunner extends SceneObjectBase {
5939
5918
  this.setState({ data: __spreadProps$m(__spreadValues$y({}, (_b = this.state.data) != null ? _b : emptyPanelData), { state: schema.LoadingState.Loading }) });
5940
5919
  return;
5941
5920
  }
5942
- if (scopesBridge == null ? void 0 : scopesBridge.isLoading()) {
5943
- writeSceneLog("SceneQueryRunner", "Scopes are in loading state, skipping query execution");
5944
- this.setState({ data: __spreadProps$m(__spreadValues$y({}, (_c = this.state.data) != null ? _c : emptyPanelData), { state: schema.LoadingState.Loading }) });
5945
- return;
5946
- }
5947
5921
  const { queries } = this.state;
5948
5922
  if (!(queries == null ? void 0 : queries.length)) {
5949
5923
  this._setNoDataState();
5950
5924
  return;
5951
5925
  }
5952
5926
  try {
5953
- const datasource = (_d = this.state.datasource) != null ? _d : findFirstDatasource(queries);
5927
+ const datasource = (_c = this.state.datasource) != null ? _c : findFirstDatasource(queries);
5954
5928
  const ds = await getDataSource(datasource, this._scopedVars);
5955
5929
  this.findAndSubscribeToAdHocFilters(ds.uid);
5956
5930
  const runRequest = runtime.getRunRequest();
5957
- const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds, scopesBridge);
5931
+ const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);
5958
5932
  writeSceneLog("SceneQueryRunner", "Starting runRequest", this.state.key);
5959
5933
  let stream = runRequest(ds, primary);
5960
5934
  if (secondaries.length > 0) {
@@ -5993,7 +5967,7 @@ class SceneQueryRunner extends SceneObjectBase {
5993
5967
  clone["_results"].next({ origin: this, data: (_a = this.state.data) != null ? _a : emptyPanelData });
5994
5968
  return clone;
5995
5969
  }
5996
- prepareRequests(timeRange, ds, scopesBridge) {
5970
+ prepareRequests(timeRange, ds) {
5997
5971
  var _a;
5998
5972
  const { minInterval, queries } = this.state;
5999
5973
  let request = __spreadValues$y({
@@ -6013,8 +5987,7 @@ class SceneQueryRunner extends SceneObjectBase {
6013
5987
  to: timeRange.state.to
6014
5988
  },
6015
5989
  cacheTimeout: this.state.cacheTimeout,
6016
- queryCachingTTL: this.state.queryCachingTTL,
6017
- scopes: scopesBridge == null ? void 0 : scopesBridge.getValue()
5990
+ queryCachingTTL: this.state.queryCachingTTL
6018
5991
  }, getEnrichedDataRequest(this));
6019
5992
  if (this._adhocFiltersVar) {
6020
5993
  request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
@@ -6982,108 +6955,6 @@ function containsSearchFilter(query) {
6982
6955
  return str.indexOf(SEARCH_FILTER_VARIABLE) > -1;
6983
6956
  }
6984
6957
 
6985
- class SceneScopesBridge extends SceneObjectBase {
6986
- constructor() {
6987
- super(...arguments);
6988
- this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["scopes"] });
6989
- this._renderBeforeActivation = true;
6990
- this._contextSubject = new rxjs.BehaviorSubject(void 0);
6991
- this._pendingScopes = null;
6992
- }
6993
- getUrlState() {
6994
- var _a, _b, _c;
6995
- return {
6996
- scopes: (_c = this._pendingScopes) != null ? _c : ((_b = (_a = this.context) == null ? void 0 : _a.state.value) != null ? _b : []).map((scope) => scope.metadata.name)
6997
- };
6998
- }
6999
- updateFromUrl(values) {
7000
- var _a, _b;
7001
- let scopes = (_a = values["scopes"]) != null ? _a : [];
7002
- scopes = (Array.isArray(scopes) ? scopes : [scopes]).map(String);
7003
- if (!this.context) {
7004
- this._pendingScopes = scopes;
7005
- return;
7006
- }
7007
- (_b = this.context) == null ? void 0 : _b.changeScopes(scopes);
7008
- }
7009
- getValue() {
7010
- var _a, _b;
7011
- return (_b = (_a = this.context) == null ? void 0 : _a.state.value) != null ? _b : [];
7012
- }
7013
- subscribeToValue(cb) {
7014
- return this.contextObservable.pipe(
7015
- rxjs.filter((context) => !!context && !context.state.loading),
7016
- rxjs.pairwise(),
7017
- rxjs.map(
7018
- ([prevContext, newContext]) => {
7019
- var _a, _b;
7020
- return [(_a = prevContext == null ? void 0 : prevContext.state.value) != null ? _a : [], (_b = newContext == null ? void 0 : newContext.state.value) != null ? _b : []];
7021
- }
7022
- ),
7023
- rxjs.filter(([prevScopes, newScopes]) => !lodash.isEqual(prevScopes, newScopes))
7024
- ).subscribe(([prevScopes, newScopes]) => {
7025
- cb(newScopes, prevScopes);
7026
- });
7027
- }
7028
- isLoading() {
7029
- var _a, _b;
7030
- return (_b = (_a = this.context) == null ? void 0 : _a.state.loading) != null ? _b : false;
7031
- }
7032
- subscribeToLoading(cb) {
7033
- return this.contextObservable.pipe(
7034
- rxjs.filter((context) => !!context),
7035
- rxjs.pairwise(),
7036
- rxjs.map(
7037
- ([prevContext, newContext]) => {
7038
- var _a, _b;
7039
- return [(_a = prevContext == null ? void 0 : prevContext.state.loading) != null ? _a : false, (_b = newContext == null ? void 0 : newContext.state.loading) != null ? _b : false];
7040
- }
7041
- ),
7042
- rxjs.filter(([prevLoading, newLoading]) => prevLoading !== newLoading)
7043
- ).subscribe(([_prevLoading, newLoading]) => {
7044
- cb(newLoading);
7045
- });
7046
- }
7047
- setEnabled(enabled) {
7048
- var _a;
7049
- (_a = this.context) == null ? void 0 : _a.setEnabled(enabled);
7050
- }
7051
- setReadOnly(readOnly) {
7052
- var _a;
7053
- (_a = this.context) == null ? void 0 : _a.setReadOnly(readOnly);
7054
- }
7055
- updateContext(newContext) {
7056
- var _a, _b;
7057
- if (this._pendingScopes && newContext) {
7058
- setTimeout(() => {
7059
- newContext == null ? void 0 : newContext.changeScopes(this._pendingScopes);
7060
- this._pendingScopes = null;
7061
- });
7062
- }
7063
- if (this.context !== newContext || ((_a = this.context) == null ? void 0 : _a.state) !== (newContext == null ? void 0 : newContext.state)) {
7064
- const shouldUpdate = ((_b = this.context) == null ? void 0 : _b.state.value) !== (newContext == null ? void 0 : newContext.state.value);
7065
- this._contextSubject.next(newContext);
7066
- if (shouldUpdate) {
7067
- this.forceRender();
7068
- }
7069
- }
7070
- }
7071
- get context() {
7072
- return this._contextSubject.getValue();
7073
- }
7074
- get contextObservable() {
7075
- return this._contextSubject.asObservable();
7076
- }
7077
- }
7078
- SceneScopesBridge.Component = SceneScopesBridgeRenderer;
7079
- function SceneScopesBridgeRenderer({ model }) {
7080
- const context = runtime.useScopes();
7081
- React.useEffect(() => {
7082
- model.updateContext(context);
7083
- }, [context, model]);
7084
- return null;
7085
- }
7086
-
7087
6958
  function getVariables(sceneObject) {
7088
6959
  var _a;
7089
6960
  return (_a = getClosest(sceneObject, (s) => s.state.$variables)) != null ? _a : EmptyVariableSet;
@@ -7227,10 +7098,6 @@ function findDescendents(scene, descendentType) {
7227
7098
  const targetScenes = findAllObjects(scene, isDescendentType);
7228
7099
  return targetScenes.filter(isDescendentType);
7229
7100
  }
7230
- function getScopesBridge(sceneObject) {
7231
- var _a;
7232
- return (_a = findObject(sceneObject, (s) => s instanceof SceneScopesBridge)) != null ? _a : void 0;
7233
- }
7234
7101
 
7235
7102
  const sceneGraph = {
7236
7103
  getVariables,
@@ -7247,8 +7114,7 @@ const sceneGraph = {
7247
7114
  findAllObjects,
7248
7115
  getAncestor,
7249
7116
  getQueryController,
7250
- findDescendents,
7251
- getScopesBridge
7117
+ findDescendents
7252
7118
  };
7253
7119
 
7254
7120
  class UniqueUrlKeyMapper {
@@ -11866,7 +11732,7 @@ class SceneRefreshPicker extends SceneObjectBase {
11866
11732
  this._autoRefreshBlocked = false;
11867
11733
  this.onRefresh = () => {
11868
11734
  const queryController = sceneGraph.getQueryController(this);
11869
- queryController == null ? void 0 : queryController.startProfile(this);
11735
+ queryController == null ? void 0 : queryController.startProfile("SceneRefreshPicker");
11870
11736
  if (queryController == null ? void 0 : queryController.state.isRunning) {
11871
11737
  queryController.cancelAll();
11872
11738
  return;
@@ -11923,7 +11789,7 @@ class SceneRefreshPicker extends SceneObjectBase {
11923
11789
  this._intervalTimer = setInterval(() => {
11924
11790
  if (this.isTabVisible()) {
11925
11791
  const queryController = sceneGraph.getQueryController(this);
11926
- queryController == null ? void 0 : queryController.startProfile(this);
11792
+ queryController == null ? void 0 : queryController.startProfile("SceneRefreshPicker");
11927
11793
  timeRange.onRefresh();
11928
11794
  } else {
11929
11795
  this._autoRefreshBlocked = true;
@@ -13002,10 +12868,6 @@ class SplitLayout extends SceneObjectBase {
13002
12868
  SplitLayout.Component = SplitLayoutRenderer;
13003
12869
 
13004
12870
  class SceneApp extends SceneObjectBase {
13005
- constructor() {
13006
- super(...arguments);
13007
- this._renderBeforeActivation = true;
13008
- }
13009
12871
  enrichDataRequest() {
13010
12872
  return {
13011
12873
  app: this.state.name || "app"
@@ -13013,10 +12875,8 @@ class SceneApp extends SceneObjectBase {
13013
12875
  }
13014
12876
  }
13015
12877
  SceneApp.Component = ({ model }) => {
13016
- const { pages, scopesBridge } = model.useState();
13017
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, scopesBridge && /* @__PURE__ */ React__default["default"].createElement(scopesBridge.Component, {
13018
- model: scopesBridge
13019
- }), /* @__PURE__ */ React__default["default"].createElement(SceneAppContext.Provider, {
12878
+ const { pages } = model.useState();
12879
+ return /* @__PURE__ */ React__default["default"].createElement(SceneAppContext.Provider, {
13020
12880
  value: model
13021
12881
  }, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Routes, null, pages.map((page) => /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
13022
12882
  key: page.state.url,
@@ -13024,7 +12884,7 @@ SceneApp.Component = ({ model }) => {
13024
12884
  element: /* @__PURE__ */ React__default["default"].createElement(page.Component, {
13025
12885
  model: page
13026
12886
  })
13027
- })))));
12887
+ }))));
13028
12888
  };
13029
12889
  const SceneAppContext = React.createContext(null);
13030
12890
  const sceneAppCache = /* @__PURE__ */ new Map();
@@ -13379,21 +13239,6 @@ class SceneAppPage extends SceneObjectBase {
13379
13239
  super(state);
13380
13240
  this._sceneCache = /* @__PURE__ */ new Map();
13381
13241
  this._drilldownCache = /* @__PURE__ */ new Map();
13382
- this._activationHandler = () => {
13383
- if (!this.state.useScopes) {
13384
- return;
13385
- }
13386
- this._scopesBridge = sceneGraph.getScopesBridge(this);
13387
- if (!this._scopesBridge) {
13388
- throw new Error("Use of scopes is enabled but no scopes bridge found");
13389
- }
13390
- this._scopesBridge.setEnabled(true);
13391
- return () => {
13392
- var _a;
13393
- (_a = this._scopesBridge) == null ? void 0 : _a.setEnabled(false);
13394
- };
13395
- };
13396
- this.addActivationHandler(this._activationHandler);
13397
13242
  }
13398
13243
  initializeScene(scene) {
13399
13244
  this.setState({ initializedScene: scene });
@@ -14392,7 +14237,6 @@ exports.SceneObjectUrlSyncConfig = SceneObjectUrlSyncConfig;
14392
14237
  exports.SceneQueryRunner = SceneQueryRunner;
14393
14238
  exports.SceneReactObject = SceneReactObject;
14394
14239
  exports.SceneRefreshPicker = SceneRefreshPicker;
14395
- exports.SceneScopesBridge = SceneScopesBridge;
14396
14240
  exports.SceneTimePicker = SceneTimePicker;
14397
14241
  exports.SceneTimeRange = SceneTimeRange;
14398
14242
  exports.SceneTimeRangeCompare = SceneTimeRangeCompare;