@levi-gemcommerce/analytics 1.0.0-dev.20 → 1.0.0-dev.22

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 (125) hide show
  1. package/dist/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
  2. package/dist/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +7 -0
  3. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.d.ts +8 -0
  4. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.d.ts +15 -0
  5. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.d.ts +6 -0
  6. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.d.ts +5 -0
  7. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.d.ts +1 -0
  8. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.d.ts +13 -0
  9. package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/index.d.ts +1 -0
  10. package/dist/esm/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +7 -0
  11. package/dist/esm/components/CardPathAnalysis/components/index.d.ts +1 -0
  12. package/dist/esm/components/CardPathAnalysis/configs/index.d.ts +2 -0
  13. package/dist/esm/components/CardPathAnalysis/constants/index.d.ts +1 -0
  14. package/dist/esm/components/CardPathAnalysis/constants/path-analysis.d.ts +73 -0
  15. package/dist/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +56 -0
  16. package/dist/esm/components/CardPathAnalysis/contexts/index.d.ts +1 -0
  17. package/dist/esm/components/CardPathAnalysis/helpers/index.d.ts +2 -0
  18. package/dist/esm/components/CardPathAnalysis/helpers/metricHelpers.d.ts +16 -0
  19. package/dist/esm/components/CardPathAnalysis/helpers/pathAnalysis.d.ts +12 -0
  20. package/dist/esm/components/CardPathAnalysis/helpers/pathAnalysisChart.d.ts +17 -0
  21. package/dist/esm/components/CardPathAnalysis/helpers/treeUtils.d.ts +7 -0
  22. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisChart.d.ts +15 -0
  23. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.d.ts +21 -0
  24. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisHeatmap.d.ts +4 -0
  25. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
  26. package/dist/esm/components/CardPathAnalysis/index.d.ts +4 -0
  27. package/dist/esm/components/CardPathAnalysis/stores/funnel-chart.d.ts +12 -0
  28. package/dist/esm/components/CardPathAnalysis/stores/index.d.ts +3 -0
  29. package/dist/esm/components/CardPathAnalysis/stores/path-analysis-campaign.d.ts +10 -0
  30. package/dist/esm/components/CardPathAnalysis/stores/path-analysis.d.ts +6 -0
  31. package/dist/esm/components/CardPathAnalysis/types/index.d.ts +1 -0
  32. package/dist/esm/components/CardPathAnalysis/types/path-analysis.d.ts +6 -0
  33. package/dist/esm/gemxql.js +63 -0
  34. package/dist/esm/gemxql.mjs +63 -0
  35. package/dist/esm/index.js +159 -14
  36. package/dist/esm/index.mjs +159 -14
  37. package/dist/esm/modules/analytics/index.d.ts +14 -0
  38. package/dist/esm/modules/analytics/types.d.ts +23 -0
  39. package/dist/esm/modules/apps/index.d.ts +4 -0
  40. package/dist/esm/modules/heatmap/hooks/useHeatmapModalMonitor.d.ts +3 -0
  41. package/dist/esm/modules/heatmap/index.d.ts +7 -0
  42. package/dist/esm/modules/heatmap/types/index.d.ts +33 -0
  43. package/dist/esm/modules/page-analytic/index.d.ts +13 -0
  44. package/dist/esm/modules/page-analytic/modules/analytic/index.d.ts +5 -0
  45. package/dist/esm/modules/shopify/index.d.ts +6 -0
  46. package/dist/esm/providers/PricingProvider.d.ts +51 -0
  47. package/dist/esm/providers/index.d.ts +2 -0
  48. package/dist/esm/shared/components/GBox/GBox.d.ts +9 -0
  49. package/dist/esm/shared/components/GBox/index.d.ts +1 -0
  50. package/dist/esm/shared/components/GFeatureLocked/GFeatureLocked.d.ts +14 -0
  51. package/dist/esm/shared/components/GFeatureLocked/constants.d.ts +3 -0
  52. package/dist/esm/shared/components/GFeatureLocked/index.d.ts +2 -0
  53. package/dist/esm/shared/components/GFeatureLocked/types.d.ts +15 -0
  54. package/dist/esm/shared/components/index.d.ts +2 -0
  55. package/dist/esm/types/index.d.ts +1 -0
  56. package/dist/esm/types/metric.d.ts +17 -1
  57. package/dist/esm/types/pricing.d.ts +33 -0
  58. package/dist/esm/types/template.d.ts +19 -0
  59. package/dist/esm/types.js +39 -1
  60. package/dist/esm/types.mjs +39 -1
  61. package/dist/esm/utils/deep-copy.d.ts +1 -0
  62. package/dist/esm/utils/index.d.ts +2 -0
  63. package/dist/esm/utils/template-type.d.ts +2 -0
  64. package/dist/style.css +1 -1
  65. package/dist/umd/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
  66. package/dist/umd/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +7 -0
  67. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.d.ts +8 -0
  68. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.d.ts +15 -0
  69. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.d.ts +6 -0
  70. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.d.ts +5 -0
  71. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.d.ts +1 -0
  72. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.d.ts +13 -0
  73. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/index.d.ts +1 -0
  74. package/dist/umd/esm/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +7 -0
  75. package/dist/umd/esm/components/CardPathAnalysis/components/index.d.ts +1 -0
  76. package/dist/umd/esm/components/CardPathAnalysis/configs/index.d.ts +2 -0
  77. package/dist/umd/esm/components/CardPathAnalysis/constants/index.d.ts +1 -0
  78. package/dist/umd/esm/components/CardPathAnalysis/constants/path-analysis.d.ts +73 -0
  79. package/dist/umd/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +56 -0
  80. package/dist/umd/esm/components/CardPathAnalysis/contexts/index.d.ts +1 -0
  81. package/dist/umd/esm/components/CardPathAnalysis/helpers/index.d.ts +2 -0
  82. package/dist/umd/esm/components/CardPathAnalysis/helpers/metricHelpers.d.ts +16 -0
  83. package/dist/umd/esm/components/CardPathAnalysis/helpers/pathAnalysis.d.ts +12 -0
  84. package/dist/umd/esm/components/CardPathAnalysis/helpers/pathAnalysisChart.d.ts +17 -0
  85. package/dist/umd/esm/components/CardPathAnalysis/helpers/treeUtils.d.ts +7 -0
  86. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisChart.d.ts +15 -0
  87. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.d.ts +21 -0
  88. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisHeatmap.d.ts +4 -0
  89. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
  90. package/dist/umd/esm/components/CardPathAnalysis/index.d.ts +4 -0
  91. package/dist/umd/esm/components/CardPathAnalysis/stores/funnel-chart.d.ts +12 -0
  92. package/dist/umd/esm/components/CardPathAnalysis/stores/index.d.ts +3 -0
  93. package/dist/umd/esm/components/CardPathAnalysis/stores/path-analysis-campaign.d.ts +10 -0
  94. package/dist/umd/esm/components/CardPathAnalysis/stores/path-analysis.d.ts +6 -0
  95. package/dist/umd/esm/components/CardPathAnalysis/types/index.d.ts +1 -0
  96. package/dist/umd/esm/components/CardPathAnalysis/types/path-analysis.d.ts +6 -0
  97. package/dist/umd/esm/modules/analytics/index.d.ts +14 -0
  98. package/dist/umd/esm/modules/analytics/types.d.ts +23 -0
  99. package/dist/umd/esm/modules/apps/index.d.ts +4 -0
  100. package/dist/umd/esm/modules/heatmap/hooks/useHeatmapModalMonitor.d.ts +3 -0
  101. package/dist/umd/esm/modules/heatmap/index.d.ts +7 -0
  102. package/dist/umd/esm/modules/heatmap/types/index.d.ts +33 -0
  103. package/dist/umd/esm/modules/page-analytic/index.d.ts +13 -0
  104. package/dist/umd/esm/modules/page-analytic/modules/analytic/index.d.ts +5 -0
  105. package/dist/umd/esm/modules/shopify/index.d.ts +6 -0
  106. package/dist/umd/esm/providers/PricingProvider.d.ts +51 -0
  107. package/dist/umd/esm/providers/index.d.ts +2 -0
  108. package/dist/umd/esm/shared/components/GBox/GBox.d.ts +9 -0
  109. package/dist/umd/esm/shared/components/GBox/index.d.ts +1 -0
  110. package/dist/umd/esm/shared/components/GFeatureLocked/GFeatureLocked.d.ts +14 -0
  111. package/dist/umd/esm/shared/components/GFeatureLocked/constants.d.ts +3 -0
  112. package/dist/umd/esm/shared/components/GFeatureLocked/index.d.ts +2 -0
  113. package/dist/umd/esm/shared/components/GFeatureLocked/types.d.ts +15 -0
  114. package/dist/umd/esm/shared/components/index.d.ts +2 -0
  115. package/dist/umd/esm/types/index.d.ts +1 -0
  116. package/dist/umd/esm/types/metric.d.ts +17 -1
  117. package/dist/umd/esm/types/pricing.d.ts +33 -0
  118. package/dist/umd/esm/types/template.d.ts +19 -0
  119. package/dist/umd/esm/utils/deep-copy.d.ts +1 -0
  120. package/dist/umd/esm/utils/index.d.ts +2 -0
  121. package/dist/umd/esm/utils/template-type.d.ts +2 -0
  122. package/dist/umd/gemxql.js +1 -1
  123. package/dist/umd/index.js +1 -1
  124. package/dist/umd/types.js +1 -1
  125. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ export type PathAnalyticMetricSelectFragment = {
2
+ totalPageViewed?: number | null;
3
+ totalVisitors?: number | null;
4
+ totalClicked?: number | null;
5
+ totalAddedToCart?: number | null;
6
+ totalReachedCheckout?: number | null;
7
+ totalOrders?: number | null;
8
+ totalSessions?: number | null;
9
+ totalSessionsThatCompletedCheckout?: number | null;
10
+ totalSessionsThatReachedCheckout?: number | null;
11
+ totalSessionsWithCartAdditions?: number | null;
12
+ totalClickedHasHref?: number | null;
13
+ totalSessionsWithoutAction?: number | null;
14
+ totalContinuationSession?: number | null;
15
+ };
16
+ export type PathAnalyticPageSelectFragment = {
17
+ level?: number | null;
18
+ locationPath?: string | null;
19
+ id: string;
20
+ parentID: string;
21
+ pageType?: string | null;
22
+ shopifyPageID?: string | null;
23
+ pageTitle?: string | null;
24
+ metric?: PathAnalyticMetricSelectFragment | null;
25
+ };
@@ -0,0 +1,7 @@
1
+ import type { CardPathAnalysisProps } from './components';
2
+ import { EAnalyticMode } from '@/types';
3
+ interface IProps extends CardPathAnalysisProps {
4
+ analyticMode: EAnalyticMode;
5
+ }
6
+ export declare const CardJourneyAnalysis: ({ analyticMode, ...props }: IProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { BoxProps } from '@shopify/polaris';
2
+ export interface CardAnalyticEmptyProps {
3
+ boxProps?: BoxProps;
4
+ minHeight?: string;
5
+ description?: string;
6
+ title?: string;
7
+ }
8
+ export declare const CardAnalyticEmpty: React.FC<CardAnalyticEmptyProps>;
@@ -0,0 +1,15 @@
1
+ import type { IFunnelChartColors } from '@/shared/charts';
2
+ import type { EAnalyticMode } from '@/types';
3
+ import type { IAnalyticsData, ICampaignPathsData } from '../../contexts';
4
+ export interface CardPathAnalysisProps {
5
+ analyticMode: EAnalyticMode;
6
+ funnelColors?: IFunnelChartColors;
7
+ children?: React.ReactNode;
8
+ campaignID?: string;
9
+ campaignGroupID?: string;
10
+ campaignVariantID?: string;
11
+ campaignVersionID?: string;
12
+ campaignPathsData?: ICampaignPathsData;
13
+ analyticsData?: IAnalyticsData;
14
+ }
15
+ export declare const CardPathAnalysis: React.FC<CardPathAnalysisProps>;
@@ -0,0 +1,6 @@
1
+ import type { IFunnelChartColors } from '@/shared/charts';
2
+ export interface PathAnalysisContentProps {
3
+ funnelColors?: IFunnelChartColors;
4
+ showBadge?: boolean;
5
+ }
6
+ export declare const CardPathAnalysisContent: React.FC<PathAnalysisContentProps>;
@@ -0,0 +1,5 @@
1
+ import type { IFunnelChartColors } from '@/shared/charts';
2
+ export interface CardPathAnalysisEmptyProps {
3
+ funnelColors?: IFunnelChartColors;
4
+ }
5
+ export declare const CardPathAnalysisEmpty: React.FC<CardPathAnalysisEmptyProps>;
@@ -0,0 +1 @@
1
+ export declare const CardPathAnalysisSkeleton: React.FC;
@@ -0,0 +1,13 @@
1
+ import type { EAnalyticMode } from '@/types';
2
+ import type { IAnalyticsData, ICampaignPathsData } from '../../contexts';
3
+ export interface CardPathAnalysisWrapperProps {
4
+ children: React.ReactNode;
5
+ campaignID?: string;
6
+ campaignGroupID?: string;
7
+ campaignVariantID?: string;
8
+ campaignVersionID?: string;
9
+ analyticMode: EAnalyticMode;
10
+ campaignPathsData?: ICampaignPathsData;
11
+ analyticsData?: IAnalyticsData;
12
+ }
13
+ export declare const CardPathAnalysisWrapper: React.FC<CardPathAnalysisWrapperProps>;
@@ -0,0 +1 @@
1
+ export * from './CardPathAnalysis';
@@ -0,0 +1,7 @@
1
+ import type { IFunnelChartColors } from '@/shared/charts';
2
+ interface PathAnalysisChartProps {
3
+ funnelColors?: IFunnelChartColors;
4
+ isEnabled?: boolean;
5
+ }
6
+ export declare const PathAnalysisChart: React.FC<PathAnalysisChartProps>;
7
+ export {};
@@ -0,0 +1 @@
1
+ export * from './CardPathAnalysis';
@@ -0,0 +1,2 @@
1
+ export declare const MAX_FUNNEL_ADDITIONAL_LEVEL = 3;
2
+ export declare const FINAL_FUNNEL_FIXED_LEVEL = 3;
@@ -0,0 +1 @@
1
+ export * from './path-analysis';
@@ -0,0 +1,73 @@
1
+ export declare const FUNNEL_POPOVER_KEY: {
2
+ readonly LEVEL_1: "LEVEL_1";
3
+ readonly LEVEL_2: "LEVEL_2";
4
+ readonly LEVEL_3: "LEVEL_3";
5
+ readonly LEVEL_4: "LEVEL_4";
6
+ readonly LEVEL_5: "LEVEL_5";
7
+ readonly LEVEL_6: "LEVEL_6";
8
+ readonly LEVEL_7: "LEVEL_7";
9
+ readonly ADD_LEVEL: "ADD_LEVEL";
10
+ };
11
+ export declare const MOCK_DATA_PATH_ANALYSIS: ({
12
+ data: ({
13
+ value: number;
14
+ key: string;
15
+ id: string;
16
+ chartTooltip: {
17
+ key: string;
18
+ value: string;
19
+ }[];
20
+ labelTooltip?: undefined;
21
+ } | {
22
+ value: number;
23
+ key: string;
24
+ labelTooltip: {
25
+ title: string;
26
+ content: string;
27
+ };
28
+ id?: undefined;
29
+ chartTooltip?: undefined;
30
+ })[];
31
+ name: string;
32
+ metadata: {
33
+ trends: {
34
+ '0': {
35
+ value: string;
36
+ trend: string;
37
+ direction: string;
38
+ };
39
+ '1': {
40
+ value: string;
41
+ trend: string;
42
+ direction: string;
43
+ };
44
+ '2': {
45
+ value: string;
46
+ trend: string;
47
+ direction: string;
48
+ };
49
+ '3': {
50
+ value: string;
51
+ trend: string;
52
+ direction: string;
53
+ };
54
+ };
55
+ };
56
+ isComparison?: undefined;
57
+ } | {
58
+ name: string;
59
+ data: ({
60
+ value: number;
61
+ key: string;
62
+ labelTooltip?: undefined;
63
+ } | {
64
+ value: number;
65
+ key: string;
66
+ labelTooltip: {
67
+ title: string;
68
+ content: string;
69
+ };
70
+ })[];
71
+ isComparison: boolean;
72
+ metadata?: undefined;
73
+ })[];
@@ -0,0 +1,56 @@
1
+ import type { OnChangeFunnelType } from '@/shared/charts';
2
+ import type { EAnalyticMode } from '@/types';
3
+ import type { IBasePathAnalyticPageWithChild, IBasePathAnalyticPageWithParent } from '../types';
4
+ export interface IPathAnalysisFirstLevel {
5
+ id: string;
6
+ locationPath: string;
7
+ pageTitle: string;
8
+ pageType: string;
9
+ parentID: string;
10
+ level: number;
11
+ metric: {
12
+ totalSessions: number;
13
+ };
14
+ }
15
+ export interface ICampaignPathsData {
16
+ paths?: IPathAnalysisFirstLevel[];
17
+ isLoading?: boolean;
18
+ }
19
+ export interface IAnalyticsData {
20
+ pathAnalytics?: IBasePathAnalyticPageWithParent[];
21
+ previousPathAnalyticsMap?: Record<string, IBasePathAnalyticPageWithParent>;
22
+ isLoading?: boolean;
23
+ }
24
+ export interface PathAnalysisType {
25
+ mode: EAnalyticMode;
26
+ campaignID?: string;
27
+ campaignGroupID?: string;
28
+ campaignVariantID?: string;
29
+ campaignVersionID?: string;
30
+ pathAnalytics?: IBasePathAnalyticPageWithParent[];
31
+ isLoadingMetric: boolean;
32
+ pageWithMetric: IBasePathAnalyticPageWithChild | undefined;
33
+ dynamicLevels: IBasePathAnalyticPageWithChild[];
34
+ nextLevelPages: IBasePathAnalyticPageWithChild[];
35
+ previousPathAnalyticsMap: Record<string, IBasePathAnalyticPageWithParent>;
36
+ handleAddNextLevel: (childId: string) => void;
37
+ handleChangeLevel: OnChangeFunnelType;
38
+ getPagesByParentID: (data: {
39
+ level?: number;
40
+ parentID?: string;
41
+ }) => IBasePathAnalyticPageWithChild[];
42
+ handleDeleteLevel: (id?: string) => void;
43
+ }
44
+ export interface PathAnalysisProviderProps {
45
+ children: React.ReactNode;
46
+ campaignID?: string;
47
+ campaignGroupID?: string;
48
+ campaignVariantID?: string;
49
+ campaignVersionID?: string;
50
+ mode: EAnalyticMode;
51
+ campaignPathsData?: ICampaignPathsData;
52
+ analyticsData?: IAnalyticsData;
53
+ }
54
+ export declare const PathAnalysisContext: import("react").Context<PathAnalysisType | undefined>;
55
+ export declare const PathAnalysisProvider: (props: PathAnalysisProviderProps) => import("react/jsx-runtime").JSX.Element;
56
+ export declare const usePathAnalysisContext: () => PathAnalysisType;
@@ -0,0 +1 @@
1
+ export * from './PathAnalysisProvider';
@@ -0,0 +1,2 @@
1
+ export * from './pathAnalysis';
2
+ export * from './pathAnalysisChart';
@@ -0,0 +1,16 @@
1
+ import type { IBasePageAnalyticMetric } from '@/types/metric';
2
+ export declare const getTotalSessionWithCartAdditionMetric: ({ metric }: {
3
+ metric?: IBasePageAnalyticMetric;
4
+ }) => {
5
+ value: number | undefined;
6
+ };
7
+ export declare const getTotalSessionReachedCheckoutMetric: ({ metric }: {
8
+ metric?: IBasePageAnalyticMetric;
9
+ }) => {
10
+ value: number | undefined;
11
+ };
12
+ export declare const getTotalSessionCompletedCheckoutMetric: ({ metric }: {
13
+ metric?: IBasePageAnalyticMetric;
14
+ }) => {
15
+ value: number | undefined;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { IBasePathAnalyticPageWithChild, IBasePathAnalyticPageWithParent } from '../types';
2
+ import type { IGetTextPrice } from '@/modules/shopify';
3
+ export declare const processPathAnalytics: (analyticsData: IBasePathAnalyticPageWithParent[] | undefined, locationPath: string) => IBasePathAnalyticPageWithChild | undefined;
4
+ export declare const processPathAnalyticsTree: (analyticsData: IBasePathAnalyticPageWithParent[] | undefined) => IBasePathAnalyticPageWithChild[] | undefined;
5
+ export declare const getFunnelChildrenPages: (page: IBasePathAnalyticPageWithChild | undefined) => IBasePathAnalyticPageWithChild[];
6
+ export declare const getFunnelChartTooltip: (data: {
7
+ page?: IBasePathAnalyticPageWithChild;
8
+ getTextPrice: IGetTextPrice;
9
+ }) => {
10
+ key: string;
11
+ value: string;
12
+ }[];
@@ -0,0 +1,17 @@
1
+ import type { TrendIndicatorProps } from '@shopify/polaris-viz';
2
+ import type { IBasePathAnalyticPageWithChild } from '../types';
3
+ export declare const calculateFunnelTrendChange: ({ currentValue, previousValue, }: {
4
+ currentValue?: number;
5
+ previousValue?: number;
6
+ }) => TrendIndicatorProps;
7
+ export declare const calculateFirstLevelTrend: ({ pageWithMetric, previousPathAnalyticsMap, }: {
8
+ pageWithMetric?: IBasePathAnalyticPageWithChild;
9
+ previousPathAnalyticsMap: Record<string, IBasePathAnalyticPageWithChild>;
10
+ }) => TrendIndicatorProps | null;
11
+ export declare const calculateDynamicLevelsTrends: (dynamicLevels: IBasePathAnalyticPageWithChild[], previousPathAnalyticsMap: Record<string, IBasePathAnalyticPageWithChild>) => Record<string, TrendIndicatorProps>;
12
+ export declare const calculateConversionMetricsTrends: (dynamicLevels: IBasePathAnalyticPageWithChild[], previousPathAnalyticsMap: Record<string, IBasePathAnalyticPageWithChild>, pageWithMetric?: IBasePathAnalyticPageWithChild) => Record<string, TrendIndicatorProps>;
13
+ export declare const calculateConversionFunnelTrends: ({ pageWithMetric, previousPathAnalyticsMap, dynamicLevels, }: {
14
+ pageWithMetric?: IBasePathAnalyticPageWithChild;
15
+ previousPathAnalyticsMap: Record<string, IBasePathAnalyticPageWithChild>;
16
+ dynamicLevels: IBasePathAnalyticPageWithChild[];
17
+ }) => Record<string, TrendIndicatorProps>;
@@ -0,0 +1,7 @@
1
+ export declare const removeDuplicates: <T extends object>(data: T[] | undefined, keys: (keyof T)[]) => T[];
2
+ export declare const buildTree: <T extends {
3
+ id: string;
4
+ parentID: string;
5
+ children?: T[];
6
+ level?: number | null;
7
+ }>(items: T[]) => T[];
@@ -0,0 +1,15 @@
1
+ import type { IFunnelSelectionItem } from '@/shared/charts/components/GFunnelChart/components/FunnelSelection/type';
2
+ import type { IOnChangeFunnelParams } from '@/shared/charts/components/GFunnelChart/components/types';
3
+ export declare const usePathAnalysisChart: () => {
4
+ lengthDisplayedLevels: number;
5
+ listFunnelSelection: IFunnelSelectionItem[];
6
+ isDisabledAddICon: boolean;
7
+ funnelData: import("@shopify/polaris-viz-core").DataSeries[];
8
+ onDeleteFunnel: (id?: string) => void;
9
+ onAddNextFunnel: (id: string) => void;
10
+ onChangeFunnel: (data: IOnChangeFunnelParams) => void;
11
+ getListFunnelByID: (data: {
12
+ level?: number;
13
+ parentID?: string;
14
+ }) => IFunnelSelectionItem[];
15
+ };
@@ -0,0 +1,21 @@
1
+ import type { IOnChangeFunnelParams } from '@/shared/charts/components/GFunnelChart/components/types';
2
+ import type { IBasePathAnalyticPageWithChild, IBasePathAnalyticPageWithParent } from '../types';
3
+ import type { IPathAnalysisFirstLevel } from '../contexts';
4
+ interface IUsePathAnalysisFunnelProps {
5
+ pathAnalytics: IBasePathAnalyticPageWithParent[];
6
+ pathAnalysisCacheKey: string;
7
+ dataFirstLevels?: IPathAnalysisFirstLevel[];
8
+ }
9
+ export declare const usePathAnalysisFunnel: ({ pathAnalytics, pathAnalysisCacheKey, dataFirstLevels, }: IUsePathAnalysisFunnelProps) => {
10
+ pageWithMetric: IBasePathAnalyticPageWithChild | undefined;
11
+ dynamicLevels: IBasePathAnalyticPageWithChild[];
12
+ nextLevelPages: IBasePathAnalyticPageWithChild[];
13
+ handleAddNextLevel: (childId: string) => void;
14
+ handleChangeLevel: (data: IOnChangeFunnelParams) => void;
15
+ getPagesByParentID: (data: {
16
+ level?: number;
17
+ parentID?: string;
18
+ }) => IBasePathAnalyticPageWithChild[];
19
+ handleDeleteLevel: (id?: string) => void;
20
+ };
21
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { IBasePathAnalyticPageWithChild } from '../types';
2
+ export declare const usePathAnalysisHeatmap: () => {
3
+ handleViewHeatmap: (level: number, pages: IBasePathAnalyticPageWithChild[]) => void;
4
+ };
@@ -0,0 +1,10 @@
1
+ import type { PathAnalyticPageSelectFragment } from '@/api/graphql/fragments/pathAnalytic.generated';
2
+ import type { IPathAnalysisFirstLevel } from '../contexts';
3
+ interface IUsePathAnalysisFunnelProps {
4
+ pathAnalytics: PathAnalyticPageSelectFragment[];
5
+ dataFirstLevels?: IPathAnalysisFirstLevel[];
6
+ }
7
+ export declare const usePathAnalyticsMerger: ({ pathAnalytics, dataFirstLevels }: IUsePathAnalysisFunnelProps) => {
8
+ processedPathAnalytics: PathAnalyticPageSelectFragment[];
9
+ };
10
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './components';
2
+ export * from './contexts';
3
+ export * from './constants';
4
+ export * from './stores';
@@ -0,0 +1,12 @@
1
+ import type { IBasePathAnalyticPageWithChild } from '../types';
2
+ export interface ICachedFunnelChartDataValue {
3
+ firstLocationPath?: string;
4
+ dynamicLevels?: IBasePathAnalyticPageWithChild[];
5
+ }
6
+ interface IFunnelChartStoreState {
7
+ cachedFunnelChartData: Record<string, ICachedFunnelChartDataValue>;
8
+ setCachedFunnelChartData: (key: string, funnelChartData: ICachedFunnelChartDataValue) => void;
9
+ resetData: () => void;
10
+ }
11
+ export declare const useFunnelChartStore: import("zustand").UseBoundStore<import("zustand").StoreApi<IFunnelChartStoreState>>;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './path-analysis';
2
+ export * from './path-analysis-campaign';
3
+ export * from './funnel-chart';
@@ -0,0 +1,10 @@
1
+ export declare enum IVariantType {
2
+ VARIANT_A = "A",
3
+ VARIANT_B = "B"
4
+ }
5
+ interface IPathAnalysisCampaignStoreState {
6
+ selectedVariantType: IVariantType;
7
+ setSelectedVariantType: (selectedVariantType: IVariantType) => void;
8
+ }
9
+ export declare const usePathAnalysisCampaignStore: import("zustand").UseBoundStore<import("zustand").StoreApi<IPathAnalysisCampaignStoreState>>;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ interface IPathAnalyticStoreState {
2
+ firstLevelLocationPath?: string;
3
+ setFirstLevelLocationPath: (firstLevelLocationPath?: string) => void;
4
+ }
5
+ export declare const usePathAnalysisStore: import("zustand").UseBoundStore<import("zustand").StoreApi<IPathAnalyticStoreState>>;
6
+ export {};
@@ -0,0 +1 @@
1
+ export * from './path-analysis';
@@ -0,0 +1,6 @@
1
+ import type { PathAnalyticMetricSelectFragment, PathAnalyticPageSelectFragment } from '@/api/graphql/fragments/pathAnalytic.generated';
2
+ export interface IBasePathAnalyticPageWithChild extends PathAnalyticPageSelectFragment {
3
+ children?: IBasePathAnalyticPageWithChild[];
4
+ metrics?: PathAnalyticMetricSelectFragment[];
5
+ }
6
+ export type IBasePathAnalyticPageWithParent = PathAnalyticPageSelectFragment;
@@ -599,6 +599,27 @@ const getFormattedByInterval = (value, interval, options) => {
599
599
  return dayjsTz(value).format(optionFormat.formatMonth);
600
600
  };
601
601
 
602
+ var TemplateType;
603
+ (function (TemplateType) {
604
+ TemplateType["ALL"] = "all";
605
+ TemplateType["HOME"] = "index";
606
+ TemplateType["COLLECTION"] = "collection";
607
+ TemplateType["COLLECTION_LIST"] = "collection-list";
608
+ TemplateType["PRODUCT"] = "product";
609
+ TemplateType["ARTICLE"] = "article";
610
+ TemplateType["PAGE"] = "page";
611
+ TemplateType["CART"] = "cart";
612
+ TemplateType["SEARCH"] = "search";
613
+ TemplateType["NOT_FOUND"] = "404";
614
+ TemplateType["BLOG"] = "blog";
615
+ TemplateType["PASSWORD"] = "password";
616
+ TemplateType["CONTACT"] = "contact";
617
+ TemplateType["GIF_CART"] = "gif-cart";
618
+ TemplateType["ACCOUNT"] = "account";
619
+ TemplateType["CHECKOUT"] = "checkout";
620
+ TemplateType["GIFT_CARD"] = "gift-card";
621
+ })(TemplateType || (TemplateType = {}));
622
+
602
623
  const toDate = (value) => (typeof value === 'string' ? dayjsTz(value) : value);
603
624
  const isMidnight = (date) => date.hour() === 0 && date.minute() === 0;
604
625
  const formatDateForQuery = (date, isEndDay = false) => {
@@ -970,6 +991,7 @@ var EMetricKey;
970
991
  EMetricKey["VISITOR_ITEMS"] = "visitor_items";
971
992
  EMetricKey["DEVICE_ITEMS"] = "device_items";
972
993
  EMetricKey["TRAFFIC_SOURCE_ITEMS"] = "traffic_source_items";
994
+ EMetricKey["PAGE_PATH_ANALYSIS"] = "PAGE_PATH_ANALYSIS";
973
995
  })(EMetricKey || (EMetricKey = {}));
974
996
 
975
997
  ({
@@ -1061,6 +1083,10 @@ var EMetricKey;
1061
1083
  title: 'Sessions by traffic source',
1062
1084
  content: 'Sessions on your page by where visitors come from',
1063
1085
  },
1086
+ [EMetricKey.PAGE_PATH_ANALYSIS]: {
1087
+ title: 'Journey analysis',
1088
+ content: 'Journey analysis tracks the journey from entry to purchase and shows where visitors leave the store',
1089
+ },
1064
1090
  });
