@pushwoosh/smart-components-kit 1.0.33 → 1.0.34

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.
@@ -11,7 +11,7 @@ export type ExportTask = {
11
11
  type ExportCsvBannerProps = {
12
12
  exportTask: ExportTask | undefined;
13
13
  updateExportTask: (exportTask: Partial<ExportTask>) => void;
14
- showLastExportLocalStorageKey: string;
14
+ showLastExportLocalStorageKey?: string;
15
15
  lastTasksParams?: GetLastTasksRequest;
16
16
  };
17
17
  export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, }: ExportCsvBannerProps) => React.JSX.Element | null;
@@ -1,4 +1,4 @@
1
- export declare const useExportVisibility: (key: string) => {
1
+ export declare const useExportVisibility: (key?: string) => {
2
2
  isHidden: boolean;
3
3
  hide: () => void;
4
4
  show: () => void;
@@ -1,13 +1,18 @@
1
1
  import { useCallback, useState } from 'react';
2
2
  export const useExportVisibility = key => {
3
- const [isHidden, setIsHidden] = useState(() => Boolean(+(localStorage.getItem(key) ?? 0)));
3
+ const [isHidden, setIsHidden] = useState(() => {
4
+ if (!key) return false;
5
+ return Boolean(+(localStorage.getItem(key) ?? 0));
6
+ });
4
7
  const hide = useCallback(() => {
5
- localStorage.setItem(key, '1');
6
8
  setIsHidden(true);
9
+ if (!key) return;
10
+ localStorage.setItem(key, '1');
7
11
  }, [key]);
8
12
  const show = useCallback(() => {
9
- localStorage.setItem(key, '0');
10
13
  setIsHidden(false);
14
+ if (!key) return;
15
+ localStorage.setItem(key, '0');
11
16
  }, [key]);
12
17
  return {
13
18
  isHidden,
@@ -47,6 +47,7 @@ export const usePresetOpenActions = pushPreset => {
47
47
  defaultDeeplinkUrl = deeplinkManual.url;
48
48
  }
49
49
  // setTimeout нужен, чтобы не получать ошибку 'ResizeObserver loop completed with undelivered notifications.'
50
+ // Она возникает, когда этот хук вызывается ВНУТРИ Modal и с пересчетом её размера. Подробности в тикете FRONT-750
50
51
  setTimeout(() => {
51
52
  setOpenActions({
52
53
  webPageUrl,
package/package.json CHANGED
@@ -42,8 +42,8 @@
42
42
  "peerDependencies": {
43
43
  "@pushwoosh/grpc-bridge": "^1.5.36",
44
44
  "@pushwoosh/http-client": "^2.5.0",
45
- "@pushwoosh/rpc-v2-http-api-data": "^0.1.501",
46
45
  "@pushwoosh/rpc-gateway-journey-data": "^0.26.206",
46
+ "@pushwoosh/rpc-v2-http-api-data": "^0.1.566",
47
47
  "@pushwoosh/session-store": "^2.5.0",
48
48
  "react": "^16.14.0 || ^18.0.0",
49
49
  "react-dom": "^16.14.0 || ^18.0.0"
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">= 18"
53
53
  },
54
- "version": "1.0.33"
54
+ "version": "1.0.34"
55
55
  }