@grafana/scenes 4.29.0 → 4.29.1--canary.765.9461208757.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import { Observable, Unsubscribable, MonoTypeOperatorFunction, Subscription, Rep
7
7
  import * as _grafana_schema from '@grafana/schema';
8
8
  import { VariableType, VariableHide, TimeZone, DataTopic, DataQuery, DataSourceRef, VariableRefresh, LoadingState, DashboardCursorSync, MatcherConfig, TableFieldOptions } from '@grafana/schema';
9
9
  import { VariableInterpolation } from '@grafana/runtime';
10
+ import { Location } from 'history';
10
11
  import { PanelContext, IconName } from '@grafana/ui';
11
12
  import ReactGridLayout from 'react-grid-layout';
12
13
  import { RouteComponentProps } from 'react-router-dom';
@@ -1567,26 +1568,38 @@ interface UrlSyncManagerLike {
1567
1568
  initSync(root: SceneObject): void;
1568
1569
  cleanUp(root: SceneObject): void;
1569
1570
  getUrlState(root: SceneObject): SceneObjectUrlValues;
1571
+ handleNewLocation(location: Location): void;
1572
+ handleNewObject(sceneObj: SceneObject): void;
1570
1573
  }
1571
1574
  declare class UrlSyncManager implements UrlSyncManagerLike {
1572
1575
  private _urlKeyMapper;
1573
- private _sceneRoot;
1576
+ private _sceneRoot?;
1574
1577
  private _stateSub;
1575
- private _locationSub?;
1576
- private _lastPath?;
1577
- private _ignoreNextLocationUpdate;
1578
+ private _lastLocation;
1579
+ private _urlParams;
1578
1580
  /**
1579
1581
  * Updates the current scene state to match URL state.
1580
1582
  */
1581
1583
  initSync(root: SceneObject): void;
1582
1584
  cleanUp(root: SceneObject): void;
1583
- syncFrom(sceneObj: SceneObject): void;
1584
- private _onLocationUpdate;
1585
+ handleNewLocation(location: Location): void;
1586
+ handleNewObject(sceneObj: SceneObject): void;
1585
1587
  private _onStateChanged;
1586
1588
  getUrlState(root: SceneObject): SceneObjectUrlValues;
1587
1589
  }
1588
1590
  declare function getUrlSyncManager(): UrlSyncManagerLike;
1589
1591
 
1592
+ declare function useUrlSync(sceneRoot: SceneObject): boolean;
1593
+
1594
+ interface UrlSyncContextProviderProps {
1595
+ scene: SceneObject;
1596
+ children: React.ReactNode;
1597
+ }
1598
+ /**
1599
+ * Right now this is actually not defining a context, but think it might in the future (with UrlSyncManager as the context value)
1600
+ */
1601
+ declare function UrlSyncContextProvider({ children, scene }: UrlSyncContextProviderProps): React$1.ReactNode;
1602
+
1590
1603
  interface EmbeddedSceneState extends SceneObjectState {
1591
1604
  /**
1592
1605
  * The main content of the scene (usually a SceneFlexLayout)
@@ -1600,13 +1613,6 @@ interface EmbeddedSceneState extends SceneObjectState {
1600
1613
  declare class EmbeddedScene extends SceneObjectBase<EmbeddedSceneState> {
1601
1614
  static Component: typeof EmbeddedSceneRenderer;
1602
1615
  constructor(state: EmbeddedSceneState);
1603
- /**
1604
- * initUrlSync should be called before the scene is rendered to ensure that objects are in sync
1605
- * before they get activated. This saves some unnecessary re-renders and makes sure variables
1606
- * queries are issued as needed. If your using SceneAppPage you will not need to call this as
1607
- * url sync is handled on the SceneAppPage level not this level.
1608
- */
1609
- initUrlSync(): void;
1610
1616
  }
1611
1617
  declare function EmbeddedSceneRenderer({ model }: SceneComponentProps<EmbeddedScene>): React__default.JSX.Element;
1612
1618
 
@@ -2641,4 +2647,4 @@ declare const sceneUtils: {
2641
2647
  isGroupByVariable: typeof isGroupByVariable;
2642
2648
  };
2643
2649
 
2644
- export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FiltersRequestEnricher, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, NestedScene, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SceneActivationHandler, SceneApp, SceneAppDrilldownView, SceneAppPage, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneComponent, SceneComponentProps, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformer, SceneDeactivationHandler, SceneDebugger, SceneFlexItem, SceneFlexItemLike, SceneFlexItemState, SceneFlexLayout, SceneGridItem, SceneGridItemLike, SceneGridItemStateLike, SceneGridLayout, SceneGridRow, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectBase, SceneObjectRef, SceneObjectState, SceneObjectStateChangedEvent, SceneObjectStateChangedPayload, SceneObjectUrlSyncConfig, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeLike, SceneTimeRangeState, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSet, SceneVariableSetState, SceneVariableState, SceneVariableValueChangedEvent, SceneVariables, SplitLayout, TestVariable, TextBoxVariable, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableValue, VariableValueControl, VariableValueOption, VariableValueSelectWrapper, VariableValueSelectors, VariableValueSingle, VizConfig, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelMenu, VizPanelState, index$1 as behaviors, index as dataLayers, formatRegistry, getUrlSyncManager, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState };
2650
+ export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FiltersRequestEnricher, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, NestedScene, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SceneActivationHandler, SceneApp, SceneAppDrilldownView, SceneAppPage, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneComponent, SceneComponentProps, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformer, SceneDeactivationHandler, SceneDebugger, SceneFlexItem, SceneFlexItemLike, SceneFlexItemState, SceneFlexLayout, SceneGridItem, SceneGridItemLike, SceneGridItemStateLike, SceneGridLayout, SceneGridRow, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectBase, SceneObjectRef, SceneObjectState, SceneObjectStateChangedEvent, SceneObjectStateChangedPayload, SceneObjectUrlSyncConfig, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeLike, SceneTimeRangeState, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSet, SceneVariableSetState, SceneVariableState, SceneVariableValueChangedEvent, SceneVariables, SplitLayout, TestVariable, TextBoxVariable, UrlSyncContextProvider, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableValue, VariableValueControl, VariableValueOption, VariableValueSelectWrapper, VariableValueSelectors, VariableValueSingle, VizConfig, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelMenu, VizPanelState, index$1 as behaviors, index as dataLayers, formatRegistry, getUrlSyncManager, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync };