@pushwoosh/kit-helpers 4.11.0 → 4.11.2

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.
@@ -8,9 +8,11 @@ export const identifyOpenReplaySession = properties => {
8
8
  store.push(properties);
9
9
  window.pwOpenReplayIdentifyStore = store;
10
10
  } else {
11
- window.OpenReplay?.setUserID(properties.email);
11
+ var _window$OpenReplay;
12
+ (_window$OpenReplay = window.OpenReplay) === null || _window$OpenReplay === void 0 || _window$OpenReplay.setUserID(properties.email);
12
13
  if (properties.accountID) {
13
- window.OpenReplay?.setMetadata('AccountID', `${properties.accountID}`);
14
+ var _window$OpenReplay2;
15
+ (_window$OpenReplay2 = window.OpenReplay) === null || _window$OpenReplay2 === void 0 || _window$OpenReplay2.setMetadata('AccountID', `${properties.accountID}`);
14
16
  }
15
17
  }
16
18
  };
package/expand.js CHANGED
@@ -1,5 +1,7 @@
1
+ import { createElement as _createElement } from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
1
3
  /* eslint-disable react/require-default-props, react/jsx-no-bind */
2
- import React, { useEffect, useRef, useState } from 'react';
4
+ import { useEffect, useRef, useState } from 'react';
3
5
  import { CSSTransition, TransitionGroup } from 'react-transition-group';
4
6
  import styled, { css } from 'styled-components';
5
7
  const ExpandTransitionComp = ({
@@ -22,21 +24,24 @@ const ExpandTransitionComp = ({
22
24
  });
23
25
  }
24
26
  useEffect(updateStyle, [timeout]);
25
- return React.createElement(CSSTransition, {
27
+ return _jsx(CSSTransition, {
26
28
  ...rest,
27
29
  timeout: timeout,
28
30
  classNames: className,
29
31
  onEnter: updateStyle,
30
32
  onExit: updateStyle,
31
- nodeRef: refExternal
32
- }, React.createElement("div", {
33
- ref: refExternal,
34
- className: externalClassName ? `${className} ${externalClassName}` : className,
35
- style: externalStyle
36
- }, React.createElement("div", {
37
- ref: refInternal,
38
- className: internalClassName
39
- }, children)));
33
+ nodeRef: refExternal,
34
+ children: _jsx("div", {
35
+ ref: refExternal,
36
+ className: externalClassName ? `${className} ${externalClassName}` : className,
37
+ style: externalStyle,
38
+ children: _jsx("div", {
39
+ ref: refInternal,
40
+ className: internalClassName,
41
+ children: children
42
+ })
43
+ })
44
+ });
40
45
  };
41
46
  const CollapseTransition = styled(ExpandTransitionComp).withConfig({
42
47
  displayName: "CollapseTransition",
@@ -53,10 +58,11 @@ export const Collapse = ({
53
58
  children,
54
59
  className,
55
60
  ...rest
56
- }) => React.createElement(TransitionGroup, {
57
- component: null
58
- }, expanded && React.createElement(CollapseTransition, {
59
- ...rest,
60
- externalClassName: className,
61
- key: 0
62
- }, typeof children === 'function' ? children() : children));
61
+ }) => _jsx(TransitionGroup, {
62
+ component: null,
63
+ children: expanded && _createElement(CollapseTransition, {
64
+ ...rest,
65
+ externalClassName: className,
66
+ key: 0
67
+ }, typeof children === 'function' ? children() : children)
68
+ });
package/flex.d.ts CHANGED
@@ -5,13 +5,13 @@ type FlexContainerProps = CommonContainerProps & {
5
5
  };
6
6
  export declare const FlexContainer: import("styled-components").StyledComponent<"div", any, FlexContainerProps, never>;
