@tapcart/mobile-components 0.10.2 → 0.11.0

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.
@@ -19,7 +19,7 @@ export const LoadingDots = ({ iconColor, size = 4, spacing = 1, opacity = 0.8, s
19
19
  }, [show]);
20
20
  if (!showLoadingDots)
21
21
  return null;
22
- return (_jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center", isAnimatingOut ? "animate-fadeOut" : "animate-fadeIn", {
22
+ return (_jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center z-20", isAnimatingOut ? "animate-fadeOut" : "animate-fadeIn", {
23
23
  "bg-white bg-opacity-70": showBackground,
24
24
  }) }, { children: _jsxs("div", Object.assign({ className: `flex space-x-${spacing}` }, { children: [_jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce [animation-delay:-0.3s]` }), _jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce [animation-delay:-0.15s]` }), _jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce` })] })) })));
25
25
  };
@@ -2,6 +2,15 @@ import * as React from "react";
2
2
  import { Color } from "../../lib/utils";
3
3
  import { Translations } from "app-studio-types";
4
4
  interface WishlistSelectStyleConfig {
5
+ headerText?: string;
6
+ headerFont?: {
7
+ family: string;
8
+ weight: string;
9
+ };
10
+ headerSize?: number;
11
+ headerColor?: Color;
12
+ headerUppercase?: boolean;
13
+ placeholderText?: string;
5
14
  triggerBackgroundColor?: Color;
6
15
  triggerBorderColor?: Color;
7
16
  triggerCornerRadius?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"wishlist-select.d.ts","sourceRoot":"","sources":["../../../components/ui/wishlist-select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO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O
57
57
  };
58
58
  const selectedChild = React.Children.toArray(children).find((child) => React.isValidElement(child) &&
59
59
  child.props.value === selectedValue);
60
- return (_jsxs("div", Object.assign({ className: "relative", ref: ref }, { children: [_jsxs(WishlistSelectTrigger, Object.assign({ ref: triggerRef, onClick: handleToggle, styleConfig: styleConfig }, { children: [_jsx(WishlistSelectItem, Object.assign({ isTrigger: true, styleConfig: styleConfig }, { children: selectedChild ? (selectedChild.props.children({ isTrigger: true, translations })) : (_jsx(Wishlist, { name: translations["wishlist-multiple-create-text-field-placeholder"], isTrigger: true, translations: translations, nameStyle: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameTextColor)
60
+ // Create header style object that will be reused
61
+ const headerStyle = React.useMemo(() => {
62
+ var _a, _b, _c, _d;
63
+ return ({
64
+ color: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerColor)
65
+ ? getColor(styleConfig.headerColor)
66
+ : undefined,
67
+ fontFamily: ((_a = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerFont) === null || _a === void 0 ? void 0 : _a.family) !== "unset"
68
+ ? (_b = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerFont) === null || _b === void 0 ? void 0 : _b.family
69
+ : undefined,
70
+ fontWeight: ((_c = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerFont) === null || _c === void 0 ? void 0 : _c.weight) !== "unset"
71
+ ? (_d = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerFont) === null || _d === void 0 ? void 0 : _d.weight
72
+ : "600",
73
+ fontSize: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerSize)
74
+ ? `${styleConfig.headerSize}px`
75
+ : "18px",
76
+ textTransform: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerUppercase) ? "uppercase" : undefined,
77
+ });
78
+ }, [styleConfig]);
79
+ return (_jsxs("div", Object.assign({ className: "relative", ref: ref }, { children: [_jsxs(WishlistSelectTrigger, Object.assign({ ref: triggerRef, onClick: handleToggle, styleConfig: styleConfig }, { children: [_jsx(WishlistSelectItem, Object.assign({ isTrigger: true, styleConfig: styleConfig }, { children: selectedChild ? (selectedChild.props.children({ isTrigger: true, translations })) : (_jsx(Wishlist, { headerText: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.headerText) || "My Wishlists", headerStyle: headerStyle, name: translations["wishlist-multiple-create-text-field-placeholder"], isTrigger: true, translations: translations, nameStyle: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameTextColor)
61
80
  ? {
62
81
  color: getColor(styleConfig.nameTextColor),
63
82
  fontFamily: ((_a = styleConfig.nameFont) === null || _a === void 0 ? void 0 : _a.family) !== "unset"
@@ -23,8 +23,18 @@ interface WishlistStyleConfig {
23
23
  defaultImageIconColor?: Color;
24
24
  imageLeftBorderRadius?: number;
25
25
  imageRightBorderRadius?: number;
26
+ headerText?: string;
27
+ headerFont?: {
28
+ family: string;
29
+ weight: string;
30
+ };
31
+ headerSize?: number;
32
+ headerColor?: Color;
33
+ headerUppercase?: boolean;
26
34
  }
27
35
  export interface WishlistProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
36
+ headerText?: string;
37
+ headerStyle?: React.CSSProperties;
28
38
  name?: string;
29
39
  amount?: number;
30
40
  selected?: boolean;
@@ -46,7 +56,7 @@ declare const PlaceholderIcon: ({ rightBorderRadius, leftBorderRadius, styleConf
46
56
  leftBorderRadius?: number | undefined;
47
57
  styleConfig?: WishlistStyleConfig | undefined;
48
58
  }) => import("react/jsx-runtime").JSX.Element;
49
- declare const Wishlist: React.ForwardRefExoticComponent<WishlistProps & React.RefAttributes<HTMLButtonElement>>;
59
+ declare const Wishlist: React.ForwardRefExoticComponent<WishlistProps & React.RefAttributes<HTMLDivElement | HTMLButtonElement>>;
50
60
  export interface CreateNewProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
51
61
  selected?: boolean;
52
62
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"wishlist.d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AC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,CAAA;IACxE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,YAAY,CAAA;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACjC,WAAW,CAAC,EAAE,mBAAmB,CAAA;CAClC;AAED,QAAA,MAAM,eAAe;;;;6CAsDpB,CAAA;AAED,QAAA,MAAM,QAAQ,0GAsPb,CAAA;AAID,MAAM,WAAW,cACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,YAAY,CAAA;IAC1B,WAAW,CAAC,EAAE,mBAAmB,CAAA;CAClC;AAED,QAAA,MAAM,SAAS,0FAuCd,CAAA;AAID,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;AAC/C,YAAY,EAAE,mBAAmB,EAAE,CAAA"}
@@ -37,8 +37,8 @@ const PlaceholderIcon = ({ rightBorderRadius, leftBorderRadius, styleConfig, })
37
37
  "coreColors-secondaryIcon" })) })));
38
38
  };
39
39
  const Wishlist = React.forwardRef((_a, ref) => {
40
- var _b, _c, _d, _e, _f, _g, _h, _j;
41
- var { selected = false, onClick, className, name, amount, imgUrl, imgRightBorderRadius = 4, imgLeftBorderRadius = 0, aspectRatio, objectFit, isTrigger, translations, nameStyle, amountStyle, styleConfig } = _a, props = __rest(_a, ["selected", "onClick", "className", "name", "amount", "imgUrl", "imgRightBorderRadius", "imgLeftBorderRadius", "aspectRatio", "objectFit", "isTrigger", "translations", "nameStyle", "amountStyle", "styleConfig"]);
40
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
41
+ var { headerText = "Wishlists", headerStyle, selected = false, onClick, className, name, amount, imgUrl, imgRightBorderRadius = 4, imgLeftBorderRadius = 0, aspectRatio, objectFit, isTrigger, translations, nameStyle, amountStyle, styleConfig } = _a, props = __rest(_a, ["headerText", "headerStyle", "selected", "onClick", "className", "name", "amount", "imgUrl", "imgRightBorderRadius", "imgLeftBorderRadius", "aspectRatio", "objectFit", "isTrigger", "translations", "nameStyle", "amountStyle", "styleConfig"]);
42
42
  // Calculate effective border radius values (manifest takes priority)
43
43
  const effectiveRightBorderRadius = (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.imageRightBorderRadius) !== undefined
44
44
  ? styleConfig.imageRightBorderRadius
@@ -46,7 +46,54 @@ const Wishlist = React.forwardRef((_a, ref) => {
46
46
  const effectiveLeftBorderRadius = (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.imageLeftBorderRadius) !== undefined
47
47
  ? styleConfig.imageLeftBorderRadius
48
48
  : imgLeftBorderRadius !== null && imgLeftBorderRadius !== void 0 ? imgLeftBorderRadius : 0;
49
- return (_jsxs("button", Object.assign({ className: cn("flex flex-row items-center px-4 py-2 w-full ", selected ? "bg-stateColors-skeleton" : "", className), ref: ref, onClick: onClick }, props, { children: [imgUrl ? (_jsx("div", Object.assign({ className: "h-10 w-10 border border-coreColors-dividingLines overflow-hidden", style: {
49
+ // Build header style from styleConfig if no headerStyle is provided
50
+ const effectiveHeaderStyle = React.useMemo(() => {
51
+ var _a, _b, _c, _d;
52
+ if (headerStyle)
53
+ return headerStyle;
54
+ if (!styleConfig)
55
+ return undefined;
56
+ return {
57
+ color: styleConfig.headerColor
58
+ ? getColor(styleConfig.headerColor)
59
+ : undefined,
60
+ fontFamily: ((_a = styleConfig.headerFont) === null || _a === void 0 ? void 0 : _a.family) !== "unset"
61
+ ? (_b = styleConfig.headerFont) === null || _b === void 0 ? void 0 : _b.family
62
+ : undefined,
63
+ fontWeight: ((_c = styleConfig.headerFont) === null || _c === void 0 ? void 0 : _c.weight) !== "unset"
64
+ ? (_d = styleConfig.headerFont) === null || _d === void 0 ? void 0 : _d.weight
65
+ : undefined,
66
+ fontSize: styleConfig.headerSize
67
+ ? `${styleConfig.headerSize}px`
68
+ : undefined,
69
+ textTransform: styleConfig.headerUppercase ? "uppercase" : undefined,
70
+ };
71
+ }, [headerStyle, styleConfig]);
72
+ // Use div instead of button when used as trigger to avoid nested button elements
73
+ if (isTrigger) {
74
+ return (_jsxs("div", Object.assign({ className: cn("flex flex-row items-center px-4 py-2 w-full ", selected ? "bg-stateColors-skeleton" : "", className) }, { children: [imgUrl ? (_jsx("div", Object.assign({ className: "h-10 w-10 border border-coreColors-dividingLines overflow-hidden", style: {
75
+ flex: "0 1 auto",
76
+ borderTopRightRadius: `${effectiveRightBorderRadius}px`,
77
+ borderBottomRightRadius: `${effectiveRightBorderRadius}px`,
78
+ borderTopLeftRadius: `${effectiveLeftBorderRadius}px`,
79
+ borderBottomLeftRadius: `${effectiveLeftBorderRadius}px`,
80
+ } }, { children: _jsx("img", { alt: "wishlist-image", src: `${imgUrl}?width=40`, width: 40, height: 40, className: cn("w-full h-full", objectFit === "contain" ? "object-contain" : "object-cover"), style: {
81
+ borderTopRightRadius: `${effectiveRightBorderRadius}px`,
82
+ borderBottomRightRadius: `${effectiveRightBorderRadius}px`,
83
+ borderTopLeftRadius: `${effectiveLeftBorderRadius}px`,
84
+ borderBottomLeftRadius: `${effectiveLeftBorderRadius}px`,
85
+ } }) }))) : (_jsx(PlaceholderIcon, { rightBorderRadius: imgRightBorderRadius, leftBorderRadius: imgLeftBorderRadius, styleConfig: styleConfig })), _jsxs("div", Object.assign({ className: "flex flex-col flex-1 items-start mx-2 overflow-hidden" }, { children: [_jsx("div", Object.assign({ style: Object.assign({
86
+ // Base styles to match body-secondary but allow overrides
87
+ fontSize: "12px", lineHeight: "120%", fontWeight: "400", color: "var(--textColors-secondaryColor)" }, effectiveHeaderStyle) }, { children: headerText })), _jsx(Text, Object.assign({ type: "body-secondary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: Object.assign(Object.assign({}, nameStyle), { color: (nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.color) || getColor(styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameTextColor), fontFamily: ((_b = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _b === void 0 ? void 0 : _b.family) !== "unset"
88
+ ? (_c = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _c === void 0 ? void 0 : _c.family
89
+ : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontFamily, fontWeight: ((_d = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _d === void 0 ? void 0 : _d.weight) !== "unset"
90
+ ? (_e = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _e === void 0 ? void 0 : _e.weight
91
+ : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontWeight, fontSize: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameSize)
92
+ ? `${styleConfig.nameSize}px`
93
+ : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontSize }) }, { children: name }))] }))] })));
94
+ }
95
+ // Use button when not used as trigger
96
+ return (_jsxs("button", Object.assign({ className: cn("flex flex-row items-center px-4 py-2 w-full", selected ? "bg-stateColors-skeleton" : "", className), ref: ref, onClick: onClick }, props, { children: [imgUrl ? (_jsx("div", Object.assign({ className: "h-10 w-10 border border-coreColors-dividingLines overflow-hidden", style: {
50
97
  flex: "0 1 auto",
51
98
  borderTopRightRadius: `${effectiveRightBorderRadius}px`,
52
99
  borderBottomRightRadius: `${effectiveRightBorderRadius}px`,
@@ -57,21 +104,21 @@ const Wishlist = React.forwardRef((_a, ref) => {
57
104
  borderBottomRightRadius: `${effectiveRightBorderRadius}px`,
58
105
  borderTopLeftRadius: `${effectiveLeftBorderRadius}px`,
59
106
  borderBottomLeftRadius: `${effectiveLeftBorderRadius}px`,
60
- } }) }))) : (_jsx(PlaceholderIcon, { rightBorderRadius: imgRightBorderRadius, leftBorderRadius: imgLeftBorderRadius, styleConfig: styleConfig })), _jsxs("div", Object.assign({ className: "flex flex-col flex-1 items-start mx-2 overflow-hidden" }, { children: [isTrigger && _jsx(Text, Object.assign({ type: "body-secondary" }, { children: "Wishlists" })), _jsx(Text, Object.assign({ type: "body-secondary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: Object.assign(Object.assign({}, nameStyle), { color: (nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.color) || getColor(styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameTextColor), fontFamily: ((_b = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _b === void 0 ? void 0 : _b.family) !== "unset"
61
- ? (_c = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _c === void 0 ? void 0 : _c.family
62
- : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontFamily, fontWeight: ((_d = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _d === void 0 ? void 0 : _d.weight) !== "unset"
63
- ? (_e = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _e === void 0 ? void 0 : _e.weight
107
+ } }) }))) : (_jsx(PlaceholderIcon, { rightBorderRadius: imgRightBorderRadius, leftBorderRadius: imgLeftBorderRadius, styleConfig: styleConfig })), _jsxs("div", Object.assign({ className: "flex flex-col flex-1 items-start mx-2 overflow-hidden" }, { children: [_jsx(Text, Object.assign({ type: "body-secondary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: Object.assign(Object.assign({}, nameStyle), { color: (nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.color) || getColor(styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameTextColor), fontFamily: ((_f = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _f === void 0 ? void 0 : _f.family) !== "unset"
108
+ ? (_g = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _g === void 0 ? void 0 : _g.family
109
+ : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontFamily, fontWeight: ((_h = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _h === void 0 ? void 0 : _h.weight) !== "unset"
110
+ ? (_j = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameFont) === null || _j === void 0 ? void 0 : _j.weight
64
111
  : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontWeight, fontSize: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.nameSize)
65
112
  ? `${styleConfig.nameSize}px`
66
- : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontSize }) }, { children: name })), !isTrigger && (_jsx(Text, Object.assign({ type: "label", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: Object.assign(Object.assign({}, amountStyle), { color: (amountStyle === null || amountStyle === void 0 ? void 0 : amountStyle.color) || getColor(styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countTextColor), fontFamily: ((_f = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _f === void 0 ? void 0 : _f.family) !== "unset"
67
- ? (_g = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _g === void 0 ? void 0 : _g.family
68
- : amountStyle === null || amountStyle === void 0 ? void 0 : amountStyle.fontFamily, fontWeight: ((_h = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _h === void 0 ? void 0 : _h.weight) !== "unset"
69
- ? (_j = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _j === void 0 ? void 0 : _j.weight
113
+ : nameStyle === null || nameStyle === void 0 ? void 0 : nameStyle.fontSize }) }, { children: name })), _jsx(Text, Object.assign({ type: "label", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: Object.assign(Object.assign({}, amountStyle), { color: (amountStyle === null || amountStyle === void 0 ? void 0 : amountStyle.color) || getColor(styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countTextColor), fontFamily: ((_k = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _k === void 0 ? void 0 : _k.family) !== "unset"
114
+ ? (_l = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _l === void 0 ? void 0 : _l.family
115
+ : amountStyle === null || amountStyle === void 0 ? void 0 : amountStyle.fontFamily, fontWeight: ((_m = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _m === void 0 ? void 0 : _m.weight) !== "unset"
116
+ ? (_o = styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countFont) === null || _o === void 0 ? void 0 : _o.weight
70
117
  : amountStyle === null || amountStyle === void 0 ? void 0 : amountStyle.fontWeight, fontSize: (styleConfig === null || styleConfig === void 0 ? void 0 : styleConfig.countSize)
71
118
  ? `${styleConfig.countSize}px`
72
119
  : amountStyle === null || amountStyle === void 0 ? void 0 : amountStyle.fontSize }) }, { children: `${amount} ${amount !== 1
73
120
  ? translations["checkout-summary-items"]
74
- : translations["checkout-summary-item"]}` })))] }))] })));
121
+ : translations["checkout-summary-item"]}` }))] }))] })));
75
122
  });
