@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.
- package/dist/esm/api/graphql/fragments/pathAnalytic.generated.d.ts +25 -0
- package/dist/esm/components/CardPathAnalysis/CardJourneyAnalysis.d.ts +9 -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 +8 -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/PathAnalysisConfigProvider.d.ts +23 -0
- package/dist/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +59 -0
- package/dist/esm/components/CardPathAnalysis/contexts/index.d.ts +2 -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 +22 -0
- package/dist/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
- package/dist/esm/components/CardPathAnalysis/index.d.ts +5 -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/components/index.d.ts +1 -0
- package/dist/esm/gemxql.js +64 -1
- package/dist/esm/gemxql.mjs +64 -1
- package/dist/esm/hooks/useSearchParams.d.ts +1 -0
- package/dist/esm/index.js +21622 -108
- package/dist/esm/index.mjs +21622 -108
- package/dist/esm/modules/analytics/constants/index.d.ts +15 -0
- package/dist/esm/modules/analytics/index.d.ts +3 -0
- package/dist/esm/modules/analytics/types/index.d.ts +41 -0
- package/dist/esm/modules/analytics/utils/formatMetric.d.ts +8 -0
- package/dist/esm/modules/analytics/utils/getPAMetricValue.d.ts +3 -0
- package/dist/esm/modules/analytics/utils/index.d.ts +3 -0
- package/dist/esm/modules/analytics/utils/metric.d.ts +26 -0
- package/dist/esm/providers/ConvertMoneyProvider.d.ts +1 -1
- package/dist/esm/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipWithPortal.d.ts +1 -1
- package/dist/esm/shared/charts/components/GPolarisViz/hooks/useRootContainer.d.ts +1 -1
- 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 +20 -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 +9 -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 +8 -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/PathAnalysisConfigProvider.d.ts +23 -0
- package/dist/umd/esm/components/CardPathAnalysis/contexts/PathAnalysisProvider.d.ts +59 -0
- package/dist/umd/esm/components/CardPathAnalysis/contexts/index.d.ts +2 -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 +22 -0
- package/dist/umd/esm/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.d.ts +10 -0
- package/dist/umd/esm/components/CardPathAnalysis/index.d.ts +5 -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/components/index.d.ts +1 -0
- package/dist/umd/esm/hooks/useSearchParams.d.ts +1 -0
- package/dist/umd/esm/modules/analytics/constants/index.d.ts +15 -0
- package/dist/umd/esm/modules/analytics/index.d.ts +3 -0
- package/dist/umd/esm/modules/analytics/types/index.d.ts +41 -0
- package/dist/umd/esm/modules/analytics/utils/formatMetric.d.ts +8 -0
- package/dist/umd/esm/modules/analytics/utils/getPAMetricValue.d.ts +3 -0
- package/dist/umd/esm/modules/analytics/utils/index.d.ts +3 -0
- package/dist/umd/esm/modules/analytics/utils/metric.d.ts +26 -0
- package/dist/umd/esm/providers/ConvertMoneyProvider.d.ts +1 -1
- package/dist/umd/esm/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipWithPortal.d.ts +1 -1
- package/dist/umd/esm/shared/charts/components/GPolarisViz/hooks/useRootContainer.d.ts +1 -1
- 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 +20 -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 +5 -3
package/dist/esm/gemxql.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import timezone from 'dayjs/plugin/timezone.js';
|
|
|
4
4
|
import utc from 'dayjs/plugin/utc.js';
|
|
5
5
|
import { useQuery } from '@tanstack/react-query';
|
|
6
6
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
7
|
-
import { create } from 'zustand';
|
|
8
7
|
import { createContext, useContext, useState, useRef, useCallback, useEffect } from 'react';
|
|
8
|
+
import { create } from 'zustand';
|
|
9
9
|
|
|
10
10
|
const NONE_VALUE = 'None';
|
|
11
11
|
const PLACEHOLDER_VALUE = '-';
|
|
@@ -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 `PathAnalysisConfigProvider`,
|
|
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' },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSearchParams: () => [URLSearchParams];
|