@gem-sdk/analytics 0.1.0-staging.3 → 0.1.0-staging.4
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/GModalOrderJourney/GModalOrderJourney.d.ts +20 -0
- package/dist/esm/components/GModalOrderJourney/components/OrderJourneySkeleton.d.ts +1 -0
- package/dist/esm/components/GModalOrderJourney/components/index.d.ts +1 -0
- package/dist/esm/components/GModalOrderJourney/context/OrderJourneyContext.d.ts +6 -0
- package/dist/esm/components/GModalOrderJourney/context/index.d.ts +1 -0
- package/dist/esm/components/GModalOrderJourney/hooks/index.d.ts +1 -0
- package/dist/esm/components/GModalOrderJourney/hooks/useGModalOrderJourney.d.ts +7 -0
- package/dist/esm/components/GModalOrderJourney/index.d.ts +4 -0
- package/dist/esm/components/GModalOrderJourney/types/index.d.ts +4 -0
- package/dist/esm/components/GModalOrderJourney/utils/index.d.ts +28 -0
- package/dist/esm/components/OrderAnalytic/types/order.d.ts +32 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/gemxql.js +5 -0
- package/dist/esm/gemxql.mjs +5 -0
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/usePreventBodyScroll.d.ts +3 -0
- package/dist/esm/index.js +595 -9
- package/dist/esm/index.mjs +595 -9
- package/dist/esm/shared/components/GDotInline/GDotInline.d.ts +5 -0
- package/dist/esm/shared/components/GDotInline/index.d.ts +1 -0
- package/dist/esm/shared/components/GModal/GModal.d.ts +14 -0
- package/dist/esm/shared/components/GModal/index.d.ts +1 -0
- package/dist/esm/shared/components/GSpinner/GSpinner.d.ts +5 -0
- package/dist/esm/shared/components/GSpinner/index.d.ts +1 -0
- package/dist/esm/shared/components/index.d.ts +3 -0
- package/dist/esm/shared/journey/common/JourneyContainer/components/JourneyContainer.d.ts +10 -0
- package/dist/esm/shared/journey/common/JourneyContainer/components/JourneyTimeline.d.ts +1 -0
- package/dist/esm/shared/journey/common/JourneyContainer/components/index.d.ts +2 -0
- package/dist/esm/shared/journey/common/JourneyContainer/index.d.ts +1 -0
- package/dist/esm/shared/journey/common/index.d.ts +1 -0
- package/dist/esm/shared/journey/index.d.ts +2 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/AcceptedPostPurchaseOffer.d.ts +10 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/CheckoutCompleted.d.ts +9 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/CheckoutItems.d.ts +6 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStarted.d.ts +10 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStartedDetail.d.ts +8 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/CheckoutStarted/index.d.ts +2 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/PageViewed/PageViewed.d.ts +9 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/PageViewed/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/ProductAddedToCart.d.ts +10 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/ProductQuantity/ProductQuantity.d.ts +6 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/ProductQuantity/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/ProductRemovedFromCart.d.ts +10 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/components/index.d.ts +6 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/constants/event.d.ts +13 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/constants/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/index.d.ts +2 -0
- package/dist/esm/shared/journey/ui/JourneyEvents/types.d.ts +2 -0
- package/dist/esm/shared/journey/ui/JourneyGroup/JourneyGroup.d.ts +7 -0
- package/dist/esm/shared/journey/ui/JourneyGroup/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyItem/components/EventMarkerIcon.d.ts +2 -0
- package/dist/esm/shared/journey/ui/JourneyItem/components/JourneyDetail.d.ts +5 -0
- package/dist/esm/shared/journey/ui/JourneyItem/components/JourneyItem.d.ts +9 -0
- package/dist/esm/shared/journey/ui/JourneyItem/components/JourneyTime.d.ts +9 -0
- package/dist/esm/shared/journey/ui/JourneyItem/components/QuantityWrapper.d.ts +5 -0
- package/dist/esm/shared/journey/ui/JourneyItem/components/index.d.ts +3 -0
- package/dist/esm/shared/journey/ui/JourneyItem/index.d.ts +2 -0
- package/dist/esm/shared/journey/ui/JourneyItem/types/events.d.ts +18 -0
- package/dist/esm/shared/journey/ui/JourneyItem/types/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/components/JourneyDateBadge.d.ts +5 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/components/JourneyIdBadge.d.ts +6 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/components/JourneyLoadMore.d.ts +6 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/components/JourneyTitle.d.ts +9 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/components/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/index.d.ts +1 -0
- package/dist/esm/shared/journey/ui/index.d.ts +3 -0
- package/dist/esm/shared/journey/ui/type.d.ts +2 -0
- package/dist/esm/types/campaign.d.ts +4 -0
- package/dist/esm/types.js +6 -1
- package/dist/esm/types.mjs +6 -1
- package/dist/esm/utils/array.d.ts +1 -0
- package/dist/esm/utils/date-time.d.ts +1 -0
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/is-browser.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/umd/esm/components/GModalOrderJourney/GModalOrderJourney.d.ts +20 -0
- package/dist/umd/esm/components/GModalOrderJourney/components/OrderJourneySkeleton.d.ts +1 -0
- package/dist/umd/esm/components/GModalOrderJourney/components/index.d.ts +1 -0
- package/dist/umd/esm/components/GModalOrderJourney/context/OrderJourneyContext.d.ts +6 -0
- package/dist/umd/esm/components/GModalOrderJourney/context/index.d.ts +1 -0
- package/dist/umd/esm/components/GModalOrderJourney/hooks/index.d.ts +1 -0
- package/dist/umd/esm/components/GModalOrderJourney/hooks/useGModalOrderJourney.d.ts +7 -0
- package/dist/umd/esm/components/GModalOrderJourney/index.d.ts +4 -0
- package/dist/umd/esm/components/GModalOrderJourney/types/index.d.ts +4 -0
- package/dist/umd/esm/components/GModalOrderJourney/utils/index.d.ts +28 -0
- package/dist/umd/esm/components/OrderAnalytic/types/order.d.ts +32 -0
- package/dist/umd/esm/components/index.d.ts +1 -0
- package/dist/umd/esm/hooks/index.d.ts +1 -0
- package/dist/umd/esm/hooks/usePreventBodyScroll.d.ts +3 -0
- package/dist/umd/esm/shared/components/GDotInline/GDotInline.d.ts +5 -0
- package/dist/umd/esm/shared/components/GDotInline/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GModal/GModal.d.ts +14 -0
- package/dist/umd/esm/shared/components/GModal/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GSpinner/GSpinner.d.ts +5 -0
- package/dist/umd/esm/shared/components/GSpinner/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/index.d.ts +3 -0
- package/dist/umd/esm/shared/journey/common/JourneyContainer/components/JourneyContainer.d.ts +10 -0
- package/dist/umd/esm/shared/journey/common/JourneyContainer/components/JourneyTimeline.d.ts +1 -0
- package/dist/umd/esm/shared/journey/common/JourneyContainer/components/index.d.ts +2 -0
- package/dist/umd/esm/shared/journey/common/JourneyContainer/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/common/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/index.d.ts +2 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/AcceptedPostPurchaseOffer.d.ts +10 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/CheckoutCompleted.d.ts +9 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/CheckoutItems.d.ts +6 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStarted.d.ts +10 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStartedDetail.d.ts +8 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/CheckoutStarted/index.d.ts +2 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/PageViewed/PageViewed.d.ts +9 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/PageViewed/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/ProductAddedToCart.d.ts +10 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/ProductQuantity/ProductQuantity.d.ts +6 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/ProductQuantity/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/ProductRemovedFromCart.d.ts +10 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/components/index.d.ts +6 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/constants/event.d.ts +13 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/constants/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/index.d.ts +2 -0
- package/dist/umd/esm/shared/journey/ui/JourneyEvents/types.d.ts +2 -0
- package/dist/umd/esm/shared/journey/ui/JourneyGroup/JourneyGroup.d.ts +7 -0
- package/dist/umd/esm/shared/journey/ui/JourneyGroup/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/components/EventMarkerIcon.d.ts +2 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/components/JourneyDetail.d.ts +5 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/components/JourneyItem.d.ts +9 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/components/JourneyTime.d.ts +9 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/components/QuantityWrapper.d.ts +5 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/components/index.d.ts +3 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/index.d.ts +2 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/types/events.d.ts +18 -0
- package/dist/umd/esm/shared/journey/ui/JourneyItem/types/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/components/JourneyDateBadge.d.ts +5 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/components/JourneyIdBadge.d.ts +6 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/components/JourneyLoadMore.d.ts +6 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/components/JourneyTitle.d.ts +9 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/components/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/index.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/index.d.ts +3 -0
- package/dist/umd/esm/shared/journey/ui/type.d.ts +2 -0
- package/dist/umd/esm/types/campaign.d.ts +4 -0
- package/dist/umd/esm/utils/array.d.ts +1 -0
- package/dist/umd/esm/utils/date-time.d.ts +1 -0
- package/dist/umd/esm/utils/index.d.ts +3 -0
- package/dist/umd/esm/utils/is-browser.d.ts +1 -0
- package/dist/umd/gemxql.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/types.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Text, Box, InlineStack, Icon, InlineGrid, Tooltip as Tooltip$1, Popover, BlockStack, List, Button, Checkbox, RadioButton, ActionList, Link, SkeletonDisplayText, Pagination as Pagination$1, Card, SkeletonBodyText, TextField, Collapsible, useBreakpoints, Select, Scrollable, OptionList, DatePicker, ButtonGroup, Divider,
|
|
3
|
+
import { Text, Box, InlineStack, Icon, InlineGrid, Tooltip as Tooltip$1, Popover, BlockStack, List, Button, Checkbox, RadioButton, ActionList, Link, SkeletonDisplayText, Pagination as Pagination$1, Spinner, Modal, Card, SkeletonBodyText, TextField, Collapsible, useBreakpoints, Select, Scrollable, OptionList, DatePicker, ButtonGroup, Divider, Badge } from '@shopify/polaris';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { useMemo, useCallback, forwardRef, useState, useRef, useImperativeHandle, useEffect, Fragment as Fragment$1, createContext, useContext, createElement, useLayoutEffect, memo, Component } from 'react';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
@@ -213,6 +213,11 @@ var ICampaignType;
|
|
|
213
213
|
ICampaignType["TEMPLATE_BUNDLE"] = "TEMPLATE_BUNDLE";
|
|
214
214
|
// THEME = 'THEME',
|
|
215
215
|
})(ICampaignType || (ICampaignType = {}));
|
|
216
|
+
var IVariantType$1;
|
|
217
|
+
(function (IVariantType) {
|
|
218
|
+
IVariantType["VARIANT_A"] = "A";
|
|
219
|
+
IVariantType["VARIANT_B"] = "B";
|
|
220
|
+
})(IVariantType$1 || (IVariantType$1 = {}));
|
|
216
221
|
|
|
217
222
|
const TARGET_VISITOR = [
|
|
218
223
|
{ value: EVisitorType.NEW, label: 'New' },
|
|
@@ -307,6 +312,20 @@ var SvgCaretDownIcon = function SvgCaretDownIcon(props) {
|
|
|
307
312
|
};
|
|
308
313
|
SvgCaretDownIcon.displayName = "CaretDownIcon";
|
|
309
314
|
|
|
315
|
+
var SvgCartIcon = function SvgCartIcon(props) {
|
|
316
|
+
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
317
|
+
viewBox: "0 0 20 20"
|
|
318
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
319
|
+
fillRule: "evenodd",
|
|
320
|
+
d: "M2.5 3.75a.75.75 0 0 1 .75-.75h1.612a1.75 1.75 0 0 1 1.732 1.5h9.656a.75.75 0 0 1 .748.808l-.358 4.653a2.75 2.75 0 0 1-2.742 2.539h-6.351l.093.78a.25.25 0 0 0 .248.22h6.362a.75.75 0 0 1 0 1.5h-6.362a1.75 1.75 0 0 1-1.738-1.543l-1.04-8.737a.25.25 0 0 0-.248-.22h-1.612a.75.75 0 0 1-.75-.75Zm4.868 7.25h6.53a1.25 1.25 0 0 0 1.246-1.154l.296-3.846h-8.667l.595 5Z"
|
|
321
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
322
|
+
d: "M10 17a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"
|
|
323
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
324
|
+
d: "M15 17a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"
|
|
325
|
+
}));
|
|
326
|
+
};
|
|
327
|
+
SvgCartIcon.displayName = "CartIcon";
|
|
328
|
+
|
|
310
329
|
var SvgChartLineIcon = function SvgChartLineIcon(props) {
|
|
311
330
|
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
312
331
|
viewBox: "0 0 20 20"
|
|
@@ -357,6 +376,39 @@ var SvgChevronUpIcon = function SvgChevronUpIcon(props) {
|
|
|
357
376
|
};
|
|
358
377
|
SvgChevronUpIcon.displayName = "ChevronUpIcon";
|
|
359
378
|
|
|
379
|
+
var SvgCursorIcon = function SvgCursorIcon(props) {
|
|
380
|
+
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
381
|
+
viewBox: "0 0 20 20"
|
|
382
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
383
|
+
d: "M10.5 3.75a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0v-2.5Z"
|
|
384
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
385
|
+
d: "M14.28 6.28a.75.75 0 0 0-1.06-1.06l-1 1a.75.75 0 0 0 1.06 1.06l1-1Z"
|
|
386
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
387
|
+
d: "M7.28 13.28a.75.75 0 0 0-1.06-1.06l-1 1a.75.75 0 1 0 1.06 1.06l1-1Z"
|
|
388
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
389
|
+
d: "M7 9.75a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h2.5a.75.75 0 0 1 .75.75Z"
|
|
390
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
391
|
+
d: "M5.97 7.03a.75.75 0 0 0 1.06-1.06l-1.75-1.75a.75.75 0 0 0-1.06 1.06l1.75 1.75Z"
|
|
392
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
393
|
+
fillRule: "evenodd",
|
|
394
|
+
d: "M8.22 8.22a.75.75 0 0 1 .767-.181l7.5 2.5a.75.75 0 0 1 .293 1.241l-1.97 1.97 1.97 1.97a.75.75 0 1 1-1.06 1.06l-1.97-1.97-1.97 1.97a.75.75 0 0 1-1.241-.293l-2.5-7.5a.75.75 0 0 1 .18-.767Zm4.998 5.001.002-.001.001-.002 1.64-1.64-4.925-1.642 1.642 4.926 1.64-1.64Z"
|
|
395
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
396
|
+
d: "M10.5 3.75a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0v-2.5Z"
|
|
397
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
398
|
+
d: "M14.28 6.28a.75.75 0 0 0-1.06-1.06l-1 1a.75.75 0 0 0 1.06 1.06l1-1Z"
|
|
399
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
400
|
+
d: "M7.28 13.28a.75.75 0 0 0-1.06-1.06l-1 1a.75.75 0 1 0 1.06 1.06l1-1Z"
|
|
401
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
402
|
+
d: "M7 9.75a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h2.5a.75.75 0 0 1 .75.75Z"
|
|
403
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
404
|
+
d: "M5.97 7.03a.75.75 0 0 0 1.06-1.06l-1.75-1.75a.75.75 0 0 0-1.06 1.06l1.75 1.75Z"
|
|
405
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
406
|
+
fillRule: "evenodd",
|
|
407
|
+
d: "M8.22 8.22a.75.75 0 0 1 .767-.181l7.5 2.5a.75.75 0 0 1 .293 1.241l-1.97 1.97 1.97 1.97a.75.75 0 1 1-1.06 1.06l-1.97-1.97-1.97 1.97a.75.75 0 0 1-1.241-.293l-2.5-7.5a.75.75 0 0 1 .18-.767Zm4.998 5.001.002-.001.001-.002 1.64-1.64-4.925-1.642 1.642 4.926 1.64-1.64Z"
|
|
408
|
+
}));
|
|
409
|
+
};
|
|
410
|
+
SvgCursorIcon.displayName = "CursorIcon";
|
|
411
|
+
|
|
360
412
|
var SvgDeleteIcon = function SvgDeleteIcon(props) {
|
|
361
413
|
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
362
414
|
viewBox: "0 0 20 20"
|
|
@@ -371,6 +423,17 @@ var SvgDeleteIcon = function SvgDeleteIcon(props) {
|
|
|
371
423
|
};
|
|
372
424
|
SvgDeleteIcon.displayName = "DeleteIcon";
|
|
373
425
|
|
|
426
|
+
var SvgExternalSmallIcon = function SvgExternalSmallIcon(props) {
|
|
427
|
+
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
428
|
+
viewBox: "0 0 20 20"
|
|
429
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
430
|
+
d: "M11.75 4.5a.75.75 0 0 0 0 1.5h1.19l-2.72 2.72a.75.75 0 1 0 1.06 1.06l2.72-2.72v1.19a.75.75 0 0 0 1.5 0v-3a.75.75 0 0 0-.75-.75h-3Z"
|
|
431
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
432
|
+
d: "M15 11.25a.75.75 0 0 0-1.5 0v1c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5c0-.69.56-1.25 1.25-1.25h1a.75.75 0 0 0 0-1.5h-1a2.75 2.75 0 0 0-2.75 2.75v4.5a2.75 2.75 0 0 0 2.75 2.75h4.5a2.75 2.75 0 0 0 2.75-2.75v-1Z"
|
|
433
|
+
}));
|
|
434
|
+
};
|
|
435
|
+
SvgExternalSmallIcon.displayName = "ExternalSmallIcon";
|
|
436
|
+
|
|
374
437
|
var SvgInfoIcon = function SvgInfoIcon(props) {
|
|
375
438
|
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
376
439
|
viewBox: "0 0 20 20"
|
|
@@ -407,6 +470,16 @@ var SvgOrderIcon = function SvgOrderIcon(props) {
|
|
|
407
470
|
};
|
|
408
471
|
SvgOrderIcon.displayName = "OrderIcon";
|
|
409
472
|
|
|
473
|
+
var SvgPaymentIcon = function SvgPaymentIcon(props) {
|
|
474
|
+
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
475
|
+
viewBox: "0 0 20 20"
|
|
476
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
477
|
+
fillRule: "evenodd",
|
|
478
|
+
d: "M9.621 4h5.258c.395 0 .736 0 1.017.023.297.024.592.078.875.222.424.216.768.56.984.984.144.283.198.578.222.875.023.28.023.622.023 1.017v2.258c0 .395 0 .736-.023 1.017a2.29 2.29 0 0 1-.222.875 2.25 2.25 0 0 1-.983.984c-.284.144-.58.198-.876.222-.28.023-.622.023-1.017.023h-2.58c-.08.083-.169.16-.265.23l-2.73 1.965c-.565.407-.93.67-1.335.859-.358.167-.736.29-1.125.363-.44.083-.889.083-1.586.083h-1.508a.75.75 0 0 1 0-1.5h1.436c.794 0 1.095-.003 1.379-.057.266-.05.524-.134.77-.248.261-.122.508-.296 1.152-.76l2.67-1.923a.423.423 0 0 0-.35-.753l-4.875 1.219a.75.75 0 0 1-.364-1.456l.932-.233v-2.289c-.59.002-.821.011-1.033.062a2.25 2.25 0 0 0-.65.27c-.21.128-.398.31-.943.854l-.594.594a.75.75 0 0 1-1.06-1.06l.654-.655c.46-.46.78-.78 1.16-1.012a3.75 3.75 0 0 1 1.083-.45c.397-.095.813-.103 1.387-.103a6.79 6.79 0 0 1 .019-.396 2.29 2.29 0 0 1 .222-.875 2.25 2.25 0 0 1 .984-.984 2.29 2.29 0 0 1 .875-.222c.28-.023.622-.023 1.017-.023Zm5.229 7h-2.024a1.925 1.925 0 0 0-2.382-1.697l-2.444.611v-1.414h8.5v.85c0 .432 0 .712-.018.924-.017.204-.045.28-.064.317a.75.75 0 0 1-.328.327c-.037.02-.112.047-.316.064-.212.017-.492.018-.924.018Zm1.645-4.5h-8.49c.002-.104.006-.194.013-.274.017-.204.045-.28.064-.316a.75.75 0 0 1 .328-.328c.037-.02.112-.047.316-.064.212-.017.492-.018.924-.018h5.2c.432 0 .712 0 .924.018.204.017.28.045.316.064a.75.75 0 0 1 .328.328c.02.037.047.112.064.316.007.08.01.17.013.274Z"
|
|
479
|
+
}));
|
|
480
|
+
};
|
|
481
|
+
SvgPaymentIcon.displayName = "PaymentIcon";
|
|
482
|
+
|
|
410
483
|
var SvgPlusIcon = function SvgPlusIcon(props) {
|
|
411
484
|
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
412
485
|
viewBox: "0 0 20 20"
|
|
@@ -416,6 +489,19 @@ var SvgPlusIcon = function SvgPlusIcon(props) {
|
|
|
416
489
|
};
|
|
417
490
|
SvgPlusIcon.displayName = "PlusIcon";
|
|
418
491
|
|
|
492
|
+
var SvgProductRemoveIcon = function SvgProductRemoveIcon(props) {
|
|
493
|
+
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
494
|
+
viewBox: "0 0 20 20"
|
|
495
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
496
|
+
d: "M8.575 4.649a3.75 3.75 0 0 1 2.7-1.149h1.975a3.25 3.25 0 0 1 3.25 3.25v2.371c0 .766-.311 1.498-.863 2.029a.75.75 0 1 1-1.04-1.08c.258-.249.403-.591.403-.949v-2.371a1.75 1.75 0 0 0-1.75-1.75h-1.974a2.25 2.25 0 0 0-1.62.69l-4.254 4.417a1.25 1.25 0 0 0 .016 1.75l2.898 2.898a1 1 0 0 0 1.4.014l.451-.434a.75.75 0 1 1 1.04 1.08l-.45.434a2.5 2.5 0 0 1-3.502-.033l-2.898-2.898a2.75 2.75 0 0 1-.036-3.852l4.254-4.417Z"
|
|
497
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
498
|
+
d: "M14 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"
|
|
499
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
500
|
+
d: "M12.25 12.25a.75.75 0 0 0 0 1.5h4a.75.75 0 0 0 0-1.5h-4Z"
|
|
501
|
+
}));
|
|
502
|
+
};
|
|
503
|
+
SvgProductRemoveIcon.displayName = "ProductRemoveIcon";
|
|
504
|
+
|
|
419
505
|
var SvgSearchIcon = function SvgSearchIcon(props) {
|
|
420
506
|
return /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
421
507
|
viewBox: "0 0 20 20"
|
|
@@ -757,6 +843,25 @@ const toCapitalize = (string) => {
|
|
|
757
843
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
758
844
|
};
|
|
759
845
|
|
|
846
|
+
function findLastIndex(array, predicate, thisArg) {
|
|
847
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
848
|
+
if (predicate.call(thisArg, array[i], i, array)) {
|
|
849
|
+
return i;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return -1;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
const isBrowser$1 = () => {
|
|
856
|
+
return typeof window !== 'undefined';
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
const formatDateBy = (format, date) => {
|
|
860
|
+
if (!date)
|
|
861
|
+
date = new Date();
|
|
862
|
+
return dayjsTz(date).format(format) ?? '-';
|
|
863
|
+
};
|
|
864
|
+
|
|
760
865
|
const GClickable = ({ children, fullWidth = false, cursor = 'pointer', onClick, onMouseEnter, onMouseLeave, }) => {
|
|
761
866
|
return (jsx("div", { role: "button", tabIndex: 0, className: cls({
|
|
762
867
|
'w-full': fullWidth,
|
|
@@ -1831,15 +1936,25 @@ const getPriceByCurrency = (price, currency = DEFAULT_CURRENCY_ANALYTIC, options
|
|
|
1831
1936
|
// Support legacy 3rd arg as locale string
|
|
1832
1937
|
const opts = typeof options === 'string' ? { locale: options } : options;
|
|
1833
1938
|
const locale = opts?.locale ?? 'en-US';
|
|
1834
|
-
//
|
|
1835
|
-
const
|
|
1939
|
+
// Currency's natural minimum (USD → 2, JPY/KRW/VND → 0); used as the floor for scaled tiers.
|
|
1940
|
+
const currencyMinDigits = new Intl.NumberFormat(locale, { style: 'currency', currency }).resolvedOptions().minimumFractionDigits ?? 0;
|
|
1941
|
+
// For scaled tiers, allow extra precision but never force decimals on zero-decimal currencies.
|
|
1942
|
+
const formatCurrency = (value, maxDigits) => new Intl.NumberFormat(locale, {
|
|
1943
|
+
style: 'currency',
|
|
1944
|
+
currency,
|
|
1945
|
+
...(maxDigits != null && {
|
|
1946
|
+
minimumFractionDigits: Math.min(currencyMinDigits, maxDigits),
|
|
1947
|
+
maximumFractionDigits: maxDigits,
|
|
1948
|
+
}),
|
|
1949
|
+
}).format(value);
|
|
1836
1950
|
const magnitude = Math.abs(price);
|
|
1837
1951
|
if (magnitude >= 1_000_000_000)
|
|
1838
|
-
return `${formatCurrency(price / 1_000_000_000)}B`;
|
|
1952
|
+
return `${formatCurrency(price / 1_000_000_000, 2)}B`;
|
|
1839
1953
|
if (magnitude >= 1_000_000)
|
|
1840
|
-
return `${formatCurrency(price / 1_000_000)}M`;
|
|
1954
|
+
return `${formatCurrency(price / 1_000_000, 2)}M`;
|
|
1841
1955
|
if (opts?.compact && magnitude >= 1_000)
|
|
1842
|
-
return `${formatCurrency(price / 1_000)}K`;
|
|
1956
|
+
return `${formatCurrency(price / 1_000, 1)}K`;
|
|
1957
|
+
// Let Intl pick fraction digits per currency (e.g. JPY/KRW have 0) instead of hardcoding.
|
|
1843
1958
|
return formatCurrency(price);
|
|
1844
1959
|
};
|
|
1845
1960
|
|
|
@@ -2254,6 +2369,18 @@ const useWindowSize = () => {
|
|
|
2254
2369
|
return { windowSize, windowWidth, isMobileTabletView, isMobileView };
|
|
2255
2370
|
};
|
|
2256
2371
|
|
|
2372
|
+
const usePreventBodyScroll = ({ enable }) => {
|
|
2373
|
+
useEffect(() => {
|
|
2374
|
+
if (!enable || !isBrowser$1())
|
|
2375
|
+
return;
|
|
2376
|
+
// Prevent layout shift from scrollbar removal
|
|
2377
|
+
document.body.style.overflowY = 'hidden';
|
|
2378
|
+
return () => {
|
|
2379
|
+
document.body.style.overflowY = 'unset';
|
|
2380
|
+
};
|
|
2381
|
+
}, [enable]);
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2257
2384
|
// This default value is used in our tests so that consumers of Polaris Viz don't need to mock or fire a ResizeObserver event
|
|
2258
2385
|
const defaultEntry = process.env.NODE_ENV === 'test' ? { contentRect: { width: 500, height: 500 } } : null;
|
|
2259
2386
|
function resizeObserver(callback) {
|
|
@@ -2462,6 +2589,32 @@ const GMockDataTooltip = ({ isMockData, content, children, ...props }) => {
|
|
|
2462
2589
|
return (jsx(GTooltip, { isEnabled: isMockData, content: content ?? t('This is just a demo experiment. Create a real one to view order listing.'), dismissOnMouseOut: true, ...props, children: children }));
|
|
2463
2590
|
};
|
|
2464
2591
|
|
|
2592
|
+
const GDotInline = ({ tone }) => {
|
|
2593
|
+
const textColor = getTextColorByTone();
|
|
2594
|
+
return jsx("span", { className: textColor, children: "\u2022" });
|
|
2595
|
+
function getTextColorByTone() {
|
|
2596
|
+
switch (tone) {
|
|
2597
|
+
case 'inherit':
|
|
2598
|
+
return 'text-inherit';
|
|
2599
|
+
case 'disabled':
|
|
2600
|
+
return 'text-[#B5B5B5]';
|
|
2601
|
+
default:
|
|
2602
|
+
return 'text-inherit';
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
};
|
|
2606
|
+
|
|
2607
|
+
const GSpinner = (props) => {
|
|
2608
|
+
return (jsx("div", { className: cls('Polaris-GSpinner', props.tone ? `Polaris-GSpinner--${props.tone}` : undefined), children: jsx(Spinner, { ...props }) }));
|
|
2609
|
+
};
|
|
2610
|
+
|
|
2611
|
+
const GModal = ({ children, primaryAction, secondaryActions, ...props }) => {
|
|
2612
|
+
const { isMobileView } = useWindowSize();
|
|
2613
|
+
const resolvedSecondaryActions = secondaryActions ?? [];
|
|
2614
|
+
const showMobileFooter = isMobileView && (primaryAction || resolvedSecondaryActions.length > 0);
|
|
2615
|
+
return (jsxs(Modal, { ...props, size: isMobileView ? 'small' : props.size, primaryAction: showMobileFooter ? undefined : primaryAction, secondaryActions: showMobileFooter ? undefined : secondaryActions, children: [children, showMobileFooter && (jsx(Box, { padding: "400", borderBlockStartWidth: "025", borderColor: "border-secondary", children: jsxs(BlockStack, { gap: "200", children: [jsx(Button, { ...primaryAction, onClick: primaryAction?.onAction, variant: "primary", fullWidth: true, children: primaryAction?.content ?? 'Save' }), resolvedSecondaryActions.map((action, index) => (createElement(Button, { ...action, key: index, fullWidth: true, onClick: action.onAction }, action.content)))] }) }))] }));
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2465
2618
|
const GChartSkeleton = () => {
|
|
2466
2619
|
return jsx(GSkeletonDisplayText, { height: "188px" });
|
|
2467
2620
|
};
|
|
@@ -23978,7 +24131,7 @@ const OrderIdCell = ({ value, isMockData }) => {
|
|
|
23978
24131
|
|
|
23979
24132
|
const DateCell = ({ value, isMergedWithPrev }) => (jsx(Text, { as: "span", variant: "bodySm", children: isMergedWithPrev ? '' : value }));
|
|
23980
24133
|
|
|
23981
|
-
const CheckoutStartedDetail = ({ lineItems = [], activatorWrapperProps }) => {
|
|
24134
|
+
const CheckoutStartedDetail$1 = ({ lineItems = [], activatorWrapperProps }) => {
|
|
23982
24135
|
const { t } = useTranslation();
|
|
23983
24136
|
const [active, setActive] = useState(false);
|
|
23984
24137
|
const toggleActive = useCallback(() => setActive((active) => !active), []);
|
|
@@ -24011,7 +24164,7 @@ const ItemsCell = ({ value }) => {
|
|
|
24011
24164
|
return t('{{itemQuantity}} item', { itemQuantity });
|
|
24012
24165
|
return t('{{itemQuantity}} items', { itemQuantity });
|
|
24013
24166
|
};
|
|
24014
|
-
return (jsx("div", { onMouseEnter: setTrue, onMouseLeave: setFalse, children: jsxs(InlineStack, { gap: "200", blockAlign: "center", children: [jsx(Text, { as: "span", variant: "bodyMd", tone: "subdued", children: getItemText() }), jsx(CheckoutStartedDetail, { lineItems: lineItems, activatorWrapperProps: {
|
|
24167
|
+
return (jsx("div", { onMouseEnter: setTrue, onMouseLeave: setFalse, children: jsxs(InlineStack, { gap: "200", blockAlign: "center", children: [jsx(Text, { as: "span", variant: "bodyMd", tone: "subdued", children: getItemText() }), jsx(CheckoutStartedDetail$1, { lineItems: lineItems, activatorWrapperProps: {
|
|
24015
24168
|
paddingBlockStart: '100',
|
|
24016
24169
|
opacity: itemHovering ? '1' : '0',
|
|
24017
24170
|
} })] }) }));
|
|
@@ -24344,6 +24497,439 @@ var EJourneyEvent;
|
|
|
24344
24497
|
EJourneyEvent["SEARCH_SUBMITTED"] = "SEARCH_SUBMITTED";
|
|
24345
24498
|
})(EJourneyEvent || (EJourneyEvent = {}));
|
|
24346
24499
|
|
|
24500
|
+
const useGModalOrderJourney = () => {
|
|
24501
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
24502
|
+
const [initialValues, setInitialValues] = useState(null);
|
|
24503
|
+
const handleOpenModalOrderJourney = useCallback((data) => {
|
|
24504
|
+
setInitialValues(data);
|
|
24505
|
+
setIsOpen(true);
|
|
24506
|
+
}, []);
|
|
24507
|
+
const handleCloseModalOrderJourney = useCallback(() => {
|
|
24508
|
+
setIsOpen(false);
|
|
24509
|
+
setInitialValues(null);
|
|
24510
|
+
}, []);
|
|
24511
|
+
return {
|
|
24512
|
+
isOpen,
|
|
24513
|
+
initialValues,
|
|
24514
|
+
handleOpenModalOrderJourney,
|
|
24515
|
+
handleCloseModalOrderJourney,
|
|
24516
|
+
};
|
|
24517
|
+
};
|
|
24518
|
+
|
|
24519
|
+
const OrderJourneyContext = createContext(undefined);
|
|
24520
|
+
const OrderJourneyProvider = OrderJourneyContext.Provider;
|
|
24521
|
+
const useOrderJourneyContext = () => {
|
|
24522
|
+
const context = useContext(OrderJourneyContext);
|
|
24523
|
+
if (!context)
|
|
24524
|
+
throw new Error('useOrderJourneyContext must be used within OrderJourneyProvider');
|
|
24525
|
+
return context;
|
|
24526
|
+
};
|
|
24527
|
+
|
|
24528
|
+
const EventMarkerIcon = ({ icon, tone = 'base', hasPadding = true }) => {
|
|
24529
|
+
const wrapperBackground = getWrapperBackground();
|
|
24530
|
+
const iconSource = isIconSource(icon) ? jsx(Icon, { source: icon, tone: tone }) : icon;
|
|
24531
|
+
return (jsx(Box, { padding: hasPadding ? '100' : '0', background: wrapperBackground, borderRadius: "full", children: iconSource }));
|
|
24532
|
+
function getWrapperBackground() {
|
|
24533
|
+
switch (tone) {
|
|
24534
|
+
case 'success':
|
|
24535
|
+
return 'bg-surface-success';
|
|
24536
|
+
default:
|
|
24537
|
+
return 'bg-surface-secondary';
|
|
24538
|
+
}
|
|
24539
|
+
}
|
|
24540
|
+
function isIconSource(x) {
|
|
24541
|
+
return typeof x === 'string' || (typeof x === 'object' && x.body) || typeof x === 'function';
|
|
24542
|
+
}
|
|
24543
|
+
};
|
|
24544
|
+
|
|
24545
|
+
const JourneyDetail = ({ title, children }) => {
|
|
24546
|
+
return (jsx(Box, { padding: "300", overflowX: "hidden", children: jsxs(BlockStack, { gap: "050", children: [typeof title === 'string' ? (jsx(Text, { as: "span", variant: "bodyMd", fontWeight: "medium", children: title })) : (title), children] }) }));
|
|
24547
|
+
};
|
|
24548
|
+
|
|
24549
|
+
var JourneyTimeFormat;
|
|
24550
|
+
(function (JourneyTimeFormat) {
|
|
24551
|
+
JourneyTimeFormat["HH_MM_SS"] = "HH:mm:ss";
|
|
24552
|
+
})(JourneyTimeFormat || (JourneyTimeFormat = {}));
|
|
24553
|
+
const JourneyTime = ({ time, format = JourneyTimeFormat.HH_MM_SS }) => {
|
|
24554
|
+
const formattedTime = formatDateBy(format, time);
|
|
24555
|
+
const width = getWidthByFormat();
|
|
24556
|
+
return (jsx("div", { style: { minWidth: width, maxWidth: width }, children: jsx(Text, { as: "span", variant: "bodyXs", children: formattedTime }) }));
|
|
24557
|
+
function getWidthByFormat() {
|
|
24558
|
+
switch (format) {
|
|
24559
|
+
case JourneyTimeFormat.HH_MM_SS:
|
|
24560
|
+
return '48px';
|
|
24561
|
+
default:
|
|
24562
|
+
return '48px';
|
|
24563
|
+
}
|
|
24564
|
+
}
|
|
24565
|
+
};
|
|
24566
|
+
|
|
24567
|
+
const JourneyItem = ({ time, title, eventMarker, children }) => {
|
|
24568
|
+
return (jsx(Box, { paddingInlineStart: "600", children: jsxs(InlineStack, { blockAlign: "center", gap: "400", wrap: false, children: [jsx(JourneyTime, { time: time }), jsx(EventMarkerIcon, { ...eventMarker }), jsx(JourneyDetail, { title: title, children: children })] }) }));
|
|
24569
|
+
};
|
|
24570
|
+
|
|
24571
|
+
const QuantityWrapper = ({ quantity }) => {
|
|
24572
|
+
if (!quantity)
|
|
24573
|
+
return null;
|
|
24574
|
+
return (jsx(Box, { paddingBlock: "050", paddingInline: "200", borderRadius: "200", background: "bg-fill-secondary", minWidth: "24px", children: jsx(Text, { as: "span", variant: "bodySm", fontWeight: "medium", tone: "subdued", alignment: "center", children: quantity }) }));
|
|
24575
|
+
};
|
|
24576
|
+
|
|
24577
|
+
const CheckoutStarted = ({ event }) => {
|
|
24578
|
+
const { t } = useTranslation();
|
|
24579
|
+
return (jsx(JourneyItem, { time: event.date, title: t('Started checkout'), eventMarker: { icon: SvgPaymentIcon }, children: jsx(CheckoutItems, { lineItems: event.lineItems ?? [] }) }));
|
|
24580
|
+
};
|
|
24581
|
+
|
|
24582
|
+
const CheckoutStartedDetail = ({ lineItems = [], activatorWrapperProps }) => {
|
|
24583
|
+
const { t } = useTranslation();
|
|
24584
|
+
const [active, setActive] = useState(false);
|
|
24585
|
+
const toggleActive = useCallback(() => setActive((active) => !active), []);
|
|
24586
|
+
if (!lineItems || lineItems.length === 0) {
|
|
24587
|
+
return null;
|
|
24588
|
+
}
|
|
24589
|
+
return (jsx(Popover, { active: active, activator: jsx(Box, { ...activatorWrapperProps, children: jsx(Button, { variant: "tertiary", icon: active ? SvgChevronUpIcon : SvgChevronDownIcon, onClick: toggleActive }) }), onClose: toggleActive, children: jsx(Box, { padding: "300", width: "340px", children: jsx(BlockStack, { gap: "300", children: lineItems.map((product, index, self) => {
|
|
24590
|
+
const isLast = index === self.length - 1;
|
|
24591
|
+
const boxProps = {
|
|
24592
|
+
borderBlockEndWidth: '025',
|
|
24593
|
+
borderColor: 'border-secondary',
|
|
24594
|
+
paddingBlockEnd: '300',
|
|
24595
|
+
};
|
|
24596
|
+
return (jsx(Box, { ...(!isLast && boxProps), children: jsxs(InlineStack, { gap: "300", wrap: false, children: [jsx("div", { className: "size-10", children: jsx(GThumbnail, { source: product.imageURL ?? '', alt: product.productTitle ?? '', size: "small" }) }), jsxs("div", { className: "flex flex-col gap-1 w-full", children: [jsxs(InlineStack, { gap: "200", align: "space-between", wrap: false, children: [jsx(Text, { as: "span", variant: "bodyMd", fontWeight: "medium", children: product.productTitle }), jsx("div", { className: "text-nowrap", children: jsx(Text, { as: "span", variant: "bodyMd", tone: "subdued", children: t('x {{quantity}}', { quantity: product.quantity }) }) })] }), product.title && (jsx("span", { children: jsx(Badge, { children: product.title }) }))] })] }) }, product.productID));
|
|
24597
|
+
}) }) }) }));
|
|
24598
|
+
};
|
|
24599
|
+
|
|
24600
|
+
const CheckoutItems = ({ lineItems }) => {
|
|
24601
|
+
const { t } = useTranslation();
|
|
24602
|
+
const cartQuantity = lineItems.reduce((acc, curr) => acc + (curr.quantity ?? 0), 0);
|
|
24603
|
+
return (jsxs(InlineStack, { gap: "100", children: [jsx(QuantityWrapper, { quantity: cartQuantity }), jsx(Text, { as: "span", variant: "bodyMd", tone: "subdued", children: cartQuantity > 1 ? t('items') : t('item') }), jsx(CheckoutStartedDetail, { lineItems: lineItems })] }));
|
|
24604
|
+
};
|
|
24605
|
+
|
|
24606
|
+
const CheckoutCompleted = ({ event }) => {
|
|
24607
|
+
const { t } = useTranslation();
|
|
24608
|
+
const { orderId } = useOrderJourneyContext();
|
|
24609
|
+
const isCheckoutCompletedEventOfCurrentOrder = event.orderID === orderId;
|
|
24610
|
+
const titleMarkup = renderTitleMarkup();
|
|
24611
|
+
return (jsx(JourneyItem, { time: event.date, title: titleMarkup, eventMarker: {
|
|
24612
|
+
icon: SvgCheckIcon,
|
|
24613
|
+
tone: isCheckoutCompletedEventOfCurrentOrder ? 'success' : 'base',
|
|
24614
|
+
}, children: jsx(CheckoutItems, { lineItems: event.lineItems ?? [] }) }));
|
|
24615
|
+
function renderTitleMarkup() {
|
|
24616
|
+
return (jsxs(InlineStack, { gap: "200", blockAlign: "center", wrap: false, children: [jsx(Text, { as: "span", variant: "bodyMd", fontWeight: "medium", children: t('Completed checkout') }), event.orderID && (jsxs(Fragment, { children: [jsx(GDotInline, { tone: "disabled" }), jsxs(InlineStack, { gap: "025", blockAlign: "center", wrap: false, children: [jsx(Icon, { source: SvgOrderIcon, tone: "base" }), jsx(Text, { as: "span", variant: "bodySm", tone: "subdued", children: event.orderID })] })] }))] }));
|
|
24617
|
+
}
|
|
24618
|
+
};
|
|
24619
|
+
|
|
24620
|
+
/**
|
|
24621
|
+
* Slices journey items based on the analytic metric mode.
|
|
24622
|
+
*
|
|
24623
|
+
* - FIRST_SESSION: Returns all items (no slicing)
|
|
24624
|
+
* - PAGE_ONLY: Slices from the LAST matching event (most recent relevant interaction)
|
|
24625
|
+
* - ALL_SESSION: Slices from the FIRST matching event (entire journey from first interaction)
|
|
24626
|
+
*/
|
|
24627
|
+
const sliceJourneyItems = ({ journeyItems, mode, source, filteredCampaignId, pageAnalytic, }) => {
|
|
24628
|
+
if (mode === EAnalyticMode.FIRST_SESSION)
|
|
24629
|
+
return journeyItems;
|
|
24630
|
+
const isCampaignVariant = ({ campaignGroupID = '', campaignID = '' }) => !isCampaignOfAnother({ campaignGroupID: campaignGroupID ?? '', campaignID: campaignID ?? '', filteredCampaignId });
|
|
24631
|
+
const isMatchingPage = ({ locationPath = '' }) => locationPath === pageAnalytic?.path;
|
|
24632
|
+
const sliceFromIndex = (index) => (index !== -1 ? journeyItems.slice(index) : journeyItems);
|
|
24633
|
+
const predicate = source === EReportSource.CAMPAIGN ? isCampaignVariant : isMatchingPage;
|
|
24634
|
+
// PAGE_ONLY: slice from LAST matching event (most recent relevant interaction)
|
|
24635
|
+
if (mode === EAnalyticMode.PAGE_ONLY) {
|
|
24636
|
+
return sliceFromIndex(findLastIndex(journeyItems, predicate));
|
|
24637
|
+
}
|
|
24638
|
+
// ALL_SESSION: slice from FIRST matching event (entire journey from first interaction)
|
|
24639
|
+
if (mode === EAnalyticMode.ALL_SESSION) {
|
|
24640
|
+
return sliceFromIndex(journeyItems.findIndex(predicate));
|
|
24641
|
+
}
|
|
24642
|
+
return journeyItems;
|
|
24643
|
+
};
|
|
24644
|
+
const getEventCampaignIdByType = ({ campaignGroupID, campaignID, }) => {
|
|
24645
|
+
return campaignGroupID !== '0' ? campaignGroupID : campaignID;
|
|
24646
|
+
};
|
|
24647
|
+
const isCampaignOfAnother = ({ campaignGroupID, campaignID, filteredCampaignId, }) => {
|
|
24648
|
+
const eventCampaignIdByType = getEventCampaignIdByType({ campaignGroupID, campaignID });
|
|
24649
|
+
const isEventOfAnotherCampaign = filteredCampaignId && eventCampaignIdByType !== filteredCampaignId;
|
|
24650
|
+
return isEventOfAnotherCampaign;
|
|
24651
|
+
};
|
|
24652
|
+
|
|
24653
|
+
const PageViewed = ({ event }) => {
|
|
24654
|
+
const { t } = useTranslation();
|
|
24655
|
+
const { date, locationPath, campaignGroupID = '', campaignID = '', filteredCampaignId, campaignName, campaignGroupName, campaignVariantType, } = event;
|
|
24656
|
+
const eventCampaignName = filteredCampaignId ? '' : campaignGroupName || campaignName;
|
|
24657
|
+
const isEventWithNoCampaign = !campaignVariantType;
|
|
24658
|
+
const eventCampaignIdByType = getEventCampaignIdByType({
|
|
24659
|
+
campaignGroupID: campaignGroupID ?? '',
|
|
24660
|
+
campaignID: campaignID ?? '',
|
|
24661
|
+
});
|
|
24662
|
+
const isEventOfAnotherCampaign = isCampaignOfAnother({
|
|
24663
|
+
campaignGroupID: campaignGroupID ?? '',
|
|
24664
|
+
campaignID: campaignID ?? '',
|
|
24665
|
+
filteredCampaignId,
|
|
24666
|
+
});
|
|
24667
|
+
const pageViewEventMarkerIcon = getPageViewEventMarkerIcon();
|
|
24668
|
+
const titleMarkup = renderTitleMarkup();
|
|
24669
|
+
const hasPadding = useMemo(() => {
|
|
24670
|
+
if (isEventWithNoCampaign)
|
|
24671
|
+
return true;
|
|
24672
|
+
if (!filteredCampaignId)
|
|
24673
|
+
return false;
|
|
24674
|
+
return eventCampaignIdByType !== filteredCampaignId;
|
|
24675
|
+
}, [filteredCampaignId, eventCampaignIdByType, isEventWithNoCampaign]);
|
|
24676
|
+
return (jsx(JourneyItem, { time: date, title: titleMarkup, eventMarker: { icon: pageViewEventMarkerIcon, hasPadding }, children: jsx(InlineStack, { gap: "200", wrap: false, blockAlign: "center", children: jsx("div", { className: "min-w-0 w-full", children: jsx(GTextTruncated, { as: "span", variant: "bodySm", tone: "subdued", children: locationPath ?? '' }) }) }) }));
|
|
24677
|
+
function getPageViewEventMarkerIcon() {
|
|
24678
|
+
if (isEventOfAnotherCampaign)
|
|
24679
|
+
return SvgCursorIcon;
|
|
24680
|
+
switch (campaignVariantType) {
|
|
24681
|
+
case IVariantType$1.VARIANT_A:
|
|
24682
|
+
return jsx(GVariantBadge, { variant: "A", size: "md", tone: "active" });
|
|
24683
|
+
case IVariantType$1.VARIANT_B:
|
|
24684
|
+
return jsx(GVariantBadge, { variant: "B", size: "md" });
|
|
24685
|
+
default:
|
|
24686
|
+
return SvgCursorIcon;
|
|
24687
|
+
}
|
|
24688
|
+
}
|
|
24689
|
+
function renderTitleMarkup() {
|
|
24690
|
+
return (jsxs(InlineStack, { gap: "200", blockAlign: "center", wrap: false, children: [jsx("span", { className: "text-nowrap", children: jsx(Text, { as: "span", variant: "bodyMd", fontWeight: "medium", breakWord: false, children: t('Visited page') }) }), eventCampaignName && !isEventOfAnotherCampaign && (jsxs(Fragment, { children: [jsx(GDotInline, { tone: "disabled" }), jsx("div", { className: "min-w-0 w-full", children: jsx(GI18NText, { as: "span", variant: "bodySm", tone: "subdued", truncate: true, transformers: {
|
|
24691
|
+
1: (name) => (jsx(Text, { as: "span", variant: "bodySm", tone: "subdued", fontWeight: "medium", children: name })),
|
|
24692
|
+
}, children: t('Experiment: [1]{{name}}[]', { name: eventCampaignName }) }) })] }))] }));
|
|
24693
|
+
}
|
|
24694
|
+
};
|
|
24695
|
+
|
|
24696
|
+
const ProductAddedToCart = ({ event }) => {
|
|
24697
|
+
const { t } = useTranslation();
|
|
24698
|
+
return (jsx(JourneyItem, { time: event.date, title: t('Added product to cart'), eventMarker: { icon: SvgCartIcon }, children: jsx(CheckoutItems, { lineItems: event.lineItems ?? [] }) }));
|
|
24699
|
+
};
|
|
24700
|
+
|
|
24701
|
+
const ProductRemovedFromCart = ({ event }) => {
|
|
24702
|
+
const { t } = useTranslation();
|
|
24703
|
+
return (jsx(JourneyItem, { time: event.date, title: t('Remove product from cart'), eventMarker: { icon: SvgProductRemoveIcon }, children: jsx(CheckoutItems, { lineItems: event.lineItems ?? [] }) }));
|
|
24704
|
+
};
|
|
24705
|
+
|
|
24706
|
+
const DefaultEventComponent = () => null;
|
|
24707
|
+
const JOURNEY_EVENT_COMPONENTS_MAP = {
|
|
24708
|
+
[EJourneyEvent.ADDED_TO_CART]: DefaultEventComponent,
|
|
24709
|
+
[EJourneyEvent.CHECKOUT_ADDRESS_INFO_SUBMITTED]: DefaultEventComponent,
|
|
24710
|
+
[EJourneyEvent.CHECKOUT_COMPLETED]: CheckoutCompleted,
|
|
24711
|
+
[EJourneyEvent.CHECKOUT_CONTACT_INFO_SUBMITTED]: DefaultEventComponent,
|
|
24712
|
+
[EJourneyEvent.CHECKOUT_SHIPPING_INFO_SUBMITTED]: DefaultEventComponent,
|
|
24713
|
+
[EJourneyEvent.CHECKOUT_STARTED]: CheckoutStarted,
|
|
24714
|
+
[EJourneyEvent.COLLECTION_VIEWED]: DefaultEventComponent,
|
|
24715
|
+
[EJourneyEvent.ORDER]: DefaultEventComponent,
|
|
24716
|
+
[EJourneyEvent.PAGE_VIEWED]: PageViewed,
|
|
24717
|
+
[EJourneyEvent.PAYMENT_INFO_SUBMITTED]: DefaultEventComponent,
|
|
24718
|
+
[EJourneyEvent.PRODUCT_ADDED_TO_CART]: ProductAddedToCart,
|
|
24719
|
+
[EJourneyEvent.PRODUCT_REMOVED_FROM_CART]: ProductRemovedFromCart,
|
|
24720
|
+
[EJourneyEvent.PRODUCT_VIEWED]: DefaultEventComponent,
|
|
24721
|
+
[EJourneyEvent.SEARCH_SUBMITTED]: DefaultEventComponent,
|
|
24722
|
+
};
|
|
24723
|
+
|
|
24724
|
+
const JourneyDateBadge = ({ content }) => {
|
|
24725
|
+
return (jsx(Box, { background: "bg-surface-secondary", paddingBlock: "100", paddingInline: "200", borderRadius: "200", minWidth: "110px", children: jsx(GBlockCenter, { children: jsx(Text, { as: "p", variant: "bodyMd", fontWeight: "medium", children: content }) }) }));
|
|
24726
|
+
};
|
|
24727
|
+
|
|
24728
|
+
const BOX_BACKGROUND = {
|
|
24729
|
+
default: 'bg-surface-secondary-active',
|
|
24730
|
+
onHover: 'bg-surface-secondary',
|
|
24731
|
+
};
|
|
24732
|
+
const JourneyLoadMore = ({ isFetching, onLoadMode }) => {
|
|
24733
|
+
const [boxBackground, setBoxBackground] = useState(BOX_BACKGROUND.default);
|
|
24734
|
+
const { t } = useTranslation();
|
|
24735
|
+
if (isFetching) {
|
|
24736
|
+
return (jsx(Box, { paddingBlock: "100", paddingInline: "300", background: BOX_BACKGROUND.onHover, borderRadius: "200", children: jsx(GSpinner, { size: "small" }) }));
|
|
24737
|
+
}
|
|
24738
|
+
return (jsx("div", { className: "cursor-pointer", onMouseEnter: () => setBoxBackground(BOX_BACKGROUND.onHover), onMouseLeave: () => setBoxBackground(BOX_BACKGROUND.default), onClick: onLoadMode, children: jsx(Box, { paddingBlock: "100", paddingInline: "200", background: boxBackground, borderRadius: "200", children: jsxs(InlineStack, { gap: "050", wrap: false, blockAlign: "center", children: [jsx(Icon, { source: SvgChevronUpIcon }), jsx(Text, { as: "p", variant: "bodySm", fontWeight: "medium", children: t('More steps') })] }) }) }));
|
|
24739
|
+
};
|
|
24740
|
+
|
|
24741
|
+
const JourneyIdBadge = ({ id, type = 'order' }) => {
|
|
24742
|
+
const { t } = useTranslation();
|
|
24743
|
+
const idContent = getIdContent();
|
|
24744
|
+
const { onViewOrderDetails } = useOrderJourneyContext();
|
|
24745
|
+
return (jsx(GTooltip, { content: t('View order details'), children: jsx("div", { className: "cursor-pointer", onClick: () => onViewOrderDetails?.(id), children: jsx(Box, { background: "bg-surface-secondary-active", paddingBlock: "100", paddingInline: "200", borderRadius: "200", children: jsxs(InlineStack, { gap: "100", blockAlign: "center", children: [jsx(GI18NText, { as: "p", variant: "bodyMd", fontWeight: "medium", tone: "subdued", transformers: {
|
|
24746
|
+
1: (text) => {
|
|
24747
|
+
return (jsx(Text, { as: "span", tone: "base", children: text }));
|
|
24748
|
+
},
|
|
24749
|
+
}, children: idContent }), jsx(Icon, { source: SvgExternalSmallIcon })] }) }) }) }));
|
|
24750
|
+
function getIdContent() {
|
|
24751
|
+
switch (type) {
|
|
24752
|
+
case 'order':
|
|
24753
|
+
return t('Order ID: [1]{{id}}[]', { id });
|
|
24754
|
+
default:
|
|
24755
|
+
return id;
|
|
24756
|
+
}
|
|
24757
|
+
}
|
|
24758
|
+
};
|
|
24759
|
+
|
|
24760
|
+
const JourneyTitle = ({ content, id, hasMoreSteps, isFetching = false, onLoadMode }) => {
|
|
24761
|
+
const isStickyHeader = !!id;
|
|
24762
|
+
const isShowLoadMore = isStickyHeader && hasMoreSteps && onLoadMode;
|
|
24763
|
+
return (jsxs(Box, { paddingBlock: "300", paddingInline: "400", position: "relative", children: [jsxs(InlineStack, { align: "space-between", gap: "100", children: [jsxs(InlineStack, { gap: "400", children: [jsx(JourneyDateBadge, { content: content }), id && jsx(JourneyIdBadge, { id: id })] }), isShowLoadMore && jsx(JourneyLoadMore, { isFetching: isFetching, onLoadMode: onLoadMode })] }), jsx(JourneyTitleLine, {})] }));
|
|
24764
|
+
};
|
|
24765
|
+
const JourneyTitleLine = () => {
|
|
24766
|
+
return jsx("div", { className: "absolute top-[50%] right-0 left-0 translate-y-[-50%] h-[1px] bg-border -z-[1]" });
|
|
24767
|
+
};
|
|
24768
|
+
|
|
24769
|
+
const JourneyGroup = ({ eventsByDate, sectionRefs }) => {
|
|
24770
|
+
return eventsByDate.map(({ dateKey, date, events }, index) => {
|
|
24771
|
+
const isLatestDate = index === 0;
|
|
24772
|
+
return (jsxs("div", { ref: (el) => {
|
|
24773
|
+
if (el)
|
|
24774
|
+
sectionRefs.current.set(dateKey, el);
|
|
24775
|
+
}, className: "relative", children: [!isLatestDate && jsx(JourneyTitle, { content: date }), events.map((event, eventIndex) => (jsx(JourneyEventRenderer, { event: event }, `${event.eventType}-${event.date}-${eventIndex}`))), jsx(JourneyTimeline, {})] }, dateKey));
|
|
24776
|
+
});
|
|
24777
|
+
};
|
|
24778
|
+
function JourneyEventRenderer({ event }) {
|
|
24779
|
+
const Component = JOURNEY_EVENT_COMPONENTS_MAP[event.eventType];
|
|
24780
|
+
if (!Component)
|
|
24781
|
+
return null;
|
|
24782
|
+
return jsx(Component, { event: event });
|
|
24783
|
+
}
|
|
24784
|
+
|
|
24785
|
+
const JourneyContainer = ({ orderId, eventsByDate, hasMoreSteps, isFetchingMoreSteps, onLoadMore, }) => {
|
|
24786
|
+
const firstEventsByDate = eventsByDate[0];
|
|
24787
|
+
const [currentDate, setCurrentDate] = useState(firstEventsByDate?.date || '');
|
|
24788
|
+
const [showShadow, setShowShadow] = useState(false);
|
|
24789
|
+
const scrollContainerRef = useRef(null);
|
|
24790
|
+
const sectionRefs = useRef(new Map());
|
|
24791
|
+
const scrollableRef = useRef(null);
|
|
24792
|
+
const prevIsFetchingRef = useRef(isFetchingMoreSteps);
|
|
24793
|
+
useEffect(() => {
|
|
24794
|
+
// Find the Polaris Scrollable container after mount
|
|
24795
|
+
if (!isBrowser$1() || !scrollContainerRef.current)
|
|
24796
|
+
return;
|
|
24797
|
+
let element = scrollContainerRef.current.parentElement;
|
|
24798
|
+
// Traverse up to find the scrollable container
|
|
24799
|
+
while (element) {
|
|
24800
|
+
const overflow = getComputedStyle(element).overflowY;
|
|
24801
|
+
if (overflow === 'auto' || overflow === 'scroll') {
|
|
24802
|
+
scrollableRef.current = element;
|
|
24803
|
+
break;
|
|
24804
|
+
}
|
|
24805
|
+
element = element.parentElement;
|
|
24806
|
+
}
|
|
24807
|
+
const scrollableElement = scrollableRef.current;
|
|
24808
|
+
if (!scrollableElement)
|
|
24809
|
+
return;
|
|
24810
|
+
const handleScroll = () => {
|
|
24811
|
+
const scrollTop = scrollableElement.scrollTop;
|
|
24812
|
+
setShowShadow(scrollTop > 10);
|
|
24813
|
+
// Find which date section is currently visible at the top
|
|
24814
|
+
let currentSection = firstEventsByDate;
|
|
24815
|
+
const headerOffset = 20; // Account for fixed header height
|
|
24816
|
+
const scrollableContainerRect = scrollableElement.getBoundingClientRect();
|
|
24817
|
+
for (const dateGroup of eventsByDate) {
|
|
24818
|
+
const element = sectionRefs.current.get(dateGroup.dateKey);
|
|
24819
|
+
if (!element)
|
|
24820
|
+
continue;
|
|
24821
|
+
const rect = element.getBoundingClientRect();
|
|
24822
|
+
// If section top is above or near the header position
|
|
24823
|
+
if (rect.top - scrollableContainerRect.top <= headerOffset) {
|
|
24824
|
+
currentSection = dateGroup;
|
|
24825
|
+
}
|
|
24826
|
+
}
|
|
24827
|
+
setCurrentDate(currentSection?.date || firstEventsByDate?.date || '');
|
|
24828
|
+
};
|
|
24829
|
+
scrollableElement.addEventListener('scroll', handleScroll);
|
|
24830
|
+
handleScroll(); // Initial call
|
|
24831
|
+
return () => scrollableElement.removeEventListener('scroll', handleScroll);
|
|
24832
|
+
}, [eventsByDate, firstEventsByDate]);
|
|
24833
|
+
const handleScrollToTop = () => {
|
|
24834
|
+
if (!scrollableRef.current)
|
|
24835
|
+
return;
|
|
24836
|
+
scrollableRef.current.scrollTo({ top: 0, behavior: 'smooth' });
|
|
24837
|
+
};
|
|
24838
|
+
// Auto-scroll to top when more steps are fetched
|
|
24839
|
+
useEffect(() => {
|
|
24840
|
+
const wasFetching = prevIsFetchingRef.current;
|
|
24841
|
+
const isNowDone = !isFetchingMoreSteps;
|
|
24842
|
+
// If we were fetching and now we're done, scroll to top
|
|
24843
|
+
if (wasFetching && isNowDone) {
|
|
24844
|
+
handleScrollToTop();
|
|
24845
|
+
}
|
|
24846
|
+
// Update ref for next render
|
|
24847
|
+
prevIsFetchingRef.current = isFetchingMoreSteps;
|
|
24848
|
+
}, [isFetchingMoreSteps]);
|
|
24849
|
+
return (jsxs(Scrollable, { scrollbarWidth: "thin", vertical: true, horizontal: true, className: "max-h-[100vh] md:max-h-[calc(100vh-120px)] pb-5", children: [jsx(GBox, { ariaShadow: showShadow ? 'shadow-outset-200' : undefined, position: "sticky", insetBlockStart: "0", zIndex: "10", background: "bg-fill", children: jsx(JourneyTitle, { content: currentDate, id: orderId, hasMoreSteps: hasMoreSteps, isFetching: isFetchingMoreSteps, onLoadMode: () => {
|
|
24850
|
+
onLoadMore();
|
|
24851
|
+
handleScrollToTop();
|
|
24852
|
+
} }) }), jsx("div", { ref: scrollContainerRef, className: "min-h-[100vh] md:min-h-[calc(100vh-192px)]", children: jsx(JourneyGroup, { eventsByDate: eventsByDate, sectionRefs: sectionRefs }) })] }));
|
|
24853
|
+
};
|
|
24854
|
+
|
|
24855
|
+
const JourneyTimeline = () => {
|
|
24856
|
+
const journeyItemPaddingInlineStart = 24;
|
|
24857
|
+
const journeyItemTimeWidth = 48;
|
|
24858
|
+
const journeyItemInlineGap = 16;
|
|
24859
|
+
const eventMarkerIconSize = 28;
|
|
24860
|
+
const journeyTimeLineWidth = 2;
|
|
24861
|
+
const timelineLeft = journeyItemPaddingInlineStart +
|
|
24862
|
+
journeyItemTimeWidth +
|
|
24863
|
+
journeyItemInlineGap +
|
|
24864
|
+
eventMarkerIconSize / 2 -
|
|
24865
|
+
journeyTimeLineWidth / 2;
|
|
24866
|
+
return jsx("div", { className: cls('w-[2px] absolute top-5 bottom-7 bg-[#F3F3F3] -z-[1]'), style: { left: timelineLeft } });
|
|
24867
|
+
};
|
|
24868
|
+
|
|
24869
|
+
const OrderJourneySkeleton = () => {
|
|
24870
|
+
return (jsxs(Scrollable, { scrollbarWidth: "thin", vertical: true, horizontal: true, className: "max-h-[100vh] md:max-h-[calc(100vh-120px)] pb-5", children: [jsx(GBox, { position: "sticky", insetBlockStart: "0", zIndex: "10", background: "bg-fill", children: jsxs(Box, { paddingBlock: "300", paddingInline: "400", position: "relative", children: [jsx(InlineStack, { align: "space-between", gap: "100", children: jsxs(InlineStack, { gap: "400", children: [jsx("div", { className: "bg-surface-secondary rounded-md px-3 py-1.5", children: jsx("div", { className: "w-24", children: jsx(SkeletonBodyText, { lines: 1 }) }) }), jsx("div", { className: "bg-surface-secondary rounded-md px-3 py-1.5", children: jsx("div", { className: "w-40", children: jsx(SkeletonBodyText, { lines: 1 }) }) })] }) }), jsx("div", { className: "absolute top-[50%] right-0 left-0 translate-y-[-50%] h-[1px] bg-border -z-[1]" })] }) }), jsxs("div", { className: "min-h-[100vh] md:min-h-[calc(100vh-120px)] relative mt-4", children: [jsx("div", { className: "w-[2px] absolute top-4 bottom-4 bg-[#F3F3F3] -z-[1]", style: { left: 110 } }), Array.from({ length: 8 }).map((_, index) => (jsx(JourneyEventSkeleton, { isLast: index === 7 }, index)))] })] }));
|
|
24871
|
+
};
|
|
24872
|
+
const JourneyEventSkeleton = ({ isLast }) => {
|
|
24873
|
+
return (jsx(Box, { paddingInlineStart: "600", children: jsxs(InlineStack, { blockAlign: "start", gap: "400", wrap: false, children: [jsx("div", { className: "w-12 pt-1", children: jsx(SkeletonBodyText, { lines: 1 }) }), jsx("div", { className: "shrink-0 mt-0.5", children: jsx("div", { className: "w-7 h-7 bg-border-secondary rounded-full animate-pulse" }) }), jsxs(Box, { paddingBlockEnd: "400", width: "100%", children: [jsx("div", { className: "mb-2", children: jsx(SkeletonDisplayText, { size: "small" }) }), !isLast ? (jsx("div", { className: "max-w-[70%]", children: jsx(SkeletonBodyText, { lines: Math.random() > 0.5 ? 1 : 2 }) })) : (jsx("div", { className: "max-w-[40%]", children: jsx(SkeletonBodyText, { lines: 1 }) }))] })] }) }));
|
|
24874
|
+
};
|
|
24875
|
+
|
|
24876
|
+
const GModalOrderJourney = ({ open, onClose, title, orderId, journeyItems, isLoading = false, hasNextPage = false, isFetchingNextPage = false, fetchNextPage, reportCampaign, pageAnalytic, mode, journeySource, onViewOrderDetails, }) => {
|
|
24877
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
24878
|
+
usePreventBodyScroll({ enable: open });
|
|
24879
|
+
const source = useMemo(() => {
|
|
24880
|
+
if (journeySource)
|
|
24881
|
+
return journeySource;
|
|
24882
|
+
if (reportCampaign)
|
|
24883
|
+
return EReportSource.CAMPAIGN;
|
|
24884
|
+
if (pageAnalytic)
|
|
24885
|
+
return EReportSource.PAGE;
|
|
24886
|
+
}, [reportCampaign, pageAnalytic, journeySource]);
|
|
24887
|
+
const filteredCampaignId = reportCampaign?.id;
|
|
24888
|
+
const slicedJourneyItems = useMemo(() => {
|
|
24889
|
+
if (!source)
|
|
24890
|
+
return journeyItems;
|
|
24891
|
+
return sliceJourneyItems({
|
|
24892
|
+
journeyItems,
|
|
24893
|
+
mode,
|
|
24894
|
+
source,
|
|
24895
|
+
pageAnalytic,
|
|
24896
|
+
filteredCampaignId,
|
|
24897
|
+
});
|
|
24898
|
+
}, [journeyItems, mode, source, pageAnalytic, filteredCampaignId]);
|
|
24899
|
+
const isSliced = slicedJourneyItems.length < journeyItems.length;
|
|
24900
|
+
const displayedItems = isExpanded ? journeyItems : slicedJourneyItems;
|
|
24901
|
+
const hasMoreSteps = (!isExpanded && isSliced) || hasNextPage;
|
|
24902
|
+
const handleLoadMore = useCallback(() => {
|
|
24903
|
+
if (!isExpanded && isSliced) {
|
|
24904
|
+
setIsExpanded(true);
|
|
24905
|
+
}
|
|
24906
|
+
else if (hasNextPage) {
|
|
24907
|
+
fetchNextPage?.();
|
|
24908
|
+
}
|
|
24909
|
+
}, [isExpanded, isSliced, hasNextPage, fetchNextPage]);
|
|
24910
|
+
const eventsByDate = useMemo(() => {
|
|
24911
|
+
const grouped = new Map();
|
|
24912
|
+
displayedItems?.forEach((journeyItem) => {
|
|
24913
|
+
const dateKey = formatDateBy('MMMM D', journeyItem.date);
|
|
24914
|
+
if (!grouped.has(dateKey))
|
|
24915
|
+
grouped.set(dateKey, []);
|
|
24916
|
+
grouped.get(dateKey)?.push(journeyItem);
|
|
24917
|
+
});
|
|
24918
|
+
return Array.from(grouped.entries()).map(([date, events]) => ({
|
|
24919
|
+
date,
|
|
24920
|
+
dateKey: date,
|
|
24921
|
+
events: events.map((event) => ({ ...event, filteredCampaignId })),
|
|
24922
|
+
}));
|
|
24923
|
+
}, [displayedItems, filteredCampaignId]);
|
|
24924
|
+
useEffect(() => {
|
|
24925
|
+
if (!open)
|
|
24926
|
+
setIsExpanded(false);
|
|
24927
|
+
}, [open]);
|
|
24928
|
+
if (!orderId)
|
|
24929
|
+
return null;
|
|
24930
|
+
return (jsx(GModal, { open: open, title: title, onClose: onClose, children: jsx(OrderJourneyProvider, { value: { orderId, onViewOrderDetails }, children: isLoading ? (jsx(OrderJourneySkeleton, {})) : (jsx(JourneyContainer, { orderId: orderId, eventsByDate: eventsByDate, hasMoreSteps: hasMoreSteps, isFetchingMoreSteps: isFetchingNextPage, onLoadMore: handleLoadMore })) }) }));
|
|
24931
|
+
};
|
|
24932
|
+
|
|
24347
24933
|
function isBrowser() {
|
|
24348
24934
|
return typeof window !== 'undefined';
|
|
24349
24935
|
}
|
|
@@ -24387,4 +24973,4 @@ const useStickyFilterBoxProps = ({ id }) => {
|
|
|
24387
24973
|
};
|
|
24388
24974
|
};
|
|
24389
24975
|
|
|
24390
|
-
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 };
|
|
24976
|
+
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, GModalOrderJourney, 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, OrderJourneyProvider, 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, useGModalOrderJourney, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, useOrderJourneyContext, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useTimezoneContext, useVersionDateTimeFilters };
|