76
123
  Wishlist.displayName = "Wishlist";
77
124
  const CreateNew = React.forwardRef((_a, ref) => {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, getVariantGidsFromIds, getBadgesForProductFn, createCollectionImageMap, isFavoriteIntegrationEnabled, getLoyaltyButtonProps, getSpaceBetween, getGridSpacing, pluralize, getInputPlaceholderTextProps, parsePhoneNumber, } from "./lib/utils";
1
+ export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, getVariantGidsFromIds, getBadgesForProductFn, createCollectionImageMap, isFavoriteIntegrationEnabled, getEnabledWishlistIntegration, supportsMultipleWishlists, getWishlistAddItemNavigation, getLoyaltyButtonProps, getSpaceBetween, getGridSpacing, pluralize, getInputPlaceholderTextProps, parsePhoneNumber, addItemToWishlist, removeItemFromWishlists, } from "./lib/utils";
2
+ export type { WishlistEntryMatch } from "./lib/utils";
2
3
  export * from "./lib/cart.util";
3
4
  export * from "./lib/variablesCart.util";
4
5
  export * from "./lib/isTapcartVersion20.util";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,SAAS,EACT,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,aAAa,CAAA;AACpB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,+B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nD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,6CAA6C,CAAA;AAC3D,cAAc,kDAAkD,CAAA;AAChE,cAAc,qBAAqB,CAAA;AACnC,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // component exports