1065
1091
 
1066
1092
  var EAnalyticMode;
@@ -1093,6 +1119,43 @@ var ETrafficSourceType;
1093
1119
  ETrafficSourceType["SMS"] = "sms";
1094
1120
  })(ETrafficSourceType || (ETrafficSourceType = {}));
1095
1121
 
1122
+ /**
1123
+ * Pricing enums mirrored from the host app (`~/modules/pricing/types`).
1124
+ *
1125
+ * They are duplicated here so the SDK no longer needs to import the host's
1126
+ * pricing module directly. The host can import these enums back from
1127
+ * `@gem-sdk/analytics/types` to build the value passed to `PricingProvider`,
1128
+ * which guarantees the string values stay in sync on both sides.
1129
+ */
1130
+ var IPlanKey;
1131
+ (function (IPlanKey) {
1132
+ /**
1133
+ * @deprecated This plan is available for users installed before release 1.3.0.
1134
+ */
1135
+ IPlanKey["CONTENT_TESTING"] = "content-testing";
1136
+ IPlanKey["PAGE_OPT"] = "page-optimize";
1137
+ IPlanKey["FUNNEL_OPT"] = "funnel-optimize";
1138
+ IPlanKey["PROFIT_OPT"] = "profit-optimize";
1139
+ // Trial plans
1140
+ IPlanKey["TRIAL_PAGE_OPT"] = "trial-page-optimize";
1141
+ IPlanKey["TRIAL_FUNNEL_OPT"] = "trial-funnel-optimize";
1142
+ IPlanKey["TRIAL_PROFIT_OPT"] = "trial-profit-optimize";
1143
+ })(IPlanKey || (IPlanKey = {}));
1144
+ var IShopPlanState;
1145
+ (function (IShopPlanState) {
1146
+ IShopPlanState["TRIAL_PAGE_OPT"] = "TRIAL_PAGE_OPT";
1147
+ IShopPlanState["TRIAL_FUNNEL_OPT"] = "TRIAL_FUNNEL_OPT";
1148
+ IShopPlanState["TRIAL_PROFIT_OPT"] = "TRIAL_PROFIT_OPT";
1149
+ IShopPlanState["ACTIVE_PAGE_OPT"] = "ACTIVE_PAGE_OPT";
1150
+ IShopPlanState["ACTIVE_FUNNEL_OPT"] = "ACTIVE_FUNNEL_OPT";
1151
+ IShopPlanState["ACTIVE_PROFIT_OPT"] = "ACTIVE_PROFIT_OPT";
1152
+ IShopPlanState["LOADING_PLAN"] = "LOADING_PLAN";
1153
+ IShopPlanState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
1154
+ IShopPlanState["ACTIVE_PAGE_OPT_AND_TRIAL_PAGE_OPT"] = "ACTIVE_PAGE_OPT_AND_TRIAL_PAGE_OPT";
1155
+ IShopPlanState["ACTIVE_PAGE_OPT_AND_TRIAL_FUNNEL_OPT"] = "ACTIVE_PAGE_OPT_AND_TRIAL_FUNNEL_OPT";
1156
+ IShopPlanState["ACTIVE_FUNNEL_OPT_AND_TRIAL_FUNNEL_OPT"] = "ACTIVE_FUNNEL_OPT_AND_TRIAL_FUNNEL_OPT";
1157
+ })(IShopPlanState || (IShopPlanState = {}));
1158
+
1096
1159
  [
1097
1160
  { value: EVisitorType.NEW, label: 'New' },
1098
1161
  { value: EVisitorType.RETURNING, label: 'Returning' },
@@ -599,6 +599,27 @@ const getFormattedByInterval = (value, interval, options) => {
599
599
  return dayjsTz(value).format(optionFormat.formatMonth);
600
600
  };
601
601
 
602
+ var TemplateType;
603
+ (function (TemplateType) {
604
+ TemplateType["ALL"] = "all";
605
+ TemplateType["HOME"] = "index";
606
+ TemplateType["COLLECTION"] = "collection";
607
+ TemplateType["COLLECTION_LIST"] = "collection-list";
608
+ TemplateType["PRODUCT"] = "product";
609
+ TemplateType["ARTICLE"] = "article";
610
+ TemplateType["PAGE"] = "page";
611
+ TemplateType["CART"] = "cart";
612
+ TemplateType["SEARCH"] = "search";
613
+ TemplateType["NOT_FOUND"] = "404";
614
+ TemplateType["BLOG"] = "blog";
615
+ TemplateType["PASSWORD"] = "password";
616
+ TemplateType["CONTACT"] = "contact";
617
+ TemplateType["GIF_CART"] = "gif-cart";
618
+ TemplateType["ACCOUNT"] = "account";
619
+ TemplateType["CHECKOUT"] = "checkout";
620
+ TemplateType["GIFT_CARD"] = "gift-card";
621
+ })(TemplateType || (TemplateType = {}));
622
+
602
623
  const toDate = (value) => (typeof value === 'string' ? dayjsTz(value) : value);
603
624
  const isMidnight = (date) => date.hour() === 0 && date.minute() === 0;
604
625
  const formatDateForQuery = (date, isEndDay = false) => {
@@ -970,6 +991,7 @@ var EMetricKey;
970
991
  EMetricKey["VISITOR_ITEMS"] = "visitor_items";
971
992
  EMetricKey["DEVICE_ITEMS"] = "device_items";
972
993
  EMetricKey["TRAFFIC_SOURCE_ITEMS"] = "traffic_source_items";
994
+ EMetricKey["PAGE_PATH_ANALYSIS"] = "PAGE_PATH_ANALYSIS";
973
995
  })(EMetricKey || (EMetricKey = {}));
