@gem-sdk/analytics 1.0.0-dev.21 → 1.0.0-dev.41

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 (127) hide show
  1. package/dist/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
  2. package/dist/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +9 -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 +8 -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/PathAnalysisConfigProvider.d.ts +23 -0
  16. package/dist/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +59 -0
  17. package/dist/esm/components/CardPathAnalysis/contexts/index.d.ts +2 -0
  18. package/dist/esm/components/CardPathAnalysis/helpers/index.d.ts +2 -0
  19. package/dist/esm/components/CardPathAnalysis/helpers/metricHelpers.d.ts +16 -0
  20. package/dist/esm/components/CardPathAnalysis/helpers/pathAnalysis.d.ts +12 -0
  21. package/dist/esm/components/CardPathAnalysis/helpers/pathAnalysisChart.d.ts +17 -0
  22. package/dist/esm/components/CardPathAnalysis/helpers/treeUtils.d.ts +7 -0
  23. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisChart.d.ts +15 -0
  24. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.d.ts +22 -0
  25. package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
  26. package/dist/esm/components/CardPathAnalysis/index.d.ts +5 -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/components/index.d.ts +1 -0
  34. package/dist/esm/gemxql.js +64 -1
  35. package/dist/esm/gemxql.mjs +64 -1
  36. package/dist/esm/hooks/useSearchParams.d.ts +1 -0
  37. package/dist/esm/index.js +21622 -108
  38. package/dist/esm/index.mjs +21622 -108
  39. package/dist/esm/modules/analytics/constants/index.d.ts +15 -0
  40. package/dist/esm/modules/analytics/index.d.ts +3 -0
  41. package/dist/esm/modules/analytics/types/index.d.ts +41 -0
  42. package/dist/esm/modules/analytics/utils/formatMetric.d.ts +8 -0
  43. package/dist/esm/modules/analytics/utils/getPAMetricValue.d.ts +3 -0
  44. package/dist/esm/modules/analytics/utils/index.d.ts +3 -0
  45. package/dist/esm/modules/analytics/utils/metric.d.ts +26 -0
  46. package/dist/esm/providers/ConvertMoneyProvider.d.ts +1 -1
  47. package/dist/esm/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipWithPortal.d.ts +1 -1
  48. package/dist/esm/shared/charts/components/GPolarisViz/hooks/useRootContainer.d.ts +1 -1
  49. package/dist/esm/shared/components/GBox/GBox.d.ts +9 -0
  50. package/dist/esm/shared/components/GBox/index.d.ts +1 -0
  51. package/dist/esm/shared/components/GFeatureLocked/GFeatureLocked.d.ts +14 -0
  52. package/dist/esm/shared/components/GFeatureLocked/constants.d.ts +3 -0
  53. package/dist/esm/shared/components/GFeatureLocked/index.d.ts +2 -0
  54. package/dist/esm/shared/components/GFeatureLocked/types.d.ts +15 -0
  55. package/dist/esm/shared/components/index.d.ts +2 -0
  56. package/dist/esm/types/index.d.ts +1 -0
  57. package/dist/esm/types/metric.d.ts +20 -1
  58. package/dist/esm/types/pricing.d.ts +33 -0
  59. package/dist/esm/types/template.d.ts +19 -0
  60. package/dist/esm/types.js +39 -1
  61. package/dist/esm/types.mjs +39 -1
  62. package/dist/esm/utils/deep-copy.d.ts +1 -0
  63. package/dist/esm/utils/index.d.ts +2 -0
  64. package/dist/esm/utils/template-type.d.ts +2 -0
  65. package/dist/style.css +1 -1
  66. package/dist/umd/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
  67. package/dist/umd/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +9 -0
  68. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.d.ts +8 -0
  69. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.d.ts +15 -0
  70. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.d.ts +6 -0
  71. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.d.ts +5 -0
  72. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.d.ts +1 -0
  73. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.d.ts +13 -0
  74. package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/index.d.ts +1 -0
  75. package/dist/umd/esm/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +8 -0
  76. package/dist/umd/esm/components/CardPathAnalysis/components/index.d.ts +1 -0
  77. package/dist/umd/esm/components/CardPathAnalysis/configs/index.d.ts +2 -0
  78. package/dist/umd/esm/components/CardPathAnalysis/constants/index.d.ts +1 -0
  79. package/dist/umd/esm/components/CardPathAnalysis/constants/path-analysis.d.ts +73 -0
  80. package/dist/umd/esm/components/CardPathAnalysis/contexts/PathAnalysisConfigProvider.d.ts +23 -0
  81. package/dist/umd/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +59 -0
  82. package/dist/umd/esm/components/CardPathAnalysis/contexts/index.d.ts +2 -0
  83. package/dist/umd/esm/components/CardPathAnalysis/helpers/index.d.ts +2 -0
  84. package/dist/umd/esm/components/CardPathAnalysis/helpers/metricHelpers.d.ts +16 -0
  85. package/dist/umd/esm/components/CardPathAnalysis/helpers/pathAnalysis.d.ts +12 -0
  86. package/dist/umd/esm/components/CardPathAnalysis/helpers/pathAnalysisChart.d.ts +17 -0
  87. package/dist/umd/esm/components/CardPathAnalysis/helpers/treeUtils.d.ts +7 -0
  88. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisChart.d.ts +15 -0
  89. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.d.ts +22 -0
  90. package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
  91. package/dist/umd/esm/components/CardPathAnalysis/index.d.ts +5 -0
  92. package/dist/umd/esm/components/CardPathAnalysis/stores/funnel-chart.d.ts +12 -0
  93. package/dist/umd/esm/components/CardPathAnalysis/stores/index.d.ts +3 -0
  94. package/dist/umd/esm/components/CardPathAnalysis/stores/path-analysis-campaign.d.ts +10 -0
  95. package/dist/umd/esm/components/CardPathAnalysis/stores/path-analysis.d.ts +6 -0
  96. package/dist/umd/esm/components/CardPathAnalysis/types/index.d.ts +1 -0
  97. package/dist/umd/esm/components/CardPathAnalysis/types/path-analysis.d.ts +6 -0
  98. package/dist/umd/esm/components/index.d.ts +1 -0
  99. package/dist/umd/esm/hooks/useSearchParams.d.ts +1 -0
  100. package/dist/umd/esm/modules/analytics/constants/index.d.ts +15 -0
  101. package/dist/umd/esm/modules/analytics/index.d.ts +3 -0
  102. package/dist/umd/esm/modules/analytics/types/index.d.ts +41 -0
  103. package/dist/umd/esm/modules/analytics/utils/formatMetric.d.ts +8 -0
  104. package/dist/umd/esm/modules/analytics/utils/getPAMetricValue.d.ts +3 -0
  105. package/dist/umd/esm/modules/analytics/utils/index.d.ts +3 -0
  106. package/dist/umd/esm/modules/analytics/utils/metric.d.ts +26 -0
  107. package/dist/umd/esm/providers/ConvertMoneyProvider.d.ts +1 -1
  108. package/dist/umd/esm/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipWithPortal.d.ts +1 -1
  109. package/dist/umd/esm/shared/charts/components/GPolarisViz/hooks/useRootContainer.d.ts +1 -1
  110. package/dist/umd/esm/shared/components/GBox/GBox.d.ts +9 -0
  111. package/dist/umd/esm/shared/components/GBox/index.d.ts +1 -0
  112. package/dist/umd/esm/shared/components/GFeatureLocked/GFeatureLocked.d.ts +14 -0
  113. package/dist/umd/esm/shared/components/GFeatureLocked/constants.d.ts +3 -0
  114. package/dist/umd/esm/shared/components/GFeatureLocked/index.d.ts +2 -0
  115. package/dist/umd/esm/shared/components/GFeatureLocked/types.d.ts +15 -0
  116. package/dist/umd/esm/shared/components/index.d.ts +2 -0
  117. package/dist/umd/esm/types/index.d.ts +1 -0
  118. package/dist/umd/esm/types/metric.d.ts +20 -1
  119. package/dist/umd/esm/types/pricing.d.ts +33 -0
  120. package/dist/umd/esm/types/template.d.ts +19 -0
  121. package/dist/umd/esm/utils/deep-copy.d.ts +1 -0
  122. package/dist/umd/esm/utils/index.d.ts +2 -0
  123. package/dist/umd/esm/utils/template-type.d.ts +2 -0
  124. package/dist/umd/gemxql.js +1 -1
  125. package/dist/umd/index.js +1 -1
  126. package/dist/umd/types.js +1 -1
  127. package/package.json +5 -3
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IBasePathAnalyticPageWithChild } from '../types';
3
+ export interface IPathAnalysisPricingConfig {
4
+ isLoading: boolean;
5
+ isPathAnalysisEnabled: boolean;
6
+ onOpenModalPricing: () => void;
7
+ }
8
+ export interface IPathAnalysisHeatmapConfig {
9
+ isEnabledV1: boolean;
10
+ isEnabledV2: boolean;
11
+ onView: (level: number, pages: IBasePathAnalyticPageWithChild[]) => void;
12
+ }
13
+ export interface IPathAnalysisConfig {
14
+ pricing: IPathAnalysisPricingConfig;
15
+ heatmap: IPathAnalysisHeatmapConfig;
16
+ }
17
+ export interface IPathAnalysisConfigProviderProps {
18
+ children: ReactNode;
19
+ pricing: IPathAnalysisPricingConfig;
20
+ heatmap: IPathAnalysisHeatmapConfig;
21
+ }
22
+ export declare const PathAnalysisConfigProvider: ({ children, pricing, heatmap }: IPathAnalysisConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const usePathAnalysisConfig: () => IPathAnalysisConfig;
@@ -0,0 +1,59 @@
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
+ locationPath?: string;
24
+ shopifyPageType?: string;
25
+ }
26
+ export interface PathAnalysisType {
27
+ mode: EAnalyticMode;
28
+ campaignID?: string;
29
+ campaignGroupID?: string;
30
+ campaignVariantID?: string;
31
+ campaignVersionID?: string;
32
+ pathAnalytics?: IBasePathAnalyticPageWithParent[];
33
+ isLoadingMetric: boolean;
34
+ shopifyPageType?: string;
35
+ pageWithMetric: IBasePathAnalyticPageWithChild | undefined;
36
+ dynamicLevels: IBasePathAnalyticPageWithChild[];
37
+ nextLevelPages: IBasePathAnalyticPageWithChild[];
38
+ previousPathAnalyticsMap: Record<string, IBasePathAnalyticPageWithParent>;
39
+ handleAddNextLevel: (childId: string) => void;
40
+ handleChangeLevel: OnChangeFunnelType;
41
+ getPagesByParentID: (data: {
42
+ level?: number;
43
+ parentID?: string;
44
+ }) => IBasePathAnalyticPageWithChild[];
45
+ handleDeleteLevel: (id?: string) => void;
46
+ }
47
+ export interface PathAnalysisProviderProps {
48
+ children: React.ReactNode;
49
+ campaignID?: string;
50
+ campaignGroupID?: string;
51
+ campaignVariantID?: string;
52
+ campaignVersionID?: string;
53
+ mode: EAnalyticMode;
54
+ campaignPathsData?: ICampaignPathsData;
55
+ analyticsData?: IAnalyticsData;
56
+ }
57
+ export declare const PathAnalysisContext: import("react").Context<PathAnalysisType | undefined>;
58
+ export declare const PathAnalysisProvider: (props: PathAnalysisProviderProps) => import("react/jsx-runtime").JSX.Element;
59
+ export declare const usePathAnalysisContext: () => PathAnalysisType;
@@ -0,0 +1,2 @@
1
+ export * from './PathAnalysisConfigProvider';
2
+ 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 { IGetTextPrice } from '@/core/gemxql';
2
+ import type { IBasePathAnalyticPageWithChild, IBasePathAnalyticPageWithParent } from '../types';
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,22 @@
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
+ locationPath?: string;
9
+ }
10
+ export declare const usePathAnalysisFunnel: ({ pathAnalytics, pathAnalysisCacheKey, dataFirstLevels, locationPath, }: IUsePathAnalysisFunnelProps) => {
11
+ pageWithMetric: IBasePathAnalyticPageWithChild | undefined;
12
+ dynamicLevels: IBasePathAnalyticPageWithChild[];
13
+ nextLevelPages: IBasePathAnalyticPageWithChild[];
14
+ handleAddNextLevel: (childId: string) => void;
15
+ handleChangeLevel: (data: IOnChangeFunnelParams) => void;
16
+ getPagesByParentID: (data: {
17
+ level?: number;
18
+ parentID?: string;
19
+ }) => IBasePathAnalyticPageWithChild[];
20
+ handleDeleteLevel: (id?: string) => void;
21
+ };
22
+ export {};
@@ -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,5 @@
1
+ export * from './CardJourneyAnalysis';
2
+ export * from './components';
3
+ export * from './contexts';
4
+ export * from './constants';
5
+ 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;
@@ -4,3 +4,4 @@ export * from './SingleMetricChartCard';
4
4
  export * from './AnalyticMode';