7
7
  export declare const Cluster: import("styled-components").StyledComponent<"div", any, import("./styled-helpers").CommonBoxProps & {
8
- $alignContent?: import("./styled-helpers").AlignContentValue | undefined;
9
- $alignItems?: import("./styled-helpers").ItemAlignmentValue | undefined;
10
- $gap?: import("./styled-helpers").StrNum | undefined;
11
- $justifyContent?: import("./styled-helpers").JustifyContentValue | undefined;
8
+ $alignContent?: import("./styled-helpers").AlignContentValue;
9
+ $alignItems?: import("./styled-helpers").ItemAlignmentValue;
10
+ $gap?: import("./styled-helpers").StrNum;
11
+ $justifyContent?: import("./styled-helpers").JustifyContentValue;
12
12
  } & {
13
- $flexDirection?: "row" | "row-reverse" | "column" | "column-reverse" | undefined;
14
- $flexWrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
13
+ $flexDirection?: "row" | "row-reverse" | "column" | "column-reverse";
14
+ $flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
15
15
  } & {
16
16
  $flexWrap: string;
17
17
  }, "$flexWrap">;
package/grid.d.ts CHANGED
@@ -7,50 +7,50 @@ type GridContainerProps = CommonContainerProps & {
7
7
  };
8
8
  export declare const GridContainer: import("styled-components").StyledComponent<"div", any, GridContainerProps, never>;
9
9
  export declare const Columns: import("styled-components").StyledComponent<"div", any, import("./styled-helpers").CommonBoxProps & {
10
- $alignContent?: import("./styled-helpers").AlignContentValue | undefined;
11
- $alignItems?: ItemAlignmentValue | undefined;
12
- $gap?: StrNum | undefined;
13
- $justifyContent?: import("./styled-helpers").JustifyContentValue | undefined;
10
+ $alignContent?: import("./styled-helpers").AlignContentValue;
11
+ $alignItems?: ItemAlignmentValue;
12
+ $gap?: StrNum;
13
+ $justifyContent?: import("./styled-helpers").JustifyContentValue;
14
14
  } & {
15
- $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
16
- $justifyItems?: ItemAlignmentValue | undefined;
17
- $placeItems?: ItemAlignmentValue | undefined;
15
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense";
16
+ $justifyItems?: ItemAlignmentValue;
17
+ $placeItems?: ItemAlignmentValue;
18
18
  } & {
19
19
  $sizes: StrNum;
20
20
  }, never>;
21
21
  export declare const Rows: import("styled-components").StyledComponent<"div", any, import("./styled-helpers").CommonBoxProps & {
22
- $alignContent?: import("./styled-helpers").AlignContentValue | undefined;
23
- $alignItems?: ItemAlignmentValue | undefined;
24
- $gap?: StrNum | undefined;
25
- $justifyContent?: import("./styled-helpers").JustifyContentValue | undefined;
22
+ $alignContent?: import("./styled-helpers").AlignContentValue;
23
+ $alignItems?: ItemAlignmentValue;
24
+ $gap?: StrNum;
25
+ $justifyContent?: import("./styled-helpers").JustifyContentValue;
26
26
  } & {
27
- $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
28
- $justifyItems?: ItemAlignmentValue | undefined;
29
- $placeItems?: ItemAlignmentValue | undefined;
27
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense";
28
+ $justifyItems?: ItemAlignmentValue;
29
+ $placeItems?: ItemAlignmentValue;
30
30
  } & {
31
31
  $sizes: StrNum;
32
32
  }, never>;
33
33
  export declare const Horizontal: import("styled-components").StyledComponent<"div", any, import("./styled-helpers").CommonBoxProps & {
34
- $alignContent?: import("./styled-helpers").AlignContentValue | undefined;
35
- $alignItems?: ItemAlignmentValue | undefined;
36
- $gap?: StrNum | undefined;
37
- $justifyContent?: import("./styled-helpers").JustifyContentValue | undefined;
34
+ $alignContent?: import("./styled-helpers").AlignContentValue;
35
+ $alignItems?: ItemAlignmentValue;
36
+ $gap?: StrNum;
37
+ $justifyContent?: import("./styled-helpers").JustifyContentValue;
38
38
  } & {
39
- $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
40
- $justifyItems?: ItemAlignmentValue | undefined;
41
- $placeItems?: ItemAlignmentValue | undefined;
39
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense";
40
+ $justifyItems?: ItemAlignmentValue;
41
+ $placeItems?: ItemAlignmentValue;
42
42
  } & {
43
43
  $gridAutoFlow: string;
44
44
  }, "$gridAutoFlow">;