974
996
 
975
997
  ({
@@ -1061,6 +1083,10 @@ var EMetricKey;
1061
1083
  title: 'Sessions by traffic source',
1062
1084
  content: 'Sessions on your page by where visitors come from',
1063
1085
  },
1086
+ [EMetricKey.PAGE_PATH_ANALYSIS]: {
1087
+ title: 'Journey analysis',
1088
+ content: 'Journey analysis tracks the journey from entry to purchase and shows where visitors leave the store',
1089
+ },
1064
1090
  });
1065
1091
 
1066
1092
  var EAnalyticMode;
@@ -1093,6 +1119,43 @@ var ETrafficSourceType;
1093
1119
  ETrafficSourceType["SMS"] = "sms";
1094
1120
  })(ETrafficSourceType || (ETrafficSourceType = {}));
1095
1121
 
1122
+ /**
1123
+ * Pricing enums mirrored from the host app (`~/modules/pricing/types`).
1124
+ *
1125
+ * They are duplicated here so the SDK no longer needs to import the host's
1126
+ * pricing module directly. The host can import these enums back from
1127
+ * `@gem-sdk/analytics/types` to build the value passed to `PricingProvider`,
1128
+ * which guarantees the string values stay in sync on both sides.
1129
+ */
1130
+ var IPlanKey;
1131
+ (function (IPlanKey) {
1132
+ /**
1133
+ * @deprecated This plan is available for users installed before release 1.3.0.
1134
+ */
1135
+ IPlanKey["CONTENT_TESTING"] = "content-testing";
1136
+ IPlanKey["PAGE_OPT"] = "page-optimize";
1137
+ IPlanKey["FUNNEL_OPT"] = "funnel-optimize";
1138
+ IPlanKey["PROFIT_OPT"] = "profit-optimize";
1139
+ // Trial plans
1140
+ IPlanKey["TRIAL_PAGE_OPT"] = "trial-page-optimize";
1141
+ IPlanKey["TRIAL_FUNNEL_OPT"] = "trial-funnel-optimize";
1142
+ IPlanKey["TRIAL_PROFIT_OPT"] = "trial-profit-optimize";
1143
+ })(IPlanKey || (IPlanKey = {}));
1144
+ var IShopPlanState;
1145
+ (function (IShopPlanState) {
1146
+ IShopPlanState["TRIAL_PAGE_OPT"] = "TRIAL_PAGE_OPT";
1147
+ IShopPlanState["TRIAL_FUNNEL_OPT"] = "TRIAL_FUNNEL_OPT";
1148
+ IShopPlanState["TRIAL_PROFIT_OPT"] = "TRIAL_PROFIT_OPT";
1149
+ IShopPlanState["ACTIVE_PAGE_OPT"] = "ACTIVE_PAGE_OPT";
1150
+ IShopPlanState["ACTIVE_FUNNEL_OPT"] = "ACTIVE_FUNNEL_OPT";
1151
+ IShopPlanState["ACTIVE_PROFIT_OPT"] = "ACTIVE_PROFIT_OPT";
1152
+ IShopPlanState["LOADING_PLAN"] = "LOADING_PLAN";
1153
+ IShopPlanState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
1154
+ IShopPlanState["ACTIVE_PAGE_OPT_AND_TRIAL_PAGE_OPT"] = "ACTIVE_PAGE_OPT_AND_TRIAL_PAGE_OPT";
1155
+ IShopPlanState["ACTIVE_PAGE_OPT_AND_TRIAL_FUNNEL_OPT"] = "ACTIVE_PAGE_OPT_AND_TRIAL_FUNNEL_OPT";
1156
+ IShopPlanState["ACTIVE_FUNNEL_OPT_AND_TRIAL_FUNNEL_OPT"] = "ACTIVE_FUNNEL_OPT_AND_TRIAL_FUNNEL_OPT";
1157
+ })(IShopPlanState || (IShopPlanState = {}));
1158
+
1096
1159
  [
1097
1160
  { value: EVisitorType.NEW, label: 'New' },
1098
1161
  { value: EVisitorType.RETURNING, label: 'Returning' },