2
- export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, getVariantGidsFromIds, getBadgesForProductFn, createCollectionImageMap, isFavoriteIntegrationEnabled, getLoyaltyButtonProps, getSpaceBetween, getGridSpacing, pluralize, getInputPlaceholderTextProps, parsePhoneNumber, } from "./lib/utils";
2
+ export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, getVariantGidsFromIds, getBadgesForProductFn, createCollectionImageMap, isFavoriteIntegrationEnabled, getEnabledWishlistIntegration, supportsMultipleWishlists, getWishlistAddItemNavigation, getLoyaltyButtonProps, getSpaceBetween, getGridSpacing, pluralize, getInputPlaceholderTextProps, parsePhoneNumber, addItemToWishlist, removeItemFromWishlists, } from "./lib/utils";
3
3
  export * from "./lib/cart.util";
4
4
  export * from "./lib/variablesCart.util";
5
5
  export * from "./lib/isTapcartVersion20.util";
@@ -1,4 +1,4 @@
1
- import { Integrations, ConditionalSelectorMetafield, ConditionalSelectorValues, Collection, UserSelectedTag, Product, Customer, ShopifyMetafield } from "app-studio-types";
1
+ import { Integrations, Integration, ConditionalSelectorMetafield, ConditionalSelectorValues, Collection, UserSelectedTag, Product, Customer, ShopifyMetafield } from "app-studio-types";
2
2
  import { ClassValue } from "clsx";
