@levi-gemcommerce/analytics 2.0.1-dev.1 → 2.0.2-dev.1
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/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +0 -1
- package/dist/esm/index.js +16 -1
- package/dist/esm/index.mjs +16 -1
- package/dist/esm/providers/TimezoneProvider.d.ts +11 -0
- package/dist/esm/providers/index.d.ts +2 -0
- package/dist/umd/esm/components/CardPathAnalysis/components/PathAnalysisChart.d.ts +0 -1
- package/dist/umd/esm/providers/TimezoneProvider.d.ts +11 -0
- package/dist/umd/esm/providers/index.d.ts +2 -0
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2475,6 +2475,20 @@ const MetricChartProvider = ({ children, minHeight = CHART_MIN_HEIGHT, seriesCol
|
|
|
2475
2475
|
}, children: children })] }));
|
|
2476
2476
|
};
|
|
2477
2477
|
|
|
2478
|
+
const TimezoneContext = createContext({ tz: 'UTC' });
|
|
2479
|
+
const TimezoneProvider = ({ children, tz }) => {
|
|
2480
|
+
const [currentTz, setCurrentTz] = useState(() => {
|
|
2481
|
+
setTz(tz);
|
|
2482
|
+
return tz;
|
|
2483
|
+
});
|
|
2484
|
+
useEffect(() => {
|
|
2485
|
+
setTz(tz);
|
|
2486
|
+
setCurrentTz(tz);
|
|
2487
|
+
}, [tz]);
|
|
2488
|
+
return jsx(TimezoneContext.Provider, { value: { tz: currentTz }, children: children });
|
|
2489
|
+
};
|
|
2490
|
+
const useTimezoneContext = () => useContext(TimezoneContext);
|
|
2491
|
+
|
|
2478
2492
|
const MetricChart = ({ lineChartData, isLoading, isEmptyMetricData, columnTypes, metricKey, }) => {
|
|
2479
2493
|
const { formatValue, yAxisOptions } = useFormatLineChartData({ metricKey, columnTypes: columnTypes || {} });
|
|
2480
2494
|
if (!metricKey) {
|
|
@@ -3217,6 +3231,7 @@ const COMPARE_DATE_TIME_FILTERS_MAP = {
|
|
|
3217
3231
|
};
|
|
3218
3232
|
|
|
3219
3233
|
const useDateTimeFilter = () => {
|
|
3234
|
+
useTimezoneContext();
|
|
3220
3235
|
const currentDate = dayjsTzToLocalTZ().startOf('day');
|
|
3221
3236
|
const mappings = getDateTimeFilterMapping();
|
|
3222
3237
|
const TODAY_CONFIG = mappings[MainDateTimePickerAlias.TODAY];
|
|
@@ -25853,4 +25868,4 @@ const useStickyFilterBoxProps = ({ id }) => {
|
|
|
25853
25868
|
};
|
|
25854
25869
|
};
|
|
25855
25870
|
|
|
25856
|
-
export { ANALYTICS_METRIC_TOOLTIP, AnalyticModeSelector, CAMPAIGN_BACKGROUND_MAIN, CHART_MIN_HEIGHT, COMPARE_DATE_TIME_FILTERS_MAP, CardJourneyAnalysis, CardPathAnalysis, CompareDateTimePickerAlias, ConvertMoneyProvider, CurrencySelector, DATE_TIME_COMPARISON_FILTERS, DEFAULT_CURRENCY_ANALYTIC, DEFAULT_CURRENT_PERIOD_LABEL, DEFAULT_PREVIOUS_PERIOD_LABEL, DEFAULT_SELECTED_COLUMNS_FOR_EXPERIMENT, DateTimeFilterInputs, DateTimeFilters, DateTimePickerContext, DateTimePickerProvider, EJourneyEvent, EReportSource, FUNNEL_POPOVER_KEY, GSelectableMetricChartCard, GTimePicker, IVariantType, MOCK_DATA_PATH_ANALYSIS, MainDateTimePickerAlias, MetricChartProvider, MetricDonutChartCard, ORDER_COLUMN_MAPPING, ORDER_LISTING_COLUMNS, ORDER_LISTING_CONFIG, ORDER_LISTING_DIMENSIONS, ORDER_LISTING_DIMENSION_LAYOUT, ORDER_LISTING_LATEST_COLUMNS_FOR_PAGE, ORDER_LISTING_METRICS, ORDER_LISTING_METRIC_LAYOUTS, OrderListingLatestTable, PLACEHOLDER_VALUE$1 as PLACEHOLDER_VALUE, PREVIOUS_PERIOD_FILTER, PathAnalysisConfigProvider, PathAnalysisContext, PathAnalysisProvider, SERIES_COLORS, SORT_ORDER_LISTING_DEFAULT, SingleMetricChartCard, TARGET_CHANNEL, TARGET_DEVICES, TARGET_VISITOR, THUMB_PRODUCT_DEFAULT, TREND_TONE, convertDateToTz, convertToDateTimeFilters, createLastDaysRange, dayjsTz, dayjsTzToDate, dayjsTzToLocalTZ, formatDate, formatDateTimeRange, formatDayjs, formatMs, formatTime, formatTimeRange, getDateRangeTitle, getDateTimeFilterBase, getDateTimeFilterByAlias, getDateTimeFilterMapping, getEndOfDayBy, getInitialTimezone, getLast12Months, getLast30Days, getLast365Days, getLast7Days, getLast90Days, getLastMonth, getLastYear, getMonthAndYearByDateFilter, getNoComparison, getPreviousMonth, getPreviousPeriod, getPreviousQuarter, getPreviousWeek, getPreviousYear, getToday, getVersionDateDescription, getVersionDateRangeTitle, getYesterday, isDate, isMidnight, isSameDayTimestamp, isValidDate, isValidYearMonthDayDateString, parseYearMonthDayDateString, setTz, useConvertMoneyContext, useCurrencyRatesStore, useDateTimeFilter, useDateTimePicker, useDateTimePickerContext, useFunnelChartStore, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useVersionDateTimeFilters };
|
|
25871
|
+
export { ANALYTICS_METRIC_TOOLTIP, AnalyticModeSelector, CAMPAIGN_BACKGROUND_MAIN, CHART_MIN_HEIGHT, COMPARE_DATE_TIME_FILTERS_MAP, CardJourneyAnalysis, CardPathAnalysis, CompareDateTimePickerAlias, ConvertMoneyProvider, CurrencySelector, DATE_TIME_COMPARISON_FILTERS, DEFAULT_CURRENCY_ANALYTIC, DEFAULT_CURRENT_PERIOD_LABEL, DEFAULT_PREVIOUS_PERIOD_LABEL, DEFAULT_SELECTED_COLUMNS_FOR_EXPERIMENT, DateTimeFilterInputs, DateTimeFilters, DateTimePickerContext, DateTimePickerProvider, EJourneyEvent, EReportSource, FUNNEL_POPOVER_KEY, GSelectableMetricChartCard, GTimePicker, IVariantType, MOCK_DATA_PATH_ANALYSIS, MainDateTimePickerAlias, MetricChartProvider, MetricDonutChartCard, ORDER_COLUMN_MAPPING, ORDER_LISTING_COLUMNS, ORDER_LISTING_CONFIG, ORDER_LISTING_DIMENSIONS, ORDER_LISTING_DIMENSION_LAYOUT, ORDER_LISTING_LATEST_COLUMNS_FOR_PAGE, ORDER_LISTING_METRICS, ORDER_LISTING_METRIC_LAYOUTS, OrderListingLatestTable, PLACEHOLDER_VALUE$1 as PLACEHOLDER_VALUE, PREVIOUS_PERIOD_FILTER, PathAnalysisConfigProvider, PathAnalysisContext, PathAnalysisProvider, SERIES_COLORS, SORT_ORDER_LISTING_DEFAULT, SingleMetricChartCard, TARGET_CHANNEL, TARGET_DEVICES, TARGET_VISITOR, THUMB_PRODUCT_DEFAULT, TREND_TONE, TimezoneProvider, convertDateToTz, convertToDateTimeFilters, createLastDaysRange, dayjsTz, dayjsTzToDate, dayjsTzToLocalTZ, formatDate, formatDateTimeRange, formatDayjs, formatMs, formatTime, formatTimeRange, getDateRangeTitle, getDateTimeFilterBase, getDateTimeFilterByAlias, getDateTimeFilterMapping, getEndOfDayBy, getInitialTimezone, getLast12Months, getLast30Days, getLast365Days, getLast7Days, getLast90Days, getLastMonth, getLastYear, getMonthAndYearByDateFilter, getNoComparison, getPreviousMonth, getPreviousPeriod, getPreviousQuarter, getPreviousWeek, getPreviousYear, getToday, getVersionDateDescription, getVersionDateRangeTitle, getYesterday, isDate, isMidnight, isSameDayTimestamp, isValidDate, isValidYearMonthDayDateString, parseYearMonthDayDateString, setTz, useConvertMoneyContext, useCurrencyRatesStore, useDateTimeFilter, useDateTimePicker, useDateTimePickerContext, useFunnelChartStore, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useTimezoneContext, useVersionDateTimeFilters };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2475,6 +2475,20 @@ const MetricChartProvider = ({ children, minHeight = CHART_MIN_HEIGHT, seriesCol
|
|
|
2475
2475
|
}, children: children })] }));
|
|
2476
2476
|
};
|
|
2477
2477
|
|
|
2478
|
+
const TimezoneContext = createContext({ tz: 'UTC' });
|
|
2479
|
+
const TimezoneProvider = ({ children, tz }) => {
|
|
2480
|
+
const [currentTz, setCurrentTz] = useState(() => {
|
|
2481
|
+
setTz(tz);
|
|
2482
|
+
return tz;
|
|
2483
|
+
});
|
|
2484
|
+
useEffect(() => {
|
|
2485
|
+
setTz(tz);
|
|
2486
|
+
setCurrentTz(tz);
|
|
2487
|
+
}, [tz]);
|
|
2488
|
+
return jsx(TimezoneContext.Provider, { value: { tz: currentTz }, children: children });
|
|
2489
|
+
};
|
|
2490
|
+
const useTimezoneContext = () => useContext(TimezoneContext);
|
|
2491
|
+
|
|
2478
2492
|
const MetricChart = ({ lineChartData, isLoading, isEmptyMetricData, columnTypes, metricKey, }) => {
|
|
2479
2493
|
const { formatValue, yAxisOptions } = useFormatLineChartData({ metricKey, columnTypes: columnTypes || {} });
|
|
2480
2494
|
if (!metricKey) {
|
|
@@ -3217,6 +3231,7 @@ const COMPARE_DATE_TIME_FILTERS_MAP = {
|
|
|
3217
3231
|
};
|
|
3218
3232
|
|
|
3219
3233
|
const useDateTimeFilter = () => {
|
|
3234
|
+
useTimezoneContext();
|
|
3220
3235
|
const currentDate = dayjsTzToLocalTZ().startOf('day');
|
|
3221
3236
|
const mappings = getDateTimeFilterMapping();
|
|
3222
3237
|
const TODAY_CONFIG = mappings[MainDateTimePickerAlias.TODAY];
|
|
@@ -25853,4 +25868,4 @@ const useStickyFilterBoxProps = ({ id }) => {
|
|
|
25853
25868
|
};
|
|
25854
25869
|
};
|
|
25855
25870
|
|
|
25856
|
-
export { ANALYTICS_METRIC_TOOLTIP, AnalyticModeSelector, CAMPAIGN_BACKGROUND_MAIN, CHART_MIN_HEIGHT, COMPARE_DATE_TIME_FILTERS_MAP, CardJourneyAnalysis, CardPathAnalysis, CompareDateTimePickerAlias, ConvertMoneyProvider, CurrencySelector, DATE_TIME_COMPARISON_FILTERS, DEFAULT_CURRENCY_ANALYTIC, DEFAULT_CURRENT_PERIOD_LABEL, DEFAULT_PREVIOUS_PERIOD_LABEL, DEFAULT_SELECTED_COLUMNS_FOR_EXPERIMENT, DateTimeFilterInputs, DateTimeFilters, DateTimePickerContext, DateTimePickerProvider, EJourneyEvent, EReportSource, FUNNEL_POPOVER_KEY, GSelectableMetricChartCard, GTimePicker, IVariantType, MOCK_DATA_PATH_ANALYSIS, MainDateTimePickerAlias, MetricChartProvider, MetricDonutChartCard, ORDER_COLUMN_MAPPING, ORDER_LISTING_COLUMNS, ORDER_LISTING_CONFIG, ORDER_LISTING_DIMENSIONS, ORDER_LISTING_DIMENSION_LAYOUT, ORDER_LISTING_LATEST_COLUMNS_FOR_PAGE, ORDER_LISTING_METRICS, ORDER_LISTING_METRIC_LAYOUTS, OrderListingLatestTable, PLACEHOLDER_VALUE$1 as PLACEHOLDER_VALUE, PREVIOUS_PERIOD_FILTER, PathAnalysisConfigProvider, PathAnalysisContext, PathAnalysisProvider, SERIES_COLORS, SORT_ORDER_LISTING_DEFAULT, SingleMetricChartCard, TARGET_CHANNEL, TARGET_DEVICES, TARGET_VISITOR, THUMB_PRODUCT_DEFAULT, TREND_TONE, convertDateToTz, convertToDateTimeFilters, createLastDaysRange, dayjsTz, dayjsTzToDate, dayjsTzToLocalTZ, formatDate, formatDateTimeRange, formatDayjs, formatMs, formatTime, formatTimeRange, getDateRangeTitle, getDateTimeFilterBase, getDateTimeFilterByAlias, getDateTimeFilterMapping, getEndOfDayBy, getInitialTimezone, getLast12Months, getLast30Days, getLast365Days, getLast7Days, getLast90Days, getLastMonth, getLastYear, getMonthAndYearByDateFilter, getNoComparison, getPreviousMonth, getPreviousPeriod, getPreviousQuarter, getPreviousWeek, getPreviousYear, getToday, getVersionDateDescription, getVersionDateRangeTitle, getYesterday, isDate, isMidnight, isSameDayTimestamp, isValidDate, isValidYearMonthDayDateString, parseYearMonthDayDateString, setTz, useConvertMoneyContext, useCurrencyRatesStore, useDateTimeFilter, useDateTimePicker, useDateTimePickerContext, useFunnelChartStore, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useVersionDateTimeFilters };
|
|
25871
|
+
export { ANALYTICS_METRIC_TOOLTIP, AnalyticModeSelector, CAMPAIGN_BACKGROUND_MAIN, CHART_MIN_HEIGHT, COMPARE_DATE_TIME_FILTERS_MAP, CardJourneyAnalysis, CardPathAnalysis, CompareDateTimePickerAlias, ConvertMoneyProvider, CurrencySelector, DATE_TIME_COMPARISON_FILTERS, DEFAULT_CURRENCY_ANALYTIC, DEFAULT_CURRENT_PERIOD_LABEL, DEFAULT_PREVIOUS_PERIOD_LABEL, DEFAULT_SELECTED_COLUMNS_FOR_EXPERIMENT, DateTimeFilterInputs, DateTimeFilters, DateTimePickerContext, DateTimePickerProvider, EJourneyEvent, EReportSource, FUNNEL_POPOVER_KEY, GSelectableMetricChartCard, GTimePicker, IVariantType, MOCK_DATA_PATH_ANALYSIS, MainDateTimePickerAlias, MetricChartProvider, MetricDonutChartCard, ORDER_COLUMN_MAPPING, ORDER_LISTING_COLUMNS, ORDER_LISTING_CONFIG, ORDER_LISTING_DIMENSIONS, ORDER_LISTING_DIMENSION_LAYOUT, ORDER_LISTING_LATEST_COLUMNS_FOR_PAGE, ORDER_LISTING_METRICS, ORDER_LISTING_METRIC_LAYOUTS, OrderListingLatestTable, PLACEHOLDER_VALUE$1 as PLACEHOLDER_VALUE, PREVIOUS_PERIOD_FILTER, PathAnalysisConfigProvider, PathAnalysisContext, PathAnalysisProvider, SERIES_COLORS, SORT_ORDER_LISTING_DEFAULT, SingleMetricChartCard, TARGET_CHANNEL, TARGET_DEVICES, TARGET_VISITOR, THUMB_PRODUCT_DEFAULT, TREND_TONE, TimezoneProvider, convertDateToTz, convertToDateTimeFilters, createLastDaysRange, dayjsTz, dayjsTzToDate, dayjsTzToLocalTZ, formatDate, formatDateTimeRange, formatDayjs, formatMs, formatTime, formatTimeRange, getDateRangeTitle, getDateTimeFilterBase, getDateTimeFilterByAlias, getDateTimeFilterMapping, getEndOfDayBy, getInitialTimezone, getLast12Months, getLast30Days, getLast365Days, getLast7Days, getLast90Days, getLastMonth, getLastYear, getMonthAndYearByDateFilter, getNoComparison, getPreviousMonth, getPreviousPeriod, getPreviousQuarter, getPreviousWeek, getPreviousYear, getToday, getVersionDateDescription, getVersionDateRangeTitle, getYesterday, isDate, isMidnight, isSameDayTimestamp, isValidDate, isValidYearMonthDayDateString, parseYearMonthDayDateString, setTz, useConvertMoneyContext, useCurrencyRatesStore, useDateTimeFilter, useDateTimePicker, useDateTimePickerContext, useFunnelChartStore, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useTimezoneContext, useVersionDateTimeFilters };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface ITimezoneContext {
|
|
3
|
+
tz: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ITimezoneProviderProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
tz: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TimezoneProvider: ({ children, tz }: ITimezoneProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const useTimezoneContext: () => ITimezoneContext;
|
|
11
|
+
export {};
|
|
@@ -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 { TimezoneProvider, useTimezoneContext } from './TimezoneProvider';
|
|
5
|
+
export type { ITimezoneProviderProps } from './TimezoneProvider';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface ITimezoneContext {
|
|
3
|
+
tz: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ITimezoneProviderProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
tz: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TimezoneProvider: ({ children, tz }: ITimezoneProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const useTimezoneContext: () => ITimezoneContext;
|
|
11
|
+
export {};
|
|
@@ -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 { TimezoneProvider, useTimezoneContext } from './TimezoneProvider';
|
|
5
|
+
export type { ITimezoneProviderProps } from './TimezoneProvider';
|