@levi-gemcommerce/analytics 3.0.1-dev.3 → 3.0.1-dev.5
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/OrderAnalytic/types/order.d.ts +1 -1
- package/package.json +38 -15
- package/src/api/graphql/fragments/pathAnalytic.generated.ts +0 -26
- package/src/assets/img/all-sessions.png +0 -0
- package/src/assets/img/analytic-empty.png +0 -0
- package/src/assets/img/first-session.png +0 -0
- package/src/assets/img/page-only.png +0 -0
- package/src/assets/svg/gemx-skeleton.svg +0 -12
- package/src/assets/svg/product.svg +0 -18
- package/src/components/AnalyticMode/AnalyticModeSelector.tsx +0 -50
- package/src/components/AnalyticMode/index.ts +0 -2
- package/src/components/CardPathAnalysis/CardJourneyAnalysis.tsx +0 -33
- package/src/components/CardPathAnalysis/assets/img/analytic-gemx.png +0 -0
- package/src/components/CardPathAnalysis/assets/styles/PathAnalysis.scss +0 -60
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.tsx +0 -45
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.tsx +0 -53
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.tsx +0 -65
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.tsx +0 -29
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.tsx +0 -12
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.tsx +0 -43
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/index.ts +0 -1
- package/src/components/CardPathAnalysis/components/PathAnalysisChart.tsx +0 -55
- package/src/components/CardPathAnalysis/components/index.ts +0 -1
- package/src/components/CardPathAnalysis/configs/index.ts +0 -2
- package/src/components/CardPathAnalysis/constants/index.ts +0 -1
- package/src/components/CardPathAnalysis/constants/path-analysis.ts +0 -162
- package/src/components/CardPathAnalysis/contexts/PathAnalysisConfigProvider.tsx +0 -66
- package/src/components/CardPathAnalysis/contexts/PathAnalysisProvider.tsx +0 -130
- package/src/components/CardPathAnalysis/contexts/index.ts +0 -2
- package/src/components/CardPathAnalysis/helpers/index.ts +0 -2
- package/src/components/CardPathAnalysis/helpers/metricHelpers.ts +0 -13
- package/src/components/CardPathAnalysis/helpers/pathAnalysis.ts +0 -96
- package/src/components/CardPathAnalysis/helpers/pathAnalysisChart.ts +0 -128
- package/src/components/CardPathAnalysis/helpers/treeUtils.ts +0 -38
- package/src/components/CardPathAnalysis/hooks/usePathAnalysisChart.tsx +0 -292
- package/src/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.ts +0 -206
- package/src/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.ts +0 -43
- package/src/components/CardPathAnalysis/index.ts +0 -5
- package/src/components/CardPathAnalysis/stores/funnel-chart.ts +0 -30
- package/src/components/CardPathAnalysis/stores/index.ts +0 -3
- package/src/components/CardPathAnalysis/stores/path-analysis-campaign.ts +0 -16
- package/src/components/CardPathAnalysis/stores/path-analysis.ts +0 -11
- package/src/components/CardPathAnalysis/types/index.ts +0 -1
- package/src/components/CardPathAnalysis/types/path-analysis.ts +0 -10
- package/src/components/CurrencySelector/CurrencySelector.tsx +0 -127
- package/src/components/CurrencySelector/index.ts +0 -2
- package/src/components/GModalOrderJourney/GModalOrderJourney.tsx +0 -131
- package/src/components/GModalOrderJourney/components/OrderJourneySkeleton.tsx +0 -93
- package/src/components/GModalOrderJourney/components/index.ts +0 -1
- package/src/components/GModalOrderJourney/context/OrderJourneyContext.tsx +0 -17
- package/src/components/GModalOrderJourney/context/index.ts +0 -1
- package/src/components/GModalOrderJourney/hooks/index.ts +0 -1
- package/src/components/GModalOrderJourney/hooks/useGModalOrderJourney.ts +0 -25
- package/src/components/GModalOrderJourney/index.ts +0 -5
- package/src/components/GModalOrderJourney/types/index.ts +0 -4
- package/src/components/GModalOrderJourney/utils/index.ts +0 -75
- package/src/components/GSelectableMetricChartCard/GSelectableMetricChartCard.tsx +0 -83
- package/src/components/GSelectableMetricChartCard/MetricChartTab.tsx +0 -56
- package/src/components/GSelectableMetricChartCard/index.ts +0 -2
- package/src/components/GTimePicker/GTimePicker.tsx +0 -31
- package/src/components/GTimePicker/components/BaseTimePicker.tsx +0 -249
- package/src/components/GTimePicker/components/CompareTimePicker.tsx +0 -41
- package/src/components/GTimePicker/components/DateTimeFilterAddition.tsx +0 -84
- package/src/components/GTimePicker/components/DateTimeFilterInputs.tsx +0 -124
- package/src/components/GTimePicker/components/DateTimeFilters.tsx +0 -86
- package/src/components/GTimePicker/components/MainTimePicker.tsx +0 -47
- package/src/components/GTimePicker/components/index.ts +0 -2
- package/src/components/GTimePicker/constants/compareDateTimePicker.ts +0 -68
- package/src/components/GTimePicker/constants/datePicker.ts +0 -14
- package/src/components/GTimePicker/constants/index.ts +0 -2
- package/src/components/GTimePicker/constants/mainDataTimePicker.ts +0 -88
- package/src/components/GTimePicker/contexts/DateTimePickerProvider.tsx +0 -125
- package/src/components/GTimePicker/contexts/index.ts +0 -1
- package/src/components/GTimePicker/helpers/date-range-info.ts +0 -84
- package/src/components/GTimePicker/helpers/index.ts +0 -4
- package/src/components/GTimePicker/helpers/parse-date.ts +0 -127
- package/src/components/GTimePicker/helpers/time-picker.ts +0 -123
- package/src/components/GTimePicker/helpers/version.ts +0 -36
- package/src/components/GTimePicker/hooks/index.ts +0 -3
- package/src/components/GTimePicker/hooks/useCompareDateTimePicker.tsx +0 -79
- package/src/components/GTimePicker/hooks/useDateTimeFilter.ts +0 -83
- package/src/components/GTimePicker/hooks/useDateTimePicker.tsx +0 -99
- package/src/components/GTimePicker/hooks/useVersionDateTimeFilters.ts +0 -30
- package/src/components/GTimePicker/index.ts +0 -7
- package/src/components/GTimePicker/types/index.ts +0 -43
- package/src/components/MetricDonutChartCard/MetricDonutChartCard.tsx +0 -121
- package/src/components/MetricDonutChartCard/index.ts +0 -2
- package/src/components/MetricDonutChartCard/utils/donut-chart.ts +0 -75
- package/src/components/MetricDonutChartCard/utils/index.ts +0 -1
- package/src/components/OrderAnalytic/OrderListingLatestTable.tsx +0 -111
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/OrderListingTableSkeleton.tsx +0 -40
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonCellContent.tsx +0 -77
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonHeader.tsx +0 -35
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonRow.tsx +0 -35
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonSummaryRow.tsx +0 -36
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/constants.ts +0 -11
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/index.ts +0 -1
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingTable.tsx +0 -159
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingTableEmpty.tsx +0 -29
- package/src/components/OrderAnalytic/components/OrderListing/index.ts +0 -2
- package/src/components/OrderAnalytic/components/index.ts +0 -1
- package/src/components/OrderAnalytic/constants/index.ts +0 -2
- package/src/components/OrderAnalytic/constants/order-columns.ts +0 -51
- package/src/components/OrderAnalytic/constants/order-listing.ts +0 -199
- package/src/components/OrderAnalytic/helpers/index.ts +0 -1
- package/src/components/OrderAnalytic/helpers/order-listing.ts +0 -48
- package/src/components/OrderAnalytic/hooks/index.ts +0 -1
- package/src/components/OrderAnalytic/hooks/useOrderListingData.ts +0 -55
- package/src/components/OrderAnalytic/index.ts +0 -5
- package/src/components/OrderAnalytic/stores/index.ts +0 -2
- package/src/components/OrderAnalytic/stores/order-columns-selector.ts +0 -24
- package/src/components/OrderAnalytic/stores/order-control.ts +0 -15
- package/src/components/OrderAnalytic/types/index.ts +0 -3
- package/src/components/OrderAnalytic/types/order.ts +0 -89
- package/src/components/OrderAnalytic/types/orderListing.ts +0 -4
- package/src/components/OrderAnalytic/types/report.ts +0 -14
- package/src/components/SingleMetricChartCard/SingleMetricChartCard.tsx +0 -56
- package/src/components/SingleMetricChartCard/index.tsx +0 -2
- package/src/components/common/chart/GChartSkeleton.tsx +0 -5
- package/src/components/common/chart/MetricChart.tsx +0 -62
- package/src/components/common/chart/MetricChartEmpty.tsx +0 -35
- package/src/components/common/chart/MetricChartTooltip.tsx +0 -74
- package/src/components/common/chart/MetricDonutChartSkeleton.tsx +0 -14
- package/src/components/common/chart/MetricInfoBlock.tsx +0 -66
- package/src/components/common/chart/MetricInfoSkeleton.tsx +0 -25
- package/src/components/common/chart/MetricValueSummary.tsx +0 -23
- package/src/components/common/chart/index.ts +0 -8
- package/src/components/common/icons/DownIcon8px.tsx +0 -14
- package/src/components/common/icons/UpIcon8px.tsx +0 -14
- package/src/components/common/icons/index.ts +0 -2
- package/src/components/common/percent/MetricPercentage.tsx +0 -42
- package/src/components/common/percent/index.ts +0 -1
- package/src/components/index.ts +0 -9
- package/src/constants/analytic-metric-tooltip.tsx +0 -164
- package/src/constants/breakdown-targets.ts +0 -25
- package/src/constants/campaign.ts +0 -4
- package/src/constants/chart.ts +0 -17
- package/src/constants/currency.ts +0 -3
- package/src/constants/index.ts +0 -6
- package/src/constants/thumbnail.ts +0 -3
- package/src/core/gemxql/api/index.ts +0 -2
- package/src/core/gemxql/api/useCustomGemXQlQuery.ts +0 -35
- package/src/core/gemxql/api/useGemxQlNamedQuery.ts +0 -34
- package/src/core/gemxql/builder/build-gemxql-query.ts +0 -81
- package/src/core/gemxql/builder/clauses/condition-query.ts +0 -74
- package/src/core/gemxql/builder/clauses/from-query.ts +0 -18
- package/src/core/gemxql/builder/clauses/group-query.ts +0 -43
- package/src/core/gemxql/builder/clauses/index.ts +0 -11
- package/src/core/gemxql/builder/clauses/limit-query.ts +0 -15
- package/src/core/gemxql/builder/clauses/mode-query.ts +0 -14
- package/src/core/gemxql/builder/clauses/offset-query.ts +0 -15
- package/src/core/gemxql/builder/clauses/order-by-query.ts +0 -37
- package/src/core/gemxql/builder/clauses/show-query.ts +0 -18
- package/src/core/gemxql/builder/clauses/time-query.ts +0 -67
- package/src/core/gemxql/builder/clauses/time-series-query.ts +0 -15
- package/src/core/gemxql/builder/clauses/timezone-query.ts +0 -17
- package/src/core/gemxql/builder/configs/date-formats.ts +0 -1
- package/src/core/gemxql/builder/configs/index.ts +0 -3
- package/src/core/gemxql/builder/configs/keywords.ts +0 -16
- package/src/core/gemxql/builder/configs/query-defaults.ts +0 -1
- package/src/core/gemxql/builder/filters/build-extra-conditions.ts +0 -69
- package/src/core/gemxql/builder/filters/build-filter-conditions.ts +0 -161
- package/src/core/gemxql/builder/filters/index.ts +0 -2
- package/src/core/gemxql/builder/helpers/date-query-helpers.ts +0 -41
- package/src/core/gemxql/builder/helpers/index.ts +0 -1
- package/src/core/gemxql/builder/helpers/is-valid-query-input.ts +0 -8
- package/src/core/gemxql/builder/index.ts +0 -6
- package/src/core/gemxql/builder/parse-gemxql-query.ts +0 -43
- package/src/core/gemxql/constants/analytic-data.ts +0 -2
- package/src/core/gemxql/constants/column-keys.ts +0 -4
- package/src/core/gemxql/constants/index.ts +0 -4
- package/src/core/gemxql/constants/operators.ts +0 -2
- package/src/core/gemxql/constants/row-reader-mode.ts +0 -9
- package/src/core/gemxql/graphql/fragments/gemxql.generated.ts +0 -80
- package/src/core/gemxql/graphql/fragments/gemxql.gql +0 -18
- package/src/core/gemxql/graphql/index.ts +0 -2
- package/src/core/gemxql/graphql/queries/gemxql.generated.ts +0 -26
- package/src/core/gemxql/graphql/queries/gemxql.gql +0 -5
- package/src/core/gemxql/helpers/columnKeys.ts +0 -8
- package/src/core/gemxql/helpers/extractQueryData.ts +0 -18
- package/src/core/gemxql/helpers/formatAnalyticData.ts +0 -92
- package/src/core/gemxql/helpers/formatAnalyticDate.ts +0 -29
- package/src/core/gemxql/helpers/getTimeDimension.ts +0 -11
- package/src/core/gemxql/helpers/hasMetricData.ts +0 -6
- package/src/core/gemxql/helpers/index.ts +0 -8
- package/src/core/gemxql/helpers/parseJsonFields.ts +0 -36
- package/src/core/gemxql/helpers/readNumeric.ts +0 -25
- package/src/core/gemxql/hooks/index.ts +0 -2
- package/src/core/gemxql/hooks/useAnalyticData.ts +0 -67
- package/src/core/gemxql/hooks/useGemXQlPagination.ts +0 -79
- package/src/core/gemxql/index.ts +0 -8
- package/src/core/gemxql/types/analytic-data.ts +0 -26
- package/src/core/gemxql/types/analytic-source.ts +0 -4
- package/src/core/gemxql/types/extra-condition.ts +0 -40
- package/src/core/gemxql/types/field-filters.ts +0 -18
- package/src/core/gemxql/types/field-operators.ts +0 -8
- package/src/core/gemxql/types/filter-types.ts +0 -33
- package/src/core/gemxql/types/group-with-clause.ts +0 -12
- package/src/core/gemxql/types/index.ts +0 -11
- package/src/core/gemxql/types/order-by.ts +0 -13
- package/src/core/gemxql/types/page-fields.ts +0 -25
- package/src/core/gemxql/types/row-reader-mode.ts +0 -6
- package/src/core/gemxql/types/time-dimension.ts +0 -8
- package/src/global.d.ts +0 -38
- package/src/hooks/index.ts +0 -7
- package/src/hooks/publish/index.ts +0 -2
- package/src/hooks/publish/useStickyDetectById.ts +0 -39
- package/src/hooks/publish/useStickyFilterBoxProps.ts +0 -26
- package/src/hooks/publish/useWindowSize.ts +0 -54
- package/src/hooks/useEnhancedEffect.ts +0 -3
- package/src/hooks/useFetchCurrencyRates.ts +0 -48
- package/src/hooks/useFormatLineChartData.ts +0 -28
- package/src/hooks/usePopoverResizeObserver.ts +0 -43
- package/src/hooks/usePreventBodyScroll.ts +0 -15
- package/src/hooks/useSearchParams.ts +0 -7
- package/src/hooks/useToggle.ts +0 -23
- package/src/index.ts +0 -10
- package/src/modules/analytics/constants/index.ts +0 -124
- package/src/modules/analytics/index.ts +0 -3
- package/src/modules/analytics/types/index.ts +0 -43
- package/src/modules/analytics/utils/formatMetric.ts +0 -42
- package/src/modules/analytics/utils/getPAMetricValue.ts +0 -11
- package/src/modules/analytics/utils/index.ts +0 -3
- package/src/modules/analytics/utils/metric.ts +0 -172
- package/src/providers/ConvertMoneyProvider.tsx +0 -68
- package/src/providers/MetricChartProvider.tsx +0 -50
- package/src/providers/TimezoneProvider.tsx +0 -31
- package/src/providers/index.ts +0 -5
- package/src/shared/charts/components/ComboChart.tsx +0 -108
- package/src/shared/charts/components/GBarChart.tsx +0 -96
- package/src/shared/charts/components/GComboChart.tsx +0 -15
- package/src/shared/charts/components/GDonutChart.tsx +0 -25
- package/src/shared/charts/components/GFunnelChart/GFunnelChart.tsx +0 -34
- package/src/shared/charts/components/GFunnelChart/components/FunnelChartAction.tsx +0 -67
- package/src/shared/charts/components/GFunnelChart/components/FunnelChartActionIcon.tsx +0 -60
- package/src/shared/charts/components/GFunnelChart/components/FunnelChartActionWrapper.tsx +0 -100
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionContent.tsx +0 -92
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionHeader.tsx +0 -54
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionItem.tsx +0 -51
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionPopover.tsx +0 -95
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/index.ts +0 -1
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/type.ts +0 -7
- package/src/shared/charts/components/GFunnelChart/components/types.ts +0 -24
- package/src/shared/charts/components/GFunnelChart/index.ts +0 -4
- package/src/shared/charts/components/GFunnelChart/types.ts +0 -11
- package/src/shared/charts/components/GPolarisViz/components/Arc/Arc.module.scss +0 -7
- package/src/shared/charts/components/GPolarisViz/components/Arc/Arc.tsx +0 -135
- package/src/shared/charts/components/GPolarisViz/components/Arc/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/ChartContainer.module.scss +0 -39
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/ChartContainer.tsx +0 -150
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/hooks/useContainerBounds.ts +0 -113
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/ChartDiv.tsx +0 -18
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/ChartElements.module.scss +0 -21
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/ChartSVG.tsx +0 -40
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/index.ts +0 -7
- package/src/shared/charts/components/GPolarisViz/components/ChartErrorBoundary/ChartErrorBoundary.tsx +0 -56
- package/src/shared/charts/components/GPolarisViz/components/ChartErrorBoundary/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartErrorBoundary/utilities/checkForMismatchedData.ts +0 -34
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/ChartSkeleton.module.scss +0 -6
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/ChartSkeleton.tsx +0 -96
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/DonutSkeleton/DonutSkeleton.module.scss +0 -41
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/DonutSkeleton/DonutSkeleton.tsx +0 -193
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/DonutSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/ErrorText/ErrorText.tsx +0 -40
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/ErrorText/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/FunnelSkeleton/FunnelSkeleton.tsx +0 -69
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/FunnelSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/GridSkeleton/GridSkeleton.tsx +0 -155
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/GridSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/Shimmer/Shimmer.module.scss +0 -33
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/Shimmer/Shimmer.tsx +0 -34
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/Shimmer/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleBarSkeleton/SimpleBarSkeleton.module.scss +0 -15
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleBarSkeleton/SimpleBarSkeleton.tsx +0 -53
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleBarSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleNormalizedSkeleton/SimpleNormalizedSkeleton.module.scss +0 -35
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleNormalizedSkeleton/SimpleNormalizedSkeleton.tsx +0 -75
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleNormalizedSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SparkSkeleton/SparkSkeleton.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SparkSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/index.ts +0 -8
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/index.ts +0 -9
- package/src/shared/charts/components/GPolarisViz/components/ConicGradientWithStops/ConicGradientWithStops.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/ConicGradientWithStops/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/DefaultPreview/DefaultPreview.module.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/components/DefaultPreview/DefaultPreview.tsx +0 -25
- package/src/shared/charts/components/GPolarisViz/components/DefaultPreview/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/Chart.tsx +0 -209
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/FunnelChart.tsx +0 -72
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/FunnelChartXAxisArrows.tsx +0 -52
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/FunnelChartXAxisLabels.tsx +0 -66
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/FunnelSegment.tsx +0 -121
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/Label.module.scss +0 -23
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/Label.tsx +0 -67
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/index.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/Chart.tsx +0 -259
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/FunnelChartNext.tsx +0 -104
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelChartLabels/FunnelChartLabels.tsx +0 -387
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelChartLabels/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelTooltip/FunnelTooltip.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelTooltip/FunnelTooltip.tsx +0 -37
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelTooltip/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/ScaleIcon.tsx +0 -20
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/ScaleIconTooltip.tsx +0 -31
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/CustomTooltip.tsx +0 -68
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/Tooltip.scss +0 -52
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/Tooltip.tsx +0 -149
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipOverlay.tsx +0 -117
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipWithPortal.tsx +0 -12
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/index.ts +0 -8
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/constants.ts +0 -28
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/hooks/useTooltipInteraction.ts +0 -59
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/hooks/useTooltipPlacement.ts +0 -113
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/index.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/types.ts +0 -13
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/utilities/calculate-dropoff.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/utilities/useBuildFunnelTrends.ts +0 -108
- package/src/shared/charts/components/GPolarisViz/components/HorizontalGridLines/HorizontalGridLines.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/HorizontalGridLines/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/Labels/SingleTextLine.tsx +0 -64
- package/src/shared/charts/components/GPolarisViz/components/Labels/hooks/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/Labels/hooks/useLabels.tsx +0 -131
- package/src/shared/charts/components/GPolarisViz/components/Labels/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/endLineTruncate.ts +0 -23
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/endWordTruncate.ts +0 -34
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/estimateTextHeight.ts +0 -31
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/formatAndAddEllipsis.ts +0 -12
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getDiagonalLabels.ts +0 -70
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getHorizontalLabels.ts +0 -90
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getVerticalLabels.ts +0 -58
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getWidestLabel.ts +0 -15
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/shouldSkipLabel.ts +0 -11
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/endWordTruncate.test.ts +0 -16
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/estimateTextHeight.test.ts +0 -19
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/formatAndAddEllipsis.test.ts +0 -9
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/truncateLastLine.test.ts +0 -22
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/truncateSingleLine.test.ts +0 -15
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/truncateLabels.ts +0 -75
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/truncateLastLine.ts +0 -61
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/truncateSingleLine.ts +0 -39
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/LinePreview.module.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/LinePreview.tsx +0 -105
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/constants.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/SwallowErrors/SwallowErrors.tsx +0 -32
- package/src/shared/charts/components/GPolarisViz/components/SwallowErrors/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TextLine/TextLine.tsx +0 -88
- package/src/shared/charts/components/GPolarisViz/components/TextLine/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/TooltipContent.tsx +0 -109
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipContentContainer/TooltipContentContainer.module.scss +0 -10
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipContentContainer/TooltipContentContainer.tsx +0 -67
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipContentContainer/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipRow/TooltipRow.module.scss +0 -26
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipRow/TooltipRow.tsx +0 -57
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipRow/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeries/TooltipSeries.module.scss +0 -4
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeries/TooltipSeries.tsx +0 -26
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeries/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeriesName/TooltipSeriesName.module.scss +0 -4
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeriesName/TooltipSeriesName.tsx +0 -20
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeriesName/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipTitle/TooltipTitle.module.scss +0 -7
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipTitle/TooltipTitle.tsx +0 -15
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipTitle/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/index.ts +0 -5
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/constants.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/hooks/useGetLongestLabelFromData.ts +0 -56
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/index.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/utilities/get-tooltip-template-content-column-count.ts +0 -10
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/utilities/tests/get-tooltip-template-content-column-count.test.ts +0 -48
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/TooltipWrapper.tsx +0 -338
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/components/TooltipAnimatedContainer.module.scss +0 -6
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/components/TooltipAnimatedContainer.tsx +0 -139
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/constants.ts +0 -18
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/index.ts +0 -5
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/types.ts +0 -62
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/eventPoint.ts +0 -84
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getAlteredHorizontalBarPosition.ts +0 -110
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getAlteredLineChartPosition.ts +0 -115
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getAlteredVerticalBarPosition.ts +0 -105
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getDonutChartTooltipPosition.ts +0 -64
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getHorizontalBarChartTooltipPosition.ts +0 -79
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getLineChartTooltipPosition.ts +0 -68
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getVerticalBarChartTooltipPosition.ts +0 -123
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/shouldBlockTooltipEvents.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities.ts +0 -162
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/TrendIndicator.tsx +0 -72
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Arrows/ArrowDown.tsx +0 -12
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Arrows/ArrowUp.tsx +0 -12
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Arrows/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Svg/Svg.scss +0 -7
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Svg/Svg.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Svg/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/constants.ts +0 -12
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/index.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/utilities/estimateTrendIndicatorWidth.ts +0 -9
- package/src/shared/charts/components/GPolarisViz/components/VerticalBarChart/utilities/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/VerticalBarChart/utilities/sortBarChartData.ts +0 -20
- package/src/shared/charts/components/GPolarisViz/components/VerticalGridLines/VerticalGridLines.tsx +0 -32
- package/src/shared/charts/components/GPolarisViz/components/VerticalGridLines/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/index.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/constants.ts +0 -72
- package/src/shared/charts/components/GPolarisViz/data/character-width-offsets.json +0 -65
- package/src/shared/charts/components/GPolarisViz/data/character-widths.json +0 -1
- package/src/shared/charts/components/GPolarisViz/hooks/index.ts +0 -5
- package/src/shared/charts/components/GPolarisViz/hooks/useBarSpringConfig.ts +0 -21
- package/src/shared/charts/components/GPolarisViz/hooks/useBrowserCheck.ts +0 -13
- package/src/shared/charts/components/GPolarisViz/hooks/useCallbackRef.tsx +0 -39
- package/src/shared/charts/components/GPolarisViz/hooks/useDataForHorizontalChart.ts +0 -69
- package/src/shared/charts/components/GPolarisViz/hooks/useDebouncedCallback.ts +0 -197
- package/src/shared/charts/components/GPolarisViz/hooks/useFormattedLabels.ts +0 -31
- package/src/shared/charts/components/GPolarisViz/hooks/useFunnelBarScaling.ts +0 -53
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalBarSizes.ts +0 -70
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalStackedValues.ts +0 -34
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalTicksAndScale.ts +0 -67
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalXScale.ts +0 -48
- package/src/shared/charts/components/GPolarisViz/hooks/useIndexForLabels.ts +0 -16
- package/src/shared/charts/components/GPolarisViz/hooks/usePrefersReducedMotion.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/hooks/usePrintResizing.ts +0 -94
- package/src/shared/charts/components/GPolarisViz/hooks/useReducedLabelIndexes.ts +0 -21
- package/src/shared/charts/components/GPolarisViz/hooks/useResizeObserver.ts +0 -39
- package/src/shared/charts/components/GPolarisViz/hooks/useRootContainer.ts +0 -20
- package/src/shared/charts/components/GPolarisViz/hooks/useWatchColorVisionEvents.tsx +0 -35
- package/src/shared/charts/components/GPolarisViz/index.ts +0 -10
- package/src/shared/charts/components/GPolarisViz/shared/Bar/Bar.tsx +0 -89
- package/src/shared/charts/components/GPolarisViz/shared/Bar/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/FunnelChartConnector.tsx +0 -46
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/FunnelChartConnectorGradient.tsx +0 -21
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/constants.ts +0 -11
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/FunnelChartSegment.tsx +0 -100
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/components/AnimatedSegment.tsx +0 -50
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/components/InteractiveOverlay.tsx +0 -34
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/components/ScaledSegment.tsx +0 -218
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/constants.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/shared/SeriesIcon/SeriesIcon.tsx +0 -22
- package/src/shared/charts/components/GPolarisViz/shared/SeriesIcon/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/shared/ZeroValueLine/ZeroValueLine.tsx +0 -45
- package/src/shared/charts/components/GPolarisViz/shared/ZeroValueLine/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/shared/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/styles/_common.scss +0 -15
- package/src/shared/charts/components/GPolarisViz/styles/shared/_accessibility.scss +0 -41
- package/src/shared/charts/components/GPolarisViz/styles/shared/_chart-container.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/styles/shared/_variables.scss +0 -322
- package/src/shared/charts/components/GPolarisViz/types.ts +0 -261
- package/src/shared/charts/components/GPolarisViz/utilities/base.ts +0 -13
- package/src/shared/charts/components/GPolarisViz/utilities/classnames.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/utilities/createCssConicGradient.ts +0 -12
- package/src/shared/charts/components/GPolarisViz/utilities/createCssGradient.ts +0 -7
- package/src/shared/charts/components/GPolarisViz/utilities/estimateStringWidthWithOffset.ts +0 -15
- package/src/shared/charts/components/GPolarisViz/utilities/getAxisOptions.ts +0 -26
- package/src/shared/charts/components/GPolarisViz/utilities/getCSSBackgroundFromColor.ts +0 -8
- package/src/shared/charts/components/GPolarisViz/utilities/getChartId.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/utilities/getFontSize.ts +0 -7
- package/src/shared/charts/components/GPolarisViz/utilities/getStackedMinMax.ts +0 -43
- package/src/shared/charts/components/GPolarisViz/utilities/getStackedValues.ts +0 -35
- package/src/shared/charts/components/GPolarisViz/utilities/getStackedValuesFromDataSeries.tsx +0 -30
- package/src/shared/charts/components/GPolarisViz/utilities/getTrendIndicatorData.ts +0 -22
- package/src/shared/charts/components/GPolarisViz/utilities/hasHiddenComparisonSeries.ts +0 -26
- package/src/shared/charts/components/GPolarisViz/utilities/index.ts +0 -6
- package/src/shared/charts/components/GSimpleBarChart.tsx +0 -32
- package/src/shared/charts/components/index.ts +0 -7
- package/src/shared/charts/constants/chart.ts +0 -14
- package/src/shared/charts/constants/index.ts +0 -1
- package/src/shared/charts/contexts/GChartProvider.tsx +0 -48
- package/src/shared/charts/contexts/index.ts +0 -1
- package/src/shared/charts/index.ts +0 -4
- package/src/shared/charts/types/chart.ts +0 -36
- package/src/shared/charts/types/index.ts +0 -1
- package/src/shared/components/GActivatorPopover/GActivatorPopover.tsx +0 -107
- package/src/shared/components/GActivatorPopover/index.ts +0 -1
- package/src/shared/components/GBlockCenter/GBlockCenter.scss +0 -19
- package/src/shared/components/GBlockCenter/GBlockCenter.tsx +0 -72
- package/src/shared/components/GBlockCenter/index.ts +0 -1
- package/src/shared/components/GBox/GBox.scss +0 -25
- package/src/shared/components/GBox/GBox.tsx +0 -15
- package/src/shared/components/GBox/index.ts +0 -1
- package/src/shared/components/GBoxCard/GBoxCard.tsx +0 -27
- package/src/shared/components/GBoxCard/index.ts +0 -1
- package/src/shared/components/GButton/GButton.scss +0 -41
- package/src/shared/components/GButton/GButton.tsx +0 -73
- package/src/shared/components/GButton/index.ts +0 -1
- package/src/shared/components/GCheckbox/GCheckbox.tsx +0 -176
- package/src/shared/components/GCheckbox/index.ts +0 -1
- package/src/shared/components/GChoice/ChoiceHelpText.tsx +0 -25
- package/src/shared/components/GChoice/GChoice.scss +0 -14
- package/src/shared/components/GChoice/GChoice.tsx +0 -165
- package/src/shared/components/GChoice/index.ts +0 -2
- package/src/shared/components/GClickable/GClickable.tsx +0 -43
- package/src/shared/components/GClickable/index.ts +0 -1
- package/src/shared/components/GDiv/GDiv.tsx +0 -27
- package/src/shared/components/GDiv/index.ts +0 -1
- package/src/shared/components/GDotInline/GDotInline.tsx +0 -20
- package/src/shared/components/GDotInline/index.ts +0 -1
- package/src/shared/components/GFeatureLocked/GFeatureLocked.tsx +0 -85
- package/src/shared/components/GFeatureLocked/assets/images/empty-analytics.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-campaign-group-template-illustration.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-campaign-group-template.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-page-listing-illustration.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-page-listing.png +0 -0
- package/src/shared/components/GFeatureLocked/constants.ts +0 -33
- package/src/shared/components/GFeatureLocked/index.ts +0 -2
- package/src/shared/components/GFeatureLocked/types.ts +0 -16
- package/src/shared/components/GI18NText/GI18NText.tsx +0 -37
- package/src/shared/components/GI18NText/index.ts +0 -2
- package/src/shared/components/GI18NText/types.ts +0 -7
- package/src/shared/components/GInlineCenter/GInlineCenter.scss +0 -17
- package/src/shared/components/GInlineCenter/GInlineCenter.tsx +0 -39
- package/src/shared/components/GInlineCenter/index.ts +0 -1
- package/src/shared/components/GMockDataTooltip/GMockDataTooltip.tsx +0 -30
- package/src/shared/components/GMockDataTooltip/index.ts +0 -1
- package/src/shared/components/GModal/GModal.tsx +0 -49
- package/src/shared/components/GModal/index.ts +0 -1
- package/src/shared/components/GOptionList/GOptionList.tsx +0 -63
- package/src/shared/components/GOptionList/index.ts +0 -1
- package/src/shared/components/GPagination/GPagination.tsx +0 -44
- package/src/shared/components/GPagination/hooks/useGPagination.ts +0 -42
- package/src/shared/components/GPagination/index.ts +0 -2
- package/src/shared/components/GSelector/GSelector.tsx +0 -198
- package/src/shared/components/GSelector/index.ts +0 -1
- package/src/shared/components/GSkeletonDisplayText/GSkeletonDisplayText.tsx +0 -14
- package/src/shared/components/GSkeletonDisplayText/index.ts +0 -1
- package/src/shared/components/GSpinner/GSpinner.tsx +0 -16
- package/src/shared/components/GSpinner/index.ts +0 -1
- package/src/shared/components/GTextLink/GTextLink.tsx +0 -26
- package/src/shared/components/GTextLink/index.ts +0 -1
- package/src/shared/components/GTextTooltip/GTextTooltip.tsx +0 -18
- package/src/shared/components/GTextTooltip/index.ts +0 -1
- package/src/shared/components/GTextTruncated/GTextTruncated.tsx +0 -80
- package/src/shared/components/GTextTruncated/index.ts +0 -1
- package/src/shared/components/GThumbnail/GThumbnail.scss +0 -5
- package/src/shared/components/GThumbnail/GThumbnail.tsx +0 -69
- package/src/shared/components/GThumbnail/index.ts +0 -1
- package/src/shared/components/GTooltip/GTooltip.tsx +0 -34
- package/src/shared/components/GTooltip/components/GTooltipCard.tsx +0 -164
- package/src/shared/components/GTooltip/index.ts +0 -3
- package/src/shared/components/GTooltipCard/GTooltipCard.tsx +0 -161
- package/src/shared/components/GTooltipCard/index.ts +0 -7
- package/src/shared/components/GVariantBadge/GVariant.tsx +0 -55
- package/src/shared/components/GVariantBadge/GVariantBadge.scss +0 -10
- package/src/shared/components/GVariantBadge/GVariantBadge.tsx +0 -82
- package/src/shared/components/GVariantBadge/index.ts +0 -4
- package/src/shared/components/GVariantBadge/types.ts +0 -20
- package/src/shared/components/GViewBySelector/GViewBySelector.tsx +0 -114
- package/src/shared/components/GViewBySelector/index.ts +0 -1
- package/src/shared/components/index.ts +0 -26
- package/src/shared/index.ts +0 -1
- package/src/shared/journey/common/JourneyContainer/components/JourneyContainer.tsx +0 -140
- package/src/shared/journey/common/JourneyContainer/components/JourneyTimeline.tsx +0 -18
- package/src/shared/journey/common/JourneyContainer/components/index.ts +0 -2
- package/src/shared/journey/common/JourneyContainer/index.ts +0 -1
- package/src/shared/journey/common/index.ts +0 -1
- package/src/shared/journey/index.ts +0 -2
- package/src/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/AcceptedPostPurchaseOffer.tsx +0 -24
- package/src/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/CheckoutCompleted.tsx +0 -64
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutItems.tsx +0 -27
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStarted.tsx +0 -25
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStartedDetail.tsx +0 -79
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutStarted/index.ts +0 -2
- package/src/shared/journey/ui/JourneyEvents/components/PageViewed/PageViewed.tsx +0 -116
- package/src/shared/journey/ui/JourneyEvents/components/PageViewed/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/ProductAddedToCart.tsx +0 -24
- package/src/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/ProductQuantity/ProductQuantity.tsx +0 -33
- package/src/shared/journey/ui/JourneyEvents/components/ProductQuantity/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/ProductRemovedFromCart.tsx +0 -24
- package/src/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/index.ts +0 -6
- package/src/shared/journey/ui/JourneyEvents/constants/event.ts +0 -38
- package/src/shared/journey/ui/JourneyEvents/constants/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/index.ts +0 -2
- package/src/shared/journey/ui/JourneyEvents/types.ts +0 -2
- package/src/shared/journey/ui/JourneyGroup/JourneyGroup.tsx +0 -41
- package/src/shared/journey/ui/JourneyGroup/index.ts +0 -1
- package/src/shared/journey/ui/JourneyItem/components/EventMarkerIcon.tsx +0 -28
- package/src/shared/journey/ui/JourneyItem/components/JourneyDetail.tsx +0 -24
- package/src/shared/journey/ui/JourneyItem/components/JourneyItem.tsx +0 -27
- package/src/shared/journey/ui/JourneyItem/components/JourneyTime.tsx +0 -33
- package/src/shared/journey/ui/JourneyItem/components/QuantityWrapper.tsx +0 -17
- package/src/shared/journey/ui/JourneyItem/components/index.ts +0 -3
- package/src/shared/journey/ui/JourneyItem/index.ts +0 -2
- package/src/shared/journey/ui/JourneyItem/types/events.ts +0 -33
- package/src/shared/journey/ui/JourneyItem/types/index.ts +0 -1
- package/src/shared/journey/ui/JourneyTitle/components/GemxIdBadge.tsx +0 -38
- package/src/shared/journey/ui/JourneyTitle/components/JourneyDateBadge.tsx +0 -18
- package/src/shared/journey/ui/JourneyTitle/components/JourneyIdBadge.tsx +0 -65
- package/src/shared/journey/ui/JourneyTitle/components/JourneyLoadMore.tsx +0 -43
- package/src/shared/journey/ui/JourneyTitle/components/JourneyTitle.tsx +0 -42
- package/src/shared/journey/ui/JourneyTitle/components/index.ts +0 -2
- package/src/shared/journey/ui/JourneyTitle/constants/idBadge.ts +0 -1
- package/src/shared/journey/ui/JourneyTitle/constants/index.ts +0 -1
- package/src/shared/journey/ui/JourneyTitle/index.ts +0 -1
- package/src/shared/journey/ui/index.ts +0 -3
- package/src/shared/journey/ui/type.ts +0 -2
- package/src/shared/reports/common/Visualization/constants/columns.ts +0 -6
- package/src/shared/reports/common/Visualization/constants/index.ts +0 -2
- package/src/shared/reports/common/Visualization/constants/version.ts +0 -8
- package/src/shared/reports/common/Visualization/index.ts +0 -2
- package/src/shared/reports/common/Visualization/types/chart.ts +0 -5
- package/src/shared/reports/common/Visualization/types/index.ts +0 -3
- package/src/shared/reports/common/Visualization/types/report-metric.ts +0 -21
- package/src/shared/reports/common/Visualization/types/report.ts +0 -42
- package/src/shared/reports/common/Visualization/utils/index.ts +0 -2
- package/src/shared/reports/common/Visualization/utils/version.ts +0 -9
- package/src/shared/reports/common/Visualization/utils/visualization.ts +0 -58
- package/src/shared/reports/common/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/ReportTable.tsx +0 -194
- package/src/shared/reports/ui/ReportTable/ReportTableSkeleton.tsx +0 -73
- package/src/shared/reports/ui/ReportTable/assets/styles/ReportTable.scss +0 -288
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/CampaignsCell.tsx +0 -102
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/CampaignsCellVersion.tsx +0 -11
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/Cell.tsx +0 -93
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CellRenderers.tsx +0 -72
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/DateCell.tsx +0 -9
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/DefaultCell.tsx +0 -32
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/GemxIdCell.tsx +0 -18
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/ItemsCell/CheckoutStartedDetail.tsx +0 -79
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/ItemsCell/ItemsCell.tsx +0 -56
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/ItemsCell/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/NoneCell.tsx +0 -11
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/LoadingData.tsx +0 -10
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/NoData.tsx +0 -13
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderCell.tsx +0 -78
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderCellBase.tsx +0 -55
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderCellContainer.tsx +0 -43
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderItem.tsx +0 -79
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderIdCell.tsx +0 -70
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/PreviousCell.tsx +0 -17
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/TotalCell.tsx +0 -14
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/VersionCell.tsx +0 -31
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/WrapperCell.tsx +0 -31
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/type.ts +0 -18
- package/src/shared/reports/ui/ReportTable/components/Body/Row.tsx +0 -85
- package/src/shared/reports/ui/ReportTable/components/Body/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/components/Footer/Pagination.tsx +0 -76
- package/src/shared/reports/ui/ReportTable/components/Footer/ScrollBar.tsx +0 -19
- package/src/shared/reports/ui/ReportTable/components/Footer/WrapperFooter.tsx +0 -39
- package/src/shared/reports/ui/ReportTable/components/Footer/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Header/Header.tsx +0 -68
- package/src/shared/reports/ui/ReportTable/components/Header/SortableHeader.tsx +0 -49
- package/src/shared/reports/ui/ReportTable/components/Header/SortableHeaderWithTooltip.tsx +0 -60
- package/src/shared/reports/ui/ReportTable/components/Header/SummaryCell.tsx +0 -26
- package/src/shared/reports/ui/ReportTable/components/Header/SummaryRow.tsx +0 -69
- package/src/shared/reports/ui/ReportTable/components/Header/WrapperHeader.tsx +0 -54
- package/src/shared/reports/ui/ReportTable/components/Header/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/constants/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/constants/order.ts +0 -30
- package/src/shared/reports/ui/ReportTable/constants/table.ts +0 -17
- package/src/shared/reports/ui/ReportTable/context/ReportTableActionsContext.tsx +0 -28
- package/src/shared/reports/ui/ReportTable/helpers/format.ts +0 -29
- package/src/shared/reports/ui/ReportTable/helpers/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/helpers/report.ts +0 -7
- package/src/shared/reports/ui/ReportTable/hooks/index.ts +0 -3
- package/src/shared/reports/ui/ReportTable/hooks/useReportTable.ts +0 -172
- package/src/shared/reports/ui/ReportTable/hooks/useReportTableCell.tsx +0 -28
- package/src/shared/reports/ui/ReportTable/hooks/useSyncedScroll.ts +0 -81
- package/src/shared/reports/ui/ReportTable/index.ts +0 -4
- package/src/shared/reports/ui/ReportTable/types/dimension.ts +0 -8
- package/src/shared/reports/ui/ReportTable/types/index.ts +0 -43
- package/src/shared/reports/ui/ReportTable/types/order.ts +0 -15
- package/src/shared/reports/ui/ReportTable/types/report-columns.ts +0 -11
- package/src/shared/reports/ui/ReportTable/utils/format.ts +0 -100
- package/src/shared/reports/ui/ReportTable/utils/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/utils/order.ts +0 -8
- package/src/shared/reports/ui/ReportTable/utils/table.ts +0 -19
- package/src/shared/reports/ui/ReportTable/utils/visualization.ts +0 -56
- package/src/shared/reports/ui/index.ts +0 -0
- package/src/stores/currencyRatesStore.ts +0 -13
- package/src/stores/index.ts +0 -2
- package/src/styles/index.scss +0 -9
- package/src/types/analytic-mode.ts +0 -5
- package/src/types/breakdown-items.ts +0 -21
- package/src/types/campaign.ts +0 -13
- package/src/types/chart.ts +0 -42
- package/src/types/currency.ts +0 -329
- package/src/types/index.ts +0 -8
- package/src/types/metric.ts +0 -81
- package/src/types/pricing.ts +0 -38
- package/src/types/report-columns.ts +0 -1
- package/src/types/template.ts +0 -19
- package/src/utils/analytics.ts +0 -75
- package/src/utils/array.ts +0 -13
- package/src/utils/cls.ts +0 -18
- package/src/utils/currency.ts +0 -42
- package/src/utils/date-time.ts +0 -7
- package/src/utils/dayjs.ts +0 -52
- package/src/utils/deep-copy.ts +0 -4
- package/src/utils/index.ts +0 -12
- package/src/utils/is-browser.ts +0 -3
- package/src/utils/number.ts +0 -19
- package/src/utils/percentage.ts +0 -40
- package/src/utils/sort.ts +0 -87
- package/src/utils/string.ts +0 -20
- package/src/utils/template-type.ts +0 -30
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
interface IUsePopoverResizeObserverOptions {
|
|
4
|
-
active: boolean;
|
|
5
|
-
onHeightChange?: (height: number) => void;
|
|
6
|
-
selector?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const usePopoverResizeObserver = ({
|
|
10
|
-
active,
|
|
11
|
-
onHeightChange,
|
|
12
|
-
selector = '.Polaris-Popover__Content--fluidContent',
|
|
13
|
-
}: IUsePopoverResizeObserverOptions): void => {
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!active) return;
|
|
16
|
-
|
|
17
|
-
let resizeObserver: ResizeObserver | null = null;
|
|
18
|
-
const setupResizeObserver = (): void => {
|
|
19
|
-
const popoverContent = document.querySelector(selector);
|
|
20
|
-
if (popoverContent && !resizeObserver) {
|
|
21
|
-
resizeObserver = new ResizeObserver((entries) => {
|
|
22
|
-
for (const entry of entries) {
|
|
23
|
-
const { height } = entry.contentRect;
|
|
24
|
-
onHeightChange?.(height);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
resizeObserver.observe(popoverContent);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const timer = setTimeout(() => {
|
|
32
|
-
setupResizeObserver();
|
|
33
|
-
}, 200);
|
|
34
|
-
|
|
35
|
-
return () => {
|
|
36
|
-
clearTimeout(timer);
|
|
37
|
-
if (resizeObserver) {
|
|
38
|
-
resizeObserver.disconnect();
|
|
39
|
-
resizeObserver = null;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}, [active, selector]);
|
|
43
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isBrowser } from '@/utils';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
|
|
4
|
-
export const usePreventBodyScroll = ({ enable }: { enable: boolean }) => {
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
if (!enable || !isBrowser()) return;
|
|
7
|
-
|
|
8
|
-
// Prevent layout shift from scrollbar removal
|
|
9
|
-
document.body.style.overflowY = 'hidden';
|
|
10
|
-
|
|
11
|
-
return () => {
|
|
12
|
-
document.body.style.overflowY = 'unset';
|
|
13
|
-
};
|
|
14
|
-
}, [enable]);
|
|
15
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Framework-agnostic replacement for @remix-run/react useSearchParams.
|
|
2
|
-
// Returns a read-only URLSearchParams from window.location.search so the SDK
|
|
3
|
-
// works outside of a Remix/React Router context (e.g. Next.js, plain React).
|
|
4
|
-
export const useSearchParams = (): [URLSearchParams] => {
|
|
5
|
-
const params = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : new URLSearchParams();
|
|
6
|
-
return [params];
|
|
7
|
-
};
|
package/src/hooks/useToggle.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
interface IUseToggleReturn {
|
|
4
|
-
value: boolean;
|
|
5
|
-
toggle: () => void;
|
|
6
|
-
setTrue: () => void;
|
|
7
|
-
setFalse: () => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Returns a stateful value, and a set of memoized functions to toggle it,
|
|
12
|
-
* set it to true and set it to false
|
|
13
|
-
*/
|
|
14
|
-
export function useToggle(initialState: boolean): IUseToggleReturn {
|
|
15
|
-
const [value, setState] = useState(initialState);
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
value,
|
|
19
|
-
toggle: useCallback(() => setState((state) => !state), []),
|
|
20
|
-
setTrue: useCallback(() => setState(true), []),
|
|
21
|
-
setFalse: useCallback(() => setState(false), []),
|
|
22
|
-
};
|
|
23
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './constants';
|
|
3
|
-
export * from './hooks/publish';
|
|
4
|
-
export * from './providers';
|
|
5
|
-
export * from './stores';
|
|
6
|
-
export * from './utils/dayjs';
|
|
7
|
-
|
|
8
|
-
export * from './shared/reports/ui/ReportTable/ReportTable';
|
|
9
|
-
export { ReportTableSkeleton } from './shared/reports/ui/ReportTable/ReportTableSkeleton';
|
|
10
|
-
export { formatReportData } from './shared/reports/ui/ReportTable/utils/format';
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getAddToCartRateMetric,
|
|
3
|
-
getAverageOrderValueMetric,
|
|
4
|
-
getAverageTimeOnPageMetric,
|
|
5
|
-
getBounceRateMetric,
|
|
6
|
-
getConversionRateMetric,
|
|
7
|
-
getLinkCtrMetric,
|
|
8
|
-
getNewReturningCustomerMetric,
|
|
9
|
-
getPathAnalysisMetric,
|
|
10
|
-
getRevenuePerVisitorMetric,
|
|
11
|
-
getTotalATCMetric,
|
|
12
|
-
getTotalOrderMetric,
|
|
13
|
-
getTotalPageViewMetric,
|
|
14
|
-
getTotalRevenueMetric,
|
|
15
|
-
getTotalSessionByDeviceMetric,
|
|
16
|
-
getTotalSessionCompletedCheckoutMetric,
|
|
17
|
-
getTotalSessionMetric,
|
|
18
|
-
getTotalSessionReachedCheckoutMetric,
|
|
19
|
-
getTotalSessionWithCartAdditionMetric,
|
|
20
|
-
getTotalVisitorMetric,
|
|
21
|
-
} from '../utils';
|
|
22
|
-
import type { IFunctionGetMetric } from '../types';
|
|
23
|
-
import { IPAMetricKey } from '../types';
|
|
24
|
-
|
|
25
|
-
interface IPageAnalyticMappingItem {
|
|
26
|
-
heading: { title: string };
|
|
27
|
-
getMetricValue: IFunctionGetMetric;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const PA_METRIC_TOOLTIP: Record<IPAMetricKey, unknown> = {} as Record<IPAMetricKey, unknown>;
|
|
31
|
-
|
|
32
|
-
export const SHOPIFY_PAGE_TYPE_KEY = 'shopify_page_type';
|
|
33
|
-
|
|
34
|
-
export const METRICS_COLUMNS: Record<IPAMetricKey, { label: string }> = {
|
|
35
|
-
[IPAMetricKey.PAGE_SESSIONS]: { label: 'Sessions' },
|
|
36
|
-
[IPAMetricKey.PAGE_BR]: { label: 'Bounce rate' },
|
|
37
|
-
[IPAMetricKey.PAGE_CTR]: { label: 'Click-through rate' },
|
|
38
|
-
[IPAMetricKey.PAGE_CR]: { label: 'Conversion rate' },
|
|
39
|
-
[IPAMetricKey.PAGE_VISITORS]: { label: 'Visitors' },
|
|
40
|
-
[IPAMetricKey.PAGE_AVG_TIME]: { label: 'Avg time on page' },
|
|
41
|
-
[IPAMetricKey.PAGE_VIEWS]: { label: 'Pageviews' },
|
|
42
|
-
[IPAMetricKey.PAGE_REVENUE]: { label: 'Revenue' },
|
|
43
|
-
[IPAMetricKey.PAGE_ADDED_TO_CART]: { label: 'Added to cart' },
|
|
44
|
-
[IPAMetricKey.PAGE_REACHED_CHECKOUT]: { label: 'Sessions that reached checkout' },
|
|
45
|
-
[IPAMetricKey.PAGE_COMPLETE_CHECKOUT]: { label: 'Sessions that completed checkout' },
|
|
46
|
-
[IPAMetricKey.PAGE_RPV]: { label: 'Revenue per visitor' },
|
|
47
|
-
[IPAMetricKey.PAGE_CART_ADDITION]: { label: 'Sessions with cart additions' },
|
|
48
|
-
[IPAMetricKey.PAGE_ADD_TO_CART_RATE]: { label: 'Add to cart rate' },
|
|
49
|
-
[IPAMetricKey.PAGE_ORDERS]: { label: 'Orders' },
|
|
50
|
-
[IPAMetricKey.PAGE_AOV]: { label: 'Average order value' },
|
|
51
|
-
[IPAMetricKey.PAGE_SESSIONS_BY_VISITOR]: { label: 'Visitor by type' },
|
|
52
|
-
[IPAMetricKey.PAGE_SESSIONS_BY_TRAFFIC]: { label: 'Sessions by traffic source' },
|
|
53
|
-
[IPAMetricKey.PAGE_PATH_ANALYSIS]: { label: 'Journey analysis' },
|
|
54
|
-
[IPAMetricKey.PAGE_SESSIONS_BY_DEVICE]: { label: 'Sessions by device type' },
|
|
55
|
-
[IPAMetricKey.PAGE_NEW_RETURNING_CUSTOMER]: { label: 'New vs returning visitors' },
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const getHeading = (key: IPAMetricKey): { title: string } => ({ title: METRICS_COLUMNS[key].label });
|
|
59
|
-
|
|
60
|
-
export const PAGE_ANALYTIC_MAPPING: Record<IPAMetricKey, IPageAnalyticMappingItem> = {
|
|
61
|
-
[IPAMetricKey.PAGE_SESSIONS]: {
|
|
62
|
-
getMetricValue: getTotalSessionMetric,
|
|
63
|
-
heading: getHeading(IPAMetricKey.PAGE_SESSIONS),
|
|
64
|
-
},
|
|
65
|
-
[IPAMetricKey.PAGE_BR]: { getMetricValue: getBounceRateMetric, heading: getHeading(IPAMetricKey.PAGE_BR) },
|
|
66
|
-
[IPAMetricKey.PAGE_CTR]: { getMetricValue: getLinkCtrMetric, heading: getHeading(IPAMetricKey.PAGE_CTR) },
|
|
67
|
-
[IPAMetricKey.PAGE_CR]: { getMetricValue: getConversionRateMetric, heading: getHeading(IPAMetricKey.PAGE_CR) },
|
|
68
|
-
[IPAMetricKey.PAGE_VISITORS]: {
|
|
69
|
-
getMetricValue: getTotalVisitorMetric,
|
|
70
|
-
heading: getHeading(IPAMetricKey.PAGE_VISITORS),
|
|
71
|
-
},
|
|
72
|
-
[IPAMetricKey.PAGE_AVG_TIME]: {
|
|
73
|
-
getMetricValue: getAverageTimeOnPageMetric,
|
|
74
|
-
heading: getHeading(IPAMetricKey.PAGE_AVG_TIME),
|
|
75
|
-
},
|
|
76
|
-
[IPAMetricKey.PAGE_VIEWS]: { getMetricValue: getTotalPageViewMetric, heading: getHeading(IPAMetricKey.PAGE_VIEWS) },
|
|
77
|
-
[IPAMetricKey.PAGE_REVENUE]: {
|
|
78
|
-
getMetricValue: getTotalRevenueMetric,
|
|
79
|
-
heading: getHeading(IPAMetricKey.PAGE_REVENUE),
|
|
80
|
-
},
|
|
81
|
-
[IPAMetricKey.PAGE_ADDED_TO_CART]: {
|
|
82
|
-
getMetricValue: getTotalATCMetric,
|
|
83
|
-
heading: getHeading(IPAMetricKey.PAGE_ADDED_TO_CART),
|
|
84
|
-
},
|
|
85
|
-
[IPAMetricKey.PAGE_REACHED_CHECKOUT]: {
|
|
86
|
-
getMetricValue: getTotalSessionReachedCheckoutMetric,
|
|
87
|
-
heading: getHeading(IPAMetricKey.PAGE_REACHED_CHECKOUT),
|
|
88
|
-
},
|
|
89
|
-
[IPAMetricKey.PAGE_COMPLETE_CHECKOUT]: {
|
|
90
|
-
getMetricValue: getTotalSessionCompletedCheckoutMetric,
|
|
91
|
-
heading: getHeading(IPAMetricKey.PAGE_COMPLETE_CHECKOUT),
|
|
92
|
-
},
|
|
93
|
-
[IPAMetricKey.PAGE_RPV]: { getMetricValue: getRevenuePerVisitorMetric, heading: getHeading(IPAMetricKey.PAGE_RPV) },
|
|
94
|
-
[IPAMetricKey.PAGE_CART_ADDITION]: {
|
|
95
|
-
getMetricValue: getTotalSessionWithCartAdditionMetric,
|
|
96
|
-
heading: getHeading(IPAMetricKey.PAGE_CART_ADDITION),
|
|
97
|
-
},
|
|
98
|
-
[IPAMetricKey.PAGE_ADD_TO_CART_RATE]: {
|
|
99
|
-
getMetricValue: getAddToCartRateMetric,
|
|
100
|
-
heading: getHeading(IPAMetricKey.PAGE_ADD_TO_CART_RATE),
|
|
101
|
-
},
|
|
102
|
-
[IPAMetricKey.PAGE_ORDERS]: { getMetricValue: getTotalOrderMetric, heading: getHeading(IPAMetricKey.PAGE_ORDERS) },
|
|
103
|
-
[IPAMetricKey.PAGE_AOV]: { getMetricValue: getAverageOrderValueMetric, heading: getHeading(IPAMetricKey.PAGE_AOV) },
|
|
104
|
-
[IPAMetricKey.PAGE_SESSIONS_BY_VISITOR]: {
|
|
105
|
-
getMetricValue: getTotalVisitorMetric,
|
|
106
|
-
heading: getHeading(IPAMetricKey.PAGE_SESSIONS_BY_VISITOR),
|
|
107
|
-
},
|
|
108
|
-
[IPAMetricKey.PAGE_SESSIONS_BY_TRAFFIC]: {
|
|
109
|
-
getMetricValue: getTotalSessionMetric,
|
|
110
|
-
heading: getHeading(IPAMetricKey.PAGE_SESSIONS_BY_TRAFFIC),
|
|
111
|
-
},
|
|
112
|
-
[IPAMetricKey.PAGE_PATH_ANALYSIS]: {
|
|
113
|
-
getMetricValue: getPathAnalysisMetric,
|
|
114
|
-
heading: getHeading(IPAMetricKey.PAGE_PATH_ANALYSIS),
|
|
115
|
-
},
|
|
116
|
-
[IPAMetricKey.PAGE_SESSIONS_BY_DEVICE]: {
|
|
117
|
-
getMetricValue: getTotalSessionByDeviceMetric,
|
|
118
|
-
heading: getHeading(IPAMetricKey.PAGE_SESSIONS_BY_DEVICE),
|
|
119
|
-
},
|
|
120
|
-
[IPAMetricKey.PAGE_NEW_RETURNING_CUSTOMER]: {
|
|
121
|
-
getMetricValue: getNewReturningCustomerMetric,
|
|
122
|
-
heading: getHeading(IPAMetricKey.PAGE_NEW_RETURNING_CUSTOMER),
|
|
123
|
-
},
|
|
124
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { IBasePageAnalyticMetric } from '@/types/metric';
|
|
2
|
-
|
|
3
|
-
export enum IPAMetricKey {
|
|
4
|
-
PAGE_SESSIONS = 'PAGE_SESSIONS',
|
|
5
|
-
PAGE_BR = 'PAGE_BOUNCE_RATE',
|
|
6
|
-
PAGE_CTR = 'PAGE_CLICK_THROUGH_RATE',
|
|
7
|
-
PAGE_AVG_TIME = 'PAGE_AVG_TIME',
|
|
8
|
-
PAGE_VIEWS = 'PAGE_VIEWS',
|
|
9
|
-
PAGE_RPV = 'PAGE_REVENUE_PER_VISITOR',
|
|
10
|
-
PAGE_REVENUE = 'PAGE_REVENUE',
|
|
11
|
-
PAGE_NEW_RETURNING_CUSTOMER = 'PAGE_NEW_RETURNING_CUSTOMER',
|
|
12
|
-
PAGE_SESSIONS_BY_VISITOR = 'PAGE_SESSIONS_BY_VISITOR',
|
|
13
|
-
PAGE_SESSIONS_BY_DEVICE = 'PAGE_SESSIONS_BY_DEVICE',
|
|
14
|
-
PAGE_SESSIONS_BY_TRAFFIC = 'PAGE_SESSIONS_BY_TRAFFIC',
|
|
15
|
-
PAGE_PATH_ANALYSIS = 'PAGE_PATH_ANALYSIS',
|
|
16
|
-
PAGE_CART_ADDITION = 'PAGE_SESSION_WITH_CART_ADDITION',
|
|
17
|
-
PAGE_ADDED_TO_CART = 'PAGE_ADDED_TO_CART',
|
|
18
|
-
PAGE_ADD_TO_CART_RATE = 'ADD_TO_CART_RATE',
|
|
19
|
-
PAGE_REACHED_CHECKOUT = 'PAGE_REACHED_CHECKOUT',
|
|
20
|
-
PAGE_COMPLETE_CHECKOUT = 'PAGE_COMPLETE_CHECKOUT',
|
|
21
|
-
PAGE_ORDERS = 'PAGE_ORDERS',
|
|
22
|
-
PAGE_CR = 'PAGE_CONVERSION_RATE',
|
|
23
|
-
PAGE_AOV = 'PAGE_AVERAGE_ORDER_VALUE',
|
|
24
|
-
PAGE_VISITORS = 'PAGE_VISITORS',
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export enum IMetricFormatter {
|
|
28
|
-
PERCENTAGE_STRING = 'PERCENTAGE_STRING',
|
|
29
|
-
CURRENCY = 'CURRENCY',
|
|
30
|
-
DURATION = 'DURATION',
|
|
31
|
-
DURATION_MS = 'DURATION_MS',
|
|
32
|
-
MILLISECONDS = 'MILLISECONDS',
|
|
33
|
-
NORMAL = 'NORMAL',
|
|
34
|
-
NUMBER_COMMAS = 'NUMBER_COMMAS',
|
|
35
|
-
NUMBER_COMMAS_LEAN = 'NUMBER_COMMAS_LEAN',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface IDetectMetricResult<K = number | undefined> {
|
|
39
|
-
formatter: IMetricFormatter;
|
|
40
|
-
value: K;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type IFunctionGetMetric<T = IBasePageAnalyticMetric> = (props: { metric?: T }) => IDetectMetricResult;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { IGetTextPrice } from '@/core/gemxql';
|
|
2
|
-
|
|
3
|
-
import { calcPercentageString, getTimeDurationLabel, numberWithCommas } from '@/utils';
|
|
4
|
-
import { IMetricFormatter } from '../types';
|
|
5
|
-
|
|
6
|
-
export type IFormatMetricParams = {
|
|
7
|
-
value: number | string | undefined;
|
|
8
|
-
formatter: string;
|
|
9
|
-
getTextPrice: IGetTextPrice;
|
|
10
|
-
compact?: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const formatMetricByFormatter = ({ value, formatter, getTextPrice, compact }: IFormatMetricParams): string => {
|
|
14
|
-
const dataValue = value ?? 0;
|
|
15
|
-
|
|
16
|
-
switch (formatter) {
|
|
17
|
-
case IMetricFormatter.PERCENTAGE_STRING: {
|
|
18
|
-
if (typeof dataValue !== 'number') return calcPercentageString(0, 1, 2) ?? '';
|
|
19
|
-
return calcPercentageString(dataValue, 1, 2) ?? '';
|
|
20
|
-
}
|
|
21
|
-
case IMetricFormatter.NUMBER_COMMAS:
|
|
22
|
-
case IMetricFormatter.NUMBER_COMMAS_LEAN:
|
|
23
|
-
case IMetricFormatter.NORMAL: {
|
|
24
|
-
if (compact && typeof dataValue === 'number' && Math.abs(dataValue) >= 1_000) {
|
|
25
|
-
return new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 }).format(dataValue);
|
|
26
|
-
}
|
|
27
|
-
return numberWithCommas(dataValue.toString());
|
|
28
|
-
}
|
|
29
|
-
case IMetricFormatter.DURATION: {
|
|
30
|
-
return getTimeDurationLabel(Number(dataValue));
|
|
31
|
-
}
|
|
32
|
-
case IMetricFormatter.DURATION_MS:
|
|
33
|
-
case IMetricFormatter.MILLISECONDS: {
|
|
34
|
-
return getTimeDurationLabel(Number(dataValue) / 1000);
|
|
35
|
-
}
|
|
36
|
-
case IMetricFormatter.CURRENCY: {
|
|
37
|
-
return getTextPrice(dataValue, false, compact ? { compact } : undefined);
|
|
38
|
-
}
|
|
39
|
-
default:
|
|
40
|
-
return `${dataValue}`;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IBasePageAnalyticMetric } from '@/types/metric';
|
|
2
|
-
import type { IDetectMetricResult, IPAMetricKey } from '../types';
|
|
3
|
-
|
|
4
|
-
import { PAGE_ANALYTIC_MAPPING } from '../constants';
|
|
5
|
-
import { IMetricFormatter } from '../types';
|
|
6
|
-
|
|
7
|
-
export const getPAMetricValueV2 = (metric?: IBasePageAnalyticMetric, key?: IPAMetricKey): IDetectMetricResult => {
|
|
8
|
-
if (!metric || !key || !(key in PAGE_ANALYTIC_MAPPING)) return { value: 0, formatter: IMetricFormatter.NORMAL };
|
|
9
|
-
|
|
10
|
-
return PAGE_ANALYTIC_MAPPING[key].getMetricValue({ metric });
|
|
11
|
-
};
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type { IDetectMetricResult, IFunctionGetMetric } from '../types';
|
|
2
|
-
|
|
3
|
-
import { IMetricFormatter } from '../types';
|
|
4
|
-
|
|
5
|
-
export const detectDataV2By = <T>({
|
|
6
|
-
data,
|
|
7
|
-
formatter,
|
|
8
|
-
extractValue,
|
|
9
|
-
}: {
|
|
10
|
-
data: T | undefined;
|
|
11
|
-
formatter: IMetricFormatter;
|
|
12
|
-
extractValue: (value: T | undefined) => number | undefined;
|
|
13
|
-
}): IDetectMetricResult => {
|
|
14
|
-
const valueEmpty: IDetectMetricResult = { formatter, value: 0 };
|
|
15
|
-
if (!data) return valueEmpty;
|
|
16
|
-
|
|
17
|
-
const value = extractValue(data);
|
|
18
|
-
if (typeof value === 'undefined') return valueEmpty;
|
|
19
|
-
|
|
20
|
-
return { value, formatter };
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const toNumber = (value?: number | null): number => value ?? 0;
|
|
24
|
-
|
|
25
|
-
const divideRatio = (part?: number | null, total?: number | null): number | undefined => {
|
|
26
|
-
const numerator = toNumber(part);
|
|
27
|
-
const denominator = toNumber(total);
|
|
28
|
-
if (denominator <= 0 || !Number.isFinite(numerator)) return undefined;
|
|
29
|
-
return numerator / denominator;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const getTotalSessionMetric: IFunctionGetMetric = ({ metric }) =>
|
|
33
|
-
detectDataV2By({
|
|
34
|
-
data: metric,
|
|
35
|
-
extractValue: (value) => value?.totalSessions ?? undefined,
|
|
36
|
-
formatter: IMetricFormatter.NORMAL,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const getTotalVisitorMetric: IFunctionGetMetric = ({ metric }) =>
|
|
40
|
-
detectDataV2By({
|
|
41
|
-
data: metric,
|
|
42
|
-
extractValue: (value) => value?.totalVisitors ?? undefined,
|
|
43
|
-
formatter: IMetricFormatter.NORMAL,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const getTotalOrderMetric: IFunctionGetMetric = ({ metric }) =>
|
|
47
|
-
detectDataV2By({
|
|
48
|
-
data: metric,
|
|
49
|
-
extractValue: (value) => value?.totalOrders ?? undefined,
|
|
50
|
-
formatter: IMetricFormatter.NORMAL,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export const getTotalPageViewMetric: IFunctionGetMetric = ({ metric }) =>
|
|
54
|
-
detectDataV2By({
|
|
55
|
-
data: metric,
|
|
56
|
-
extractValue: (value) => value?.totalPageViewed ?? undefined,
|
|
57
|
-
formatter: IMetricFormatter.NORMAL,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export const getTotalRevenueMetric: IFunctionGetMetric = ({ metric }) =>
|
|
61
|
-
detectDataV2By({
|
|
62
|
-
data: metric,
|
|
63
|
-
extractValue: (value) => value?.totalRevenue ?? undefined,
|
|
64
|
-
formatter: IMetricFormatter.CURRENCY,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export const getBounceRateMetric: IFunctionGetMetric = ({ metric }) =>
|
|
68
|
-
detectDataV2By({
|
|
69
|
-
data: metric,
|
|
70
|
-
extractValue: (value) => divideRatio(value?.totalSessionsWithoutAction, value?.totalSessions),
|
|
71
|
-
formatter: IMetricFormatter.PERCENTAGE_STRING,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
export const getLinkCtrMetric: IFunctionGetMetric = ({ metric }) =>
|
|
75
|
-
detectDataV2By({
|
|
76
|
-
data: metric,
|
|
77
|
-
extractValue: (value) => divideRatio(value?.totalClickedHasHref, value?.totalPageViewed),
|
|
78
|
-
formatter: IMetricFormatter.PERCENTAGE_STRING,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export const getConversionRateMetric: IFunctionGetMetric = ({ metric }) =>
|
|
82
|
-
detectDataV2By({
|
|
83
|
-
data: metric,
|
|
84
|
-
extractValue: (value) => divideRatio(value?.totalSessionsThatCompletedCheckout, value?.totalSessions),
|
|
85
|
-
formatter: IMetricFormatter.PERCENTAGE_STRING,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
export const getAddToCartRateMetric: IFunctionGetMetric = ({ metric }) =>
|
|
89
|
-
detectDataV2By({
|
|
90
|
-
data: metric,
|
|
91
|
-
extractValue: (value) => divideRatio(value?.totalSessionsWithCartAdditions, value?.totalSessions),
|
|
92
|
-
formatter: IMetricFormatter.PERCENTAGE_STRING,
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export const getAverageTimeOnPageMetric: IFunctionGetMetric = ({ metric }) =>
|
|
96
|
-
detectDataV2By({
|
|
97
|
-
data: metric,
|
|
98
|
-
extractValue: (value) => {
|
|
99
|
-
const averageTimeOnPage = divideRatio(value?.totalTimeOnPage, value?.totalPageViewedHaveTimeOnPage);
|
|
100
|
-
return averageTimeOnPage ? Number(averageTimeOnPage.toFixed(2)) : undefined;
|
|
101
|
-
},
|
|
102
|
-
formatter: IMetricFormatter.DURATION,
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
export const getRevenuePerVisitorMetric: IFunctionGetMetric = ({ metric }) =>
|
|
106
|
-
detectDataV2By({
|
|
107
|
-
data: metric,
|
|
108
|
-
extractValue: (value) => {
|
|
109
|
-
const revenuePerVisitor = divideRatio(value?.totalRevenue, value?.totalVisitors);
|
|
110
|
-
return revenuePerVisitor ? Number(revenuePerVisitor.toFixed(2)) : undefined;
|
|
111
|
-
},
|
|
112
|
-
formatter: IMetricFormatter.CURRENCY,
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
export const getAverageOrderValueMetric: IFunctionGetMetric = ({ metric }) =>
|
|
116
|
-
detectDataV2By({
|
|
117
|
-
data: metric,
|
|
118
|
-
extractValue: (value) => {
|
|
119
|
-
const averageOrderValue = divideRatio(value?.totalRevenue, value?.totalOrders);
|
|
120
|
-
return averageOrderValue ? Number(averageOrderValue.toFixed(2)) : undefined;
|
|
121
|
-
},
|
|
122
|
-
formatter: IMetricFormatter.CURRENCY,
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
export const getTotalATCMetric: IFunctionGetMetric = ({ metric }) =>
|
|
126
|
-
detectDataV2By({
|
|
127
|
-
data: metric,
|
|
128
|
-
extractValue: (value) => value?.totalAddedToCart ?? undefined,
|
|
129
|
-
formatter: IMetricFormatter.NORMAL,
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
export const getTotalSessionWithCartAdditionMetric: IFunctionGetMetric = ({ metric }) =>
|
|
133
|
-
detectDataV2By({
|
|
134
|
-
data: metric,
|
|
135
|
-
extractValue: (value) => value?.totalSessionsWithCartAdditions ?? undefined,
|
|
136
|
-
formatter: IMetricFormatter.NORMAL,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
export const getTotalSessionReachedCheckoutMetric: IFunctionGetMetric = ({ metric }) =>
|
|
140
|
-
detectDataV2By({
|
|
141
|
-
data: metric,
|
|
142
|
-
extractValue: (value) => value?.totalSessionsThatReachedCheckout ?? undefined,
|
|
143
|
-
formatter: IMetricFormatter.NORMAL,
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
export const getTotalSessionCompletedCheckoutMetric: IFunctionGetMetric = ({ metric }) =>
|
|
147
|
-
detectDataV2By({
|
|
148
|
-
data: metric,
|
|
149
|
-
extractValue: (value) => value?.totalSessionsThatCompletedCheckout ?? undefined,
|
|
150
|
-
formatter: IMetricFormatter.NORMAL,
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
export const getPathAnalysisMetric: IFunctionGetMetric = ({ metric }) =>
|
|
154
|
-
detectDataV2By({
|
|
155
|
-
data: metric,
|
|
156
|
-
extractValue: () => undefined,
|
|
157
|
-
formatter: IMetricFormatter.NORMAL,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
export const getTotalSessionByDeviceMetric: IFunctionGetMetric = ({ metric }) =>
|
|
161
|
-
detectDataV2By({
|
|
162
|
-
data: metric,
|
|
163
|
-
extractValue: () => undefined,
|
|
164
|
-
formatter: IMetricFormatter.NORMAL,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
export const getNewReturningCustomerMetric: IFunctionGetMetric = ({ metric }) =>
|
|
168
|
-
detectDataV2By({
|
|
169
|
-
data: metric,
|
|
170
|
-
extractValue: () => undefined,
|
|
171
|
-
formatter: IMetricFormatter.NORMAL,
|
|
172
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { IGetTextPrice } from '@/core/gemxql';
|
|
3
|
-
|
|
4
|
-
import { DEFAULT_CURRENCY_ANALYTIC } from '@/constants';
|
|
5
|
-
import { useFetchCurrencyRates } from '@/hooks/useFetchCurrencyRates';
|
|
6
|
-
import { useCurrencyRatesStore, type ICurrencyRates } from '@/stores';
|
|
7
|
-
import { getPriceByCurrency } from '@/utils/currency';
|
|
8
|
-
import { trimDecimalZeros } from '@/utils/number';
|
|
9
|
-
import { createContext, useCallback, useContext, useMemo } from 'react';
|
|
10
|
-
|
|
11
|
-
interface IConvertMoneyContext {
|
|
12
|
-
getTextPrice: IGetTextPrice;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const ConvertMoneyContext = createContext<IConvertMoneyContext>({
|
|
16
|
-
getTextPrice: (price) => {
|
|
17
|
-
if (typeof price === 'string') return price;
|
|
18
|
-
return `${price ?? 0}`;
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export interface IProps {
|
|
23
|
-
children: ReactNode;
|
|
24
|
-
currency?: string;
|
|
25
|
-
locale?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const convertAmount = (amount: number, from: string, to: string, rates: ICurrencyRates): number | null => {
|
|
29
|
-
if (from === to) return amount;
|
|
30
|
-
if (!rates[from] || !rates[to]) return null;
|
|
31
|
-
const converted = (amount * rates[from]) / rates[to];
|
|
32
|
-
return Number.isFinite(converted) ? converted : null;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const ConvertMoneyProvider = ({ children, currency, locale = 'en-US' }: IProps) => {
|
|
36
|
-
useFetchCurrencyRates();
|
|
37
|
-
|
|
38
|
-
const currencyRates = useCurrencyRatesStore((state) => state.currencyRates);
|
|
39
|
-
|
|
40
|
-
const getTextPrice: IGetTextPrice = useCallback(
|
|
41
|
-
(price, _hasCurrency, options) => {
|
|
42
|
-
if (typeof price === 'string') return price;
|
|
43
|
-
if (typeof price !== 'number') return '0';
|
|
44
|
-
|
|
45
|
-
if (!currency) return price.toString();
|
|
46
|
-
|
|
47
|
-
let displayAmount = price;
|
|
48
|
-
let displayCurrency: string = DEFAULT_CURRENCY_ANALYTIC;
|
|
49
|
-
|
|
50
|
-
if (currencyRates) {
|
|
51
|
-
const converted = convertAmount(price, DEFAULT_CURRENCY_ANALYTIC, currency, currencyRates);
|
|
52
|
-
if (converted !== null) {
|
|
53
|
-
displayAmount = converted;
|
|
54
|
-
displayCurrency = currency;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return trimDecimalZeros(getPriceByCurrency(displayAmount, displayCurrency, { locale, compact: options?.compact }) ?? '0');
|
|
59
|
-
},
|
|
60
|
-
[currency, locale, currencyRates],
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const value = useMemo(() => ({ getTextPrice }), [getTextPrice]);
|
|
64
|
-
|
|
65
|
-
return <ConvertMoneyContext.Provider value={value}>{children}</ConvertMoneyContext.Provider>;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const useConvertMoneyContext = (): IConvertMoneyContext => useContext(ConvertMoneyContext);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { PartialTheme } from '@shopify/polaris-viz-core';
|
|
2
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
import { CHART_MIN_HEIGHT, SERIES_COLORS } from '@/constants';
|
|
5
|
-
import { PolarisVizProvider } from '@shopify/polaris-viz';
|
|
6
|
-
|
|
7
|
-
import chartStyle from '@shopify/polaris-viz/build/esm/styles.css?url';
|
|
8
|
-
|
|
9
|
-
type ISeriesColors = PartialTheme['seriesColors'];
|
|
10
|
-
|
|
11
|
-
const LINE_SERIES_COLORS: ISeriesColors = {
|
|
12
|
-
comparison: SERIES_COLORS.comparison,
|
|
13
|
-
single: SERIES_COLORS.current,
|
|
14
|
-
all: [...SERIES_COLORS.all],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export interface IProps {
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
minHeight?: number;
|
|
20
|
-
seriesColors?: ISeriesColors;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const MetricChartProvider = ({
|
|
24
|
-
children,
|
|
25
|
-
minHeight = CHART_MIN_HEIGHT,
|
|
26
|
-
seriesColors = LINE_SERIES_COLORS,
|
|
27
|
-
}: IProps): ReactElement => {
|
|
28
|
-
return (
|
|
29
|
-
<>
|
|
30
|
-
<link rel="stylesheet" href={chartStyle} />
|
|
31
|
-
<PolarisVizProvider
|
|
32
|
-
themes={{
|
|
33
|
-
Light: {
|
|
34
|
-
chartContainer: {
|
|
35
|
-
minHeight,
|
|
36
|
-
},
|
|
37
|
-
grid: {
|
|
38
|
-
horizontalOverflow: true,
|
|
39
|
-
verticalOverflow: true,
|
|
40
|
-
horizontalMargin: 0,
|
|
41
|
-
},
|
|
42
|
-
seriesColors,
|
|
43
|
-
},
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
</PolarisVizProvider>
|
|
48
|
-
</>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { setTz } from '@/utils/dayjs';
|
|
4
|
-
import { createContext, useContext, useEffect, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
interface ITimezoneContext {
|
|
7
|
-
tz: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const TimezoneContext = createContext<ITimezoneContext>({ tz: 'UTC' });
|
|
11
|
-
|
|
12
|
-
export interface ITimezoneProviderProps {
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
tz: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const TimezoneProvider = ({ children, tz }: ITimezoneProviderProps) => {
|
|
18
|
-
const [currentTz, setCurrentTz] = useState(() => {
|
|
19
|
-
setTz(tz);
|
|
20
|
-
return tz;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
setTz(tz);
|
|
25
|
-
setCurrentTz(tz);
|
|
26
|
-
}, [tz]);
|
|
27
|
-
|
|
28
|
-
return <TimezoneContext.Provider value={{ tz: currentTz }}>{children}</TimezoneContext.Provider>;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const useTimezoneContext = (): ITimezoneContext => useContext(TimezoneContext);
|
package/src/providers/index.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { ConvertMoneyProvider, useConvertMoneyContext } from './ConvertMoneyProvider';
|
|
2
|
-
export type { IProps as IConvertMoneyProviderProps } from './ConvertMoneyProvider';
|
|
3
|
-
export { MetricChartProvider } from './MetricChartProvider';
|
|
4
|
-
export { TimezoneProvider, useTimezoneContext } from './TimezoneProvider';
|
|
5
|
-
export type { ITimezoneProviderProps } from './TimezoneProvider';
|