3
3
  import { CSSProperties } from "react";
4
4
  export declare const parsePhoneNumber: (input: string, country?: string) => import("phone").PhoneResult;
@@ -1117,6 +1117,32 @@ export declare const createCollectionImageMap: (collections: {
1117
1117
  image?: string;
1118
1118
  }[]) => Record<string, string>;
1119
1119
  export declare const isFavoriteIntegrationEnabled: (integrations: Integrations) => boolean;
1120
+ export declare const getEnabledWishlistIntegration: (integrations: Integrations) => Integration | null;
1121
+ export declare const supportsMultipleWishlists: (integration: Integration | null | undefined) => boolean;
1122
+ export declare const getWishlistAddItemNavigation: (productId: string, isAuthenticated?: boolean) => {
1123
+ destination: {
1124
+ type: "internal";
1125
+ url: string;
1126
+ };
1127
+ presentation: {
1128
+ transition: "popover";
1129
+ style: string;
1130
+ snapPoints: number[];
1131
+ };
1132
+ header: {
1133
+ visible: boolean;
1134
+ };
1135
+ };
1136
+ type WishlistEntryItem = {
1137
+ id?: string;
1138
+ _id?: string;
1139
+ productId?: string | null;
1140
+ variantId?: string | null;
1141
+ };
1142
+ export type WishlistEntryMatch = {
1143
+ wishlistId: string | null;
1144
+ item: WishlistEntryItem;
1145
+ };
1120
1146
  export declare const pluralize: (word: string, count?: number, inclusive?: boolean) => string;
1121
1147
  export declare const getInputPlaceholderTextProps: (placeholderText: TextStyle) => {
1122
1148
  placeholderTextColor: Color;
@@ -1126,6 +1152,38 @@ export declare const getInputPlaceholderTextProps: (placeholderText: TextStyle)
1126
1152
  placeholderFont: string;
1127
1153
  placeholderFontWeight: string | number;
1128
1154
  };
1155
+ /**
1156
+ * Adds an item to the wishlist. Depending on merchant integrations or if variants exist or if logged in drawer functionality is involved
1157
+ * @param Tapcart
1158
+ * @param integrations
1159
+ * @param product
1160
+ * @param selectedVariantId
1161
+ */
1162
+ export declare const addItemToWishlist: ({ Tapcart, integrations, product, selectedVariantId, }: {
1163
+ Tapcart: any;
1164
+ integrations: Integrations;
1165
+ product: {
1166
+ id: string;
1167
+ variants?: any[] | undefined;
1168
+ };
1169
+ selectedVariantId?: string | undefined;
1170
+ }) => Promise<boolean>;
1171
+ /**
1172
+ * Removes an item from all wishlists by product ID.
1173
+ *
1174
+ * @param {Object} params - The parameters for the function.
1175
+ * @param {any} params.Tapcart - The Tapcart instance.
1176
+ * @param {string} params.productId - The ID of the product to remove.
1177
+ * @returns {Promise<{ id: string; variantId: string; productId: string }[]>} - An array of removed wishlist entries.
1178
+ */
1179
+ export declare const removeItemFromWishlists: ({ Tapcart, productId, }: {
1180
+ Tapcart: any;
1181
+ productId: string;
1182
+ }) => Promise<{
1183
+ id: string;
1184
+ variantId: string;
1185
+ productId: string;
1186
+ }[]>;
1129
1187
  export type Badge = {
1130
1188
  id: string;
1131
1189
  horizontalPosition: string;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,4BAA4B,EAC5B,yBAAyB,EACzB,UAAU,EACV,eAAe,EACf,OAAO,EACP,QAAQ,EACR,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAA;AAMvC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,eAAO,MAAM,gBAAgB,UAAW,MAAM,YAAY,MAAM,gCACrC,CAAA;AAE3B,MAAM,MAAM,KAAK,GAAG;IAAE,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnE,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAE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QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE,eAAO,MAAM,WAAW;cAMZ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DnB,CAAA;AAED,eAAO,MAAM,iBAAiB,QAAS,GAAG,2BAC+B,CAAA;AAEzE,eAAO,MAAM,WAAW,QAAS,GAAG,wCACO,CAAA;AAE3C,eAAO,MAAM,yBAAyB,QAC/B,GAAG,EAAE,6BAGX,CAAA;AAED,eAAO,MAAM,mBAAmB,QACzB,GAAG,EAAE,0CAGX,CAAA;AA6BD,eAAO,MAAM,eAAe,aAChB,yBAAyB,cACvB,yBAAyB,YAoDtC,CAAA;AAGD,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,GAAG,CAAA;CACX,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;IAC3B,UAAU,EAAE,CAAC,SAAS,GAAG,UAAU,CAAC,EAAE,CAAA;CACvC,CAAA;AAoDD,eAAO,MAAM,kBAAkB,UACtB,UAAU,WACR,GAAG,KACX,OAyBF,CAAA"}
package/dist/lib/utils.js CHANGED
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { clsx } from "clsx";
2
11
  import dayjs from "dayjs";
3
12
  import relativeTime from "dayjs/plugin/relativeTime";
@@ -302,12 +311,94 @@ export const createCollectionImageMap = (collections) => {
302
311
  return imageMap;
303
312
  }, {});
