@evergis/react 3.1.93 → 3.1.95

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.
@@ -206,6 +206,9 @@ export interface ConfigLayer {
206
206
  isVisible?: boolean;
207
207
  selectable?: boolean;
208
208
  filterZoomTo?: boolean;
209
+ searchFields?: string[];
210
+ minScale?: number;
211
+ maxScale?: number;
209
212
  }
210
213
  export interface ConfigTask {
211
214
  name: string;
@@ -2,6 +2,7 @@ import { default as MapboxDraw, DrawCustomMode } from '@mapbox/mapbox-gl-draw';
2
2
  interface ExtendedMapboxDrawModes extends MapboxDraw.Modes {
3
3
  [key: string]: DrawCustomMode;
4
4
  static: DrawCustomMode;
5
+ invisible: DrawCustomMode;
5
6
  }
6
7
  export declare const customModes: ExtendedMapboxDrawModes;
7
8
  export {};
package/dist/index.js CHANGED
@@ -3937,6 +3937,15 @@ const ServerNotificationsContext = React.createContext({});
3937
3937
  const useServerNotifications = (url, initialized) => {
3938
3938
  const hubConnection = React.useRef(null);
3939
3939
  const [connection, setConnection] = React.useState(null);
3940
+ const subscribeNotifications = React.useCallback(() => {
3941
+ if (!connection || connection.state !== "Connected") {
3942
+ return;
3943
+ }
3944
+ connection
3945
+ .invoke("SubscribeNotifications", [])
3946
+ .then(() => console.info("Подписка `SubscribeNotifications` оформлена"))
3947
+ .catch(err => console.info("Ошибка подписки `SubscribeNotifications`:", err));
3948
+ }, [connection]);
3940
3949
  React.useEffect(() => {
3941
3950
  if (!initialized) {
3942
3951
  return;
@@ -3945,6 +3954,7 @@ const useServerNotifications = (url, initialized) => {
3945
3954
  .withUrl(`${url}?clientId=${api.generateId()}`, {
3946
3955
  withCredentials: true,
3947
3956
  })
3957
+ .withAutomaticReconnect({ nextRetryDelayInMilliseconds: () => 3000 })
3948
3958
  .configureLogging(signalr.LogLevel.Information)
3949
3959
  .build();
3950
3960
  hubConnection.current
@@ -3957,10 +3967,9 @@ const useServerNotifications = (url, initialized) => {
3957
3967
  if (!connection || connection.state !== "Connected") {
3958
3968
  return;
3959
3969
  }
3960
- connection
3961
- .invoke("SubscribeNotifications", [])
3962
- .then(() => console.info("Подписка `SubscribeNotifications` оформлена"))
3963
- .catch(err => console.info("Ошибка подписки `SubscribeNotifications`:", err));
3970
+ connection.onreconnecting(() => console.info("Переподключение к серверным нотификациям"));
3971
+ connection.onreconnected(subscribeNotifications);
3972
+ subscribeNotifications();
3964
3973
  }, [connection]);
3965
3974
  return connection;
3966
3975
  };
@@ -4642,6 +4651,7 @@ const LayerGroupMain = styled(uilibGl.Flex) `
4642
4651
 
4643
4652
  const customModes = MapboxDraw.modes;
4644
4653
  const StaticMode = {};
4654
+ const InvisibleMode = {};
4645
4655
  StaticMode.onSetup = function () {
4646
4656
  this.setActionableState(undefined);
4647
4657
  return {};
@@ -4649,7 +4659,13 @@ StaticMode.onSetup = function () {
4649
4659
  StaticMode.toDisplayFeatures = function (state, geojson, display) {
4650
4660
  display(geojson);
4651
4661
  };
4662
+ InvisibleMode.onSetup = function () {
4663
+ this.setActionableState(undefined);
4664
+ return {};
4665
+ };
4666
+ InvisibleMode.toDisplayFeatures = function () { };
4652
4667
  customModes.static = StaticMode;
4668
+ customModes.invisible = InvisibleMode;
4653
4669
 
4654
4670
  const customStyles = [
4655
4671
  {
@@ -9867,8 +9883,6 @@ const useDashboardHeader = () => {
9867
9883
  };
9868
9884
 
9869
9885
  const useDataSources = ({ type: widgetType, config, attributes, filters, layerParams, eqlParameters, }) => {
9870
- // const { map } = useMapContext();
9871
- // const sr = useProjectSrid();
9872
9886
  const { ewktGeometry, api } = useGlobalContext();
9873
9887
  const { dataSources } = useWidgetContext(widgetType);
9874
9888
  const { filters: configFilters, dataSources: configDataSources } = config || {};