@levi-gemcommerce/analytics 1.0.0-dev.21 → 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.
- package/dist/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
- package/dist/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +7 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.d.ts +8 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.d.ts +15 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.d.ts +6 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.d.ts +5 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.d.ts +1 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.d.ts +13 -0
- package/dist/esm/components/CardPathAnalysis/components/CardPathAnalysis/index.d.ts +1 -0
- package/dist/esm/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +7 -0
- package/dist/esm/components/CardPathAnalysis/components/index.d.ts +1 -0
- package/dist/esm/components/CardPathAnalysis/configs/index.d.ts +2 -0
- package/dist/esm/components/CardPathAnalysis/constants/index.d.ts +1 -0
- package/dist/esm/components/CardPathAnalysis/constants/path-analysis.d.ts +73 -0
- package/dist/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +56 -0
- package/dist/esm/components/CardPathAnalysis/contexts/index.d.ts +1 -0
- package/dist/esm/components/CardPathAnalysis/helpers/index.d.ts +2 -0
- package/dist/esm/components/CardPathAnalysis/helpers/metricHelpers.d.ts +16 -0
- package/dist/esm/components/CardPathAnalysis/helpers/pathAnalysis.d.ts +12 -0
- package/dist/esm/components/CardPathAnalysis/helpers/pathAnalysisChart.d.ts +17 -0
- package/dist/esm/components/CardPathAnalysis/helpers/treeUtils.d.ts +7 -0
- package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisChart.d.ts +15 -0
- package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.d.ts +21 -0
- package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalysisHeatmap.d.ts +4 -0
- package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
- package/dist/esm/components/CardPathAnalysis/index.d.ts +4 -0
- package/dist/esm/components/CardPathAnalysis/stores/funnel-chart.d.ts +12 -0
- package/dist/esm/components/CardPathAnalysis/stores/index.d.ts +3 -0
- package/dist/esm/components/CardPathAnalysis/stores/path-analysis-campaign.d.ts +10 -0
- package/dist/esm/components/CardPathAnalysis/stores/path-analysis.d.ts +6 -0
- package/dist/esm/components/CardPathAnalysis/types/index.d.ts +1 -0
- package/dist/esm/components/CardPathAnalysis/types/path-analysis.d.ts +6 -0
- package/dist/esm/gemxql.js +63 -0
- package/dist/esm/gemxql.mjs +63 -0
- package/dist/esm/index.js +145 -1
- package/dist/esm/index.mjs +145 -1
- package/dist/esm/modules/analytics/index.d.ts +14 -0
- package/dist/esm/modules/analytics/types.d.ts +23 -0
- package/dist/esm/modules/apps/index.d.ts +4 -0
- package/dist/esm/modules/heatmap/hooks/useHeatmapModalMonitor.d.ts +3 -0
- package/dist/esm/modules/heatmap/index.d.ts +7 -0
- package/dist/esm/modules/heatmap/types/index.d.ts +33 -0
- package/dist/esm/modules/page-analytic/index.d.ts +13 -0
- package/dist/esm/modules/page-analytic/modules/analytic/index.d.ts +5 -0
- package/dist/esm/modules/shopify/index.d.ts +6 -0
- package/dist/esm/providers/PricingProvider.d.ts +51 -0
- package/dist/esm/providers/index.d.ts +2 -0
- package/dist/esm/shared/components/GBox/GBox.d.ts +9 -0
- package/dist/esm/shared/components/GBox/index.d.ts +1 -0
- package/dist/esm/shared/components/GFeatureLocked/GFeatureLocked.d.ts +14 -0
- package/dist/esm/shared/components/GFeatureLocked/constants.d.ts +3 -0
- package/dist/esm/shared/components/GFeatureLocked/index.d.ts +2 -0
- package/dist/esm/shared/components/GFeatureLocked/types.d.ts +15 -0
- package/dist/esm/shared/components/index.d.ts +2 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/metric.d.ts +17 -1
- package/dist/esm/types/pricing.d.ts +33 -0
- package/dist/esm/types/template.d.ts +19 -0
- package/dist/esm/types.js +39 -1
- package/dist/esm/types.mjs +39 -1
- package/dist/esm/utils/deep-copy.d.ts +1 -0
- package/dist/esm/utils/index.d.ts +2 -0
- package/dist/esm/utils/template-type.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/umd/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
- package/dist/umd/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +7 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.d.ts +8 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.d.ts +15 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.d.ts +6 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.d.ts +5 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.d.ts +1 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.d.ts +13 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/CardPathAnalysis/index.d.ts +1 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +7 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/index.d.ts +1 -0
- package/dist/umd/esm/components/CardPathAnalysis/configs/index.d.ts +2 -0
- package/dist/umd/esm/components/CardPathAnalysis/constants/index.d.ts +1 -0
- package/dist/umd/esm/components/CardPathAnalysis/constants/path-analysis.d.ts +73 -0
- package/dist/umd/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +56 -0
- package/dist/umd/esm/components/CardPathAnalysis/contexts/index.d.ts +1 -0
- package/dist/umd/esm/components/CardPathAnalysis/helpers/index.d.ts +2 -0
- package/dist/umd/esm/components/CardPathAnalysis/helpers/metricHelpers.d.ts +16 -0
- package/dist/umd/esm/components/CardPathAnalysis/helpers/pathAnalysis.d.ts +12 -0
- package/dist/umd/esm/components/CardPathAnalysis/helpers/pathAnalysisChart.d.ts +17 -0
- package/dist/umd/esm/components/CardPathAnalysis/helpers/treeUtils.d.ts +7 -0
- package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisChart.d.ts +15 -0
- package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.d.ts +21 -0
- package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalysisHeatmap.d.ts +4 -0
- package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
- package/dist/umd/esm/components/CardPathAnalysis/index.d.ts +4 -0
- package/dist/umd/esm/components/CardPathAnalysis/stores/funnel-chart.d.ts +12 -0
- package/dist/umd/esm/components/CardPathAnalysis/stores/index.d.ts +3 -0
- package/dist/umd/esm/components/CardPathAnalysis/stores/path-analysis-campaign.d.ts +10 -0
- package/dist/umd/esm/components/CardPathAnalysis/stores/path-analysis.d.ts +6 -0
- package/dist/umd/esm/components/CardPathAnalysis/types/index.d.ts +1 -0
- package/dist/umd/esm/components/CardPathAnalysis/types/path-analysis.d.ts +6 -0
- package/dist/umd/esm/modules/analytics/index.d.ts +14 -0
- package/dist/umd/esm/modules/analytics/types.d.ts +23 -0
- package/dist/umd/esm/modules/apps/index.d.ts +4 -0
- package/dist/umd/esm/modules/heatmap/hooks/useHeatmapModalMonitor.d.ts +3 -0
- package/dist/umd/esm/modules/heatmap/index.d.ts +7 -0
- package/dist/umd/esm/modules/heatmap/types/index.d.ts +33 -0
- package/dist/umd/esm/modules/page-analytic/index.d.ts +13 -0
- package/dist/umd/esm/modules/page-analytic/modules/analytic/index.d.ts +5 -0
- package/dist/umd/esm/modules/shopify/index.d.ts +6 -0
- package/dist/umd/esm/providers/PricingProvider.d.ts +51 -0
- package/dist/umd/esm/providers/index.d.ts +2 -0
- package/dist/umd/esm/shared/components/GBox/GBox.d.ts +9 -0
- package/dist/umd/esm/shared/components/GBox/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GFeatureLocked/GFeatureLocked.d.ts +14 -0
- package/dist/umd/esm/shared/components/GFeatureLocked/constants.d.ts +3 -0
- package/dist/umd/esm/shared/components/GFeatureLocked/index.d.ts +2 -0
- package/dist/umd/esm/shared/components/GFeatureLocked/types.d.ts +15 -0
- package/dist/umd/esm/shared/components/index.d.ts +2 -0
- package/dist/umd/esm/types/index.d.ts +1 -0
- package/dist/umd/esm/types/metric.d.ts +17 -1
- package/dist/umd/esm/types/pricing.d.ts +33 -0
- package/dist/umd/esm/types/template.d.ts +19 -0
- package/dist/umd/esm/utils/deep-copy.d.ts +1 -0
- package/dist/umd/esm/utils/index.d.ts +2 -0
- package/dist/umd/esm/utils/template-type.d.ts +2 -0
- package/dist/umd/gemxql.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/types.js +1 -1
- package/package.json +1 -1
|
@@ -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,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,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,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,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,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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IGetTextPrice } from '../shopify';
|
|
2
|
+
import type { IPAMetricKey } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export type IFormatMetricParams = {
|
|
5
|
+
value: number | string | undefined;
|
|
6
|
+
formatter: string;
|
|
7
|
+
getTextPrice: IGetTextPrice;
|
|
8
|
+
};
|
|
9
|
+
export declare const formatMetricByFormatter: (_params: IFormatMetricParams) => string;
|
|
10
|
+
export declare const PA_METRIC_TOOLTIP: Record<IPAMetricKey, unknown>;
|
|
11
|
+
export declare const useMetricsTimeFilter: () => {
|
|
12
|
+
dateTimePicked: unknown;
|
|
13
|
+
compareDateTimePicked: unknown;
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum IPAMetricKey {
|
|
2
|
+
PAGE_SESSIONS = "PAGE_SESSIONS",
|
|
3
|
+
PAGE_BR = "PAGE_BOUNCE_RATE",
|
|
4
|
+
PAGE_CTR = "PAGE_CLICK_THROUGH_RATE",
|
|
5
|
+
PAGE_AVG_TIME = "PAGE_AVG_TIME",
|
|
6
|
+
PAGE_VIEWS = "PAGE_VIEWS",
|
|
7
|
+
PAGE_RPV = "PAGE_REVENUE_PER_VISITOR",
|
|
8
|
+
PAGE_REVENUE = "PAGE_REVENUE",
|
|
9
|
+
PAGE_NEW_RETURNING_CUSTOMER = "PAGE_NEW_RETURNING_CUSTOMER",
|
|
10
|
+
PAGE_SESSIONS_BY_VISITOR = "PAGE_SESSIONS_BY_VISITOR",
|
|
11
|
+
PAGE_SESSIONS_BY_DEVICE = "PAGE_SESSIONS_BY_DEVICE",
|
|
12
|
+
PAGE_SESSIONS_BY_TRAFFIC = "PAGE_SESSIONS_BY_TRAFFIC",
|
|
13
|
+
PAGE_PATH_ANALYSIS = "PAGE_PATH_ANALYSIS",
|
|
14
|
+
PAGE_CART_ADDITION = "PAGE_SESSION_WITH_CART_ADDITION",
|
|
15
|
+
PAGE_ADDED_TO_CART = "PAGE_ADDED_TO_CART",
|
|
16
|
+
PAGE_ADD_TO_CART_RATE = "ADD_TO_CART_RATE",
|
|
17
|
+
PAGE_REACHED_CHECKOUT = "PAGE_REACHED_CHECKOUT",
|
|
18
|
+
PAGE_COMPLETE_CHECKOUT = "PAGE_COMPLETE_CHECKOUT",
|
|
19
|
+
PAGE_ORDERS = "PAGE_ORDERS",
|
|
20
|
+
PAGE_CR = "PAGE_CONVERSION_RATE",
|
|
21
|
+
PAGE_AOV = "PAGE_AVERAGE_ORDER_VALUE",
|
|
22
|
+
PAGE_VISITORS = "PAGE_VISITORS"
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EHeatmapBaseFilterType, EHeatmapFilterType } from './types';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export declare const useHeatmapFilterBuildParams: () => {
|
|
4
|
+
buildSearchParams: (filters: Partial<Record<EHeatmapFilterType, unknown>>, baseFilters: Partial<Record<EHeatmapBaseFilterType, unknown>>) => {
|
|
5
|
+
toString: () => string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare enum EHeatmapBaseFilterType {
|
|
2
|
+
DATE_RANGE = "date_range",
|
|
3
|
+
URL_PATH = "url_path",
|
|
4
|
+
ANALYTIC_MODE = "analytic_mode",
|
|
5
|
+
OPERATOR = "operator"
|
|
6
|
+
}
|
|
7
|
+
export declare enum EHeatmapFilterType {
|
|
8
|
+
VISITOR_JOURNEY = "visitor_journey",
|
|
9
|
+
MARKET = "market",
|
|
10
|
+
VISITOR_TYPE = "visitor_type",
|
|
11
|
+
TRAFFIC_SOURCE = "traffic_source",
|
|
12
|
+
PURCHASE_TYPE = "purchase_type",
|
|
13
|
+
TIME_ON_PAGE = "time_on_page",
|
|
14
|
+
ORDER_VALUE = "order_value",
|
|
15
|
+
CAMPAIGN = "campaign_id",
|
|
16
|
+
REFERRAL_SOURCE = "referral_source"
|
|
17
|
+
}
|
|
18
|
+
export interface IFilterVisitorJourneyValue {
|
|
19
|
+
id: string;
|
|
20
|
+
path: string;
|
|
21
|
+
level: number;
|
|
22
|
+
isHeatmap: boolean;
|
|
23
|
+
subFilter?: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface IFilterVisitorJourney {
|
|
26
|
+
value?: IFilterVisitorJourneyValue[];
|
|
27
|
+
}
|
|
28
|
+
export interface IFilterCampaignValue {
|
|
29
|
+
campaignId: string;
|
|
30
|
+
campaignGroupId?: string;
|
|
31
|
+
campaignVariantId: string;
|
|
32
|
+
campaignVariantType: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IPAMetricKey } from '../analytics/types';
|
|
2
|
+
export declare const LOCATION_PATH_KEY = "location_path";
|
|
3
|
+
export declare const SHOPIFY_PAGE_TYPE_KEY = "shopify_page_type";
|
|
4
|
+
export declare const METRICS_COLUMNS: Record<IPAMetricKey, {
|
|
5
|
+
label: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const PAGE_ANALYTIC_MAPPING: Record<IPAMetricKey, {
|
|
8
|
+
heading: {
|
|
9
|
+
title: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { IPlanKey, IShopPlanState } from '@/types/pricing';
|
|
3
|
+
/**
|
|
4
|
+
* Pricing values the SDK needs from the host app.
|
|
5
|
+
*
|
|
6
|
+
* The host owns all pricing logic (plan state, limitations, modals). It computes
|
|
7
|
+
* these values with its own pricing hooks and injects them through
|
|
8
|
+
* `PricingProvider`. SDK components then read them via the context hooks below
|
|
9
|
+
* instead of importing `~/modules/pricing` directly.
|
|
10
|
+
*/
|
|
11
|
+
export interface IPricingContextValue {
|
|
12
|
+
/** Whether the active plan is still being resolved. */
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
/** The shop's current active (paid) plan key. */
|
|
15
|
+
activePlanKey: IPlanKey;
|
|
16
|
+
/** Aggregated plan state, used to detect trial-expired and similar cases. */
|
|
17
|
+
shopPlanState: IShopPlanState;
|
|
18
|
+
/** Result of the host's path-analysis limitation check for the active plan. */
|
|
19
|
+
isPathAnalysisEnabled: boolean;
|
|
20
|
+
/** Opens the host's pricing modal (e.g. on an upgrade CTA). */
|
|
21
|
+
onOpenModalPricing: () => void;
|
|
22
|
+
}
|
|
23
|
+
export interface IPricingProviderProps extends IPricingContextValue {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const PricingProvider: ({ children, isLoading, activePlanKey, shopPlanState, isPathAnalysisEnabled, onOpenModalPricing, }: IPricingProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const usePricingContext: () => IPricingContextValue;
|
|
28
|
+
/**
|
|
29
|
+
* The hooks below mirror the host's `~/modules/pricing` API so existing SDK
|
|
30
|
+
* components only need to swap their import path. Each one reads from the
|
|
31
|
+
* injected `PricingContext`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const usePricingPlanActive: () => {
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
activePlanKey: IPlanKey;
|
|
36
|
+
};
|
|
37
|
+
export declare const usePricingPlanActiveState: () => {
|
|
38
|
+
shopPlanState: IShopPlanState;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* `planKey` is kept for API compatibility with the host hook. The SDK only ever
|
|
42
|
+
* checks the active plan, so the enabled flag is taken straight from context.
|
|
43
|
+
*/
|
|
44
|
+
export declare const useLimitPathAnalysis: (_props?: {
|
|
45
|
+
planKey?: IPlanKey;
|
|
46
|
+
}) => {
|
|
47
|
+
isEnabled: boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare const usePricingModalMonitor: () => {
|
|
50
|
+
onOpenModalPricing: () => void;
|
|
51
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { ConvertMoneyProvider, useConvertMoneyContext } from './ConvertMoneyProvider';
|
|
2
2
|
export type { IProps as IConvertMoneyProviderProps } from './ConvertMoneyProvider';
|
|
3
3
|
export { MetricChartProvider } from './MetricChartProvider';
|
|
4
|
+
export { PricingProvider, usePricingContext, usePricingPlanActive, usePricingPlanActiveState, useLimitPathAnalysis, usePricingModalMonitor, } from './PricingProvider';
|
|
5
|
+
export type { IPricingContextValue, IPricingProviderProps } from './PricingProvider';
|
|
@@ -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,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
|
+
}
|
|
@@ -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,18 @@ 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
|
+
}
|
|
@@ -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 `PricingProvider`,
|
|
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;
|