@gfed-medusa/sf-lib-common 3.6.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/breadcrumbs/index.d.ts +2 -2
- package/dist/components/breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/cart-mismatch-banner/index.d.ts +2 -2
- package/dist/components/cart-mismatch-banner/index.d.ts.map +1 -1
- package/dist/components/delete-button/index.d.ts +2 -2
- package/dist/components/error-message/index.d.ts +2 -2
- package/dist/components/free-shipping-price-nudge/index.d.ts +2 -2
- package/dist/components/interactive-link/index.d.ts +2 -2
- package/dist/components/line-item-options/index.d.ts +2 -2
- package/dist/components/line-item-price/index.d.ts +2 -2
- package/dist/components/line-item-price/index.d.ts.map +1 -1
- package/dist/components/localized-client-link/index.d.ts +2 -2
- package/dist/components/localized-client-link/index.d.ts.map +1 -1
- package/dist/components/modal/index.d.ts +2 -2
- package/dist/components/preview-price/index.d.ts +2 -2
- package/dist/components/product-card/index.d.ts +2 -2
- package/dist/components/product-preview/index.d.ts +2 -2
- package/dist/components/product-preview/index.d.ts.map +1 -1
- package/dist/components/submit-button/index.d.ts +2 -2
- package/dist/lib/context/apollo-context.d.ts +2 -2
- package/dist/lib/context/apollo-context.d.ts.map +1 -1
- package/dist/lib/context/modal-context.d.ts +2 -2
- package/dist/lib/data/context.d.ts +2 -2
- package/dist/lib/data/contextual-banner.d.ts +15 -0
- package/dist/lib/data/contextual-banner.d.ts.map +1 -0
- package/dist/lib/data/contextual-banner.js +19 -0
- package/dist/lib/data/contextual-banner.js.map +1 -0
- package/dist/lib/gql/fragments/cart.d.ts +9 -9
- package/dist/lib/gql/fragments/cart.d.ts.map +1 -1
- package/dist/lib/gql/fragments/customer.d.ts +3 -3
- package/dist/lib/gql/fragments/customer.d.ts.map +1 -1
- package/dist/lib/gql/fragments/product.d.ts +8 -8
- package/dist/lib/gql/fragments/product.d.ts.map +1 -1
- package/dist/lib/gql/mutations/cart.d.ts +6 -6
- package/dist/lib/gql/queries/cart-summary.d.ts +2 -2
- package/dist/lib/gql/queries/cart.d.ts +2 -2
- package/dist/lib/gql/queries/collections.d.ts +3 -3
- package/dist/lib/gql/queries/contextual-banner.d.ts +7 -0
- package/dist/lib/gql/queries/contextual-banner.d.ts.map +1 -0
- package/dist/lib/gql/queries/contextual-banner.js +21 -0
- package/dist/lib/gql/queries/contextual-banner.js.map +1 -0
- package/dist/lib/gql/queries/customer.d.ts +2 -2
- package/dist/lib/gql/queries/footer.d.ts +3 -3
- package/dist/lib/gql/queries/home-banner.d.ts +2 -2
- package/dist/lib/gql/queries/order.d.ts +4 -4
- package/dist/lib/gql/queries/product.d.ts +2 -2
- package/dist/lib/gql/queries/regions.d.ts +3 -3
- package/dist/lib/gql/queries/shipping.d.ts +3 -3
- package/dist/lib/gql/queries/shipping.d.ts.map +1 -1
- package/dist/lib/hooks/use-apollo.d.ts +2 -2
- package/dist/lib/personalization/behavior-tracker.d.ts +15 -0
- package/dist/lib/personalization/behavior-tracker.d.ts.map +1 -0
- package/dist/lib/personalization/behavior-tracker.js +54 -0
- package/dist/lib/personalization/behavior-tracker.js.map +1 -0
- package/dist/lib/personalization/config.d.ts +31 -0
- package/dist/lib/personalization/config.d.ts.map +1 -0
- package/dist/lib/personalization/config.js +77 -0
- package/dist/lib/personalization/config.js.map +1 -0
- package/dist/lib/personalization/user-profile.d.ts +15 -0
- package/dist/lib/personalization/user-profile.d.ts.map +1 -0
- package/dist/lib/personalization/user-profile.js +47 -0
- package/dist/lib/personalization/user-profile.js.map +1 -0
- package/package.json +5 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/breadcrumbs/index.d.ts
|
|
4
4
|
declare const SEPARATOR_ICONS: Record<string, React.ComponentType<{
|
|
@@ -14,7 +14,7 @@ declare function Breadcrumbs({
|
|
|
14
14
|
iconClassName,
|
|
15
15
|
iconSize,
|
|
16
16
|
separatorIcon
|
|
17
|
-
}: BreadcrumbsProps):
|
|
17
|
+
}: BreadcrumbsProps): react_jsx_runtime13.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Breadcrumbs };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":[],"mappings":";;;cAiBM,iBAAiB,eAErB,KAAA,CAAM;;;AAyCW,CAAA,CAAA,CAAA;AA3CU,UAQnB,gBAAA,CAAgB;EA+BjB,aAAA,CAAW,EAAA,MAAA,OA9BW,eA8BX;EAClB,QAAA,CAAA,EAAA,MAAA;EACA,aAAA,CAAA,EAAA,MAAA;;iBAFO,WAAA,CAIN;EAAA,aAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAA,gBAAA,CAAA,EAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":[],"mappings":";;;cAiBM,iBAAiB,eAErB,KAAA,CAAM;;;AAyCW,CAAA,CAAA,CAAA;AA3CU,UAQnB,gBAAA,CAAgB;EA+BjB,aAAA,CAAW,EAAA,MAAA,OA9BW,eA8BX;EAClB,QAAA,CAAA,EAAA,MAAA;EACA,aAAA,CAAA,EAAA,MAAA;;iBAFO,WAAA,CAIN;EAAA,aAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAA,gBAAA,CAAA,EAAgB,mBAAA,CAAA,GAAA,CAAA,OAAhB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Cart, Customer } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/cart-mismatch-banner/index.d.ts
|
|
5
5
|
declare function CartMismatchBanner(props: {
|
|
6
6
|
customer: Customer;
|
|
7
7
|
cart: Cart;
|
|
8
|
-
}):
|
|
8
|
+
}): react_jsx_runtime15.JSX.Element | undefined;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CartMismatchBanner };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/cart-mismatch-banner/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAYS,kBAAA;YAAsC;EAAtC,IAAA,EAAsD,IAAtD;CAAsC,CAAA,EAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/cart-mismatch-banner/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAYS,kBAAA;YAAsC;EAAtC,IAAA,EAAsD,IAAtD;CAAsC,CAAA,EAAsB,mBAAA,CAAA,GAAA,CAAA,OAAA,GAAtB,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/delete-button/index.d.ts
|
|
4
4
|
declare const DeleteButton: ({
|
|
@@ -9,7 +9,7 @@ declare const DeleteButton: ({
|
|
|
9
9
|
id: string;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
|
-
}) =>
|
|
12
|
+
}) => react_jsx_runtime9.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { DeleteButton };
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/error-message/index.d.ts
|
|
4
4
|
declare const ErrorMessage: ({
|
|
@@ -7,7 +7,7 @@ declare const ErrorMessage: ({
|
|
|
7
7
|
}: {
|
|
8
8
|
error?: string | null;
|
|
9
9
|
"data-testid"?: string;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => react_jsx_runtime8.JSX.Element | null;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ErrorMessage };
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cart, ShippingOption } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/free-shipping-price-nudge/index.d.ts
|
|
5
5
|
declare function ShippingPriceNudge({
|
|
@@ -10,7 +10,7 @@ declare function ShippingPriceNudge({
|
|
|
10
10
|
variant?: 'popup' | 'inline';
|
|
11
11
|
cart: Cart;
|
|
12
12
|
shippingOptions: ShippingOption[];
|
|
13
|
-
}):
|
|
13
|
+
}): react_jsx_runtime0.JSX.Element | undefined;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { ShippingPriceNudge };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LocalizedClientLink } from "../localized-client-link/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/interactive-link/index.d.ts
|
|
5
5
|
type InteractiveLinkProps = React.ComponentPropsWithoutRef<typeof LocalizedClientLink> & {
|
|
@@ -14,7 +14,7 @@ declare const InteractiveLink: ({
|
|
|
14
14
|
textClassName,
|
|
15
15
|
iconClassName,
|
|
16
16
|
...props
|
|
17
|
-
}: InteractiveLinkProps) =>
|
|
17
|
+
}: InteractiveLinkProps) => react_jsx_runtime1.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { InteractiveLink };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Maybe, ProductVariant } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/line-item-options/index.d.ts
|
|
5
5
|
type LineItemOptionsProps = {
|
|
@@ -11,7 +11,7 @@ declare const LineItemOptions: ({
|
|
|
11
11
|
variant,
|
|
12
12
|
"data-testid": dataTestid,
|
|
13
13
|
"data-value": dataValue
|
|
14
|
-
}: LineItemOptionsProps) =>
|
|
14
|
+
}: LineItemOptionsProps) => react_jsx_runtime2.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { LineItemOptions };
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LineItem } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/line-item-price/index.d.ts
|
|
5
5
|
type LineItemPriceProps = {
|
|
@@ -11,7 +11,7 @@ declare const LineItemPrice: ({
|
|
|
11
11
|
item,
|
|
12
12
|
style,
|
|
13
13
|
currencyCode
|
|
14
|
-
}: LineItemPriceProps) =>
|
|
14
|
+
}: LineItemPriceProps) => react_jsx_runtime3.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { LineItemPrice };
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/line-item-price/index.tsx"],"sourcesContent":[],"mappings":";;;;KAMK,kBAAA;QACG;;EADH,YAAA,EAAA,MAAA;AACW,CAAA;cAKV,aAAiB,EAAA,CAAA;EAAA,IAAA;EAAA,KAAA;EAAA;AAAA,CAAA,EAIpB,kBAJoB,EAAA,GAIF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/line-item-price/index.tsx"],"sourcesContent":[],"mappings":";;;;KAMK,kBAAA;QACG;;EADH,YAAA,EAAA,MAAA;AACW,CAAA;cAKV,aAAiB,EAAA,CAAA;EAAA,IAAA;EAAA,KAAA;EAAA;AAAA,CAAA,EAIpB,kBAJoB,EAAA,GAIF,kBAAA,CAAA,GAAA,CAAA,OAJE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/localized-client-link/index.d.ts
|
|
5
5
|
type LocalizedClientLinkProps = DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & {
|
|
@@ -10,7 +10,7 @@ declare const LocalizedClientLink: ({
|
|
|
10
10
|
href,
|
|
11
11
|
locale,
|
|
12
12
|
...props
|
|
13
|
-
}: LocalizedClientLinkProps) =>
|
|
13
|
+
}: LocalizedClientLinkProps) => react_jsx_runtime4.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { LocalizedClientLink };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/localized-client-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAWK,wBAAA,GAA2B,kBAC9B,qBAAqB,oBACrB;;;AANa,cAWT,mBAPuB,EAAA,CAAA;EAAA,QAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,CAAA,EAY1B,wBAZ0B,EAAA,GAYF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/localized-client-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAWK,wBAAA,GAA2B,kBAC9B,qBAAqB,oBACrB;;;AANa,cAWT,mBAPuB,EAAA,CAAA;EAAA,QAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,CAAA,EAY1B,wBAZ0B,EAAA,GAYF,kBAAA,CAAA,GAAA,CAAA,OAZE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/modal/index.d.ts
|
|
5
5
|
type ModalProps = {
|
|
@@ -20,7 +20,7 @@ declare const Modal: {
|
|
|
20
20
|
children,
|
|
21
21
|
"data-testid": dataTestId,
|
|
22
22
|
"aria-label": ariaLabel
|
|
23
|
-
}: ModalProps):
|
|
23
|
+
}: ModalProps): react_jsx_runtime5.JSX.Element;
|
|
24
24
|
Title: React.FC<{
|
|
25
25
|
children: React.ReactNode;
|
|
26
26
|
}>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { VariantPrice } from "../../types/prices.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/preview-price/index.d.ts
|
|
5
5
|
declare function PreviewPrice({
|
|
6
6
|
price
|
|
7
7
|
}: {
|
|
8
8
|
price: VariantPrice;
|
|
9
|
-
}):
|
|
9
|
+
}): react_jsx_runtime6.JSX.Element | null;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { PreviewPrice };
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
4
|
|
|
@@ -59,7 +59,7 @@ declare function ProductCard({
|
|
|
59
59
|
variant,
|
|
60
60
|
size,
|
|
61
61
|
className
|
|
62
|
-
}: ProductCardProps):
|
|
62
|
+
}: ProductCardProps): react_jsx_runtime7.JSX.Element;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { ProductCard };
|
|
65
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Product } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/product-preview/index.d.ts
|
|
5
5
|
type ProductPreviewProduct = Pick<Product, 'id' | 'title' | 'handle' | 'thumbnail' | 'images' | 'variants'>;
|
|
@@ -14,7 +14,7 @@ declare function ProductPreview({
|
|
|
14
14
|
isFeatured,
|
|
15
15
|
imagePriority,
|
|
16
16
|
imageFetchPriority
|
|
17
|
-
}: ProductPreviewProps):
|
|
17
|
+
}: ProductPreviewProps): react_jsx_runtime0.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { ProductPreview, ProductPreviewProduct, ProductPreviewProps };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,qBAAA,GAAwB,KAClC;KAIU,mBAAA;WACD;EANC,UAAA,CAAA,EAAA,OAAA;EAKA,aAAA,CAAA,EAAA,OAAmB;EAOtB,kBAAc,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,KAAA;CACrB;iBADO,cAAA,CAEP;EAAA,OAAA;EAAA,UAAA;EAAA,aAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,qBAAA,GAAwB,KAClC;KAIU,mBAAA;WACD;EANC,UAAA,CAAA,EAAA,OAAA;EAKA,aAAA,CAAA,EAAA,OAAmB;EAOtB,kBAAc,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,KAAA;CACrB;iBADO,cAAA,CAEP;EAAA,OAAA;EAAA,UAAA;EAAA,aAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,kBAAA,CAAA,GAAA,CAAA,OAHpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/submit-button/index.d.ts
|
|
5
5
|
declare function SubmitButton({
|
|
@@ -14,7 +14,7 @@ declare function SubmitButton({
|
|
|
14
14
|
className?: string;
|
|
15
15
|
'data-testid'?: string;
|
|
16
16
|
isLoading?: boolean;
|
|
17
|
-
}):
|
|
17
|
+
}): react_jsx_runtime14.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SubmitButton };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/context/apollo-context.d.ts
|
|
5
5
|
declare function ApolloClientProvider({
|
|
6
6
|
children
|
|
7
|
-
}: PropsWithChildren):
|
|
7
|
+
}: PropsWithChildren): react_jsx_runtime10.JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ApolloClientProvider };
|
|
10
10
|
//# sourceMappingURL=apollo-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-context.d.ts","names":[],"sources":["../../../src/lib/context/apollo-context.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,oBAAA;;GAAmC,oBAAiB,
|
|
1
|
+
{"version":3,"file":"apollo-context.d.ts","names":[],"sources":["../../../src/lib/context/apollo-context.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,oBAAA;;GAAmC,oBAAiB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/context/modal-context.d.ts
|
|
5
5
|
interface ModalContext {
|
|
@@ -13,7 +13,7 @@ interface ModalProviderProps {
|
|
|
13
13
|
declare const ModalProvider: ({
|
|
14
14
|
children,
|
|
15
15
|
close
|
|
16
|
-
}: ModalProviderProps) =>
|
|
16
|
+
}: ModalProviderProps) => react_jsx_runtime11.JSX.Element;
|
|
17
17
|
declare const useModal: () => ModalContext;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { ModalProvider, useModal };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStorefrontActions } from "./client-actions.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/data/context.d.ts
|
|
6
6
|
interface StorefrontContext {
|
|
@@ -15,7 +15,7 @@ interface StorefrontProviderProps {
|
|
|
15
15
|
declare const StorefrontProvider: ({
|
|
16
16
|
children,
|
|
17
17
|
value
|
|
18
|
-
}: StorefrontProviderProps) =>
|
|
18
|
+
}: StorefrontProviderProps) => react_jsx_runtime12.JSX.Element;
|
|
19
19
|
declare const useStorefrontContext: () => StorefrontContext;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { StorefrontContext, StorefrontProvider, useStorefrontActions, useStorefrontContext };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/lib/data/contextual-banner.d.ts
|
|
2
|
+
interface ContextualBannerContent {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
ctaLabel: string;
|
|
6
|
+
ctaHref: string;
|
|
7
|
+
trigger: string;
|
|
8
|
+
minPrice?: number;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
priority: number;
|
|
11
|
+
}
|
|
12
|
+
declare function getAllContextualBanners(): Promise<ContextualBannerContent[]>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ContextualBannerContent, getAllContextualBanners };
|
|
15
|
+
//# sourceMappingURL=contextual-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextual-banner.d.ts","names":[],"sources":["../../../src/lib/data/contextual-banner.ts"],"sourcesContent":[],"mappings":";UAGiB,uBAAA;EAAA,KAAA,EAAA,MAAA;EAeK,WAAA,EAAA,MAAA;;;;;;;;iBAAA,uBAAA,CAAA,GAA2B,QAAQ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { graphqlFetch } from "../gql/apollo-client.js";
|
|
2
|
+
import { GET_CONTEXTUAL_BANNERS_QUERY } from "../gql/queries/contextual-banner.js";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/data/contextual-banner.ts
|
|
5
|
+
async function getAllContextualBanners() {
|
|
6
|
+
try {
|
|
7
|
+
return ((await graphqlFetch({
|
|
8
|
+
query: GET_CONTEXTUAL_BANNERS_QUERY,
|
|
9
|
+
variables: {}
|
|
10
|
+
}))?.contextualBanners ?? []).filter((b) => b.isActive);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.error("Error fetching contextual banners:", error);
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { getAllContextualBanners };
|
|
19
|
+
//# sourceMappingURL=contextual-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextual-banner.js","names":[],"sources":["../../../src/lib/data/contextual-banner.ts"],"sourcesContent":["import { graphqlFetch } from '@/lib/gql/apollo-client';\nimport { GET_CONTEXTUAL_BANNERS_QUERY } from '@/lib/gql/queries/contextual-banner';\n\nexport interface ContextualBannerContent {\n title: string;\n description: string;\n ctaLabel: string;\n ctaHref: string;\n trigger: string;\n minPrice?: number;\n isActive: boolean;\n priority: number;\n}\n\ntype ContextualBannersQueryResult = {\n contextualBanners: ContextualBannerContent[];\n};\n\nexport async function getAllContextualBanners(): Promise<ContextualBannerContent[]> {\n try {\n const data = await graphqlFetch<\n ContextualBannersQueryResult,\n Record<string, never>\n >({\n query: GET_CONTEXTUAL_BANNERS_QUERY,\n variables: {},\n });\n\n const banners = data?.contextualBanners ?? [];\n return banners.filter((b) => b.isActive);\n } catch (error) {\n console.error('Error fetching contextual banners:', error);\n return [];\n }\n}"],"mappings":";;;;AAkBA,eAAsB,0BAA8D;AAClF,KAAI;AAUF,WATa,MAAM,aAGjB;GACA,OAAO;GACP,WAAW,EAAE;GACd,CAAC,GAEoB,qBAAqB,EAAE,EAC9B,QAAQ,MAAM,EAAE,SAAS;UACjC,OAAO;AACd,UAAQ,MAAM,sCAAsC,MAAM;AAC1D,SAAO,EAAE"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client19 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/fragments/cart.d.ts
|
|
4
|
-
declare const LINE_ITEM_FRAGMENT:
|
|
5
|
-
declare const COUNTRY_FRAGMENT:
|
|
6
|
-
declare const REGION_FRAGMENT:
|
|
7
|
-
declare const SHIPPING_METHODS_FRAGMENT:
|
|
8
|
-
declare const PAYMENT_COLLECTION_FRAGMENT:
|
|
9
|
-
declare const ADDRESS_FRAGMENT:
|
|
10
|
-
declare const PROMOTION_FRAGMENT:
|
|
11
|
-
declare const CART_FRAGMENT:
|
|
4
|
+
declare const LINE_ITEM_FRAGMENT: _apollo_client19.DocumentNode;
|
|
5
|
+
declare const COUNTRY_FRAGMENT: _apollo_client19.DocumentNode;
|
|
6
|
+
declare const REGION_FRAGMENT: _apollo_client19.DocumentNode;
|
|
7
|
+
declare const SHIPPING_METHODS_FRAGMENT: _apollo_client19.DocumentNode;
|
|
8
|
+
declare const PAYMENT_COLLECTION_FRAGMENT: _apollo_client19.DocumentNode;
|
|
9
|
+
declare const ADDRESS_FRAGMENT: _apollo_client19.DocumentNode;
|
|
10
|
+
declare const PROMOTION_FRAGMENT: _apollo_client19.DocumentNode;
|
|
11
|
+
declare const CART_FRAGMENT: _apollo_client19.DocumentNode;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { ADDRESS_FRAGMENT, CART_FRAGMENT, COUNTRY_FRAGMENT, LINE_ITEM_FRAGMENT, PAYMENT_COLLECTION_FRAGMENT, PROMOTION_FRAGMENT, REGION_FRAGMENT, SHIPPING_METHODS_FRAGMENT };
|
|
14
14
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/cart.ts"],"sourcesContent":[],"mappings":";;;cAIa,oBAiBZ,
|
|
1
|
+
{"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/cart.ts"],"sourcesContent":[],"mappings":";;;cAIa,oBAiBZ,gBAAA,CAjB8B;cAmBlB,kBAOZ,gBAAA,CAP4B;cAShB,iBAWZ,gBAAA,CAX2B;AA5Bf,cAyCA,yBAxBZ,EAkCA,gBAAA,CAVqC,YAxBrC;AAEY,cAkCA,2BA3BZ,EA6CA,gBAAA,CAlBuC,YA3BvC;AAEY,cA6CA,gBAlCZ,EA4CA,gBAAA,CAV4B,YAlC5B;AAEY,cA4CA,kBAlCZ,EA4CA,gBAAA,CAV8B,YAlC9B;AAEY,cA4CA,aA1BZ,EAqEA,gBAAA,CA3CyB,YA5Cc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client27 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/fragments/customer.d.ts
|
|
4
|
-
declare const CUSTOMER_ADDRESS_FRAGMENT:
|
|
5
|
-
declare const CUSTOMER_FRAGMENT:
|
|
4
|
+
declare const CUSTOMER_ADDRESS_FRAGMENT: _apollo_client27.DocumentNode;
|
|
5
|
+
declare const CUSTOMER_FRAGMENT: _apollo_client27.DocumentNode;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CUSTOMER_ADDRESS_FRAGMENT, CUSTOMER_FRAGMENT };
|
|
8
8
|
//# sourceMappingURL=customer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/customer.ts"],"sourcesContent":[],"mappings":";;;cAEa,2BAkBZ,
|
|
1
|
+
{"version":3,"file":"customer.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/customer.ts"],"sourcesContent":[],"mappings":";;;cAEa,2BAkBZ,gBAAA,CAlBqC;cAoBzB,mBAeZ,gBAAA,CAf6B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client2 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/fragments/product.d.ts
|
|
4
|
-
declare const PRICE_FRAGMENT:
|
|
5
|
-
declare const PRODUCT_VARIANT_FRAGMENT:
|
|
6
|
-
declare const PRODUCT_CATEGORY_FRAGMENT:
|
|
7
|
-
declare const PRODUCT_COLLECTION_FRAGMENT:
|
|
8
|
-
declare const PRODUCT_IMAGE_FRAGMENT:
|
|
9
|
-
declare const COLLECTION_PRODUCTS_FRAGMENT:
|
|
10
|
-
declare const COLLECTION_PRODUCTS_HOME_FRAGMENT:
|
|
4
|
+
declare const PRICE_FRAGMENT: _apollo_client2.DocumentNode;
|
|
5
|
+
declare const PRODUCT_VARIANT_FRAGMENT: _apollo_client2.DocumentNode;
|
|
6
|
+
declare const PRODUCT_CATEGORY_FRAGMENT: _apollo_client2.DocumentNode;
|
|
7
|
+
declare const PRODUCT_COLLECTION_FRAGMENT: _apollo_client2.DocumentNode;
|
|
8
|
+
declare const PRODUCT_IMAGE_FRAGMENT: _apollo_client2.DocumentNode;
|
|
9
|
+
declare const COLLECTION_PRODUCTS_FRAGMENT: _apollo_client2.DocumentNode;
|
|
10
|
+
declare const COLLECTION_PRODUCTS_HOME_FRAGMENT: _apollo_client2.DocumentNode;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { COLLECTION_PRODUCTS_FRAGMENT, COLLECTION_PRODUCTS_HOME_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_VARIANT_FRAGMENT };
|
|
13
13
|
//# sourceMappingURL=product.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":[],"mappings":";;;cAEa,gBAMZ,
|
|
1
|
+
{"version":3,"file":"product.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":[],"mappings":";;;cAEa,gBAMZ,eAAA,CAN0B;cAQd,0BAqBZ,eAAA,CArBoC;cAuBxB,2BAOZ,eAAA,CAPqC;AA/BzB,cAwCA,2BAlCZ,EAwCA,eAAA,CANuC,YAlCvC;AAEY,cAwCA,sBAnBZ,EAwBA,eAAA,CALkC,YAnBlC;AAEY,cAwBA,4BAjBZ,EAwCA,eAAA,CAvBwC,YAjBxC;AAEY,cAwCA,iCAlCZ,EA4CA,eAAA,CAV6C,YAlC7C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client10 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/mutations/cart.d.ts
|
|
4
|
-
declare const CREATE_CART_MUTATION:
|
|
5
|
-
declare const CREATE_LINE_ITEM_MUTATION:
|
|
6
|
-
declare const UPDATE_CART_MUTATION:
|
|
7
|
-
declare const DELETE_LINE_ITEM_MUTATION:
|
|
8
|
-
declare const TRANSFER_CART_MUTATION:
|
|
4
|
+
declare const CREATE_CART_MUTATION: _apollo_client10.DocumentNode;
|
|
5
|
+
declare const CREATE_LINE_ITEM_MUTATION: _apollo_client10.DocumentNode;
|
|
6
|
+
declare const UPDATE_CART_MUTATION: _apollo_client10.DocumentNode;
|
|
7
|
+
declare const DELETE_LINE_ITEM_MUTATION: _apollo_client10.DocumentNode;
|
|
8
|
+
declare const TRANSFER_CART_MUTATION: _apollo_client10.DocumentNode;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CREATE_CART_MUTATION, CREATE_LINE_ITEM_MUTATION, DELETE_LINE_ITEM_MUTATION, TRANSFER_CART_MUTATION, UPDATE_CART_MUTATION };
|
|
11
11
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client15 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/cart-summary.d.ts
|
|
4
|
-
declare const GET_CART_ITEM_COUNT_QUERY:
|
|
4
|
+
declare const GET_CART_ITEM_COUNT_QUERY: _apollo_client15.DocumentNode;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { GET_CART_ITEM_COUNT_QUERY };
|
|
7
7
|
//# sourceMappingURL=cart-summary.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client16 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/cart.d.ts
|
|
4
|
-
declare const GET_CART_QUERY:
|
|
4
|
+
declare const GET_CART_QUERY: _apollo_client16.DocumentNode;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { GET_CART_QUERY };
|
|
7
7
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client17 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/collections.d.ts
|
|
4
|
-
declare const GET_COLLECTIONS_QUERY:
|
|
5
|
-
declare const GET_COLLECTIONS_HOME_QUERY:
|
|
4
|
+
declare const GET_COLLECTIONS_QUERY: _apollo_client17.DocumentNode;
|
|
5
|
+
declare const GET_COLLECTIONS_HOME_QUERY: _apollo_client17.DocumentNode;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { GET_COLLECTIONS_HOME_QUERY, GET_COLLECTIONS_QUERY };
|
|
8
8
|
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _apollo_client9 from "@apollo/client";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/gql/queries/contextual-banner.d.ts
|
|
4
|
+
declare const GET_CONTEXTUAL_BANNERS_QUERY: _apollo_client9.DocumentNode;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { GET_CONTEXTUAL_BANNERS_QUERY };
|
|
7
|
+
//# sourceMappingURL=contextual-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextual-banner.d.ts","names":[],"sources":["../../../../src/lib/gql/queries/contextual-banner.ts"],"sourcesContent":[],"mappings":";;;cAEa,8BAaZ,eAAA,CAbwC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { gql } from "@apollo/client";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/gql/queries/contextual-banner.ts
|
|
4
|
+
const GET_CONTEXTUAL_BANNERS_QUERY = gql`
|
|
5
|
+
query GetContextualBanners {
|
|
6
|
+
contextualBanners {
|
|
7
|
+
title
|
|
8
|
+
description
|
|
9
|
+
ctaLabel
|
|
10
|
+
ctaHref
|
|
11
|
+
trigger
|
|
12
|
+
minPrice
|
|
13
|
+
isActive
|
|
14
|
+
priority
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { GET_CONTEXTUAL_BANNERS_QUERY };
|
|
21
|
+
//# sourceMappingURL=contextual-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextual-banner.js","names":[],"sources":["../../../../src/lib/gql/queries/contextual-banner.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const GET_CONTEXTUAL_BANNERS_QUERY = gql`\n query GetContextualBanners {\n contextualBanners {\n title\n description\n ctaLabel\n ctaHref\n trigger\n minPrice\n isActive\n priority\n }\n }\n`;"],"mappings":";;;AAEA,MAAa,+BAA+B,GAAG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client29 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/customer.d.ts
|
|
4
|
-
declare const GET_CUSTOMER_QUERY:
|
|
4
|
+
declare const GET_CUSTOMER_QUERY: _apollo_client29.DocumentNode;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { GET_CUSTOMER_QUERY };
|
|
7
7
|
//# sourceMappingURL=customer.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client37 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/footer.d.ts
|
|
4
|
-
declare const GET_FOOTER_QUERY:
|
|
5
|
-
declare const GET_FOOTER_DATA_QUERY:
|
|
4
|
+
declare const GET_FOOTER_QUERY: _apollo_client37.DocumentNode;
|
|
5
|
+
declare const GET_FOOTER_DATA_QUERY: _apollo_client37.DocumentNode;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { GET_FOOTER_DATA_QUERY, GET_FOOTER_QUERY };
|
|
8
8
|
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client31 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/home-banner.d.ts
|
|
4
|
-
declare const GET_HOME_BANNER_QUERY:
|
|
4
|
+
declare const GET_HOME_BANNER_QUERY: _apollo_client31.DocumentNode;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { GET_HOME_BANNER_QUERY };
|
|
7
7
|
//# sourceMappingURL=home-banner.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client32 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/order.d.ts
|
|
4
|
-
declare const ORDER_FRAGMENT:
|
|
5
|
-
declare const GET_ORDER_QUERY:
|
|
6
|
-
declare const GET_ORDERS_QUERY:
|
|
4
|
+
declare const ORDER_FRAGMENT: _apollo_client32.DocumentNode;
|
|
5
|
+
declare const GET_ORDER_QUERY: _apollo_client32.DocumentNode;
|
|
6
|
+
declare const GET_ORDERS_QUERY: _apollo_client32.DocumentNode;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { GET_ORDERS_QUERY, GET_ORDER_QUERY, ORDER_FRAGMENT };
|
|
9
9
|
//# sourceMappingURL=order.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client30 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/product.d.ts
|
|
4
|
-
declare const GET_PRODUCT_CATEGORIES_QUERY:
|
|
4
|
+
declare const GET_PRODUCT_CATEGORIES_QUERY: _apollo_client30.DocumentNode;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { GET_PRODUCT_CATEGORIES_QUERY };
|
|
7
7
|
//# sourceMappingURL=product.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client35 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/regions.d.ts
|
|
4
|
-
declare const LIST_REGIONS_QUERY:
|
|
5
|
-
declare const GET_REGION_QUERY:
|
|
4
|
+
declare const LIST_REGIONS_QUERY: _apollo_client35.DocumentNode;
|
|
5
|
+
declare const GET_REGION_QUERY: _apollo_client35.DocumentNode;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { GET_REGION_QUERY, LIST_REGIONS_QUERY };
|
|
8
8
|
//# sourceMappingURL=regions.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client0 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/shipping.d.ts
|
|
4
|
-
declare const SHIPPING_OPTION_FRAGMENT:
|
|
5
|
-
declare const GET_SHIPPING_OPTIONS_QUERY:
|
|
4
|
+
declare const SHIPPING_OPTION_FRAGMENT: _apollo_client0.DocumentNode;
|
|
5
|
+
declare const GET_SHIPPING_OPTIONS_QUERY: _apollo_client0.DocumentNode;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { GET_SHIPPING_OPTIONS_QUERY, SHIPPING_OPTION_FRAGMENT };
|
|
8
8
|
//# sourceMappingURL=shipping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipping.d.ts","names":[],"sources":["../../../../src/lib/gql/queries/shipping.ts"],"sourcesContent":[],"mappings":";;;cAEa,0BAgCZ,
|
|
1
|
+
{"version":3,"file":"shipping.d.ts","names":[],"sources":["../../../../src/lib/gql/queries/shipping.ts"],"sourcesContent":[],"mappings":";;;cAEa,0BAgCZ,eAAA,CAhCoC;cAkCxB,4BAOZ,eAAA,CAPsC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client1 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/hooks/use-apollo.d.ts
|
|
4
|
-
declare function useApollo():
|
|
4
|
+
declare function useApollo(): _apollo_client1.ApolloClient;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { useApollo };
|
|
7
7
|
//# sourceMappingURL=use-apollo.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/lib/personalization/behavior-tracker.d.ts
|
|
2
|
+
interface SegmentData {
|
|
3
|
+
interest?: string;
|
|
4
|
+
history?: string[];
|
|
5
|
+
signals?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
declare function getSegmentCookie(): SegmentData;
|
|
8
|
+
declare function setSegmentCookie(data: SegmentData): void;
|
|
9
|
+
declare function emitSignal(type: string, payload?: unknown): void;
|
|
10
|
+
declare function getSignal(type: string): unknown;
|
|
11
|
+
declare function getAllSignals(): Record<string, unknown>;
|
|
12
|
+
declare function clearSignals(): void;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SegmentData, clearSignals, emitSignal, getAllSignals, getSegmentCookie, getSignal, setSegmentCookie };
|
|
15
|
+
//# sourceMappingURL=behavior-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-tracker.d.ts","names":[],"sources":["../../../src/lib/personalization/behavior-tracker.ts"],"sourcesContent":[],"mappings":";UAEiB,WAAA;EAAA,QAAA,CAAA,EAAA,MAAW;EAcZ,OAAA,CAAA,EAAA,MAAA,EAAA;EAUA,OAAA,CAAA,EArBJ,MAqBI,CAAA,MAAgB,EAAA,OAAO,CAAA;AASvC;AAWgB,iBA9BA,gBAAA,CAAA,CA8BS,EA9BW,WA8BX;AAKT,iBAzBA,gBAAA,CAyBuB,IAAA,EAzBA,WAyBA,CAAA,EAAA,IAAA;AAKvB,iBArBA,UAAA,CAqBY,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA,EAAA,IAAA;iBAVZ,SAAA;iBAKA,aAAA,CAAA,GAAiB;iBAKjB,YAAA,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Cookies from "js-cookie";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/personalization/behavior-tracker.ts
|
|
4
|
+
const SIGNAL_COOKIE = "_jg_segment";
|
|
5
|
+
const cookieOptions = {
|
|
6
|
+
path: "/",
|
|
7
|
+
sameSite: "none",
|
|
8
|
+
secure: true,
|
|
9
|
+
domain: ".justgood.win"
|
|
10
|
+
};
|
|
11
|
+
function getSegmentCookie() {
|
|
12
|
+
const value = Cookies.get(SIGNAL_COOKIE);
|
|
13
|
+
if (!value) return {};
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(value);
|
|
16
|
+
} catch {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function setSegmentCookie(data) {
|
|
21
|
+
const expires = 7;
|
|
22
|
+
Cookies.set(SIGNAL_COOKIE, JSON.stringify(data), {
|
|
23
|
+
...cookieOptions,
|
|
24
|
+
expires
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function emitSignal(type, payload) {
|
|
28
|
+
const data = getSegmentCookie();
|
|
29
|
+
const updated = {
|
|
30
|
+
interest: data.interest,
|
|
31
|
+
history: data.history,
|
|
32
|
+
signals: data.signals ?? {}
|
|
33
|
+
};
|
|
34
|
+
updated.signals[type] = payload ?? true;
|
|
35
|
+
setSegmentCookie(updated);
|
|
36
|
+
}
|
|
37
|
+
function getSignal(type) {
|
|
38
|
+
return getSegmentCookie().signals?.[type];
|
|
39
|
+
}
|
|
40
|
+
function getAllSignals() {
|
|
41
|
+
return getSegmentCookie().signals ?? {};
|
|
42
|
+
}
|
|
43
|
+
function clearSignals() {
|
|
44
|
+
const data = getSegmentCookie();
|
|
45
|
+
setSegmentCookie({
|
|
46
|
+
interest: data.interest,
|
|
47
|
+
history: data.history,
|
|
48
|
+
signals: {}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { clearSignals, emitSignal, getAllSignals, getSegmentCookie, getSignal, setSegmentCookie };
|
|
54
|
+
//# sourceMappingURL=behavior-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-tracker.js","names":["cookieOptions: Cookies.CookieAttributes","updated: SegmentData"],"sources":["../../../src/lib/personalization/behavior-tracker.ts"],"sourcesContent":["import Cookies from 'js-cookie';\n\nexport interface SegmentData {\n interest?: string;\n history?: string[];\n signals?: Record<string, unknown>;\n}\n\nconst SIGNAL_COOKIE = '_jg_segment';\n\nconst isProd = process.env.NODE_ENV === 'production';\n\nconst cookieOptions: Cookies.CookieAttributes = isProd\n ? { path: '/', sameSite: 'none', secure: true, domain: '.justgood.win' }\n : { path: '/', sameSite: 'lax' };\n\nexport function getSegmentCookie(): SegmentData {\n const value = Cookies.get(SIGNAL_COOKIE);\n if (!value) return {};\n try {\n return JSON.parse(value);\n } catch {\n return {};\n }\n}\n\nexport function setSegmentCookie(data: SegmentData) {\n const expires = 7;\n Cookies.set(\n SIGNAL_COOKIE,\n JSON.stringify(data),\n { ...cookieOptions, expires }\n );\n}\n\nexport function emitSignal(type: string, payload?: unknown) {\n const data = getSegmentCookie();\n const updated: SegmentData = {\n interest: data.interest,\n history: data.history,\n signals: data.signals ?? {},\n };\n updated.signals![type] = payload ?? true;\n setSegmentCookie(updated);\n}\n\nexport function getSignal(type: string): unknown {\n const data = getSegmentCookie();\n return data.signals?.[type];\n}\n\nexport function getAllSignals(): Record<string, unknown> {\n const data = getSegmentCookie();\n return data.signals ?? {};\n}\n\nexport function clearSignals() {\n const data = getSegmentCookie();\n const updated: SegmentData = {\n interest: data.interest,\n history: data.history,\n signals: {},\n };\n setSegmentCookie(updated);\n}"],"mappings":";;;AAQA,MAAM,gBAAgB;AAItB,MAAMA,gBACF;CAAE,MAAM;CAAK,UAAU;CAAQ,QAAQ;CAAM,QAAQ;CAAiB;AAG1E,SAAgB,mBAAgC;CAC9C,MAAM,QAAQ,QAAQ,IAAI,cAAc;AACxC,KAAI,CAAC,MAAO,QAAO,EAAE;AACrB,KAAI;AACF,SAAO,KAAK,MAAM,MAAM;SAClB;AACN,SAAO,EAAE;;;AAIb,SAAgB,iBAAiB,MAAmB;CAClD,MAAM,UAAU;AAChB,SAAQ,IACN,eACA,KAAK,UAAU,KAAK,EACpB;EAAE,GAAG;EAAe;EAAS,CAC9B;;AAGH,SAAgB,WAAW,MAAc,SAAmB;CAC1D,MAAM,OAAO,kBAAkB;CAC/B,MAAMC,UAAuB;EAC3B,UAAU,KAAK;EACf,SAAS,KAAK;EACd,SAAS,KAAK,WAAW,EAAE;EAC5B;AACD,SAAQ,QAAS,QAAQ,WAAW;AACpC,kBAAiB,QAAQ;;AAG3B,SAAgB,UAAU,MAAuB;AAE/C,QADa,kBAAkB,CACnB,UAAU;;AAGxB,SAAgB,gBAAyC;AAEvD,QADa,kBAAkB,CACnB,WAAW,EAAE;;AAG3B,SAAgB,eAAe;CAC7B,MAAM,OAAO,kBAAkB;AAM/B,kBAL6B;EAC3B,UAAU,KAAK;EACf,SAAS,KAAK;EACd,SAAS,EAAE;EACZ,CACwB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/lib/personalization/config.d.ts
|
|
2
|
+
interface SegmentDefinition {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
categoryHandles: string[];
|
|
6
|
+
collectionHandles: string[];
|
|
7
|
+
}
|
|
8
|
+
interface SignalDefinition {
|
|
9
|
+
id: string;
|
|
10
|
+
description: string;
|
|
11
|
+
bannerTrigger: string;
|
|
12
|
+
}
|
|
13
|
+
interface PersonalizationConfig {
|
|
14
|
+
segments: SegmentDefinition[];
|
|
15
|
+
signals: SignalDefinition[];
|
|
16
|
+
dismissCooldownMs: number;
|
|
17
|
+
bannerAutoDismissMs: number;
|
|
18
|
+
historyMaxLength: number;
|
|
19
|
+
priceThresholdUsd: number;
|
|
20
|
+
pdpHesitationMs: number;
|
|
21
|
+
highScrollThreshold: number;
|
|
22
|
+
}
|
|
23
|
+
declare const PERSONALIZATION_CONFIG: PersonalizationConfig;
|
|
24
|
+
declare function getSegmentIdFromCategory(categoryHandle: string): string | null;
|
|
25
|
+
declare function getSegmentIdFromCollection(collectionHandle: string | undefined): string | null;
|
|
26
|
+
declare function getAllSegmentIds(): string[];
|
|
27
|
+
declare function getSignalDefinition(signalId: string): SignalDefinition | undefined;
|
|
28
|
+
declare function getAllSignalIds(): string[];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { PERSONALIZATION_CONFIG, PersonalizationConfig, SegmentDefinition, SignalDefinition, getAllSegmentIds, getAllSignalIds, getSegmentIdFromCategory, getSegmentIdFromCollection, getSignalDefinition };
|
|
31
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","names":[],"sources":["../../../src/lib/personalization/config.ts"],"sourcesContent":[],"mappings":";UAAiB,iBAAA;EAAA,EAAA,EAAA,MAAA;EAOA,KAAA,EAAA,MAAA;EAMA,eAAA,EAAA,MAAA,EAAqB;EAWzB,iBAAA,EAAA,MAiCZ,EAAA;AAED;AAUgB,UA9DC,gBAAA,CA8DyB;EAW1B,EAAA,EAAA,MAAA;EAIA,WAAA,EAAA,MAAA;EAIA,aAAA,EAAA,MAAe;;UA3Ed,qBAAA;YACL;WACD;;;;;;;;cASE,wBAAwB;iBAmCrB,wBAAA;iBAUA,0BAAA;iBAWA,gBAAA,CAAA;iBAIA,mBAAA,oBAAuC;iBAIvC,eAAA,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//#region src/lib/personalization/config.ts
|
|
2
|
+
const PERSONALIZATION_CONFIG = {
|
|
3
|
+
segments: [{
|
|
4
|
+
id: "mens",
|
|
5
|
+
label: "Men's",
|
|
6
|
+
categoryHandles: [
|
|
7
|
+
"mens",
|
|
8
|
+
"men",
|
|
9
|
+
"mens-collection",
|
|
10
|
+
"menswear",
|
|
11
|
+
"menstwo"
|
|
12
|
+
],
|
|
13
|
+
collectionHandles: [
|
|
14
|
+
"mens",
|
|
15
|
+
"men",
|
|
16
|
+
"mens-collection",
|
|
17
|
+
"menswear",
|
|
18
|
+
"menstwo"
|
|
19
|
+
]
|
|
20
|
+
}, {
|
|
21
|
+
id: "womens",
|
|
22
|
+
label: "Women's",
|
|
23
|
+
categoryHandles: [
|
|
24
|
+
"womens",
|
|
25
|
+
"women",
|
|
26
|
+
"womens-collection",
|
|
27
|
+
"womenswear",
|
|
28
|
+
"womenstwo"
|
|
29
|
+
],
|
|
30
|
+
collectionHandles: [
|
|
31
|
+
"womens",
|
|
32
|
+
"women",
|
|
33
|
+
"womens-collection",
|
|
34
|
+
"womenswear",
|
|
35
|
+
"womenstwo"
|
|
36
|
+
]
|
|
37
|
+
}],
|
|
38
|
+
signals: [{
|
|
39
|
+
id: "pdp-hesitation",
|
|
40
|
+
description: "User on PDP > 30s with expensive product",
|
|
41
|
+
bannerTrigger: "pdp-hesitation"
|
|
42
|
+
}, {
|
|
43
|
+
id: "high-scroll-no-action",
|
|
44
|
+
description: "User scrolled 80% without adding to cart",
|
|
45
|
+
bannerTrigger: "high-scroll-no-action"
|
|
46
|
+
}],
|
|
47
|
+
dismissCooldownMs: 3600 * 1e3,
|
|
48
|
+
bannerAutoDismissMs: 3e4,
|
|
49
|
+
historyMaxLength: 20,
|
|
50
|
+
priceThresholdUsd: 200,
|
|
51
|
+
pdpHesitationMs: 3e4,
|
|
52
|
+
highScrollThreshold: .8
|
|
53
|
+
};
|
|
54
|
+
function getSegmentIdFromCategory(categoryHandle) {
|
|
55
|
+
const normalized = categoryHandle.toLowerCase().replace(/[-_\s]/g, "");
|
|
56
|
+
for (const segment of PERSONALIZATION_CONFIG.segments) if (segment.categoryHandles.includes(normalized)) return segment.id;
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function getSegmentIdFromCollection(collectionHandle) {
|
|
60
|
+
if (!collectionHandle) return null;
|
|
61
|
+
const normalized = collectionHandle.toLowerCase().replace(/[-_\s]/g, "");
|
|
62
|
+
for (const segment of PERSONALIZATION_CONFIG.segments) if (segment.collectionHandles.includes(normalized)) return segment.id;
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function getAllSegmentIds() {
|
|
66
|
+
return PERSONALIZATION_CONFIG.segments.map((s) => s.id);
|
|
67
|
+
}
|
|
68
|
+
function getSignalDefinition(signalId) {
|
|
69
|
+
return PERSONALIZATION_CONFIG.signals.find((s) => s.id === signalId);
|
|
70
|
+
}
|
|
71
|
+
function getAllSignalIds() {
|
|
72
|
+
return PERSONALIZATION_CONFIG.signals.map((s) => s.id);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { PERSONALIZATION_CONFIG, getAllSegmentIds, getAllSignalIds, getSegmentIdFromCategory, getSegmentIdFromCollection, getSignalDefinition };
|
|
77
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","names":["PERSONALIZATION_CONFIG: PersonalizationConfig"],"sources":["../../../src/lib/personalization/config.ts"],"sourcesContent":["export interface SegmentDefinition {\n id: string;\n label: string;\n categoryHandles: string[];\n collectionHandles: string[];\n}\n\nexport interface SignalDefinition {\n id: string;\n description: string;\n bannerTrigger: string;\n}\n\nexport interface PersonalizationConfig {\n segments: SegmentDefinition[];\n signals: SignalDefinition[];\n dismissCooldownMs: number;\n bannerAutoDismissMs: number;\n historyMaxLength: number;\n priceThresholdUsd: number;\n pdpHesitationMs: number;\n highScrollThreshold: number;\n}\n\nexport const PERSONALIZATION_CONFIG: PersonalizationConfig = {\n segments: [\n {\n id: 'mens',\n label: \"Men's\",\n categoryHandles: ['mens', 'men', 'mens-collection', 'menswear', 'menstwo'],\n collectionHandles: ['mens', 'men', 'mens-collection', 'menswear', 'menstwo'],\n },\n {\n id: 'womens',\n label: \"Women's\",\n categoryHandles: ['womens', 'women', 'womens-collection', 'womenswear', 'womenstwo'],\n collectionHandles: ['womens', 'women', 'womens-collection', 'womenswear', 'womenstwo'],\n },\n ],\n signals: [\n {\n id: 'pdp-hesitation',\n description: 'User on PDP > 30s with expensive product',\n bannerTrigger: 'pdp-hesitation',\n },\n {\n id: 'high-scroll-no-action',\n description: 'User scrolled 80% without adding to cart',\n bannerTrigger: 'high-scroll-no-action',\n },\n ],\n dismissCooldownMs: 60 * 60 * 1000,\n bannerAutoDismissMs: 30_000,\n historyMaxLength: 20,\n priceThresholdUsd: 200,\n pdpHesitationMs: 30_000,\n highScrollThreshold: 0.8,\n};\n\nexport function getSegmentIdFromCategory(categoryHandle: string): string | null {\n const normalized = categoryHandle.toLowerCase().replace(/[-_\\s]/g, '');\n for (const segment of PERSONALIZATION_CONFIG.segments) {\n if (segment.categoryHandles.includes(normalized)) {\n return segment.id;\n }\n }\n return null;\n}\n\nexport function getSegmentIdFromCollection(collectionHandle: string | undefined): string | null {\n if (!collectionHandle) return null;\n const normalized = collectionHandle.toLowerCase().replace(/[-_\\s]/g, '');\n for (const segment of PERSONALIZATION_CONFIG.segments) {\n if (segment.collectionHandles.includes(normalized)) {\n return segment.id;\n }\n }\n return null;\n}\n\nexport function getAllSegmentIds(): string[] {\n return PERSONALIZATION_CONFIG.segments.map((s) => s.id);\n}\n\nexport function getSignalDefinition(signalId: string): SignalDefinition | undefined {\n return PERSONALIZATION_CONFIG.signals.find((s) => s.id === signalId);\n}\n\nexport function getAllSignalIds(): string[] {\n return PERSONALIZATION_CONFIG.signals.map((s) => s.id);\n}"],"mappings":";AAwBA,MAAaA,yBAAgD;CAC3D,UAAU,CACR;EACE,IAAI;EACJ,OAAO;EACP,iBAAiB;GAAC;GAAQ;GAAO;GAAmB;GAAY;GAAU;EAC1E,mBAAmB;GAAC;GAAQ;GAAO;GAAmB;GAAY;GAAU;EAC7E,EACD;EACE,IAAI;EACJ,OAAO;EACP,iBAAiB;GAAC;GAAU;GAAS;GAAqB;GAAc;GAAY;EACpF,mBAAmB;GAAC;GAAU;GAAS;GAAqB;GAAc;GAAY;EACvF,CACF;CACD,SAAS,CACP;EACE,IAAI;EACJ,aAAa;EACb,eAAe;EAChB,EACD;EACE,IAAI;EACJ,aAAa;EACb,eAAe;EAChB,CACF;CACD,mBAAmB,OAAU;CAC7B,qBAAqB;CACrB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,qBAAqB;CACtB;AAED,SAAgB,yBAAyB,gBAAuC;CAC9E,MAAM,aAAa,eAAe,aAAa,CAAC,QAAQ,WAAW,GAAG;AACtE,MAAK,MAAM,WAAW,uBAAuB,SAC3C,KAAI,QAAQ,gBAAgB,SAAS,WAAW,CAC9C,QAAO,QAAQ;AAGnB,QAAO;;AAGT,SAAgB,2BAA2B,kBAAqD;AAC9F,KAAI,CAAC,iBAAkB,QAAO;CAC9B,MAAM,aAAa,iBAAiB,aAAa,CAAC,QAAQ,WAAW,GAAG;AACxE,MAAK,MAAM,WAAW,uBAAuB,SAC3C,KAAI,QAAQ,kBAAkB,SAAS,WAAW,CAChD,QAAO,QAAQ;AAGnB,QAAO;;AAGT,SAAgB,mBAA6B;AAC3C,QAAO,uBAAuB,SAAS,KAAK,MAAM,EAAE,GAAG;;AAGzD,SAAgB,oBAAoB,UAAgD;AAClF,QAAO,uBAAuB,QAAQ,MAAM,MAAM,EAAE,OAAO,SAAS;;AAGtE,SAAgB,kBAA4B;AAC1C,QAAO,uBAAuB,QAAQ,KAAK,MAAM,EAAE,GAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/lib/personalization/user-profile.d.ts
|
|
2
|
+
interface UserProfile {
|
|
3
|
+
interest: string;
|
|
4
|
+
primaryInterest: string;
|
|
5
|
+
confidence: number;
|
|
6
|
+
history: string[];
|
|
7
|
+
signals: Record<string, unknown>;
|
|
8
|
+
lastUpdated: number;
|
|
9
|
+
}
|
|
10
|
+
declare function getUserProfile(): UserProfile;
|
|
11
|
+
declare function updateUserProfile(updates: Partial<UserProfile>): void;
|
|
12
|
+
declare function addToHistory(category: string): void;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { UserProfile, addToHistory, getUserProfile, updateUserProfile };
|
|
15
|
+
//# sourceMappingURL=user-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-profile.d.ts","names":[],"sources":["../../../src/lib/personalization/user-profile.ts"],"sourcesContent":[],"mappings":";UAEiB,WAAA;EAAA,QAAA,EAAA,MAAW;EAkCZ,eAAA,EAAc,MAAA;EAad,UAAA,EAAA,MAAA;EAQA,OAAA,EAAA,MAAY,EAAA;WAlDjB;;;iBA6BK,cAAA,CAAA,GAAkB;iBAalB,iBAAA,UAA2B,QAAQ;iBAQnC,YAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//#region src/lib/personalization/user-profile.ts
|
|
2
|
+
const PROFILE_KEY = "jg_user_profile";
|
|
3
|
+
function defaultProfile() {
|
|
4
|
+
return {
|
|
5
|
+
interest: "",
|
|
6
|
+
primaryInterest: "",
|
|
7
|
+
confidence: 0,
|
|
8
|
+
history: [],
|
|
9
|
+
signals: {},
|
|
10
|
+
lastUpdated: Date.now()
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function isValidUserProfile(value) {
|
|
14
|
+
if (typeof value !== "object" || value === null) return false;
|
|
15
|
+
const obj = value;
|
|
16
|
+
return typeof obj.interest === "string" && typeof obj.primaryInterest === "string" && typeof obj.confidence === "number" && Array.isArray(obj.history) && obj.history.every((h) => typeof h === "string") && typeof obj.signals === "object" && typeof obj.lastUpdated === "number";
|
|
17
|
+
}
|
|
18
|
+
function getUserProfile() {
|
|
19
|
+
if (typeof window === "undefined") return defaultProfile();
|
|
20
|
+
try {
|
|
21
|
+
const stored = localStorage.getItem(PROFILE_KEY);
|
|
22
|
+
if (!stored) return defaultProfile();
|
|
23
|
+
const parsed = JSON.parse(stored);
|
|
24
|
+
return isValidUserProfile(parsed) ? parsed : defaultProfile();
|
|
25
|
+
} catch {
|
|
26
|
+
return defaultProfile();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function updateUserProfile(updates) {
|
|
30
|
+
if (typeof window === "undefined") return;
|
|
31
|
+
const updated = {
|
|
32
|
+
...getUserProfile(),
|
|
33
|
+
...updates,
|
|
34
|
+
lastUpdated: Date.now()
|
|
35
|
+
};
|
|
36
|
+
localStorage.setItem(PROFILE_KEY, JSON.stringify(updated));
|
|
37
|
+
}
|
|
38
|
+
function addToHistory(category) {
|
|
39
|
+
const profile = getUserProfile();
|
|
40
|
+
const normalizedCategory = String(category).trim();
|
|
41
|
+
if (!normalizedCategory) return;
|
|
42
|
+
updateUserProfile({ history: [...profile.history || [], normalizedCategory].slice(-20) });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { addToHistory, getUserProfile, updateUserProfile };
|
|
47
|
+
//# sourceMappingURL=user-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-profile.js","names":[],"sources":["../../../src/lib/personalization/user-profile.ts"],"sourcesContent":["const PROFILE_KEY = 'jg_user_profile';\n\nexport interface UserProfile {\n interest: string;\n primaryInterest: string;\n confidence: number;\n history: string[];\n signals: Record<string, unknown>;\n lastUpdated: number;\n}\n\nfunction defaultProfile(): UserProfile {\n return {\n interest: '',\n primaryInterest: '',\n confidence: 0,\n history: [],\n signals: {},\n lastUpdated: Date.now(),\n };\n}\n\nfunction isValidUserProfile(value: unknown): value is UserProfile {\n if (typeof value !== 'object' || value === null) return false;\n const obj = value as Record<string, unknown>;\n return (\n typeof obj.interest === 'string' &&\n typeof obj.primaryInterest === 'string' &&\n typeof obj.confidence === 'number' &&\n Array.isArray(obj.history) &&\n obj.history.every((h) => typeof h === 'string') &&\n typeof obj.signals === 'object' &&\n typeof obj.lastUpdated === 'number'\n );\n}\n\nexport function getUserProfile(): UserProfile {\n if (typeof window === 'undefined') return defaultProfile();\n\n try {\n const stored = localStorage.getItem(PROFILE_KEY);\n if (!stored) return defaultProfile();\n const parsed = JSON.parse(stored);\n return isValidUserProfile(parsed) ? parsed : defaultProfile();\n } catch {\n return defaultProfile();\n }\n}\n\nexport function updateUserProfile(updates: Partial<UserProfile>): void {\n if (typeof window === 'undefined') return;\n\n const profile = getUserProfile();\n const updated = { ...profile, ...updates, lastUpdated: Date.now() };\n localStorage.setItem(PROFILE_KEY, JSON.stringify(updated));\n}\n\nexport function addToHistory(category: string): void {\n const profile = getUserProfile();\n const normalizedCategory = String(category).trim();\n if (!normalizedCategory) return;\n const history = [...(profile.history || []), normalizedCategory].slice(-20);\n updateUserProfile({ history });\n}\n"],"mappings":";AAAA,MAAM,cAAc;AAWpB,SAAS,iBAA8B;AACrC,QAAO;EACL,UAAU;EACV,iBAAiB;EACjB,YAAY;EACZ,SAAS,EAAE;EACX,SAAS,EAAE;EACX,aAAa,KAAK,KAAK;EACxB;;AAGH,SAAS,mBAAmB,OAAsC;AAChE,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;CACxD,MAAM,MAAM;AACZ,QACE,OAAO,IAAI,aAAa,YACxB,OAAO,IAAI,oBAAoB,YAC/B,OAAO,IAAI,eAAe,YAC1B,MAAM,QAAQ,IAAI,QAAQ,IAC1B,IAAI,QAAQ,OAAO,MAAM,OAAO,MAAM,SAAS,IAC/C,OAAO,IAAI,YAAY,YACvB,OAAO,IAAI,gBAAgB;;AAI/B,SAAgB,iBAA8B;AAC5C,KAAI,OAAO,WAAW,YAAa,QAAO,gBAAgB;AAE1D,KAAI;EACF,MAAM,SAAS,aAAa,QAAQ,YAAY;AAChD,MAAI,CAAC,OAAQ,QAAO,gBAAgB;EACpC,MAAM,SAAS,KAAK,MAAM,OAAO;AACjC,SAAO,mBAAmB,OAAO,GAAG,SAAS,gBAAgB;SACvD;AACN,SAAO,gBAAgB;;;AAI3B,SAAgB,kBAAkB,SAAqC;AACrE,KAAI,OAAO,WAAW,YAAa;CAGnC,MAAM,UAAU;EAAE,GADF,gBAAgB;EACF,GAAG;EAAS,aAAa,KAAK,KAAK;EAAE;AACnE,cAAa,QAAQ,aAAa,KAAK,UAAU,QAAQ,CAAC;;AAG5D,SAAgB,aAAa,UAAwB;CACnD,MAAM,UAAU,gBAAgB;CAChC,MAAM,qBAAqB,OAAO,SAAS,CAAC,MAAM;AAClD,KAAI,CAAC,mBAAoB;AAEzB,mBAAkB,EAAE,SADJ,CAAC,GAAI,QAAQ,WAAW,EAAE,EAAG,mBAAmB,CAAC,MAAM,IAAI,EAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gfed-medusa/sf-lib-common",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@medusajs/ui": "^4.0.29",
|
|
48
48
|
"class-variance-authority": "^0.7.1",
|
|
49
49
|
"isomorphic-dompurify": "^2.34.0",
|
|
50
|
+
"js-cookie": "^3.0.5",
|
|
50
51
|
"lucide-react": "^0.556.0",
|
|
51
52
|
"react-country-flag": "^3.1.0",
|
|
52
53
|
"server-only": "^0.0.1",
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
"@testing-library/jest-dom": "6.8.0",
|
|
63
64
|
"@testing-library/react": "^16.3.0",
|
|
64
65
|
"@types/jest": "^29.5.2",
|
|
66
|
+
"@types/js-cookie": "^3.0.6",
|
|
65
67
|
"@types/node": "^20",
|
|
66
68
|
"@types/react": "^19",
|
|
67
69
|
"@types/react-dom": "^19",
|
|
@@ -75,8 +77,8 @@
|
|
|
75
77
|
"typescript": "^5",
|
|
76
78
|
"@packages/eslint-config": "0.0.0",
|
|
77
79
|
"@packages/jest-config": "0.0.0",
|
|
78
|
-
"@packages/
|
|
79
|
-
"@packages/
|
|
80
|
+
"@packages/prettier-config": "0.0.0",
|
|
81
|
+
"@packages/typescript-config": "0.0.0"
|
|
80
82
|
},
|
|
81
83
|
"peerDependencies": {
|
|
82
84
|
"@medusajs/ui": "^4.0.29",
|