45
45
  export declare const Vertical: import("styled-components").StyledComponent<"div", any, import("./styled-helpers").CommonBoxProps & {
46
- $alignContent?: import("./styled-helpers").AlignContentValue | undefined;
47
- $alignItems?: ItemAlignmentValue | undefined;
48
- $gap?: StrNum | undefined;
49
- $justifyContent?: import("./styled-helpers").JustifyContentValue | undefined;
50
- } & {
51
- $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
52
- $justifyItems?: ItemAlignmentValue | undefined;
53
- $placeItems?: ItemAlignmentValue | undefined;
46
+ $alignContent?: import("./styled-helpers").AlignContentValue;
47
+ $alignItems?: ItemAlignmentValue;
48
+ $gap?: StrNum;
49
+ $justifyContent?: import("./styled-helpers").JustifyContentValue;
50
+ } & {
51
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense";
52
+ $justifyItems?: ItemAlignmentValue;
53
+ $placeItems?: ItemAlignmentValue;
54
54
  } & {
55
55
  $gridAutoFlow: string;
56
56
  }, "$gridAutoFlow">;
package/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './hooks/useClickAway';
5
5
  export { identifyOpenReplaySession } from './analytics/identifyOpenReplay';
6
6
  export { trackEvent } from './analytics/trackEvent';
7
7
  export { formatNumber } from './formatNumber';
8
+ export { readNavigationHistory, writeNavigationHistory } from './navigation';
8
9
  export { default as usePersistentFunction } from './hooks/usePersistentFunction';
9
10
  export { default as useEffectOnce } from './hooks/useEffectOnce';
10
11
  export { default as useMountedState } from './hooks/useMountedState';
package/index.js CHANGED
@@ -5,6 +5,7 @@ export * from './hooks/useClickAway';
5
5
  export { identifyOpenReplaySession } from './analytics/identifyOpenReplay';
6
6
  export { trackEvent } from './analytics/trackEvent';
7
7
  export { formatNumber } from './formatNumber';
8
+ export { readNavigationHistory, writeNavigationHistory } from './navigation';
8
9
  export { default as usePersistentFunction } from './hooks/usePersistentFunction';
9
10
  export { default as useEffectOnce } from './hooks/useEffectOnce';
10
11
  export { default as useMountedState } from './hooks/useMountedState';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Reads the navigation stack from sessionStorage.
3
+ * The last element is the current page.
4
+ */
5
+ export declare function readNavigationHistory(): string[];
6
+ /**
7
+ * Persists the navigation stack to sessionStorage.
8
+ */
9
+ export declare function writeNavigationHistory(entries: string[]): void;
package/navigation.js ADDED
@@ -0,0 +1,25 @@
1
+ const STORAGE_KEY = 'pw_navigation_history';
2
+ const MAX_ENTRIES = 50;
3
+ /**
4
+ * Reads the navigation stack from sessionStorage.
5
+ * The last element is the current page.
6
+ */
7
+ export function readNavigationHistory() {
8
+ try {
9
+ const raw = sessionStorage.getItem(STORAGE_KEY);
10
+ const parsed = raw ? JSON.parse(raw) : null;
11
+ return Array.isArray(parsed) && parsed.every(e => typeof e === 'string') ? parsed.slice(-MAX_ENTRIES) : [];
12
+ } catch {
13
+ return [];
14
+ }
15
+ }
16
+ /**
17
+ * Persists the navigation stack to sessionStorage.
18
+ */
19
+ export function writeNavigationHistory(entries) {
20
+ try {
21
+ sessionStorage.setItem(STORAGE_KEY, JSON.stringify(entries.slice(-MAX_ENTRIES)));
22
+ } catch {
23
+ // sessionStorage is unavailable (private mode / quota exceeded) — silently ignore.
24
+ }
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/kit-helpers",
3
- "version": "4.11.0",
3
+ "version": "4.11.2",
4
4
  "description": "React component for build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -19,7 +19,7 @@
19
19
  "react-transition-group": "^4.4.5"
20
20
  },
21
21
  "devDependencies": {
22
- "@pushwoosh/frontend-builder-engine": "^0.1.5",
22
+ "@pushwoosh/frontend-builder-engine": "^2.1.1",
23
23
  "@pushwoosh/kit-constants": "^1.6.0",
24
24
  "@types/react": "^16.14.20",
25
25
  "@types/react-dom": "^16.9.14",