5
5
  export * from './CurrencySelector';
6
6
  export * from './GTimePicker';
7
+ export * from './CardPathAnalysis';
@@ -0,0 +1 @@
1
+ export declare const useSearchParams: () => [URLSearchParams];
@@ -0,0 +1,15 @@
1
+ import type { IFunctionGetMetric } from '../types';
2
+ import { IPAMetricKey } from '../types';
3
+ interface IPageAnalyticMappingItem {
4
+ heading: {
5
+ title: string;
6
+ };
7
+ getMetricValue: IFunctionGetMetric;
8
+ }
9
+ export declare const PA_METRIC_TOOLTIP: Record<IPAMetricKey, unknown>;
10
+ export declare const SHOPIFY_PAGE_TYPE_KEY = "shopify_page_type";
11
+ export declare const METRICS_COLUMNS: Record<IPAMetricKey, {
12
+ label: string;
13
+ }>;
14
+ export declare const PAGE_ANALYTIC_MAPPING: Record<IPAMetricKey, IPageAnalyticMappingItem>;
15
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './types';
3
+ export * from './utils';
@@ -0,0 +1,41 @@
1
+ import type { IBasePageAnalyticMetric } from '@/types/metric';
2
+ export declare enum IPAMetricKey {
3
+ PAGE_SESSIONS = "PAGE_SESSIONS",
4
+ PAGE_BR = "PAGE_BOUNCE_RATE",
5
+ PAGE_CTR = "PAGE_CLICK_THROUGH_RATE",
6
+ PAGE_AVG_TIME = "PAGE_AVG_TIME",
7
+ PAGE_VIEWS = "PAGE_VIEWS",
8
+ PAGE_RPV = "PAGE_REVENUE_PER_VISITOR",
9
+ PAGE_REVENUE = "PAGE_REVENUE",
10
+ PAGE_NEW_RETURNING_CUSTOMER = "PAGE_NEW_RETURNING_CUSTOMER",
11
+ PAGE_SESSIONS_BY_VISITOR = "PAGE_SESSIONS_BY_VISITOR",
12
+ PAGE_SESSIONS_BY_DEVICE = "PAGE_SESSIONS_BY_DEVICE",
13
+ PAGE_SESSIONS_BY_TRAFFIC = "PAGE_SESSIONS_BY_TRAFFIC",
14
+ PAGE_PATH_ANALYSIS = "PAGE_PATH_ANALYSIS",
15
+ PAGE_CART_ADDITION = "PAGE_SESSION_WITH_CART_ADDITION",
16
+ PAGE_ADDED_TO_CART = "PAGE_ADDED_TO_CART",
17
+ PAGE_ADD_TO_CART_RATE = "ADD_TO_CART_RATE",
18
+ PAGE_REACHED_CHECKOUT = "PAGE_REACHED_CHECKOUT",
19
+ PAGE_COMPLETE_CHECKOUT = "PAGE_COMPLETE_CHECKOUT",
20
+ PAGE_ORDERS = "PAGE_ORDERS",
21
+ PAGE_CR = "PAGE_CONVERSION_RATE",
22
+ PAGE_AOV = "PAGE_AVERAGE_ORDER_VALUE",
23
+ PAGE_VISITORS = "PAGE_VISITORS"
24
+ }
25
+ export declare enum IMetricFormatter {
26
+ PERCENTAGE_STRING = "PERCENTAGE_STRING",
27
+ CURRENCY = "CURRENCY",
28
+ DURATION = "DURATION",
29
+ DURATION_MS = "DURATION_MS",
30
+ MILLISECONDS = "MILLISECONDS",
31
+ NORMAL = "NORMAL",
32
+ NUMBER_COMMAS = "NUMBER_COMMAS",
33
+ NUMBER_COMMAS_LEAN = "NUMBER_COMMAS_LEAN"
34
+ }
35
+ export interface IDetectMetricResult<K = number | undefined> {
36
+ formatter: IMetricFormatter;
37
+ value: K;
38
+ }
39
+ export type IFunctionGetMetric<T = IBasePageAnalyticMetric> = (props: {
40
+ metric?: T;
41
+ }) => IDetectMetricResult;
@@ -0,0 +1,8 @@
1
+ import type { IGetTextPrice } from '@/core/gemxql';
2
+ export type IFormatMetricParams = {
3
+ value: number | string | undefined;
4
+ formatter: string;
5
+ getTextPrice: IGetTextPrice;
6
+ compact?: boolean;
7
+ };
8
+ export declare const formatMetricByFormatter: ({ value, formatter, getTextPrice, compact }: IFormatMetricParams) => string;
@@ -0,0 +1,3 @@
1
+ import type { IBasePageAnalyticMetric } from '@/types/metric';
2
+ import type { IDetectMetricResult, IPAMetricKey } from '../types';
3
+ export declare const getPAMetricValueV2: (metric?: IBasePageAnalyticMetric, key?: IPAMetricKey) => IDetectMetricResult;
@@ -0,0 +1,3 @@
1
+ export * from './formatMetric';
2
+ export * from './getPAMetricValue';
3
+ export * from './metric';
@@ -0,0 +1,26 @@
1
+ import type { IDetectMetricResult, IFunctionGetMetric } from '../types';
2
+ import { IMetricFormatter } from '../types';
3
+ export declare const detectDataV2By: <T>({ data, formatter, extractValue, }: {
4
+ data: T | undefined;
5
+ formatter: IMetricFormatter;
6
+ extractValue: (value: T | undefined) => number | undefined;
7
+ }) => IDetectMetricResult;
8
+ export declare const getTotalSessionMetric: IFunctionGetMetric;
9
+ export declare const getTotalVisitorMetric: IFunctionGetMetric;
10
+ export declare const getTotalOrderMetric: IFunctionGetMetric;
11
+ export declare const getTotalPageViewMetric: IFunctionGetMetric;
12
+ export declare const getTotalRevenueMetric: IFunctionGetMetric;
13
+ export declare const getBounceRateMetric: IFunctionGetMetric;
14
+ export declare const getLinkCtrMetric: IFunctionGetMetric;
15
+ export declare const getConversionRateMetric: IFunctionGetMetric;
16
+ export declare const getAddToCartRateMetric: IFunctionGetMetric;
17
+ export declare const getAverageTimeOnPageMetric: IFunctionGetMetric;
18
+ export declare const getRevenuePerVisitorMetric: IFunctionGetMetric;
19
+ export declare const getAverageOrderValueMetric: IFunctionGetMetric;
20
+ export declare const getTotalATCMetric: IFunctionGetMetric;
21
+ export declare const getTotalSessionWithCartAdditionMetric: IFunctionGetMetric;
22
+ export declare const getTotalSessionReachedCheckoutMetric: IFunctionGetMetric;
23
+ export declare const getTotalSessionCompletedCheckoutMetric: IFunctionGetMetric;
24
+ export declare const getPathAnalysisMetric: IFunctionGetMetric;
25
+ export declare const getTotalSessionByDeviceMetric: IFunctionGetMetric;
26
+ export declare const getNewReturningCustomerMetric: IFunctionGetMetric;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { IGetTextPrice } from '@/core/gemxql/helpers/formatAnalyticData';
2
+ import type { IGetTextPrice } from '@/core/gemxql';
3
3
  interface IConvertMoneyContext {
4
4
  getTextPrice: IGetTextPrice;
5
5
  }
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export declare function TooltipWithPortal({ children }: {
3
3
  children: ReactNode;
4
- }): import("react").ReactPortal;
4
+ }): import("react").ReactPortal | null;
@@ -1 +1 @@
1
- export declare const useRootContainer: (id: string) => HTMLElement;
1
+ export declare const useRootContainer: (id: string) => HTMLElement | null;
@@ -0,0 +1,9 @@
1
+ import type { BoxProps } from '@shopify/polaris';
2
+ type AriaShadowType = 'shadow-outset-200' | 'shadow-drop-outset-100' | 'shadow-top-100' | 'shadow-bottom-100';
3
+ type AriaHeightType = 'height-full';
4
+ export interface GBoxProps extends BoxProps {
5
+ ariaShadow?: AriaShadowType;
6
+ ariaHeight?: AriaHeightType;
7
+ }
8
+ export declare const GBox: (props: GBoxProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './GBox';
@@ -0,0 +1,14 @@
1
+ import type { BlockStackProps, ButtonProps } from '@shopify/polaris';
2
+ import type { IGFeatureLocked } from './types';
3
+ import { type GBoxProps } from '../GBox';
4
+ interface GFeatureLockedProps {
5
+ title?: string;
6
+ description?: string;
7
+ type: IGFeatureLocked;
8
+ buttonProps?: Partial<ButtonProps>;
9
+ inlineAlign?: BlockStackProps['inlineAlign'];
10
+ boxProps?: GBoxProps;
11
+ boxContentProps?: GBoxProps;
12
+ }
13
+ export declare const GFeatureLocked: ({ title, description, type, buttonProps, boxProps, boxContentProps, inlineAlign, }: GFeatureLockedProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { IGFeatureLockedData } from './types';
2
+ import { IGFeatureLocked } from './types';
3
+ export declare const G_FEATURE_LOCKED_DATA: Record<IGFeatureLocked, IGFeatureLockedData>;
@@ -0,0 +1,2 @@
1
+ export * from './GFeatureLocked';
2
+ export * from './types';
@@ -0,0 +1,15 @@
1
+ export declare enum IGFeatureLocked {
2
+ CampaignGroupTemplate = "CampaignGroupTemplate",
3
+ PageListing = "PageListing",
4
+ Analytics = "Analytics",
5
+ PathAnalysis = "PathAnalysis"
6
+ }
7
+ export interface IGFeatureLockedData {
8
+ background?: string;
9
+ backgroundColor?: string;
10
+ illustration?: string;
11
+ aspectRatio?: number;
12
+ backdropFilter?: number;
13
+ maxDescriptionWidth?: string;
14
+ gradientBackground?: string;
15
+ }
@@ -14,3 +14,5 @@ export * from './GTooltip';
14
14
  export * from './GTooltipCard';
15
15
  export * from './GViewBySelector';
16
16
  export * from './GChoice';
17
+ export * from './GBox';
18
+ export * from './GFeatureLocked';
@@ -3,3 +3,4 @@ export * from './metric';
3
3
  export * from './analytic-mode';
4
4
  export * from './currency';
5
5
  export * from './breakdown-items';
6
+ export * from './pricing';
@@ -17,7 +17,8 @@ export declare enum EMetricKey {
17
17
  RPV = "revenue_per_visitor",
18
18
  VISITOR_ITEMS = "visitor_items",
19
19
  DEVICE_ITEMS = "device_items",
20
- TRAFFIC_SOURCE_ITEMS = "traffic_source_items"
20
+ TRAFFIC_SOURCE_ITEMS = "traffic_source_items",
21
+ PAGE_PATH_ANALYSIS = "PAGE_PATH_ANALYSIS"
21
22
  }
22
23
  export interface IMetricControl {
23
24
  value: string | number | null;
@@ -55,3 +56,21 @@ export interface IAnalyticMetric {
55
56
  visitors?: Array<IAnalyticStat | null> | null;
56
57
  variantKey?: string;
57
58
  }
59
+ export interface IBasePageAnalyticMetric {
60
+ totalPageViewed?: number | null;
61
+ totalVisitors?: number | null;
62
+ totalClicked?: number | null;
63
+ totalAddedToCart?: number | null;
64
+ totalReachedCheckout?: number | null;
65
+ totalOrders?: number | null;
66
+ totalSessions?: number | null;
67
+ totalSessionsThatCompletedCheckout?: number | null;
68
+ totalSessionsThatReachedCheckout?: number | null;
69
+ totalSessionsWithCartAdditions?: number | null;
70
+ totalClickedHasHref?: number | null;
71
+ totalSessionsWithoutAction?: number | null;
72
+ totalContinuationSession?: number | null;
73
+ totalRevenue?: number | null;
74
+ totalTimeOnPage?: number | null;
75
+ totalPageViewedHaveTimeOnPage?: number | null;
76
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Pricing enums mirrored from the host app (`~/modules/pricing/types`).
3
+ *
4
+ * They are duplicated here so the SDK no longer needs to import the host's
5
+ * pricing module directly. The host can import these enums back from
6
+ * `@gem-sdk/analytics/types` to build the value passed to `PathAnalysisConfigProvider`,
7
+ * which guarantees the string values stay in sync on both sides.
8
+ */
9
+ export declare enum IPlanKey {
10
+ /**
11
+ * @deprecated This plan is available for users installed before release 1.3.0.
12
+ */
13
+ CONTENT_TESTING = "content-testing",
14
+ PAGE_OPT = "page-optimize",
15
+ FUNNEL_OPT = "funnel-optimize",
16
+ PROFIT_OPT = "profit-optimize",
17
+ TRIAL_PAGE_OPT = "trial-page-optimize",
18
+ TRIAL_FUNNEL_OPT = "trial-funnel-optimize",
19
+ TRIAL_PROFIT_OPT = "trial-profit-optimize"
20
+ }
21
+ export declare enum IShopPlanState {
22
+ TRIAL_PAGE_OPT = "TRIAL_PAGE_OPT",
23
+ TRIAL_FUNNEL_OPT = "TRIAL_FUNNEL_OPT",
24
+ TRIAL_PROFIT_OPT = "TRIAL_PROFIT_OPT",
25
+ ACTIVE_PAGE_OPT = "ACTIVE_PAGE_OPT",
26
+ ACTIVE_FUNNEL_OPT = "ACTIVE_FUNNEL_OPT",
27
+ ACTIVE_PROFIT_OPT = "ACTIVE_PROFIT_OPT",
28
+ LOADING_PLAN = "LOADING_PLAN",
29
+ TRIAL_EXPIRED = "TRIAL_EXPIRED",
30
+ ACTIVE_PAGE_OPT_AND_TRIAL_PAGE_OPT = "ACTIVE_PAGE_OPT_AND_TRIAL_PAGE_OPT",
31
+ ACTIVE_PAGE_OPT_AND_TRIAL_FUNNEL_OPT = "ACTIVE_PAGE_OPT_AND_TRIAL_FUNNEL_OPT",
32
+ ACTIVE_FUNNEL_OPT_AND_TRIAL_FUNNEL_OPT = "ACTIVE_FUNNEL_OPT_AND_TRIAL_FUNNEL_OPT"
33
+ }
@@ -0,0 +1,19 @@
1
+ export declare enum TemplateType {
2
+ ALL = "all",
3
+ HOME = "index",
4
+ COLLECTION = "collection",
5
+ COLLECTION_LIST = "collection-list",
6
+ PRODUCT = "product",
7
+ ARTICLE = "article",
8
+ PAGE = "page",
9
+ CART = "cart",
10
+ SEARCH = "search",
11
+ NOT_FOUND = "404",
12
+ BLOG = "blog",
13
+ PASSWORD = "password",
14
+ CONTACT = "contact",
15
+ GIF_CART = "gif-cart",
16
+ ACCOUNT = "account",
17
+ CHECKOUT = "checkout",
18
+ GIFT_CARD = "gift-card"
19
+ }
@@ -0,0 +1 @@
1
+ export declare const deepCopy: <T>(obj: T) => T;
@@ -4,3 +4,5 @@ export * from './cls';
4
4
  export * from './sort';
5
5
  export * from './dayjs';
6
6
  export * from './analytics';
7
+ export * from './deep-copy';
8
+ export * from './template-type';
@@ -0,0 +1,2 @@
1
+ import { TemplateType } from '@/types/template';
2
+ export declare const parseTemplateType: (templateType?: TemplateType | string) => string;