304
313
  };
314
+ const WISHLIST_INTEGRATION_NAMES = new Set([
315
+ "tapcart-wishlist",
316
+ "tapcart-wishlist-v2",
317
+ "tapcart-wishlist-api",
318
+ "grove-wishlist",
319
+ "swym",
320
+ ]);
305
321
  export const isFavoriteIntegrationEnabled = (integrations) => {
306
- return integrations.some((integration) => (integration.name === "tapcart-wishlist" ||
307
- integration.name === "grove-wishlist" ||
308
- integration.name === "tapcart-wishlist-api" ||
309
- integration.name === "swym") &&
310
- integration.enabled);
322
+ return integrations.some((integration) => WISHLIST_INTEGRATION_NAMES.has(integration.name) && integration.enabled);
323
+ };
324
+ export const getEnabledWishlistIntegration = (integrations) => {
325
+ if (!Array.isArray(integrations))
326
+ return null;
327
+ return (integrations.find((integration) => WISHLIST_INTEGRATION_NAMES.has(integration.name) &&
328
+ integration.enabled === true) || null);
329
+ };
330
+ export const supportsMultipleWishlists = (integration) => {
331
+ if (!integration)
332
+ return false;
333
+ if (!WISHLIST_INTEGRATION_NAMES.has(integration.name))
334
+ return false;
335
+ if (typeof integration.multiwishlist === "boolean") {
336
+ return integration.multiwishlist;
337
+ }
338
+ switch (integration.name) {
339
+ case "tapcart-wishlist":
340
+ case "tapcart-wishlist-v2":
341
+ case "tapcart-wishlist-api":
342
+ case "grove-wishlist":
343
+ case "swym":
344
+ return true;
345
+ default:
346
+ return false;
347
+ }
348
+ };
349
+ export const getWishlistAddItemNavigation = (productId, isAuthenticated = false) => {
350
+ return {
351
+ destination: {
352
+ type: "internal",
353
+ url: `wishlist-add-item?productId=${productId}`,
354
+ },
355
+ presentation: {
356
+ transition: "popover",
357
+ style: "default",
358
+ snapPoints: isAuthenticated ? [0.5, 0.75] : [0.3, 0.5, 0.75],
359
+ },
360
+ header: {
361
+ visible: false,
362
+ },
363
+ };
364
+ };
365
+ const normalizeShopifyId = (id) => {
366
+ if (typeof id !== "string" || id.length === 0)
367
+ return null;
368
+ const normalized = getIdFromGid(id);
369
+ return normalized || id;
370
+ };
371
+ const findWishlistEntries = (wishlists, productId, variantId) => {
372
+ if (!productId || !Array.isArray(wishlists) || wishlists.length === 0) {
373
+ return [];
374
+ }
375
+ const wishlistEntries = [];
376
+ const normalizedProductId = normalizeShopifyId(productId);
377
+ for (const wishlist of wishlists) {
378
+ const items = Array.isArray(wishlist === null || wishlist === void 0 ? void 0 : wishlist.items) ? wishlist.items : [];
379
+ for (const item of items) {
380
+ const normalizedItemProductId = normalizeShopifyId(item === null || item === void 0 ? void 0 : item.productId);
381
+ if (!normalizedItemProductId)
382
+ continue;
383
+ const productMatches = normalizedItemProductId === normalizedProductId ||
384
+ (item === null || item === void 0 ? void 0 : item.productId) === productId;
385
+ if (!productMatches)
386
+ continue;
387
+ if (variantId) {
388
+ const normalizedVariantId = normalizeShopifyId(variantId);
389
+ const normalizedItemVariantId = normalizeShopifyId(item === null || item === void 0 ? void 0 : item.variantId);
390
+ const variantMatches = normalizedItemVariantId === normalizedVariantId ||
391
+ (item === null || item === void 0 ? void 0 : item.variantId) === variantId;
392
+ if (!variantMatches)
393
+ continue;
394
+ }
395
+ wishlistEntries.push({
396
+ wishlistId: (wishlist === null || wishlist === void 0 ? void 0 : wishlist.id) || (wishlist === null || wishlist === void 0 ? void 0 : wishlist._id) || null,
397
+ item,
398
+ });
399
+ }
400
+ }
401
+ return wishlistEntries;
311
402
  };
312
403
  export const pluralize = (word, count, inclusive) => {
313
404
  return Pluralize(word, count, inclusive);
@@ -326,6 +417,102 @@ export const getInputPlaceholderTextProps = (placeholderText) => {
326
417
  : placeholderText.font.weight,
327
418
  };
328
419
  };
420
+ /**
421
+ * Adds an item to the wishlist. Depending on merchant integrations or if variants exist or if logged in drawer functionality is involved
422
+ * @param Tapcart
423
+ * @param integrations
424
+ * @param product
425
+ * @param selectedVariantId
426
+ */
427
+ export const addItemToWishlist = ({ Tapcart, integrations, product, selectedVariantId, }) => __awaiter(void 0, void 0, void 0, function* () {
428
+ var _a, _b, _c, _d, _e, _f, _g, _h;
429
+ const isAuthenticated = !!((_b = (_a = Tapcart === null || Tapcart === void 0 ? void 0 : Tapcart.variables) === null || _a === void 0 ? void 0 : _a.customer) === null || _b === void 0 ? void 0 : _b.id);
430
+ const defaultWishListId = ((_e = (_d = (_c = Tapcart === null || Tapcart === void 0 ? void 0 : Tapcart.variables) === null || _c === void 0 ? void 0 : _c.wishlists) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.id) || "Default Wishlist";
431
+ const wishlistIntegration = getEnabledWishlistIntegration(integrations);
432
+ if (!wishlistIntegration) {
433
+ // If no wishlist integration adding is not possible
434
+ return false;
435
+ }
436
+ const supportsMultipleLists = supportsMultipleWishlists(wishlistIntegration);
437
+ if (!product || !(product === null || product === void 0 ? void 0 : product.id)) {
438
+ console.error("Product is missing");
439
+ return false;
440
+ }
441
+ if (!Tapcart) {
442
+ console.error("Tapcart instance is missing");
443
+ return false;
444
+ }
445
+ try {
446
+ const shouldOpenDrawer = supportsMultipleLists ||
447
+ ((product === null || product === void 0 ? void 0 : product.variants) && ((_f = product === null || product === void 0 ? void 0 : product.variants) === null || _f === void 0 ? void 0 : _f.length) > 1) ||
448
+ !isAuthenticated;
449
+ if (shouldOpenDrawer) {
450
+ Tapcart === null || Tapcart === void 0 ? void 0 : Tapcart.action("screen/open", getWishlistAddItemNavigation(getIdFromGid(product === null || product === void 0 ? void 0 : product.id), isAuthenticated));
451
+ return false;
452
+ }
453
+ const variantId = selectedVariantId || ((_h = (_g = product === null || product === void 0 ? void 0 : product.variants) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.id);
454
+ if (!variantId) {
455
+ console.error("Missing variant id for wishlist add");
456
+ return false;
457
+ }
458
+ const result = yield Tapcart.action("wishlist/item/add", {
459
+ productId: getIdFromGid(product === null || product === void 0 ? void 0 : product.id),
460
+ variantId: getIdFromGid(variantId),
461
+ wishlistId: defaultWishListId,
462
+ });
463
+ return result;
464
+ }
465
+ catch (error) {
466
+ console.error("Failed to add to wishlist", error);
467
+ }
468
+ return false;
469
+ });
470
+ /**
471
+ * Removes an item from all wishlists by product ID.
472
+ *
473
+ * @param {Object} params - The parameters for the function.
474
+ * @param {any} params.Tapcart - The Tapcart instance.
475
+ * @param {string} params.productId - The ID of the product to remove.
476
+ * @returns {Promise<{ id: string; variantId: string; productId: string }[]>} - An array of removed wishlist entries.
477
+ */
478
+ export const removeItemFromWishlists = ({ Tapcart, productId, }) => __awaiter(void 0, void 0, void 0, function* () {
479
+ var _j, _k, _l, _m;
480
+ if (!Tapcart) {
481
+ console.error("Tapcart instance is missing");
482
+ return [];
483
+ }
484
+ const removedWishlistEntries = [];
485
+ try {
486
+ const wishlistEntries = findWishlistEntries((_j = Tapcart === null || Tapcart === void 0 ? void 0 : Tapcart.variables) === null || _j === void 0 ? void 0 : _j.wishlists, productId);
487
+ // Remove all wishlist entries for the product
488
+ for (const wishlistEntry of wishlistEntries) {
489
+ if (!((_k = wishlistEntry === null || wishlistEntry === void 0 ? void 0 : wishlistEntry.item) === null || _k === void 0 ? void 0 : _k.variantId)) {
490
+ console.error("Missing variant id for wishlist removal");
491
+ continue;
492
+ }
493
+ if (!(wishlistEntry === null || wishlistEntry === void 0 ? void 0 : wishlistEntry.wishlistId)) {
494
+ console.error("Missing wishlist id for wishlist removal");
495
+ continue;
496
+ }
497
+ const result = yield Tapcart.action("wishlist/item/remove", {
498
+ productId,
499
+ variantId: getIdFromGid((_l = wishlistEntry === null || wishlistEntry === void 0 ? void 0 : wishlistEntry.item) === null || _l === void 0 ? void 0 : _l.variantId),
500
+ wishlistId: getIdFromGid(wishlistEntry === null || wishlistEntry === void 0 ? void 0 : wishlistEntry.wishlistId),
501
+ });
502
+ if (result) {
503
+ removedWishlistEntries.push({
504
+ id: getIdFromGid(wishlistEntry === null || wishlistEntry === void 0 ? void 0 : wishlistEntry.wishlistId),
505
+ variantId: getIdFromGid((_m = wishlistEntry === null || wishlistEntry === void 0 ? void 0 : wishlistEntry.item) === null || _m === void 0 ? void 0 : _m.variantId),
506
+ productId,
507
+ });
508
+ }
509
+ }
510
+ }
511
+ catch (error) {
512
+ console.error("Failed to remove from wishlist", error);
513
+ }
514
+ return removedWishlistEntries;
515
+ });
329
516
  export const getBadgesForProductFn = (badgeConfig = {}, productTags = []) => {
330
517
  const badgePositions = ["below", "bottom", "top"];
331
518
  const badgesCombined = [];
package/dist/styles.css CHANGED
@@ -880,6 +880,9 @@ video {
880
880
  .mb-6 {
881
881
  margin-bottom: 1.5rem;
882
882
  }
883
+ .ml-0 {
884
+ margin-left: 0px;
885
+ }
883
886
  .ml-1 {
884
887
  margin-left: 0.25rem;
885
888
  }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=addItemToWishlist.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addItemToWishlist.test.d.ts","sourceRoot":"","sources":["../../../tests/addItemToWishlist/addItemToWishlist.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,198 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { addItemToWishlist } from "../../lib/utils";
11
+ describe("addItemToWishlist", () => {
12
+ let Tapcart;
13
+ let integrations;
14
+ let product;
15
+ let consoleErrorSpy;
16
+ beforeEach(() => {
17
+ jest.clearAllMocks();
18
+ consoleErrorSpy = jest.spyOn(console, "error").mockImplementation();
19
+ Tapcart = {
20
+ action: jest.fn().mockResolvedValue(true),
21
+ variables: {
22
+ customer: { id: "customer-123" },
23
+ wishlists: [
24
+ {
25
+ id: "gid://shopify/Wishlist/primary",
26
+ },
27
+ ],
28
+ },
29
+ };
30
+ integrations = [
31
+ {
32
+ name: "tapcart-wishlist",
33
+ enabled: true,
34
+ multiwishlist: false,
35
+ },
36
+ ];
37
+ product = {
38
+ id: "gid://shopify/Product/123",
39
+ variants: [{ id: "gid://shopify/ProductVariant/456" }],
40
+ };
41
+ });
42
+ afterEach(() => {
43
+ consoleErrorSpy.mockRestore();
44
+ });
45
+ describe("validation", () => {
46
+ it("returns false when no wishlist integration is enabled", () => __awaiter(void 0, void 0, void 0, function* () {
47
+ const result = yield addItemToWishlist({
48
+ Tapcart,
49
+ integrations: [],
50
+ product,
51
+ });
52
+ expect(result).toBe(false);
53
+ expect(Tapcart.action).not.toHaveBeenCalled();
54
+ }));
55
+ it("logs and returns false when product is missing", () => __awaiter(void 0, void 0, void 0, function* () {
56
+ const result = yield addItemToWishlist({
57
+ Tapcart,
58
+ integrations,
59
+ product: null,
60
+ });
61
+ expect(result).toBe(false);
62
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Product is missing");
63
+ expect(Tapcart.action).not.toHaveBeenCalled();
64
+ }));
65
+ it("logs and returns false when Tapcart instance is missing", () => __awaiter(void 0, void 0, void 0, function* () {
66
+ const result = yield addItemToWishlist({
67
+ Tapcart: null,
68
+ integrations,
69
+ product,
70
+ });
71
+ expect(result).toBe(false);
72
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Tapcart instance is missing");
73
+ }));
74
+ });
75
+ describe("drawer behavior", () => {
76
+ it("opens the wishlist drawer when multiple wishlists are supported", () => __awaiter(void 0, void 0, void 0, function* () {
77
+ const multiWishlistIntegrations = [
78
+ {
79
+ name: "tapcart-wishlist",
80
+ enabled: true,
81
+ multiwishlist: true,
82
+ },
83
+ ];
84
+ const result = yield addItemToWishlist({
85
+ Tapcart,
86
+ integrations: multiWishlistIntegrations,
87
+ product,
88
+ });
89
+ expect(result).toBe(false);
90
+ expect(Tapcart.action).toHaveBeenCalledWith("screen/open", expect.objectContaining({
91
+ destination: {
92
+ type: "internal",
93
+ url: "wishlist-add-item?productId=123",
94
+ },
95
+ }));
96
+ }));
97
+ it("opens the wishlist drawer when the product exposes multiple variants", () => __awaiter(void 0, void 0, void 0, function* () {
98
+ const result = yield addItemToWishlist({
99
+ Tapcart,
100
+ integrations,
101
+ product: {
102
+ id: product.id,
103
+ variants: [
104
+ { id: "gid://shopify/ProductVariant/111" },
105
+ { id: "gid://shopify/ProductVariant/222" },
106
+ ],
107
+ },
108
+ });
109
+ expect(result).toBe(false);
110
+ expect(Tapcart.action).toHaveBeenCalledWith("screen/open", expect.objectContaining({
111
+ destination: {
112
+ type: "internal",
113
+ url: "wishlist-add-item?productId=123",
114
+ },
115
+ }));
116
+ }));
117
+ it("opens the wishlist drawer when the customer is not authenticated", () => __awaiter(void 0, void 0, void 0, function* () {
118
+ Tapcart.variables.customer = null;
119
+ const result = yield addItemToWishlist({
120
+ Tapcart,
121
+ integrations,
122
+ product,
123
+ });
124
+ expect(result).toBe(false);
125
+ expect(Tapcart.action).toHaveBeenCalledWith("screen/open", expect.objectContaining({
126
+ presentation: expect.objectContaining({
127
+ snapPoints: [0.3, 0.5, 0.75],
128
+ }),
129
+ }));
130
+ }));
131
+ });
132
+ describe("direct add", () => {
133
+ it("adds the item using the provided variant id", () => __awaiter(void 0, void 0, void 0, function* () {
134
+ const result = yield addItemToWishlist({
135
+ Tapcart,
136
+ integrations,
137
+ product: { id: product.id, variants: [] },
138
+ selectedVariantId: "gid://shopify/ProductVariant/789",
139
+ });
140
+ expect(result).toBe(true);
141
+ expect(Tapcart.action).toHaveBeenCalledTimes(1);
142
+ expect(Tapcart.action).toHaveBeenCalledWith("wishlist/item/add", {
143
+ productId: "123",
144
+ variantId: "789",
145
+ wishlistId: "gid://shopify/Wishlist/primary",
146
+ });
147
+ }));
148
+ it("uses the first product variant when none is selected", () => __awaiter(void 0, void 0, void 0, function* () {
149
+ const result = yield addItemToWishlist({
150
+ Tapcart,
151
+ integrations,
152
+ product,
153
+ });
154
+ expect(result).toBe(true);
155
+ expect(Tapcart.action).toHaveBeenCalledWith("wishlist/item/add", {
156
+ productId: "123",
157
+ variantId: "456",
158
+ wishlistId: "gid://shopify/Wishlist/primary",
159
+ });
160
+ }));
161
+ it("falls back to the default wishlist id when none are present", () => __awaiter(void 0, void 0, void 0, function* () {
162
+ Tapcart.variables.wishlists = [];
163
+ const result = yield addItemToWishlist({
164
+ Tapcart,
165
+ integrations,
166
+ product: { id: product.id, variants: [] },
167
+ selectedVariantId: "gid://shopify/ProductVariant/456",
168
+ });
169
+ expect(result).toBe(true);
170
+ expect(Tapcart.action).toHaveBeenCalledWith("wishlist/item/add", {
171
+ productId: "123",
172
+ variantId: "456",
173
+ wishlistId: "Default Wishlist",
174
+ });
175
+ }));
176
+ it("logs and returns false when no variant id can be resolved", () => __awaiter(void 0, void 0, void 0, function* () {
177
+ const result = yield addItemToWishlist({
178
+ Tapcart,
179
+ integrations,
180
+ product: { id: product.id, variants: [] },
181
+ });
182
+ expect(result).toBe(false);
183
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Missing variant id for wishlist add");
184
+ expect(Tapcart.action).not.toHaveBeenCalled();
185
+ }));
186
+ it("logs and returns false when Tapcart action rejects", () => __awaiter(void 0, void 0, void 0, function* () {
187
+ Tapcart.action = jest.fn().mockRejectedValue(new Error("boom"));
188
+ const result = yield addItemToWishlist({
189
+ Tapcart,
190
+ integrations,
191
+ product: { id: product.id, variants: [] },
192
+ selectedVariantId: "gid://shopify/ProductVariant/999",
193
+ });
194
+ expect(result).toBe(false);
195
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Failed to add to wishlist", expect.any(Error));
196
+ }));
197
+ });
198
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=removeItemFromWishlists.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeItemFromWishlists.test.d.ts","sourceRoot":"","sources":["../../../tests/removeItemFromWishlists/removeItemFromWishlists.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,123 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { removeItemFromWishlists } from "../../lib/utils";
11
+ describe("removeItemFromWishlists", () => {
12
+ let mockTapcart;
13
+ let consoleErrorSpy;
14
+ beforeEach(() => {
15
+ jest.clearAllMocks();
16
+ consoleErrorSpy = jest.spyOn(console, "error").mockImplementation();
17
+ mockTapcart = {
18
+ action: jest.fn().mockResolvedValue(true),
19
+ variables: {
20
+ wishlists: [
21
+ {
22
+ id: "gid://shopify/Wishlist/1",
23
+ items: [
24
+ {
25
+ productId: "gid://shopify/Product/123",
26
+ variantId: "gid://shopify/ProductVariant/456",
27
+ },
28
+ ],
29
+ },
30
+ ],
31
+ },
32
+ };
33
+ });
34
+ afterEach(() => {
35
+ consoleErrorSpy.mockRestore();
36
+ });
37
+ it("returns an empty array and logs when Tapcart instance is missing", () => __awaiter(void 0, void 0, void 0, function* () {
38
+ const result = yield removeItemFromWishlists({
39
+ Tapcart: null,
40
+ productId: "gid://shopify/Product/123",
41
+ });
42
+ expect(result).toEqual([]);
43
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Tapcart instance is missing");
44
+ }));
45
+ it("logs and returns an empty array when removal throws", () => __awaiter(void 0, void 0, void 0, function* () {
46
+ mockTapcart.action = jest.fn().mockImplementation(() => {
47
+ throw new Error("boom");
48
+ });
49
+ const result = yield removeItemFromWishlists({
50
+ Tapcart: mockTapcart,
51
+ productId: "gid://shopify/Product/123",
52
+ });
53
+ expect(result).toEqual([]);
54
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Failed to remove from wishlist", expect.any(Error));
55
+ }));
56
+ it("removes every wishlist entry that matches the productId", () => __awaiter(void 0, void 0, void 0, function* () {
57
+ mockTapcart.variables.wishlists.push({
58
+ _id: "wishlist-2",
59
+ items: [
60
+ {
61
+ productId: "gid://shopify/Product/123",
62
+ variantId: "gid://shopify/ProductVariant/789",
63
+ },
64
+ {
65
+ productId: "gid://shopify/Product/999",
66
+ variantId: "gid://shopify/ProductVariant/000",
67
+ },
68
+ ],
69
+ });
70
+ const result = yield removeItemFromWishlists({
71
+ Tapcart: mockTapcart,
72
+ productId: "gid://shopify/Product/123",
73
+ });
74
+ expect(mockTapcart.action).toHaveBeenCalledTimes(2);
75
+ expect(mockTapcart.action).toHaveBeenNthCalledWith(1, "wishlist/item/remove", {
76
+ productId: "gid://shopify/Product/123",
77
+ variantId: "456",
78
+ wishlistId: "1",
79
+ });
80
+ expect(mockTapcart.action).toHaveBeenNthCalledWith(2, "wishlist/item/remove", {
81
+ productId: "gid://shopify/Product/123",
82
+ variantId: "789",
83
+ wishlistId: "wishlist-2",
84
+ });
85
+ expect(result).toEqual([
86
+ { id: "1", productId: "gid://shopify/Product/123", variantId: "456" },
87
+ {
88
+ id: "wishlist-2",
89
+ productId: "gid://shopify/Product/123",
90
+ variantId: "789",
91
+ },
92
+ ]);
93
+ }));
94
+ it("returns an empty array when no wishlist entries match", () => __awaiter(void 0, void 0, void 0, function* () {
95
+ const result = yield removeItemFromWishlists({
96
+ Tapcart: mockTapcart,
97
+ productId: "gid://shopify/Product/000",
98
+ });
99
+ expect(result).toEqual([]);
100
+ expect(mockTapcart.action).not.toHaveBeenCalled();
101
+ expect(consoleErrorSpy).not.toHaveBeenCalled();
102
+ }));
103
+ it("returns an empty array and logs when a variant id is missing", () => __awaiter(void 0, void 0, void 0, function* () {
104
+ mockTapcart.variables.wishlists[0].items[0].variantId = null;
105
+ const result = yield removeItemFromWishlists({
106
+ Tapcart: mockTapcart,
107
+ productId: "gid://shopify/Product/123",
108
+ });
109
+ expect(result).toEqual([]);
110
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Missing variant id for wishlist removal");
111
+ expect(mockTapcart.action).not.toHaveBeenCalled();
112
+ }));
113
+ it("returns an empty array and logs when a wishlist id is missing", () => __awaiter(void 0, void 0, void 0, function* () {
114
+ mockTapcart.variables.wishlists[0].id = null;
115
+ const result = yield removeItemFromWishlists({
116
+ Tapcart: mockTapcart,
117
+ productId: "gid://shopify/Product/123",
118
+ });
119
+ expect(result).toEqual([]);
120
+ expect(consoleErrorSpy).toHaveBeenCalledWith("Missing wishlist id for wishlist removal");
121
+ expect(mockTapcart.action).not.toHaveBeenCalled();
122
+ }));
123
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",