@shopify/shop-minis-react 0.0.13 → 0.0.14
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/_virtual/index2.js +3 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +2 -3
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/components/commerce/merchant-card.js +10 -4
- package/dist/components/commerce/merchant-card.js.map +1 -1
- package/dist/components/commerce/product-link.js +156 -163
- package/dist/components/commerce/product-link.js.map +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/dist/types/minisSDK.generated.d.js.map +1 -1
- package/package.json +1 -1
- package/src/components/commerce/merchant-card.tsx +5 -3
- package/src/components/commerce/product-link.tsx +8 -7
- package/src/types/minisSDK.generated.d.ts +52 -1
package/dist/_virtual/index2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -163,19 +163,25 @@ function q({ shop: e, touchable: a = !0 }) {
|
|
|
163
163
|
const { navigateToShop: t } = y(), {
|
|
164
164
|
id: n,
|
|
165
165
|
name: l,
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
reviewAnalytics: { averageRating: s, reviewCount: c },
|
|
167
|
+
visualTheme: v
|
|
168
168
|
} = e, w = C.useCallback(() => {
|
|
169
169
|
a && t({ shopId: n });
|
|
170
170
|
}, [t, n, a]);
|
|
171
171
|
return /* @__PURE__ */ i(d, { touchable: a, onPress: w, children: [
|
|
172
172
|
/* @__PURE__ */ i(m, { children: [
|
|
173
173
|
/* @__PURE__ */ r(f, { src: void 0, alt: `${l} featured image` }),
|
|
174
|
-
/* @__PURE__ */ r(
|
|
174
|
+
/* @__PURE__ */ r(
|
|
175
|
+
u,
|
|
176
|
+
{
|
|
177
|
+
src: v?.logoImage?.url,
|
|
178
|
+
alt: `${l} logo`
|
|
179
|
+
}
|
|
180
|
+
)
|
|
175
181
|
] }),
|
|
176
182
|
/* @__PURE__ */ i(h, { children: [
|
|
177
183
|
/* @__PURE__ */ r(g, { children: l }),
|
|
178
|
-
/* @__PURE__ */ r(p, { rating:
|
|
184
|
+
/* @__PURE__ */ r(p, { rating: s, reviewCount: c })
|
|
179
185
|
] })
|
|
180
186
|
] });
|
|
181
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merchant-card.js","sources":["../../../src/components/commerce/merchant-card.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Star} from 'lucide-react'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {cn} from '../../lib/utils'\nimport {type Shop} from '../../types/minisSDK.generated.d'\nimport {Touchable} from '../atoms/touchable'\n\nconst merchantCardVariants = cva(\n 'relative w-full aspect-square overflow-hidden rounded-xl border border-grayscale-l20 bg-grayscale-l0 flex flex-col',\n {\n variants: {\n touchable: {\n true: 'cursor-pointer',\n false: '',\n },\n },\n defaultVariants: {\n touchable: true,\n },\n }\n)\n\nfunction formatReviewCount(count: number): string {\n if (count >= 1000000) {\n return `${Math.floor(count / 100000) / 10}M`\n }\n if (count >= 1000) {\n return `${Math.floor(count / 1000)}K`\n }\n return count.toString()\n}\n\nfunction normalizeRating(rating: number): number {\n return Math.round(rating * 10) / 10\n}\n\nexport interface MerchantCardRootProps\n extends React.ComponentProps<'div'>,\n VariantProps<typeof merchantCardVariants> {\n touchable?: boolean\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction MerchantCardRoot({\n className,\n touchable = true,\n asChild = false,\n onPress,\n ...props\n}: MerchantCardRootProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div'\n\n const content = (\n <Comp\n className={cn(merchantCardVariants({touchable}), className)}\n {...props}\n />\n )\n\n if (touchable && onPress) {\n return (\n <Touchable\n onClick={onPress}\n whileTap={{opacity: 0.7}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n {content}\n </Touchable>\n )\n }\n\n return content\n}\n\nfunction MerchantCardImageContainer({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"merchant-card-image-container\"\n className={cn('relative overflow-hidden w-full flex-grow', className)}\n {...props}\n />\n )\n}\n\nfunction MerchantCardImage({\n className,\n src,\n alt,\n ...props\n}: React.ComponentProps<'img'> & {\n src?: string\n alt?: string\n}) {\n return src ? (\n <img\n data-slot=\"merchant-card-image\"\n src={src}\n alt={alt}\n className={cn('w-full h-full object-cover', className)}\n {...props}\n />\n ) : (\n <div className=\"w-full h-full bg-grayscale-l10\" />\n )\n}\n\nfunction MerchantCardLogo({\n className,\n src,\n alt,\n ...props\n}: React.ComponentProps<'div'> & {\n src?: string\n alt?: string\n}) {\n return (\n <div\n data-slot=\"merchant-card-logo\"\n className={cn(\n 'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',\n 'w-14 h-14 rounded-xl',\n 'flex items-center justify-center overflow-hidden',\n className\n )}\n {...props}\n >\n {src ? (\n <img src={src} alt={alt} className=\"w-full h-full object-cover\" />\n ) : (\n <div className=\"w-full h-full bg-grayscale-l20\" />\n )}\n </div>\n )\n}\n\nfunction MerchantCardInfo({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"merchant-card-info\"\n className={cn('p-3 space-y-1 flex-shrink-0', className)}\n {...props}\n />\n )\n}\n\nfunction MerchantCardName({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"merchant-card-name\"\n className={cn(\n 'text-sm font-medium text-grayscale-d100',\n 'truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction MerchantCardRating({\n className,\n rating,\n reviewCount,\n ...props\n}: React.ComponentProps<'div'> & {\n rating?: number | null\n reviewCount?: number\n}) {\n if (!rating || !reviewCount) return null\n\n return (\n <div\n data-slot=\"merchant-card-rating\"\n className={cn(\n 'flex items-center gap-1 text-sm text-grayscale-d100',\n className\n )}\n {...props}\n >\n <Star className=\"h-3.5 w-3.5 fill-current\" />\n <>\n {normalizeRating(rating)} ({formatReviewCount(reviewCount)})\n </>\n </div>\n )\n}\n\nexport interface MerchantCardProps {\n shop: Shop\n touchable?: boolean\n}\n\n// Composed MerchantCard component\nfunction MerchantCard({shop, touchable = true}: MerchantCardProps) {\n const {navigateToShop} = useShopNavigation()\n\n const {\n id,\n name,\n logoImage,\n reviewAnalytics: {averageRating, reviewCount},\n } = shop\n\n const handlePress = React.useCallback(() => {\n if (!touchable) return\n navigateToShop({shopId: id})\n }, [navigateToShop, id, touchable])\n\n return (\n <MerchantCardRoot touchable={touchable} onPress={handlePress}>\n <MerchantCardImageContainer>\n {/* TODO: Add featured image */}\n <MerchantCardImage src={undefined} alt={`${name} featured image`} />\n <MerchantCardLogo src={logoImage?.url} alt={`${name} logo`} />\n </MerchantCardImageContainer>\n\n <MerchantCardInfo>\n <MerchantCardName>{name}</MerchantCardName>\n <MerchantCardRating rating={averageRating} reviewCount={reviewCount} />\n </MerchantCardInfo>\n </MerchantCardRoot>\n )\n}\n\n// Export with Object.assign pattern\nexport const MerchantCardPrimitive = Object.assign(MerchantCardRoot, {\n ImageContainer: MerchantCardImageContainer,\n Image: MerchantCardImage,\n Logo: MerchantCardLogo,\n Info: MerchantCardInfo,\n Name: MerchantCardName,\n Rating: MerchantCardRating,\n})\n\nexport {\n // Composed component\n MerchantCard,\n // Primitive components for custom composition\n MerchantCardRoot,\n MerchantCardImageContainer,\n MerchantCardImage,\n MerchantCardLogo,\n MerchantCardInfo,\n MerchantCardName,\n MerchantCardRating,\n}\n"],"names":["merchantCardVariants","cva","formatReviewCount","count","normalizeRating","rating","MerchantCardRoot","className","touchable","asChild","onPress","props","content","jsx","SlotPrimitive.Slot","cn","Touchable","MerchantCardImageContainer","MerchantCardImage","src","alt","MerchantCardLogo","MerchantCardInfo","MerchantCardName","children","MerchantCardRating","reviewCount","jsxs","Star","Fragment","MerchantCard","shop","navigateToShop","useShopNavigation","id","name","logoImage","averageRating","handlePress","React","MerchantCardPrimitive"],"mappings":";;;;;;;;AAWA,MAAMA,IAAuBC;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,IACA,iBAAiB;AAAA,MACf,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ;AAEA,SAASC,EAAkBC,GAAuB;AAChD,SAAIA,KAAS,MACJ,GAAG,KAAK,MAAMA,IAAQ,GAAM,IAAI,EAAE,MAEvCA,KAAS,MACJ,GAAG,KAAK,MAAMA,IAAQ,GAAI,CAAC,MAE7BA,EAAM,SAAS;AACxB;AAEA,SAASC,EAAgBC,GAAwB;AAC/C,SAAO,KAAK,MAAMA,IAAS,EAAE,IAAI;AACnC;AAUA,SAASC,EAAiB;AAAA,EACxB,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,SAAAC;AAAA,EACA,GAAGC;AACL,GAA0B;AAGxB,QAAMC,IACJ,gBAAAC;AAAA,IAHWJ,IAAUK,IAAqB;AAAA,IAGzC;AAAA,MACC,WAAWC,EAAGf,E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C,gBAAAwB,EAAc,IAAIC,EAAkB,GAErC;AAAA,IACJ,IAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAiB,EAAC,eAAAC,GAAe,aAAAX,EAAW;AAAA,EAAA,IAC1CK,GAEEO,IAAcC,EAAM,YAAY,MAAM;AAC1C,IAAK/B,KACUwB,EAAA,EAAC,QAAQE,GAAG;AAAA,EAC1B,GAAA,CAACF,GAAgBE,GAAI1B,CAAS,CAAC;AAElC,SACG,gBAAAmB,EAAArB,GAAA,EAAiB,WAAAE,GAAsB,SAAS8B,GAC/C,UAAA;AAAA,IAAA,gBAAAX,EAACV,GAEC,EAAA,UAAA;AAAA,MAAA,gBAAAJ,EAACK,KAAkB,KAAK,QAAW,KAAK,GAAGiB,CAAI,mBAAmB;AAAA,MAClE,gBAAAtB,EAACQ,KAAiB,KAAKe,GAAW,KAAK,KAAK,GAAGD,CAAI,QAAS,CAAA;AAAA,IAAA,GAC9D;AAAA,sBAECb,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAT,EAACU,KAAkB,UAAKY,EAAA,CAAA;AAAA,MACvB,gBAAAtB,EAAAY,GAAA,EAAmB,QAAQY,GAAe,aAAAX,EAA0B,CAAA;AAAA,IAAA,EACvE,CAAA;AAAA,EAAA,GACF;AAEJ;AAGa,MAAAc,IAAwB,OAAO,OAAOlC,GAAkB;AAAA,EACnE,gBAAgBW;AAAA,EAChB,OAAOC;AAAA,EACP,MAAMG;AAAA,EACN,MAAMC;AAAA,EACN,MAAMC;AAAA,EACN,QAAQE;AACV,CAAC;"}
|
|
1
|
+
{"version":3,"file":"merchant-card.js","sources":["../../../src/components/commerce/merchant-card.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Star} from 'lucide-react'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {cn} from '../../lib/utils'\nimport {type Shop} from '../../types/minisSDK.generated.d'\nimport {Touchable} from '../atoms/touchable'\n\nconst merchantCardVariants = cva(\n 'relative w-full aspect-square overflow-hidden rounded-xl border border-grayscale-l20 bg-grayscale-l0 flex flex-col',\n {\n variants: {\n touchable: {\n true: 'cursor-pointer',\n false: '',\n },\n },\n defaultVariants: {\n touchable: true,\n },\n }\n)\n\nfunction formatReviewCount(count: number): string {\n if (count >= 1000000) {\n return `${Math.floor(count / 100000) / 10}M`\n }\n if (count >= 1000) {\n return `${Math.floor(count / 1000)}K`\n }\n return count.toString()\n}\n\nfunction normalizeRating(rating: number): number {\n return Math.round(rating * 10) / 10\n}\n\nexport interface MerchantCardRootProps\n extends React.ComponentProps<'div'>,\n VariantProps<typeof merchantCardVariants> {\n touchable?: boolean\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction MerchantCardRoot({\n className,\n touchable = true,\n asChild = false,\n onPress,\n ...props\n}: MerchantCardRootProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div'\n\n const content = (\n <Comp\n className={cn(merchantCardVariants({touchable}), className)}\n {...props}\n />\n )\n\n if (touchable && onPress) {\n return (\n <Touchable\n onClick={onPress}\n whileTap={{opacity: 0.7}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n {content}\n </Touchable>\n )\n }\n\n return content\n}\n\nfunction MerchantCardImageContainer({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"merchant-card-image-container\"\n className={cn('relative overflow-hidden w-full flex-grow', className)}\n {...props}\n />\n )\n}\n\nfunction MerchantCardImage({\n className,\n src,\n alt,\n ...props\n}: React.ComponentProps<'img'> & {\n src?: string\n alt?: string\n}) {\n return src ? (\n <img\n data-slot=\"merchant-card-image\"\n src={src}\n alt={alt}\n className={cn('w-full h-full object-cover', className)}\n {...props}\n />\n ) : (\n <div className=\"w-full h-full bg-grayscale-l10\" />\n )\n}\n\nfunction MerchantCardLogo({\n className,\n src,\n alt,\n ...props\n}: React.ComponentProps<'div'> & {\n src?: string\n alt?: string\n}) {\n return (\n <div\n data-slot=\"merchant-card-logo\"\n className={cn(\n 'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',\n 'w-14 h-14 rounded-xl',\n 'flex items-center justify-center overflow-hidden',\n className\n )}\n {...props}\n >\n {src ? (\n <img src={src} alt={alt} className=\"w-full h-full object-cover\" />\n ) : (\n <div className=\"w-full h-full bg-grayscale-l20\" />\n )}\n </div>\n )\n}\n\nfunction MerchantCardInfo({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"merchant-card-info\"\n className={cn('p-3 space-y-1 flex-shrink-0', className)}\n {...props}\n />\n )\n}\n\nfunction MerchantCardName({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"merchant-card-name\"\n className={cn(\n 'text-sm font-medium text-grayscale-d100',\n 'truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction MerchantCardRating({\n className,\n rating,\n reviewCount,\n ...props\n}: React.ComponentProps<'div'> & {\n rating?: number | null\n reviewCount?: number\n}) {\n if (!rating || !reviewCount) return null\n\n return (\n <div\n data-slot=\"merchant-card-rating\"\n className={cn(\n 'flex items-center gap-1 text-sm text-grayscale-d100',\n className\n )}\n {...props}\n >\n <Star className=\"h-3.5 w-3.5 fill-current\" />\n <>\n {normalizeRating(rating)} ({formatReviewCount(reviewCount)})\n </>\n </div>\n )\n}\n\nexport interface MerchantCardProps {\n shop: Shop\n touchable?: boolean\n}\n\n// Composed MerchantCard component\nfunction MerchantCard({shop, touchable = true}: MerchantCardProps) {\n const {navigateToShop} = useShopNavigation()\n\n const {\n id,\n name,\n reviewAnalytics: {averageRating, reviewCount},\n visualTheme,\n } = shop\n\n const handlePress = React.useCallback(() => {\n if (!touchable) return\n navigateToShop({shopId: id})\n }, [navigateToShop, id, touchable])\n\n return (\n <MerchantCardRoot touchable={touchable} onPress={handlePress}>\n <MerchantCardImageContainer>\n {/* TODO: Add featured image */}\n <MerchantCardImage src={undefined} alt={`${name} featured image`} />\n <MerchantCardLogo\n src={visualTheme?.logoImage?.url}\n alt={`${name} logo`}\n />\n </MerchantCardImageContainer>\n\n <MerchantCardInfo>\n <MerchantCardName>{name}</MerchantCardName>\n <MerchantCardRating rating={averageRating} reviewCount={reviewCount} />\n </MerchantCardInfo>\n </MerchantCardRoot>\n )\n}\n\nexport const MerchantCardPrimitive = Object.assign(MerchantCardRoot, {\n ImageContainer: MerchantCardImageContainer,\n Image: MerchantCardImage,\n Logo: MerchantCardLogo,\n Info: MerchantCardInfo,\n Name: MerchantCardName,\n Rating: MerchantCardRating,\n})\n\nexport {\n // Composed component\n MerchantCard,\n // Primitive components for custom composition\n MerchantCardRoot,\n MerchantCardImageContainer,\n MerchantCardImage,\n MerchantCardLogo,\n MerchantCardInfo,\n MerchantCardName,\n MerchantCardRating,\n}\n"],"names":["merchantCardVariants","cva","formatReviewCount","count","normalizeRating","rating","MerchantCardRoot","className","touchable","asChild","onPress","props","content","jsx","SlotPrimitive.Slot","cn","Touchable","MerchantCardImageContainer","MerchantCardImage","src","alt","MerchantCardLogo","MerchantCardInfo","MerchantCardName","children","MerchantCardRating","reviewCount","jsxs","Star","Fragment","MerchantCard","shop","navigateToShop","useShopNavigation","id","name","averageRating","visualTheme","handlePress","React","MerchantCardPrimitive"],"mappings":";;;;;;;;AAWA,MAAMA,IAAuBC;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,IACA,iBAAiB;AAAA,MACf,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ;AAEA,SAASC,EAAkBC,GAAuB;AAChD,SAAIA,KAAS,MACJ,GAAG,KAAK,MAAMA,IAAQ,GAAM,IAAI,EAAE,MAEvCA,KAAS,MACJ,GAAG,KAAK,MA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AAwB,OAAO,OAAOlC,GAAkB;AAAA,EACnE,gBAAgBW;AAAA,EAChB,OAAOC;AAAA,EACP,MAAMG;AAAA,EACN,MAAMC;AAAA,EACN,MAAMC;AAAA,EACN,QAAQE;AACV,CAAC;"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useShopNavigation as
|
|
5
|
-
import { useSavedProductsActions as
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import * as k from "react";
|
|
3
|
+
import { cva as j } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { useShopNavigation as F } from "../../hooks/navigation/useShopNavigation.js";
|
|
5
|
+
import { useSavedProductsActions as O } from "../../hooks/user/useSavedProductsActions.js";
|
|
6
|
+
import { formatMoney as b } from "../../lib/formatMoney.js";
|
|
6
7
|
import { cn as n } from "../../lib/utils.js";
|
|
7
8
|
import { Button as M } from "../atoms/button.js";
|
|
8
|
-
import { Card as
|
|
9
|
+
import { Card as D, CardContent as q, CardAction as B } from "../atoms/card.js";
|
|
9
10
|
import { Touchable as A } from "../atoms/touchable.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { Root as
|
|
13
|
-
const
|
|
11
|
+
import H from "../../node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/star.js";
|
|
12
|
+
import U from "../../node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/heart.js";
|
|
13
|
+
import { Root as _ } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js";
|
|
14
|
+
const E = j("", {
|
|
14
15
|
variants: {
|
|
15
16
|
layout: {
|
|
16
17
|
horizontal: "w-full !flex-row items-center gap-3 px-4 py-3",
|
|
@@ -27,29 +28,29 @@ const G = F("", {
|
|
|
27
28
|
discount: "none"
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
|
-
function
|
|
31
|
-
className:
|
|
32
|
-
layout:
|
|
33
|
-
discount:
|
|
34
|
-
asChild:
|
|
35
|
-
onPress:
|
|
31
|
+
function G({
|
|
32
|
+
className: o,
|
|
33
|
+
layout: e,
|
|
34
|
+
discount: r,
|
|
35
|
+
asChild: i = !1,
|
|
36
|
+
onPress: a,
|
|
36
37
|
...s
|
|
37
38
|
}) {
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ t(
|
|
39
40
|
A,
|
|
40
41
|
{
|
|
41
|
-
onClick:
|
|
42
|
+
onClick: a,
|
|
42
43
|
whileTap: { opacity: 0.7 },
|
|
43
44
|
transition: {
|
|
44
45
|
opacity: { type: "tween", duration: 0.08, ease: "easeInOut" }
|
|
45
46
|
},
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
|
|
47
|
+
children: /* @__PURE__ */ t(
|
|
48
|
+
i ? _ : D,
|
|
48
49
|
{
|
|
49
50
|
className: n(
|
|
50
|
-
|
|
51
|
+
E({ layout: e, discount: r }),
|
|
51
52
|
"border-0 bg-white rounded-xl shadow-lg shadow-black/10",
|
|
52
|
-
|
|
53
|
+
o
|
|
53
54
|
),
|
|
54
55
|
...s
|
|
55
56
|
}
|
|
@@ -57,148 +58,148 @@ function J({
|
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
className:
|
|
62
|
-
layout:
|
|
63
|
-
...
|
|
61
|
+
function J({
|
|
62
|
+
className: o,
|
|
63
|
+
layout: e = "horizontal",
|
|
64
|
+
...r
|
|
64
65
|
}) {
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ t(
|
|
66
67
|
"div",
|
|
67
68
|
{
|
|
68
69
|
"data-slot": "product-link-image",
|
|
69
70
|
className: n(
|
|
70
71
|
"overflow-hidden rounded-md bg-muted",
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
e === "horizontal" ? "h-16 w-16 flex-shrink-0" : "aspect-square w-full",
|
|
73
|
+
o
|
|
73
74
|
),
|
|
74
|
-
...
|
|
75
|
+
...r
|
|
75
76
|
}
|
|
76
77
|
);
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
className:
|
|
80
|
-
layout:
|
|
81
|
-
...
|
|
79
|
+
function K({
|
|
80
|
+
className: o,
|
|
81
|
+
layout: e = "horizontal",
|
|
82
|
+
...r
|
|
82
83
|
}) {
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
84
|
+
return /* @__PURE__ */ t(
|
|
85
|
+
q,
|
|
85
86
|
{
|
|
86
87
|
className: n(
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
e === "horizontal" ? "flex-1 min-w-0 space-y-1 px-0 py-0" : "space-y-2",
|
|
89
|
+
o
|
|
89
90
|
),
|
|
90
|
-
...
|
|
91
|
+
...r
|
|
91
92
|
}
|
|
92
93
|
);
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
className:
|
|
96
|
-
children:
|
|
97
|
-
...
|
|
95
|
+
function Q({
|
|
96
|
+
className: o,
|
|
97
|
+
children: e,
|
|
98
|
+
...r
|
|
98
99
|
}) {
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ t(
|
|
100
101
|
"h3",
|
|
101
102
|
{
|
|
102
103
|
"data-slot": "product-link-title",
|
|
103
104
|
className: n(
|
|
104
105
|
"text-sm font-medium leading-tight text-gray-900 truncate overflow-hidden whitespace-nowrap text-ellipsis",
|
|
105
|
-
|
|
106
|
+
o
|
|
106
107
|
),
|
|
107
|
-
...
|
|
108
|
-
children:
|
|
108
|
+
...r,
|
|
109
|
+
children: e
|
|
109
110
|
}
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
return /* @__PURE__ */
|
|
113
|
+
function W({ className: o, ...e }) {
|
|
114
|
+
return /* @__PURE__ */ t(
|
|
114
115
|
"div",
|
|
115
116
|
{
|
|
116
117
|
"data-slot": "product-link-price",
|
|
117
|
-
className: n("flex items-center gap-2",
|
|
118
|
-
...
|
|
118
|
+
className: n("flex items-center gap-2", o),
|
|
119
|
+
...e
|
|
119
120
|
}
|
|
120
121
|
);
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
-
className:
|
|
124
|
-
...
|
|
123
|
+
function X({
|
|
124
|
+
className: o,
|
|
125
|
+
...e
|
|
125
126
|
}) {
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ t(
|
|
127
128
|
"span",
|
|
128
129
|
{
|
|
129
130
|
"data-slot": "product-link-current-price",
|
|
130
|
-
className: n("text-sm font-semibold text-gray-900",
|
|
131
|
-
...
|
|
131
|
+
className: n("text-sm font-semibold text-gray-900", o),
|
|
132
|
+
...e
|
|
132
133
|
}
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
className:
|
|
137
|
-
...
|
|
136
|
+
function Y({
|
|
137
|
+
className: o,
|
|
138
|
+
...e
|
|
138
139
|
}) {
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ t(
|
|
140
141
|
"span",
|
|
141
142
|
{
|
|
142
143
|
"data-slot": "product-link-original-price",
|
|
143
|
-
className: n("text-sm text-gray-500 line-through",
|
|
144
|
-
...
|
|
144
|
+
className: n("text-sm text-gray-500 line-through", o),
|
|
145
|
+
...e
|
|
145
146
|
}
|
|
146
147
|
);
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
-
className:
|
|
150
|
-
...
|
|
149
|
+
function Z({
|
|
150
|
+
className: o,
|
|
151
|
+
...e
|
|
151
152
|
}) {
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ t(
|
|
153
154
|
"span",
|
|
154
155
|
{
|
|
155
156
|
"data-slot": "product-link-discount-price",
|
|
156
|
-
className: n("text-sm font-semibold text-red-600",
|
|
157
|
-
...
|
|
157
|
+
className: n("text-sm font-semibold text-red-600", o),
|
|
158
|
+
...e
|
|
158
159
|
}
|
|
159
160
|
);
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
-
return /* @__PURE__ */
|
|
162
|
+
function $({ className: o, ...e }) {
|
|
163
|
+
return /* @__PURE__ */ t(
|
|
163
164
|
"div",
|
|
164
165
|
{
|
|
165
166
|
"data-slot": "product-link-rating",
|
|
166
167
|
className: n(
|
|
167
168
|
"flex items-center gap-1 text-xs text-muted-foreground",
|
|
168
|
-
|
|
169
|
+
o
|
|
169
170
|
),
|
|
170
|
-
...
|
|
171
|
+
...e
|
|
171
172
|
}
|
|
172
173
|
);
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
className:
|
|
176
|
-
onActionPress:
|
|
177
|
-
filled:
|
|
178
|
-
...
|
|
175
|
+
function tt({
|
|
176
|
+
className: o,
|
|
177
|
+
onActionPress: e,
|
|
178
|
+
filled: r = !1,
|
|
179
|
+
...i
|
|
179
180
|
}) {
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
181
|
+
return /* @__PURE__ */ t(
|
|
182
|
+
B,
|
|
182
183
|
{
|
|
183
|
-
className: n("flex-shrink-0 self-center px-0 py-0",
|
|
184
|
-
...
|
|
185
|
-
children: /* @__PURE__ */
|
|
184
|
+
className: n("flex-shrink-0 self-center px-0 py-0", o),
|
|
185
|
+
...i,
|
|
186
|
+
children: /* @__PURE__ */ t(
|
|
186
187
|
A,
|
|
187
188
|
{
|
|
188
189
|
stopPropagation: !0,
|
|
189
|
-
onClick:
|
|
190
|
+
onClick: e,
|
|
190
191
|
whileTap: { opacity: 0.7, scale: 0.95 },
|
|
191
192
|
transition: {
|
|
192
193
|
opacity: { type: "tween", duration: 0.08, ease: "easeInOut" },
|
|
193
194
|
scale: { type: "tween", duration: 0.08, ease: "easeInOut" }
|
|
194
195
|
},
|
|
195
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ t(
|
|
196
197
|
M,
|
|
197
198
|
{
|
|
198
199
|
variant: "borderless",
|
|
199
200
|
size: "icon",
|
|
200
201
|
className: "h-auto w-auto p-0 hover:bg-transparent",
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
+
children: /* @__PURE__ */ t(U, { fill: r ? "currentColor" : "none", className: "h-4 w-4" })
|
|
202
203
|
}
|
|
203
204
|
)
|
|
204
205
|
}
|
|
@@ -206,104 +207,96 @@ function et({
|
|
|
206
207
|
}
|
|
207
208
|
);
|
|
208
209
|
}
|
|
209
|
-
function pt({ product:
|
|
210
|
-
const { navigateToProduct:
|
|
211
|
-
id:
|
|
210
|
+
function pt({ product: o }) {
|
|
211
|
+
const { navigateToProduct: e } = F(), { saveProduct: r, unsaveProduct: i } = O(), {
|
|
212
|
+
id: a,
|
|
212
213
|
title: s,
|
|
213
|
-
featuredImage:
|
|
214
|
-
reviewAnalytics:
|
|
215
|
-
price:
|
|
216
|
-
compareAtPrice:
|
|
214
|
+
featuredImage: p,
|
|
215
|
+
reviewAnalytics: P,
|
|
216
|
+
price: l,
|
|
217
|
+
compareAtPrice: d,
|
|
217
218
|
isFavorited: z,
|
|
218
|
-
selectedVariant:
|
|
219
|
-
defaultVariantId:
|
|
220
|
-
shop:
|
|
221
|
-
} =
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
selectedVariant: f,
|
|
220
|
+
defaultVariantId: h,
|
|
221
|
+
shop: g
|
|
222
|
+
} = o, [x, C] = k.useState(z), y = P?.averageRating, N = P?.reviewCount;
|
|
223
|
+
l?.currencyCode;
|
|
224
|
+
const v = l?.amount ? b(l?.amount, l?.currencyCode) : void 0, I = p?.url, T = p?.altText || s, w = d?.amount ? b(d?.amount, d?.currencyCode) : void 0;
|
|
225
|
+
d?.currencyCode;
|
|
226
|
+
const L = w && w !== v, R = k.useCallback(() => {
|
|
227
|
+
e({
|
|
228
|
+
productId: a
|
|
224
229
|
});
|
|
225
|
-
}, [
|
|
226
|
-
const
|
|
227
|
-
C(!
|
|
230
|
+
}, [e, a]), S = k.useCallback(async () => {
|
|
231
|
+
const u = x;
|
|
232
|
+
C(!u);
|
|
228
233
|
try {
|
|
229
|
-
|
|
230
|
-
productId:
|
|
231
|
-
shopId:
|
|
232
|
-
productVariantId:
|
|
233
|
-
}) : await
|
|
234
|
-
productId:
|
|
235
|
-
shopId:
|
|
236
|
-
productVariantId:
|
|
234
|
+
u ? await i({
|
|
235
|
+
productId: a,
|
|
236
|
+
shopId: g.id,
|
|
237
|
+
productVariantId: f?.id || h
|
|
238
|
+
}) : await r({
|
|
239
|
+
productId: a,
|
|
240
|
+
shopId: g.id,
|
|
241
|
+
productVariantId: f?.id || h
|
|
237
242
|
});
|
|
238
243
|
} catch {
|
|
239
|
-
C(
|
|
244
|
+
C(u);
|
|
240
245
|
}
|
|
241
246
|
}, [
|
|
247
|
+
x,
|
|
248
|
+
a,
|
|
249
|
+
g.id,
|
|
250
|
+
f?.id,
|
|
242
251
|
h,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
m?.id,
|
|
246
|
-
p,
|
|
247
|
-
o,
|
|
248
|
-
c
|
|
252
|
+
r,
|
|
253
|
+
i
|
|
249
254
|
]);
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
|
|
255
|
+
return /* @__PURE__ */ c(
|
|
256
|
+
G,
|
|
252
257
|
{
|
|
253
258
|
layout: "horizontal",
|
|
254
|
-
discount:
|
|
255
|
-
onPress:
|
|
259
|
+
discount: L ? "small" : "none",
|
|
260
|
+
onPress: R,
|
|
256
261
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ t(J, { layout: "horizontal", children: I ? /* @__PURE__ */ t(
|
|
258
263
|
"img",
|
|
259
264
|
{
|
|
260
|
-
src:
|
|
265
|
+
src: I,
|
|
261
266
|
alt: T,
|
|
262
267
|
className: "h-full w-full object-cover"
|
|
263
268
|
}
|
|
264
|
-
) : /* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
N &&
|
|
268
|
-
Array.from({ length: 5 }, (
|
|
269
|
-
|
|
269
|
+
) : /* @__PURE__ */ t("div", { className: "h-full w-full bg-muted flex items-center justify-center text-muted-foreground text-xs", children: "No Image" }) }),
|
|
270
|
+
/* @__PURE__ */ c(K, { layout: "horizontal", children: [
|
|
271
|
+
/* @__PURE__ */ t(Q, { children: s }),
|
|
272
|
+
N && y && /* @__PURE__ */ t($, { children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
273
|
+
Array.from({ length: 5 }, (u, m) => /* @__PURE__ */ t(
|
|
274
|
+
H,
|
|
270
275
|
{
|
|
271
|
-
fill:
|
|
276
|
+
fill: m < Math.floor(y) ? "currentColor" : "none",
|
|
272
277
|
className: n(
|
|
273
278
|
"h-3 w-3",
|
|
274
|
-
|
|
279
|
+
m < Math.floor(y) ? "text-primary" : "text-gray-300"
|
|
275
280
|
)
|
|
276
281
|
},
|
|
277
|
-
|
|
282
|
+
m
|
|
278
283
|
)),
|
|
279
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ c("span", { className: "text-xs text-gray-600 ml-1", children: [
|
|
280
285
|
"(",
|
|
281
286
|
N,
|
|
282
287
|
")"
|
|
283
288
|
] })
|
|
284
289
|
] }) }),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
x
|
|
290
|
-
] }),
|
|
291
|
-
/* @__PURE__ */ a(Z, { children: [
|
|
292
|
-
R,
|
|
293
|
-
" ",
|
|
294
|
-
y
|
|
295
|
-
] })
|
|
296
|
-
] }) : /* @__PURE__ */ a(Y, { children: [
|
|
297
|
-
I,
|
|
298
|
-
" ",
|
|
299
|
-
x
|
|
300
|
-
] }) })
|
|
290
|
+
/* @__PURE__ */ t(W, { children: L ? /* @__PURE__ */ c(V, { children: [
|
|
291
|
+
/* @__PURE__ */ t(Z, { children: v }),
|
|
292
|
+
/* @__PURE__ */ t(Y, { children: w })
|
|
293
|
+
] }) : /* @__PURE__ */ t(X, { children: v }) })
|
|
301
294
|
] }),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
295
|
+
/* @__PURE__ */ t(
|
|
296
|
+
tt,
|
|
304
297
|
{
|
|
305
|
-
filled:
|
|
306
|
-
onActionPress:
|
|
298
|
+
filled: x,
|
|
299
|
+
onActionPress: S
|
|
307
300
|
}
|
|
308
301
|
)
|
|
309
302
|
]
|
|
@@ -312,15 +305,15 @@ function pt({ product: r }) {
|
|
|
312
305
|
}
|
|
313
306
|
export {
|
|
314
307
|
pt as ProductLink,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
308
|
+
tt as ProductLinkActions,
|
|
309
|
+
X as ProductLinkCurrentPrice,
|
|
310
|
+
Z as ProductLinkDiscountPrice,
|
|
311
|
+
J as ProductLinkImage,
|
|
312
|
+
K as ProductLinkInfo,
|
|
313
|
+
Y as ProductLinkOriginalPrice,
|
|
314
|
+
W as ProductLinkPrice,
|
|
315
|
+
$ as ProductLinkRating,
|
|
316
|
+
G as ProductLinkRoot,
|
|
317
|
+
Q as ProductLinkTitle
|
|
325
318
|
};
|
|
326
319
|
//# sourceMappingURL=product-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-link.js","sources":["../../../src/components/commerce/product-link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Heart, Star} from 'lucide-react'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {useSavedProductsActions} from '../../hooks/user/useSavedProductsActions'\nimport {cn} from '../../lib/utils'\nimport {type Product} from '../../types/minisSDK.generated.d'\nimport {Button} from '../atoms/button'\nimport {Card, CardContent, CardAction} from '../atoms/card'\nimport {Touchable} from '../atoms/touchable'\n\nconst productLinkVariants = cva('', {\n variants: {\n layout: {\n horizontal: 'w-full !flex-row items-center gap-3 px-4 py-3',\n vertical: 'flex-col',\n },\n discount: {\n none: '',\n small: '',\n large: '',\n },\n },\n defaultVariants: {\n layout: 'horizontal',\n discount: 'none',\n },\n})\n\n// Primitive components (building blocks)\nexport interface ProductLinkRootProps\n extends React.ComponentProps<typeof Card>,\n VariantProps<typeof productLinkVariants> {\n layout?: 'horizontal' | 'vertical'\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction ProductLinkRoot({\n className,\n layout,\n discount,\n asChild = false,\n onPress,\n ...props\n}: ProductLinkRootProps) {\n const Comp = asChild ? SlotPrimitive.Root : Card\n\n return (\n <Touchable\n onClick={onPress}\n whileTap={{opacity: 0.7}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n <Comp\n className={cn(\n productLinkVariants({layout, discount}),\n 'border-0 bg-white rounded-xl shadow-lg shadow-black/10',\n className\n )}\n {...props}\n />\n </Touchable>\n )\n}\n\nfunction ProductLinkImage({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<'div'> & {layout?: 'horizontal' | 'vertical'}) {\n return (\n <div\n data-slot=\"product-link-image\"\n className={cn(\n 'overflow-hidden rounded-md bg-muted',\n layout === 'horizontal'\n ? 'h-16 w-16 flex-shrink-0'\n : 'aspect-square w-full',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkInfo({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<typeof CardContent> & {\n layout?: 'horizontal' | 'vertical'\n}) {\n return (\n <CardContent\n className={cn(\n layout === 'horizontal'\n ? 'flex-1 min-w-0 space-y-1 px-0 py-0'\n : 'space-y-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkTitle({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"product-link-title\"\n className={cn(\n 'text-sm font-medium leading-tight text-gray-900 truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction ProductLinkPrice({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-price\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkCurrentPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-current-price\"\n className={cn('text-sm font-semibold text-gray-900', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkOriginalPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-original-price\"\n className={cn('text-sm text-gray-500 line-through', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkDiscountPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-discount-price\"\n className={cn('text-sm font-semibold text-red-600', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkRating({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-rating\"\n className={cn(\n 'flex items-center gap-1 text-xs text-muted-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkActions({\n className,\n onActionPress,\n filled = false,\n ...props\n}: React.ComponentProps<typeof CardAction> & {\n onActionPress?: () => void\n filled?: boolean\n}) {\n return (\n <CardAction\n className={cn('flex-shrink-0 self-center px-0 py-0', className)}\n {...props}\n >\n <Touchable\n stopPropagation\n onClick={onActionPress}\n whileTap={{opacity: 0.7, scale: 0.95}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n scale: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n <Button\n variant=\"borderless\"\n size=\"icon\"\n className=\"h-auto w-auto p-0 hover:bg-transparent\"\n >\n <Heart fill={filled ? 'currentColor' : 'none'} className=\"h-4 w-4\" />\n </Button>\n </Touchable>\n </CardAction>\n )\n}\n\nexport interface ProductLinkProps {\n product: Product\n}\n\n// Composed ProductLink component\nfunction ProductLink({product}: ProductLinkProps) {\n const {navigateToProduct} = useShopNavigation()\n const {saveProduct, unsaveProduct} = useSavedProductsActions()\n\n const {\n id,\n title,\n featuredImage,\n reviewAnalytics,\n price,\n compareAtPrice,\n isFavorited,\n selectedVariant,\n defaultVariantId,\n shop,\n } = product\n\n // Local state for optimistic UI updates\n const [isFavoritedLocal, setIsFavoritedLocal] = React.useState(isFavorited)\n\n const averageRating = reviewAnalytics?.averageRating\n const reviewCount = reviewAnalytics?.reviewCount\n const currencyCode = price?.currencyCode\n const amount = price?.amount\n const imageUrl = featuredImage?.url\n const imageAltText = featuredImage?.altText || title\n const compareAtPriceAmount = compareAtPrice?.amount\n const compareAtPriceCurrencyCode = compareAtPrice?.currencyCode\n const hasDiscount = compareAtPriceAmount && compareAtPriceAmount !== amount\n\n const handlePress = React.useCallback(() => {\n navigateToProduct({\n productId: id,\n })\n }, [navigateToProduct, id])\n\n const handleActionPress = React.useCallback(async () => {\n const previousState = isFavoritedLocal\n\n // Optimistic update\n setIsFavoritedLocal(!previousState)\n\n try {\n if (previousState) {\n await unsaveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n } else {\n await saveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n }\n } catch (error) {\n // Revert optimistic update on error\n setIsFavoritedLocal(previousState)\n }\n }, [\n isFavoritedLocal,\n id,\n shop.id,\n selectedVariant?.id,\n defaultVariantId,\n saveProduct,\n unsaveProduct,\n ])\n\n return (\n <ProductLinkRoot\n layout=\"horizontal\"\n discount={hasDiscount ? 'small' : 'none'}\n onPress={handlePress}\n >\n <ProductLinkImage layout=\"horizontal\">\n {imageUrl ? (\n <img\n src={imageUrl}\n alt={imageAltText}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"h-full w-full bg-muted flex items-center justify-center text-muted-foreground text-xs\">\n No Image\n </div>\n )}\n </ProductLinkImage>\n\n <ProductLinkInfo layout=\"horizontal\">\n <ProductLinkTitle>{title}</ProductLinkTitle>\n\n {reviewCount && averageRating && (\n <ProductLinkRating>\n <div className=\"flex items-center gap-1\">\n {Array.from({length: 5}, (_, i) => (\n <Star\n key={i}\n fill={\n i < Math.floor(averageRating!) ? 'currentColor' : 'none'\n }\n className={cn(\n 'h-3 w-3',\n i < Math.floor(averageRating!)\n ? 'text-primary'\n : 'text-gray-300'\n )}\n />\n ))}\n <span className=\"text-xs text-gray-600 ml-1\">\n ({reviewCount})\n </span>\n </div>\n </ProductLinkRating>\n )}\n\n <ProductLinkPrice>\n {hasDiscount ? (\n <>\n <ProductLinkDiscountPrice>\n {currencyCode} {amount}\n </ProductLinkDiscountPrice>\n <ProductLinkOriginalPrice>\n {compareAtPriceCurrencyCode} {compareAtPriceAmount}\n </ProductLinkOriginalPrice>\n </>\n ) : (\n <ProductLinkCurrentPrice>\n {currencyCode} {amount}\n </ProductLinkCurrentPrice>\n )}\n </ProductLinkPrice>\n </ProductLinkInfo>\n\n <ProductLinkActions\n filled={isFavoritedLocal}\n onActionPress={handleActionPress}\n />\n </ProductLinkRoot>\n )\n}\n\nexport {\n // Composed component\n ProductLink,\n // Primitive components for custom composition\n ProductLinkRoot,\n ProductLinkImage,\n ProductLinkInfo,\n ProductLinkTitle,\n ProductLinkPrice,\n ProductLinkCurrentPrice,\n ProductLinkOriginalPrice,\n ProductLinkDiscountPrice,\n ProductLinkRating,\n ProductLinkActions,\n}\n"],"names":["productLinkVariants","cva","ProductLinkRoot","className","layout","discount","asChild","onPress","props","jsx","Touchable","SlotPrimitive.Root","Card","cn","ProductLinkImage","ProductLinkInfo","CardContent","ProductLinkTitle","children","ProductLinkPrice","ProductLinkCurrentPrice","ProductLinkOriginalPrice","ProductLinkDiscountPrice","ProductLinkRating","ProductLinkActions","onActionPress","filled","CardAction","Button","Heart","ProductLink","product","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","reviewAnalytics","price","compareAtPrice","isFavorited","selectedVariant","defaultVariantId","shop","isFavoritedLocal","setIsFavoritedLocal","React","averageRating","reviewCount","currencyCode","amount","imageUrl","imageAltText","compareAtPriceAmount","compareAtPriceCurrencyCode","hasDiscount","handlePress","handleActionPress","previousState","jsxs","_","i","Star","Fragment"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,IAAsBC,EAAI,IAAI;AAAA,EAClC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,UAAU;AAAA,EAAA;AAEd,CAAC;AAWD,SAASC,EAAgB;AAAA,EACvB,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC;AAAA,EACA,GAAGC;AACL,GAAyB;AAIrB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASH;AAAA,MACT,UAAU,EAAC,SAAS,IAAG;AAAA,MACvB,YAAY;AAAA,QACV,SAAS,EAAC,MAAM,SAAS,UAAU,MAAM,MAAM,YAAW;AAAA,MAC5D;AAAA,MAEA,UAAA,gBAAAE;AAAA,QAVSH,IAAUK,IAAqBC;AAAA,QAUvC;AAAA,UACC,WAAWC;AAAA,YACTb,EAAoB,EAAC,QAAAI,GAAQ,UAAAC,GAAS;AAAA,YACtC;AAAA,YACAF;AAAA,UACF;AAAA,UACC,GAAGK;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,E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A;AAAA,cACzCX;AAAA,cAAY;AAAA,YAAA,EAChB,CAAA;AAAA,UAAA,EAAA,CACF,EACF,CAAA;AAAA,UAGF,gBAAA1C,EAACU,GACE,EAAA,UAAAuC,IAEG,gBAAAI,EAAAI,GAAA,EAAA,UAAA;AAAA,YAAA,gBAAAJ,EAACxC,GACE,EAAA,UAAA;AAAA,cAAA8B;AAAA,cAAa;AAAA,cAAEC;AAAA,YAAA,GAClB;AAAA,8BACChC,GACE,EAAA,UAAA;AAAA,cAAAoC;AAAA,cAA2B;AAAA,cAAED;AAAA,YAAA,EAChC,CAAA;AAAA,UACF,EAAA,CAAA,sBAECpC,GACE,EAAA,UAAA;AAAA,YAAAgC;AAAA,YAAa;AAAA,YAAEC;AAAA,UAAA,EAAA,CAClB,EAEJ,CAAA;AAAA,QAAA,GACF;AAAA,QAEA,gBAAA5C;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,QAAQuB;AAAA,YACR,eAAea;AAAA,UAAA;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"product-link.js","sources":["../../../src/components/commerce/product-link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Heart, Star} from 'lucide-react'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {useSavedProductsActions} from '../../hooks/user/useSavedProductsActions'\nimport {formatMoney} from '../../lib/formatMoney'\nimport {cn} from '../../lib/utils'\nimport {type Product} from '../../types/minisSDK.generated.d'\nimport {Button} from '../atoms/button'\nimport {Card, CardContent, CardAction} from '../atoms/card'\nimport {Touchable} from '../atoms/touchable'\n\nconst productLinkVariants = cva('', {\n variants: {\n layout: {\n horizontal: 'w-full !flex-row items-center gap-3 px-4 py-3',\n vertical: 'flex-col',\n },\n discount: {\n none: '',\n small: '',\n large: '',\n },\n },\n defaultVariants: {\n layout: 'horizontal',\n discount: 'none',\n },\n})\n\n// Primitive components (building blocks)\nexport interface ProductLinkRootProps\n extends React.ComponentProps<typeof Card>,\n VariantProps<typeof productLinkVariants> {\n layout?: 'horizontal' | 'vertical'\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction ProductLinkRoot({\n className,\n layout,\n discount,\n asChild = false,\n onPress,\n ...props\n}: ProductLinkRootProps) {\n const Comp = asChild ? SlotPrimitive.Root : Card\n\n return (\n <Touchable\n onClick={onPress}\n whileTap={{opacity: 0.7}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n <Comp\n className={cn(\n productLinkVariants({layout, discount}),\n 'border-0 bg-white rounded-xl shadow-lg shadow-black/10',\n className\n )}\n {...props}\n />\n </Touchable>\n )\n}\n\nfunction ProductLinkImage({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<'div'> & {layout?: 'horizontal' | 'vertical'}) {\n return (\n <div\n data-slot=\"product-link-image\"\n className={cn(\n 'overflow-hidden rounded-md bg-muted',\n layout === 'horizontal'\n ? 'h-16 w-16 flex-shrink-0'\n : 'aspect-square w-full',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkInfo({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<typeof CardContent> & {\n layout?: 'horizontal' | 'vertical'\n}) {\n return (\n <CardContent\n className={cn(\n layout === 'horizontal'\n ? 'flex-1 min-w-0 space-y-1 px-0 py-0'\n : 'space-y-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkTitle({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"product-link-title\"\n className={cn(\n 'text-sm font-medium leading-tight text-gray-900 truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction ProductLinkPrice({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-price\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkCurrentPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-current-price\"\n className={cn('text-sm font-semibold text-gray-900', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkOriginalPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-original-price\"\n className={cn('text-sm text-gray-500 line-through', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkDiscountPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-discount-price\"\n className={cn('text-sm font-semibold text-red-600', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkRating({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-rating\"\n className={cn(\n 'flex items-center gap-1 text-xs text-muted-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkActions({\n className,\n onActionPress,\n filled = false,\n ...props\n}: React.ComponentProps<typeof CardAction> & {\n onActionPress?: () => void\n filled?: boolean\n}) {\n return (\n <CardAction\n className={cn('flex-shrink-0 self-center px-0 py-0', className)}\n {...props}\n >\n <Touchable\n stopPropagation\n onClick={onActionPress}\n whileTap={{opacity: 0.7, scale: 0.95}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n scale: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n <Button\n variant=\"borderless\"\n size=\"icon\"\n className=\"h-auto w-auto p-0 hover:bg-transparent\"\n >\n <Heart fill={filled ? 'currentColor' : 'none'} className=\"h-4 w-4\" />\n </Button>\n </Touchable>\n </CardAction>\n )\n}\n\nexport interface ProductLinkProps {\n product: Product\n}\n\n// Composed ProductLink component\nfunction ProductLink({product}: ProductLinkProps) {\n const {navigateToProduct} = useShopNavigation()\n const {saveProduct, unsaveProduct} = useSavedProductsActions()\n\n const {\n id,\n title,\n featuredImage,\n reviewAnalytics,\n price,\n compareAtPrice,\n isFavorited,\n selectedVariant,\n defaultVariantId,\n shop,\n } = product\n\n // Local state for optimistic UI updates\n const [isFavoritedLocal, setIsFavoritedLocal] = React.useState(isFavorited)\n\n const averageRating = reviewAnalytics?.averageRating\n const reviewCount = reviewAnalytics?.reviewCount\n const currencyCode = price?.currencyCode\n const amount = price?.amount\n ? formatMoney(price?.amount, price?.currencyCode)\n : undefined\n const imageUrl = featuredImage?.url\n const imageAltText = featuredImage?.altText || title\n const compareAtPriceAmount = compareAtPrice?.amount\n ? formatMoney(compareAtPrice?.amount, compareAtPrice?.currencyCode)\n : undefined\n const compareAtPriceCurrencyCode = compareAtPrice?.currencyCode\n const hasDiscount = compareAtPriceAmount && compareAtPriceAmount !== amount\n\n const handlePress = React.useCallback(() => {\n navigateToProduct({\n productId: id,\n })\n }, [navigateToProduct, id])\n\n const handleActionPress = React.useCallback(async () => {\n const previousState = isFavoritedLocal\n\n // Optimistic update\n setIsFavoritedLocal(!previousState)\n\n try {\n if (previousState) {\n await unsaveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n } else {\n await saveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n }\n } catch (error) {\n // Revert optimistic update on error\n setIsFavoritedLocal(previousState)\n }\n }, [\n isFavoritedLocal,\n id,\n shop.id,\n selectedVariant?.id,\n defaultVariantId,\n saveProduct,\n unsaveProduct,\n ])\n\n return (\n <ProductLinkRoot\n layout=\"horizontal\"\n discount={hasDiscount ? 'small' : 'none'}\n onPress={handlePress}\n >\n <ProductLinkImage layout=\"horizontal\">\n {imageUrl ? (\n <img\n src={imageUrl}\n alt={imageAltText}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"h-full w-full bg-muted flex items-center justify-center text-muted-foreground text-xs\">\n No Image\n </div>\n )}\n </ProductLinkImage>\n\n <ProductLinkInfo layout=\"horizontal\">\n <ProductLinkTitle>{title}</ProductLinkTitle>\n\n {reviewCount && averageRating && (\n <ProductLinkRating>\n <div className=\"flex items-center gap-1\">\n {Array.from({length: 5}, (_, i) => (\n <Star\n key={i}\n fill={\n i < Math.floor(averageRating!) ? 'currentColor' : 'none'\n }\n className={cn(\n 'h-3 w-3',\n i < Math.floor(averageRating!)\n ? 'text-primary'\n : 'text-gray-300'\n )}\n />\n ))}\n <span className=\"text-xs text-gray-600 ml-1\">\n ({reviewCount})\n </span>\n </div>\n </ProductLinkRating>\n )}\n\n <ProductLinkPrice>\n {hasDiscount ? (\n <>\n <ProductLinkDiscountPrice>{amount}</ProductLinkDiscountPrice>\n <ProductLinkOriginalPrice>\n {compareAtPriceAmount}\n </ProductLinkOriginalPrice>\n </>\n ) : (\n <ProductLinkCurrentPrice>{amount}</ProductLinkCurrentPrice>\n )}\n </ProductLinkPrice>\n </ProductLinkInfo>\n\n <ProductLinkActions\n filled={isFavoritedLocal}\n onActionPress={handleActionPress}\n />\n </ProductLinkRoot>\n )\n}\n\nexport {\n // Composed component\n ProductLink,\n // Primitive components for custom composition\n ProductLinkRoot,\n ProductLinkImage,\n ProductLinkInfo,\n ProductLinkTitle,\n ProductLinkPrice,\n ProductLinkCurrentPrice,\n ProductLinkOriginalPrice,\n ProductLinkDiscountPrice,\n ProductLinkRating,\n ProductLinkActions,\n}\n"],"names":["productLinkVariants","cva","ProductLinkRoot","className","layout","discount","asChild","onPress","props","jsx","Touchable","SlotPrimitive.Root","Card","cn","ProductLinkImage","ProductLinkInfo","CardContent","ProductLinkTitle","children","ProductLinkPrice","ProductLinkCurrentPrice","ProductLinkOriginalPrice","ProductLinkDiscountPrice","ProductLinkRating","ProductLinkActions","onActionPress","filled","CardAction","Button","Heart","ProductLink","product","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","reviewAnalytics","price","compareAtPrice","isFavorited","selectedVariant","defaultVariantId","shop","isFavoritedLocal","setIsFavoritedLocal","React","averageRating","reviewCount","amount","formatMoney","imageUrl","imageAltText","compareAtPriceAmount","hasDiscount","handlePress","handleActionPress","previousState","jsxs","_","i","Star","Fragment"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAsBC,EAAI,IAAI;AAAA,EAClC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,UAAU;AAAA,EAAA;AAEd,CAAC;AAWD,SAASC,EAAgB;AAAA,EACvB,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC;AAAA,EACA,GAAGC;AACL,GAAyB;AAIrB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASH;AAAA,MACT,UAAU,EAAC,SAAS,IAAG;AAAA,MACvB,YAAY;AAAA,QACV,SAAS,EAAC,MAAM,SAAS,UAAU,MAAM,MAAM,YAAW;AAAA,MAC5D;AAAA,MAEA,UAAA,gBAAAE;AAAA,QAVSH,IAAUK,IAAqBC;AAAA,QAUvC;AAAA,UACC,WAAWC;AAAA,YACTb,EAAoB,EAAC,QAAAI,GAAQ,UAAAC,GAAS;AAAA,YACtC;AAAA,YACAF;AAAA,UACF;AAAA,UACC,GAAGK;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ;AAEA,SAASM,EAAiB;AAAA,EACxB,WAAAX;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,GAAGI;AACL,GAAuE;AAEnE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWI;AAAA,QACT;AAAA,QACAT,MAAW,eACP,4BACA;AAAA,QACJD;AAAA,MACF;AAAA,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I,GAAA,EAAA,UAAA;AAAA,YAAA,gBAAAxD,EAACa,KAA0B,UAAO8B,EAAA,CAAA;AAAA,YAClC,gBAAA3C,EAACY,KACE,UACHmC,EAAA,CAAA;AAAA,UAAA,EACF,CAAA,IAEA,gBAAA/C,EAACW,GAAyB,EAAA,UAAAgC,EAAA,CAAO,EAErC,CAAA;AAAA,QAAA,GACF;AAAA,QAEA,gBAAA3C;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,QAAQuB;AAAA,YACR,eAAeY;AAAA,UAAA;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minisSDK.generated.d.js","sources":["../../src/types/minisSDK.generated.d.ts"],"sourcesContent":["/* eslint-disable @shopify/typescript/prefer-pascal-case-enums */\n// Auto-generated type definitions for MinisSDK\n// Generated on: 2025-06-18T21:41:30.210Z\n// Do not edit this file manually - run the generation script instead\n// Source: useShopActionsImplementationV3.ts + shopActionsV3Definitions.ts + shopActionsV3Types.ts\n// Generated using TypeScript compiler API for reliable AST parsing\n//\n// This file is self-contained and can be shipped independently\n\n// ============================================================================\n// Base Types (extracted using TypeScript AST parsing)\n// ============================================================================\n\nexport interface ApiKeys {\n refreshToken: string\n accessToken: string\n}\n\nexport interface ShopActionOk<T> {\n ok: true\n data: T\n}\n\nexport interface ShopActionError {\n ok: false\n error: Error & {code?: string}\n}\n\nexport type ShopActionResult<T = void> = ShopActionOk<T> | ShopActionError\n\nexport interface ShopActions {\n getShopAppInformation: () => Promise<\n ShopActionResult<GetShopAppInformationResponse>\n >\n productRecommendationImpression(\n params: ProductRecommendationImpressionParams\n ): Promise<ShopActionResult>\n productRecommendationClick(\n params: ProductRecommendationClickParams\n ): Promise<ShopActionResult>\n hideEntryPoint(): Promise<ShopActionResult>\n closeMini(): Promise<ShopActionResult>\n\n // account actions\n followShop(params: FollowShopParams): Promise<ShopActionResult<boolean>>\n unfollowShop(params: UnfollowShopParams): Promise<ShopActionResult<boolean>>\n favorite(params: FavoriteParams): Promise<ShopActionResult>\n unfavorite(params: UnfavoriteParams): Promise<ShopActionResult>\n getAccountInformation: (\n params: GetAccountInformationParams\n ) => Promise<ShopActionResult<GetAccountInformationResponse>>\n\n // user actions\n getCurrentUser(\n params?: GetCurrentUserParams\n ): Promise<ShopActionResult<GetCurrentUserResponse>>\n\n // product actions\n createOrderAttribution(\n params: CreateOrderAttributionParams\n ): Promise<ShopActionResult>\n addToCart(params: AddToCartParams): Promise<ShopActionResult>\n buyProduct(params: BuyProductParams): Promise<ShopActionResult>\n buyProducts(params: BuyProductsParams): Promise<ShopActionResult>\n\n // error actions\n showErrorScreen: (params: ShowErrorScreenParams) => Promise<ShopActionResult>\n showErrorToast: (message: ShowErrorToastParams) => Promise<ShopActionResult>\n\n // deeplink actions\n getDeeplinkPaths(): Promise<ShopActionResult<GetDeeplinkPathsResponse>>\n navigateToDeeplink(\n params: NavigateToDeeplinkParams\n ): Promise<ShopActionResult>\n\n // navigation actions\n navigateToShop(params: NavigateToShopParams): Promise<ShopActionResult>\n navigateToProduct(params: NavigateToProductParams): Promise<ShopActionResult>\n navigateToOrder(params: NavigateToOrderParams): Promise<ShopActionResult>\n navigateToCheckout(\n params: NavigateToCheckoutParams\n ): Promise<ShopActionResult>\n\n // image upload actions\n createImageUploadLink(\n params: CreateImageUploadLinkParams\n ): Promise<ShopActionResult<CreateImageUploadLinkResponse>>\n completeImageUpload(\n params: CompleteImageUploadParams\n ): Promise<ShopActionResult<CompleteImageUploadResponse>>\n\n // async storage actions\n getPersistedItem(\n params: GetAsyncStorageItemParams\n ): Promise<ShopActionResult<string | null>>\n setPersistedItem(params: SetAsyncStorageItemParams): Promise<ShopActionResult>\n removePersistedItem(\n params: RemoveAsyncStorageItemParams\n ): Promise<ShopActionResult>\n getAllPersistedKeys(): Promise<ShopActionResult<string[]>>\n clearPersistedItems(): Promise<ShopActionResult>\n\n getInternalPersistedItem(\n params: GetAsyncStorageItemParams\n ): Promise<ShopActionResult<string | null>>\n setInternalPersistedItem(\n params: SetAsyncStorageItemParams\n ): Promise<ShopActionResult>\n removeInternalPersistedItem(\n params: RemoveAsyncStorageItemParams\n ): Promise<ShopActionResult>\n getAllInternalPersistedKeys(): Promise<ShopActionResult<string[]>>\n clearInternalPersistedItems(): Promise<ShopActionResult>\n\n // secure storage actions\n getSecret(): Promise<ShopActionResult<string | null>>\n setSecret(params: SetSecretParams): Promise<ShopActionResult>\n removeSecret(): Promise<ShopActionResult>\n\n // event reporting actions\n reportInteraction(params: ReportInteractionParams): Promise<ShopActionResult>\n reportImpression(params: ReportImpressionParams): Promise<ShopActionResult>\n reportContentImpression(\n params: ReportContentImpressionParams\n ): Promise<ShopActionResult>\n\n getProductLists(\n params?: GetProductListsParams\n ): Promise<ShopActionResult<GetProductListsResponse>>\n\n getProductList(\n params?: GetProductListParams\n ): Promise<ShopActionResult<GetProductListResponse>>\n\n // product list actions\n addProductList(\n params: AddProductListParams\n ): Promise<ShopActionResult<ProductList>>\n removeProductList(params: RemoveProductListParams): Promise<ShopActionResult>\n renameProductList: (\n params: RenameProductListParams\n ) => Promise<ShopActionResult<ProductList>>\n addProductListItem(\n params: AddProductListItemParams\n ): Promise<ShopActionResult>\n removeProductListItem(\n params: RemoveProductListItemParams\n ): Promise<ShopActionResult>\n\n // recommendations actions\n getRecommendedProducts(\n params?: GetRecommendedProductsParams\n ): Promise<ShopActionResult<GetRecommendedProductsResponse>>\n getRecommendedShops(\n params?: GetRecommendedShopsParams\n ): Promise<ShopActionResult<GetRecommendedShopsResponse>>\n searchProductsByShop(\n params?: SearchProductsByShopParams\n ): Promise<ShopActionResult<SearchProductsByShopResponse>>\n\n // orders list actions\n getOrders(\n params?: GetOrdersParams\n ): Promise<ShopActionResult<GetOrdersResponse>>\n\n getBuyerAttributes(): Promise<ShopActionResult<GetBuyerAttributesResponse>>\n\n // content actions\n showFeedbackSheet(params: ShowFeedbackSheetParams): Promise<ShopActionResult>\n\n getPopularProducts(\n params?: GetPopularProductsParams\n ): Promise<ShopActionResult<GetPopularProductsResponse>>\n\n share(params: ShareParams): Promise<ShopActionResult>\n\n getCuratedProducts(\n params: GetCuratedProductsParams\n ): Promise<ShopActionResult<GetCuratedProductsResponse>>\n\n getSavedProducts(\n params?: GetSavedProductsParams\n ): Promise<ShopActionResult<GetSavedProductsResponse>>\n\n getRecentProducts(\n params?: GetRecentProductsParams\n ): Promise<ShopActionResult<GetRecentProductsResponse>>\n\n getProductSearch(\n params: GetProductSearchParams\n ): Promise<ShopActionResult<GetProductSearchResponse>>\n\n getProducts(\n params: GetProductsParams\n ): Promise<ShopActionResult<GetProductsResponse>>\n\n getProduct(\n params: GetProductParams\n ): Promise<ShopActionResult<GetProductResponse>>\n\n getProductVariants(\n params: GetProductVariantsParams\n ): Promise<ShopActionResult<GetProductVariantsResponse>>\n\n getProductMedia(\n params: GetProductMediaParams\n ): Promise<ShopActionResult<GetProductMediaResponse>>\n\n getShop(params: GetShopParams): Promise<ShopActionResult<GetShopResponse>>\n\n getRecentShops(\n params?: GetRecentShopsParams\n ): Promise<ShopActionResult<GetRecentShopsResponse>>\n\n getFollowedShops(\n params?: GetFollowedShopsParams\n ): Promise<ShopActionResult<GetFollowedShopsResponse>>\n}\n\nexport interface AuthShopActions {\n refreshAccessToken(\n params: RefreshAccessTokenParams\n ): Promise<ShopActionResult<ApiKeys>>\n signOut(): Promise<ShopActionResult>\n}\n\nexport type AllShopActions = ShopActions & AuthShopActions\n\nexport type ShopActionParams<T extends keyof AllShopActions> = Parameters<\n AllShopActions[T]\n>[0]\n\nexport interface FavoriteParams {\n shopId: string\n productId: string\n productVariantId: string\n}\n\nexport interface UnfavoriteParams {\n shopId: string\n productId: string\n productVariantId: string\n}\n\nexport interface LineItemAttribution {\n sourceName: string\n sourceIdentifier: string\n}\n\nexport interface CreateOrderAttributionParams {\n orderId: string\n productVariantId: string\n attribution?: LineItemAttribution\n}\n\nexport interface AddToCartParams extends BuyProductLineItem {\n /**\n * The discount codes to apply to the cart.\n */\n discountCodes?: string[]\n /**\n * Attribution data for the line item.\n * @deprecated\n */\n attribution?: LineItemAttribution\n}\n\nexport interface BuyProductLineItem {\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/456`.\n */\n productVariantId: string\n /**\n * The quantity of the product to add to the cart.\n */\n quantity?: number\n}\n\nexport interface BuyProductsParams {\n items: [BuyProductLineItem, ...BuyProductLineItem[]] // at least one item\n attribution?: LineItemAttribution\n discountCode?: string\n}\n\nexport interface BuyProductParams extends BuyProductLineItem {\n /**\n * Attribution data for the line item.\n * @deprecated\n */\n attribution?: LineItemAttribution\n /**\n * The discount code to apply to the product.\n */\n discountCode?: string\n}\n\nexport interface UpdateLineItemAttributesParams {\n lineItemAttributes: {key: string; value: string}[]\n attribution?: LineItemAttribution\n}\n\nexport interface NavigateToShopParams {\n shopId: string\n}\n\nexport interface NavigateToOrderParams {\n /**\n * The GID of the order. E.g. `gid://shopify/Order/123`.\n */\n orderId: string\n}\n\nexport interface NavigateToCheckoutParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/123`.\n */\n shopId: string\n}\n\nexport interface NavigateToProductParams {\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * If present, the GID of the variant that should be initially selected\n */\n productVariantId?: string\n /*\n * Variants displayed in the product details screen will be limited to those\n * whose ID is included in this list.\n */\n includedProductVariantGIDs?: string[]\n /**\n * @deprecated use includedProductVariantGIDs instead\n */\n includedProductVariantIds?: string[]\n /**\n * @deprecated do not use\n */\n attribution?: LineItemAttribution\n /**\n * The discount code to apply to the product.\n */\n discountCode?: string\n}\n\nexport interface RefreshAccessTokenParams {\n refreshToken: string\n}\n\nexport interface ProductRecommendationImpressionParams {\n // The product GID string\n productId: string\n // Optional section id, could be useful for tracking which UI sections get impressions\n sectionId?: string\n}\n\nexport interface ProductRecommendationClickParams {\n productId: string\n sectionId?: string\n}\n\nexport interface ShowErrorScreenParams {\n /**\n * The message to display in the error screen.\n */\n message?: string\n /**\n * The title of the error screen.\n */\n title?: string\n}\n\nexport interface ShowErrorToastParams {\n message?: string\n}\n\nexport interface GetAccountInformationParams {\n /**\n * To use user account information, a shopId must be given to track on\n * which shop's behalf user information is being accessed\n */\n shopId: string\n type: 'email' | 'name' | 'phone'\n}\n\nexport interface AccountInformationPhoneInfo {\n phoneNumber: string\n countryCode: string\n prefix: string\n}\n\nexport interface GetAccountInformationResponse {\n status: 'available' | 'not-available'\n value?: string | AccountInformationPhoneInfo\n}\n\nexport interface GetShopAppInformationResponse {\n appVersion: string\n buildNumber: string\n buildId: string\n}\n\nexport interface FollowShopParams {\n shopId: string\n}\n\nexport interface UnfollowShopParams {\n shopId: string\n}\n\nexport interface NavigateToDeeplinkParams {\n deeplink: string\n}\n\nexport interface GetDeeplinkPathsResponse {\n matchers: string[]\n}\n\nexport interface ProductRecommendationClickParams {\n productId: string\n productVariantId?: string\n variantGIDs?: string[]\n discountCode?: string\n attribution?: LineItemAttribution\n sectionId?: string\n}\n\nexport interface CreateImageUploadLinkParams {\n input: {\n mimeType: string\n fileSize: number\n }[]\n}\n\nexport interface UploadTarget {\n url: string\n resourceUrl: string\n parameters: {name: string; value: string}[]\n}\n\nexport interface CreateImageUploadLinkResponse {\n targets?: UploadTarget[]\n error?: string\n}\n\nexport interface CompleteImageUploadParams {\n resourceUrls: string[]\n}\n\nexport interface CompleteImageUploadResponse {\n files?: {\n id: string\n fileStatus: 'FAILED' | 'PENDING' | 'PROCESSING' | 'READY'\n image?: {\n url: string\n } | null\n }[]\n error?: string\n}\n\nexport interface PaginationInfo {\n hasNextPage: boolean\n endCursor: string | null\n}\n\nexport interface GetProductListsResponse {\n data: ProductList[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductListResponse {\n data: ProductList | null\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecommendedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecommendedShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface SearchProductsByShopResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetBuyerAttributesResponse {\n data: {\n genderAffinity?: Gender\n categoryAffinities: TaxonomyCategory[]\n }\n}\n\nexport interface GetCurrentUserResponse {\n data: UserProfile\n}\n\nexport interface GetOrdersResponse {\n data: Order[]\n pageInfo: PaginationInfo\n}\n\nexport interface SetSecretParams {\n value: string\n}\n\nexport interface SetAsyncStorageItemParams {\n key: string\n value: string\n}\n\nexport interface GetAsyncStorageItemParams {\n key: string\n}\n\nexport interface RemoveAsyncStorageItemParams {\n key: string\n}\n\nexport interface ReportInteractionParams {\n interactionType: string\n interactionValue?: string\n pageValue?: string\n}\n\nexport interface ReportImpressionParams {\n subjectType?: string\n subjectId?: string\n pageValue?: string\n}\n\nexport interface ReportContentImpressionParams {\n publicId: string\n pageValue: string\n}\n\nexport interface GetProductListsParams {\n /**\n * The number of lists to fetch.\n */\n first?: number\n /**\n * The cursor to fetch the next page of lists.\n */\n after?: string\n /**\n * The number of items per list to fetch.\n */\n itemsFirst?: number\n /**\n * The fetch policy to use.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id?: string\n /**\n * The public ID of the product list.\n */\n publicId?: string\n /**\n * The number of items to fetch.\n */\n first?: number\n /**\n * The cursor to fetch the next page of items.\n */\n after?: string\n /**\n * The fetch policy to use.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface AddProductListParams {\n /**\n * The name of the product list.\n */\n name: string\n /**\n * A description of the product list.\n */\n description?: string\n}\n\nexport interface RemoveProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id: string\n}\n\nexport interface RenameProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id: string\n /**\n * The new name of the product list.\n */\n name: string\n}\n\nexport interface AddProductListItemParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/42`.\n */\n shopId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.\n */\n productVariantId: string\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n * This will soon be deprecated in favor of just `publicListId`.\n */\n listId: string\n /**\n * The public ID of the product list.\n */\n publicListId: string\n}\n\nexport interface RemoveProductListItemParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/42`.\n */\n shopId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.\n */\n productVariantId: string\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n * This will soon be deprecated in favor of just `publicListId`.\n */\n listId: string\n /**\n * The public ID of the product list.\n */\n publicListId: string\n}\n\nexport interface GetRecommendedProductsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecommendedShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface SearchProductsByShopParams {\n shopId: string\n query?: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetBuyerAttributesParams {\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCurrentUserParams {\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetOrdersParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface ShowFeedbackSheetParams {\n publicId: string\n}\n\nexport interface GetPopularProductsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetPopularProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface PreviewProductInARParams {\n id: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCuratedProductsParams {\n handle: string\n requiredTags?: string[]\n anyOfTags?: string[]\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCuratedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductMediaParams {\n id: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductMediaResponse {\n data: ProductMedia[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetShopParams {\n id: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetShopResponse {\n data: Shop\n}\n\nexport interface GetRecentShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecentShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetFollowedShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetFollowedShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductsParams {\n ids: string[]\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductsResponse {\n data: Product[]\n}\n\nexport interface GetProductParams {\n id: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductResponse {\n data: Product\n}\n\nexport interface ShareParams {\n message?: string\n title?: string\n url?: string\n urls?: string[]\n type?: string\n failOnCancel?: boolean\n}\n\nexport interface GetSavedProductsParams {\n includeSensitive?: boolean\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetSavedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecentProductsParams {\n includeSensitive?: boolean\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecentProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductSearchParams {\n query: string\n filters?: ProductFilters\n sortBy?: ProductSearchSortBy\n includeSensitive?: boolean\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductSearchResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductVariantsParams {\n id: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductVariantsResponse {\n data: ProductVariant[]\n pageInfo: PaginationInfo\n}\n\nexport interface MinisParams {\n /** The handle/identifier of the Mini application */\n handle: string\n /** The initial URL that was used to load the Mini (optional) */\n initialUrl?: string\n}\n\nexport type FetchPolicy =\n | 'cache-first'\n | 'network-only'\n | 'cache-only'\n | 'no-cache'\n | 'standby'\n\nexport type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network'\n\nexport enum CurrencyCode {\n AED = 'AED',\n AFN = 'AFN',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BRL = 'BRL',\n BSD = 'BSD',\n BTN = 'BTN',\n BWP = 'BWP',\n BYN = 'BYN',\n BYR = 'BYR',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHF = 'CHF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n CRC = 'CRC',\n CVE = 'CVE',\n CZK = 'CZK',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n JEP = 'JEP',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KID = 'KID',\n KMF = 'KMF',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LTL = 'LTL',\n LVL = 'LVL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MYR = 'MYR',\n MZN = 'MZN',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STD = 'STD',\n STN = 'STN',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n UYU = 'UYU',\n UZS = 'UZS',\n VED = 'VED',\n VEF = 'VEF',\n VES = 'VES',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XCD = 'XCD',\n XOF = 'XOF',\n XPF = 'XPF',\n XXX = 'XXX',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMW = 'ZMW',\n}\n\nexport type Decimal = string\n\nexport type MiniAppParams = any\n\nexport interface MiniAppConfig<\n _DeprecatedParams extends MiniAppParams = undefined,\n> {\n /**\n * Root component of used inside the Minis Viewer\n */\n ViewerRoot: () => JSX.Element | null\n}\n\nexport interface MiniManifest {\n trusted_domains?: string[]\n permissions?: string[]\n [key: string]: any\n}\n\nexport type Permission = 'CAMERA' | 'GALLERY' | 'MICROPHONE'\n\nexport interface Money {\n amount: Decimal\n currencyCode: CurrencyCode\n}\n\nexport interface ProductImage {\n id?: string | null\n altText?: string | null\n url: string\n sensitive?: boolean | null\n}\n\nexport interface ProductVariant {\n id: string\n isFavorited: boolean\n image?: ProductImage | null\n price: Money\n compareAtPrice?: Money | null\n}\n\nexport interface ProductShop {\n id: string\n name: string\n}\n\nexport type ProductMedia =\n | {\n id: string\n image: ProductImage | null\n mediaContentType: 'IMAGE'\n alt: string | null\n }\n | {\n id: string\n mediaContentType: 'MODEL_3D'\n previewImage: ProductImage | null\n sources: {\n filesize: number\n format: string\n mimeType: string\n url: string\n }[]\n alt: string | null\n }\n | {\n id: string\n mediaContentType: 'VIDEO'\n previewImage: ProductImage | null\n sources: {\n format: string\n mimeType: string\n url: string\n width: number\n height: number\n }[]\n alt: string | null\n }\n | {\n id: string\n mediaContentType: 'EXTERNAL_VIDEO'\n previewImage: ProductImage | null\n embedUrl: string\n alt: string | null\n }\n\nexport interface Product {\n id: string\n title: string\n reviewAnalytics: {\n averageRating?: number | null\n reviewCount?: number | null\n }\n shop: ProductShop\n selectedVariant?: ProductVariant\n defaultVariantId: string\n isFavorited: boolean\n variants?: ProductVariant[]\n featuredImage?: ProductImage | null\n price: Money\n compareAtPrice?: Money | null\n}\n\nexport interface Shop {\n id: string\n name: string\n isFollowing?: boolean | null\n shareUrl?: string | null\n primaryDomain: {\n url: string\n }\n logoImage?: ProductImage | null\n reviewAnalytics: {\n averageRating?: number | null\n reviewCount: number\n }\n}\n\nexport interface QueryOptions {\n fetchPolicy?: WatchQueryFetchPolicy\n skip?: boolean\n}\n\nexport interface ProductList {\n id: string\n publicId: string | null\n name: string | null\n products: Product[]\n}\n\nexport interface Order {\n id: string\n name: string\n lineItems: {\n productTitle: string\n variantTitle: string | null\n quantity: number\n product: Product | null\n }[]\n shop: Shop | null\n}\n\nexport interface BuyerAttributes {\n genderAffinity?: Gender\n categoryAffinities: TaxonomyCategory[]\n}\n\nexport enum Gender {\n Male = 'MALE',\n Female = 'FEMALE',\n Neutral = 'NEUTRAL',\n}\n\nexport interface TaxonomyCategory {\n id: string\n name: string\n ancestors?: TaxonomyCategory[]\n}\n\n/**\n * A user profile.\n */\nexport interface UserProfile {\n /**\n * The display name of the user.\n */\n displayName?: string | null\n /**\n * The avatar image of the user.\n */\n avatarImage?: {\n url: string\n } | null\n}\n\n/**\n * A user metafield.\n */\nexport interface UserMetafield {\n /**\n * The key of the user metafield.\n */\n key: string\n /**\n * The value of the user metafield.\n */\n value: string\n}\n\nexport interface ContentImage {\n id: string | null\n url: string\n width: number | null\n height: number | null\n}\n\nexport interface ContentProduct {\n id: string\n title: string\n featuredImage: ContentImage | null\n}\n\nexport type ContentVisibility = 'DISCOVERABLE' | 'LINKABLE'\n\nexport interface Content {\n publicId: string\n externalId: string | null\n image: ContentImage\n title: string\n description: string | null\n visibility: ContentVisibility[]\n shareableUrl: string | null\n products: ContentProduct[] | null\n}\n\n/**\n * The fetch policy to use. `cache-first` will only fetch from the network if there is no\n * cached data. `network-only` will fetch from the network regardless of whether there\n * is cached data.\n */\nexport type DataHookFetchPolicy = 'cache-first' | 'network-only'\n\nexport interface DataHookOptionsBase {\n /**\n * When true, the data will not be fetched immediately.\n */\n skip?: boolean\n /**\n * The fetch policy to use for the initial data load. Subsequent loads may use different policies.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface PaginatedDataHookOptionsBase extends DataHookOptionsBase {\n /**\n * The number of products to fetch.\n * @default 20\n */\n first?: number\n}\n\nexport interface DataHookReturnsBase {\n /**\n * Whether data is loading. Represents the initial data load but not `refetch`/`fetchMore` calls.\n */\n loading: boolean\n /**\n * The error that occurred while loading. Represents the initial data load and `refetch` calls but not `fetchMore`\n */\n error: Error | null\n /**\n * Refetch the data. Data is updated in place. The `loading` state will not update but the `error` state will.\n */\n refetch: () => Promise<void>\n}\n\nexport interface PaginatedDataHookReturnsBase extends DataHookReturnsBase {\n /**\n * Whether there is a next page to fetch.\n */\n hasNextPage: boolean\n /**\n * Fetch more data. Data is updated in place. The `loading` and `error` states will not update\n */\n fetchMore: () => Promise<void>\n}\n\nexport const Consent = {\n MiniConsent: 'mini_consent',\n CameraConsent: 'camera_consent',\n PhotoLibraryConsent: 'photo_library_consent',\n MicrophoneConsent: 'microphone_consent',\n} as const\n\nexport const ConsentStatus = {\n Granted: 'granted',\n Dismissed: 'dismissed',\n Idle: 'idle',\n} as const\n\nexport type ConsentType = (typeof Consent)[keyof typeof Consent]\n\nexport type ConsentStatusType =\n (typeof ConsentStatus)[keyof typeof ConsentStatus]\n\nexport interface PaginatedDataHookPageInfo {\n /**\n * Whether there is a next page to fetch.\n */\n hasNextPage: boolean\n /**\n * The cursor to use for the next page of data.\n */\n endCursor: string | null\n}\n\nexport type ProductColorFilter =\n | 'BEIGE'\n | 'BLACK'\n | 'BLUE'\n | 'BROWN'\n | 'GOLD'\n | 'GREEN'\n | 'GREY'\n | 'NAVY'\n | 'ORANGE'\n | 'PINK'\n | 'PURPLE'\n | 'RED'\n | 'SILVER'\n | 'WHITE'\n | 'YELLOW'\n\nexport type ProductApparelSizeFilter =\n | 'SIZE_3XL'\n | 'SIZE_4XL'\n | 'SIZE_5XL'\n | 'SIZE_L'\n | 'SIZE_M'\n | 'SIZE_S'\n | 'SIZE_XL'\n | 'SIZE_XS'\n | 'SIZE_XXL'\n | 'SIZE_XXS'\n\nexport interface ProductFilters {\n /**\n * The apparel sizes to filter by.\n */\n apparelSize?: ProductApparelSizeFilter[]\n /**\n * Whether the product is in stock or not.\n */\n available?: boolean\n /**\n * The category IDs to filter by.\n */\n category?: string[]\n /**\n * The colors to filter by.\n */\n color?: ProductColorFilter[]\n /**\n * The gender to filter by.\n */\n gender?: 'MALE' | 'FEMALE' | 'NEUTRAL'\n /**\n * The shop IDs to include in the search.\n */\n includeShopIds?: string[]\n /**\n * The minimum rating to filter by.\n */\n minimumRating?: number\n /**\n * The price range to filter by.\n */\n price?: {\n min?: number\n max?: number\n }\n /**\n * The shoe sizes to filter by.\n */\n shoeSize?: ProductShoeSizeFilter[]\n}\n\nexport type ProductShoeSizeFilter =\n | 'SIZE_4'\n | 'SIZE_4_5'\n | 'SIZE_5'\n | 'SIZE_5_5'\n | 'SIZE_6'\n | 'SIZE_6_5'\n | 'SIZE_7'\n | 'SIZE_7_5'\n | 'SIZE_8'\n | 'SIZE_8_5'\n | 'SIZE_9'\n | 'SIZE_9_5'\n | 'SIZE_10'\n | 'SIZE_10_5'\n | 'SIZE_11'\n | 'SIZE_11_5'\n | 'SIZE_12'\n | 'SIZE_12_5'\n | 'SIZE_13'\n | 'SIZE_13_5'\n | 'SIZE_14'\n | 'SIZE_14_5'\n | 'SIZE_15'\n\nexport type ProductSizeFilter =\n | 'SIZE_XS'\n | 'SIZE_S'\n | 'SIZE_M'\n | 'SIZE_L'\n | 'SIZE_XL'\n | 'SIZE_XXL'\n | 'SIZE_XXS'\n\nexport type ProductSearchSortBy =\n | 'MOST_RECENT'\n | 'PRICE_HIGH_TO_LOW'\n | 'PRICE_LOW_TO_HIGH'\n | 'RELEVANCE'\n\ndeclare global {\n interface Window {\n minisSDK: ShopActions\n minisParams: MinisParams\n }\n}\n\nexport {}\n"],"names":["CurrencyCode","Gender","Consent","ConsentStatus"],"mappings":"AAs2BY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA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M,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OAjKIA,IAAAA,KAAA,CAAA,CAAA,GAuTAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,UAAU,WAHAA,IAAAA,KAAA,CAAA,CAAA;AAwHL,MAAMC,IAAU;AAAA,EACrB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAEaC,IAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AACR;"}
|
|
1
|
+
{"version":3,"file":"minisSDK.generated.d.js","sources":["../../src/types/minisSDK.generated.d.ts"],"sourcesContent":["/* eslint-disable @shopify/typescript/prefer-pascal-case-enums */\n// Auto-generated type definitions for MinisSDK\n// Generated on: 2025-06-27T14:04:00.340Z\n// Do not edit this file manually - run the generation script instead\n// Source: useShopActionsImplementationV3.ts + shopActionsV3Definitions.ts + shopActionsV3Types.ts\n// Generated using TypeScript compiler API for reliable AST parsing\n//\n// This file is self-contained and can be shipped independently\n\n// ============================================================================\n// Base Types (extracted using TypeScript AST parsing)\n// ============================================================================\n\nexport interface ApiKeys {\n refreshToken: string\n accessToken: string\n}\n\nexport interface ShopActionOk<T> {\n ok: true\n data: T\n}\n\nexport interface ShopActionError {\n ok: false\n error: Error & {code?: string}\n}\n\nexport type ShopActionResult<T = void> = ShopActionOk<T> | ShopActionError\n\nexport interface ShopActions {\n getShopAppInformation: () => Promise<\n ShopActionResult<GetShopAppInformationResponse>\n >\n productRecommendationImpression(\n params: ProductRecommendationImpressionParams\n ): Promise<ShopActionResult>\n productRecommendationClick(\n params: ProductRecommendationClickParams\n ): Promise<ShopActionResult>\n hideEntryPoint(): Promise<ShopActionResult>\n closeMini(): Promise<ShopActionResult>\n\n // account actions\n followShop(params: FollowShopParams): Promise<ShopActionResult<boolean>>\n unfollowShop(params: UnfollowShopParams): Promise<ShopActionResult<boolean>>\n favorite(params: FavoriteParams): Promise<ShopActionResult>\n unfavorite(params: UnfavoriteParams): Promise<ShopActionResult>\n getAccountInformation: (\n params: GetAccountInformationParams\n ) => Promise<ShopActionResult<GetAccountInformationResponse>>\n\n // user actions\n getCurrentUser(\n params?: GetCurrentUserParams\n ): Promise<ShopActionResult<GetCurrentUserResponse>>\n\n // product actions\n createOrderAttribution(\n params: CreateOrderAttributionParams\n ): Promise<ShopActionResult>\n addToCart(params: AddToCartParams): Promise<ShopActionResult>\n buyProduct(params: BuyProductParams): Promise<ShopActionResult>\n buyProducts(params: BuyProductsParams): Promise<ShopActionResult>\n\n // error actions\n showErrorScreen: (params: ShowErrorScreenParams) => Promise<ShopActionResult>\n showErrorToast: (message: ShowErrorToastParams) => Promise<ShopActionResult>\n\n // deeplink actions\n getDeeplinkPaths(): Promise<ShopActionResult<GetDeeplinkPathsResponse>>\n navigateToDeeplink(\n params: NavigateToDeeplinkParams\n ): Promise<ShopActionResult>\n\n // navigation actions\n navigateToShop(params: NavigateToShopParams): Promise<ShopActionResult>\n navigateToProduct(params: NavigateToProductParams): Promise<ShopActionResult>\n navigateToOrder(params: NavigateToOrderParams): Promise<ShopActionResult>\n navigateToCheckout(\n params: NavigateToCheckoutParams\n ): Promise<ShopActionResult>\n\n // image upload actions\n createImageUploadLink(\n params: CreateImageUploadLinkParams\n ): Promise<ShopActionResult<CreateImageUploadLinkResponse>>\n completeImageUpload(\n params: CompleteImageUploadParams\n ): Promise<ShopActionResult<CompleteImageUploadResponse>>\n\n // async storage actions\n getPersistedItem(\n params: GetAsyncStorageItemParams\n ): Promise<ShopActionResult<string | null>>\n setPersistedItem(params: SetAsyncStorageItemParams): Promise<ShopActionResult>\n removePersistedItem(\n params: RemoveAsyncStorageItemParams\n ): Promise<ShopActionResult>\n getAllPersistedKeys(): Promise<ShopActionResult<string[]>>\n clearPersistedItems(): Promise<ShopActionResult>\n\n getInternalPersistedItem(\n params: GetAsyncStorageItemParams\n ): Promise<ShopActionResult<string | null>>\n setInternalPersistedItem(\n params: SetAsyncStorageItemParams\n ): Promise<ShopActionResult>\n removeInternalPersistedItem(\n params: RemoveAsyncStorageItemParams\n ): Promise<ShopActionResult>\n getAllInternalPersistedKeys(): Promise<ShopActionResult<string[]>>\n clearInternalPersistedItems(): Promise<ShopActionResult>\n\n // secure storage actions\n getSecret(): Promise<ShopActionResult<string | null>>\n setSecret(params: SetSecretParams): Promise<ShopActionResult>\n removeSecret(): Promise<ShopActionResult>\n\n // event reporting actions\n reportInteraction(params: ReportInteractionParams): Promise<ShopActionResult>\n reportImpression(params: ReportImpressionParams): Promise<ShopActionResult>\n reportContentImpression(\n params: ReportContentImpressionParams\n ): Promise<ShopActionResult>\n\n getProductLists(\n params?: GetProductListsParams\n ): Promise<ShopActionResult<GetProductListsResponse>>\n\n getProductList(\n params?: GetProductListParams\n ): Promise<ShopActionResult<GetProductListResponse>>\n\n // product list actions\n addProductList(\n params: AddProductListParams\n ): Promise<ShopActionResult<ProductList>>\n removeProductList(params: RemoveProductListParams): Promise<ShopActionResult>\n renameProductList: (\n params: RenameProductListParams\n ) => Promise<ShopActionResult<ProductList>>\n addProductListItem(\n params: AddProductListItemParams\n ): Promise<ShopActionResult>\n removeProductListItem(\n params: RemoveProductListItemParams\n ): Promise<ShopActionResult>\n\n // recommendations actions\n getRecommendedProducts(\n params?: GetRecommendedProductsParams\n ): Promise<ShopActionResult<GetRecommendedProductsResponse>>\n getRecommendedShops(\n params?: GetRecommendedShopsParams\n ): Promise<ShopActionResult<GetRecommendedShopsResponse>>\n searchProductsByShop(\n params?: SearchProductsByShopParams\n ): Promise<ShopActionResult<SearchProductsByShopResponse>>\n\n // orders list actions\n getOrders(\n params?: GetOrdersParams\n ): Promise<ShopActionResult<GetOrdersResponse>>\n\n getBuyerAttributes(): Promise<ShopActionResult<GetBuyerAttributesResponse>>\n\n // content actions\n showFeedbackSheet(params: ShowFeedbackSheetParams): Promise<ShopActionResult>\n\n getPopularProducts(\n params?: GetPopularProductsParams\n ): Promise<ShopActionResult<GetPopularProductsResponse>>\n\n share(params: ShareParams): Promise<ShopActionResult>\n\n getCuratedProducts(\n params: GetCuratedProductsParams\n ): Promise<ShopActionResult<GetCuratedProductsResponse>>\n\n getSavedProducts(\n params?: GetSavedProductsParams\n ): Promise<ShopActionResult<GetSavedProductsResponse>>\n\n getRecentProducts(\n params?: GetRecentProductsParams\n ): Promise<ShopActionResult<GetRecentProductsResponse>>\n\n getProductSearch(\n params: GetProductSearchParams\n ): Promise<ShopActionResult<GetProductSearchResponse>>\n\n getProducts(\n params: GetProductsParams\n ): Promise<ShopActionResult<GetProductsResponse>>\n\n getProduct(\n params: GetProductParams\n ): Promise<ShopActionResult<GetProductResponse>>\n\n getProductVariants(\n params: GetProductVariantsParams\n ): Promise<ShopActionResult<GetProductVariantsResponse>>\n\n getProductMedia(\n params: GetProductMediaParams\n ): Promise<ShopActionResult<GetProductMediaResponse>>\n\n getShop(params: GetShopParams): Promise<ShopActionResult<GetShopResponse>>\n\n getRecentShops(\n params?: GetRecentShopsParams\n ): Promise<ShopActionResult<GetRecentShopsResponse>>\n\n getFollowedShops(\n params?: GetFollowedShopsParams\n ): Promise<ShopActionResult<GetFollowedShopsResponse>>\n}\n\nexport interface AuthShopActions {\n refreshAccessToken(\n params: RefreshAccessTokenParams\n ): Promise<ShopActionResult<ApiKeys>>\n signOut(): Promise<ShopActionResult>\n}\n\nexport type AllShopActions = ShopActions & AuthShopActions\n\nexport type ShopActionParams<T extends keyof AllShopActions> = Parameters<\n AllShopActions[T]\n>[0]\n\nexport interface FavoriteParams {\n shopId: string\n productId: string\n productVariantId: string\n}\n\nexport interface UnfavoriteParams {\n shopId: string\n productId: string\n productVariantId: string\n}\n\nexport interface LineItemAttribution {\n sourceName: string\n sourceIdentifier: string\n}\n\nexport interface CreateOrderAttributionParams {\n orderId: string\n productVariantId: string\n attribution?: LineItemAttribution\n}\n\nexport interface AddToCartParams extends BuyProductLineItem {\n /**\n * The discount codes to apply to the cart.\n */\n discountCodes?: string[]\n /**\n * Attribution data for the line item.\n * @deprecated\n */\n attribution?: LineItemAttribution\n}\n\nexport interface BuyProductLineItem {\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/456`.\n */\n productVariantId: string\n /**\n * The quantity of the product to add to the cart.\n */\n quantity?: number\n}\n\nexport interface BuyProductsParams {\n items: [BuyProductLineItem, ...BuyProductLineItem[]] // at least one item\n attribution?: LineItemAttribution\n discountCode?: string\n}\n\nexport interface BuyProductParams extends BuyProductLineItem {\n /**\n * Attribution data for the line item.\n * @deprecated\n */\n attribution?: LineItemAttribution\n /**\n * The discount code to apply to the product.\n */\n discountCode?: string\n}\n\nexport interface UpdateLineItemAttributesParams {\n lineItemAttributes: {key: string; value: string}[]\n attribution?: LineItemAttribution\n}\n\nexport interface NavigateToShopParams {\n shopId: string\n}\n\nexport interface NavigateToOrderParams {\n /**\n * The GID of the order. E.g. `gid://shopify/Order/123`.\n */\n orderId: string\n}\n\nexport interface NavigateToCheckoutParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/123`.\n */\n shopId: string\n}\n\nexport interface NavigateToProductParams {\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * If present, the GID of the variant that should be initially selected\n */\n productVariantId?: string\n /*\n * Variants displayed in the product details screen will be limited to those\n * whose ID is included in this list.\n */\n includedProductVariantGIDs?: string[]\n /**\n * @deprecated use includedProductVariantGIDs instead\n */\n includedProductVariantIds?: string[]\n /**\n * @deprecated do not use\n */\n attribution?: LineItemAttribution\n /**\n * The discount code to apply to the product.\n */\n discountCode?: string\n}\n\nexport interface RefreshAccessTokenParams {\n refreshToken: string\n}\n\nexport interface ProductRecommendationImpressionParams {\n // The product GID string\n productId: string\n // Optional section id, could be useful for tracking which UI sections get impressions\n sectionId?: string\n}\n\nexport interface ProductRecommendationClickParams {\n productId: string\n sectionId?: string\n}\n\nexport interface ShowErrorScreenParams {\n /**\n * The message to display in the error screen.\n */\n message?: string\n /**\n * The title of the error screen.\n */\n title?: string\n}\n\nexport interface ShowErrorToastParams {\n message?: string\n}\n\nexport interface GetAccountInformationParams {\n /**\n * To use user account information, a shopId must be given to track on\n * which shop's behalf user information is being accessed\n */\n shopId: string\n type: 'email' | 'name' | 'phone'\n}\n\nexport interface AccountInformationPhoneInfo {\n phoneNumber: string\n countryCode: string\n prefix: string\n}\n\nexport interface GetAccountInformationResponse {\n status: 'available' | 'not-available'\n value?: string | AccountInformationPhoneInfo\n}\n\nexport interface GetShopAppInformationResponse {\n appVersion: string\n buildNumber: string\n buildId: string\n}\n\nexport interface FollowShopParams {\n shopId: string\n}\n\nexport interface UnfollowShopParams {\n shopId: string\n}\n\nexport interface NavigateToDeeplinkParams {\n deeplink: string\n}\n\nexport interface GetDeeplinkPathsResponse {\n matchers: string[]\n}\n\nexport interface ProductRecommendationClickParams {\n productId: string\n productVariantId?: string\n variantGIDs?: string[]\n discountCode?: string\n attribution?: LineItemAttribution\n sectionId?: string\n}\n\nexport interface CreateImageUploadLinkParams {\n input: {\n mimeType: string\n fileSize: number\n }[]\n}\n\nexport interface UploadTarget {\n url: string\n resourceUrl: string\n parameters: {name: string; value: string}[]\n}\n\nexport interface CreateImageUploadLinkResponse {\n targets?: UploadTarget[]\n error?: string\n}\n\nexport interface CompleteImageUploadParams {\n resourceUrls: string[]\n}\n\nexport interface CompleteImageUploadResponse {\n files?: {\n id: string\n fileStatus: 'FAILED' | 'PENDING' | 'PROCESSING' | 'READY'\n image?: {\n url: string\n } | null\n }[]\n error?: string\n}\n\nexport interface PaginationInfo {\n hasNextPage: boolean\n endCursor: string | null\n}\n\nexport interface GetProductListsResponse {\n data: ProductList[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductListResponse {\n data: ProductList | null\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecommendedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecommendedShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface SearchProductsByShopResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetBuyerAttributesResponse {\n data: {\n genderAffinity?: Gender\n categoryAffinities: TaxonomyCategory[]\n }\n}\n\nexport interface GetCurrentUserResponse {\n data: UserProfile\n}\n\nexport interface GetOrdersResponse {\n data: Order[]\n pageInfo: PaginationInfo\n}\n\nexport interface SetSecretParams {\n value: string\n}\n\nexport interface SetAsyncStorageItemParams {\n key: string\n value: string\n}\n\nexport interface GetAsyncStorageItemParams {\n key: string\n}\n\nexport interface RemoveAsyncStorageItemParams {\n key: string\n}\n\nexport interface ReportInteractionParams {\n interactionType: string\n interactionValue?: string\n pageValue?: string\n}\n\nexport interface ReportImpressionParams {\n subjectType?: string\n subjectId?: string\n pageValue?: string\n}\n\nexport interface ReportContentImpressionParams {\n publicId: string\n pageValue: string\n}\n\nexport interface GetProductListsParams {\n /**\n * The number of lists to fetch.\n */\n first?: number\n /**\n * The cursor to fetch the next page of lists.\n */\n after?: string\n /**\n * The number of items per list to fetch.\n */\n itemsFirst?: number\n /**\n * The fetch policy to use.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id?: string\n /**\n * The public ID of the product list.\n */\n publicId?: string\n /**\n * The number of items to fetch.\n */\n first?: number\n /**\n * The cursor to fetch the next page of items.\n */\n after?: string\n /**\n * The fetch policy to use.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface AddProductListParams {\n /**\n * The name of the product list.\n */\n name: string\n /**\n * A description of the product list.\n */\n description?: string\n}\n\nexport interface RemoveProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id: string\n}\n\nexport interface RenameProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id: string\n /**\n * The new name of the product list.\n */\n name: string\n}\n\nexport interface AddProductListItemParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/42`.\n */\n shopId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.\n */\n productVariantId: string\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n * This will soon be deprecated in favor of just `publicListId`.\n */\n listId: string\n /**\n * The public ID of the product list.\n */\n publicListId: string\n}\n\nexport interface RemoveProductListItemParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/42`.\n */\n shopId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.\n */\n productVariantId: string\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n * This will soon be deprecated in favor of just `publicListId`.\n */\n listId: string\n /**\n * The public ID of the product list.\n */\n publicListId: string\n}\n\nexport interface GetRecommendedProductsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecommendedShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface SearchProductsByShopParams {\n shopId: string\n query?: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetBuyerAttributesParams {\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCurrentUserParams {\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetOrdersParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface ShowFeedbackSheetParams {\n publicId: string\n}\n\nexport interface GetPopularProductsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetPopularProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface PreviewProductInARParams {\n id: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCuratedProductsParams {\n handle: string\n requiredTags?: string[]\n anyOfTags?: string[]\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCuratedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductMediaParams {\n id: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductMediaResponse {\n data: ProductMedia[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetShopParams {\n id: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetShopResponse {\n data: Shop\n}\n\nexport interface GetRecentShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecentShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetFollowedShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetFollowedShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductsParams {\n ids: string[]\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductsResponse {\n data: Product[]\n}\n\nexport interface GetProductParams {\n id: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductResponse {\n data: Product\n}\n\nexport interface ShareParams {\n message?: string\n title?: string\n url?: string\n urls?: string[]\n type?: string\n failOnCancel?: boolean\n}\n\nexport interface GetSavedProductsParams {\n includeSensitive?: boolean\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetSavedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecentProductsParams {\n includeSensitive?: boolean\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecentProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductSearchParams {\n query: string\n filters?: ProductFilters\n sortBy?: ProductSearchSortBy\n includeSensitive?: boolean\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductSearchResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductVariantsParams {\n id: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductVariantsResponse {\n data: ProductVariant[]\n pageInfo: PaginationInfo\n}\n\nexport interface MinisParams {\n /** The handle/identifier of the Mini application */\n handle: string\n /** The initial URL that was used to load the Mini (optional) */\n initialUrl?: string\n}\n\nexport type FetchPolicy =\n | 'cache-first'\n | 'network-only'\n | 'cache-only'\n | 'no-cache'\n | 'standby'\n\nexport type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network'\n\nexport enum CurrencyCode {\n AED = 'AED',\n AFN = 'AFN',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BRL = 'BRL',\n BSD = 'BSD',\n BTN = 'BTN',\n BWP = 'BWP',\n BYN = 'BYN',\n BYR = 'BYR',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHF = 'CHF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n CRC = 'CRC',\n CVE = 'CVE',\n CZK = 'CZK',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n JEP = 'JEP',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KID = 'KID',\n KMF = 'KMF',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LTL = 'LTL',\n LVL = 'LVL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MYR = 'MYR',\n MZN = 'MZN',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STD = 'STD',\n STN = 'STN',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n UYU = 'UYU',\n UZS = 'UZS',\n VED = 'VED',\n VEF = 'VEF',\n VES = 'VES',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XCD = 'XCD',\n XOF = 'XOF',\n XPF = 'XPF',\n XXX = 'XXX',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMW = 'ZMW',\n}\n\nexport type Decimal = string\n\nexport type MiniAppParams = any\n\nexport interface MiniAppConfig<\n _DeprecatedParams extends MiniAppParams = undefined,\n> {\n /**\n * Root component of used inside the Minis Viewer\n */\n ViewerRoot: () => JSX.Element | null\n}\n\nexport interface MiniManifest {\n trusted_domains?: string[]\n permissions?: string[]\n [key: string]: any\n}\n\nexport type Permission = 'CAMERA' | 'GALLERY' | 'MICROPHONE'\n\nexport interface Money {\n amount: Decimal\n currencyCode: CurrencyCode\n}\n\nexport interface ProductImage {\n id?: string | null\n altText?: string | null\n url: string\n sensitive?: boolean | null\n}\n\nexport interface ProductVariant {\n id: string\n isFavorited: boolean\n image?: ProductImage | null\n price: Money\n compareAtPrice?: Money | null\n}\n\nexport interface ProductShop {\n id: string\n name: string\n}\n\nexport type ProductMedia =\n | {\n id: string\n image: ProductImage | null\n mediaContentType: 'IMAGE'\n alt: string | null\n }\n | {\n id: string\n mediaContentType: 'MODEL_3D'\n previewImage: ProductImage | null\n sources: {\n filesize: number\n format: string\n mimeType: string\n url: string\n }[]\n alt: string | null\n }\n | {\n id: string\n mediaContentType: 'VIDEO'\n previewImage: ProductImage | null\n sources: {\n format: string\n mimeType: string\n url: string\n width: number\n height: number\n }[]\n alt: string | null\n }\n | {\n id: string\n mediaContentType: 'EXTERNAL_VIDEO'\n previewImage: ProductImage | null\n embedUrl: string\n alt: string | null\n }\n\nexport interface Product {\n id: string\n title: string\n reviewAnalytics: {\n averageRating?: number | null\n reviewCount?: number | null\n }\n shop: ProductShop\n selectedVariant?: ProductVariant\n defaultVariantId: string\n isFavorited: boolean\n variants?: ProductVariant[]\n featuredImage?: ProductImage | null\n price: Money\n compareAtPrice?: Money | null\n}\n\nexport interface Image {\n url: string\n altText?: string | null\n height?: number | null\n width?: number | null\n sensitive: boolean\n thumbhash?: string | null\n}\n\nexport interface ColorTheme {\n id: string\n primary?: string | null\n secondary?: string | null\n secondaryText?: string | null\n statusBarStyle?: string | null\n logoAverage?: string | null\n logoDominant?: string | null\n coverDominant?: string | null\n}\n\nexport interface LogoTheme {\n id: string\n logoImage?: Image | null\n}\n\nexport interface HeaderTheme {\n id: string\n coverImage?: Image | null\n thumbnailImage?: Image | null\n wordmark?: Image | null\n videoUrl?: string | null\n startingScrimColor?: string | null\n endingScrimColor?: string | null\n}\n\nexport interface BrandSettings {\n id: string\n colors?: ColorTheme | null\n logos?: LogoTheme | null\n headerTheme?: HeaderTheme | null\n}\n\nexport interface VisualTheme {\n id: string\n logoImage?: Image | null\n featuredImages: Image[]\n description?: string | null\n brandSettings?: BrandSettings | null\n}\n\nexport interface Shop {\n id: string\n name: string\n isFollowing?: boolean | null\n shareUrl?: string | null\n primaryDomain: {\n url: string\n }\n logoImage?: ProductImage | null\n reviewAnalytics: {\n averageRating?: number | null\n reviewCount: number\n }\n visualTheme?: VisualTheme | null\n}\n\nexport interface QueryOptions {\n fetchPolicy?: WatchQueryFetchPolicy\n skip?: boolean\n}\n\nexport interface ProductList {\n id: string\n publicId: string | null\n name: string | null\n products: Product[]\n}\n\nexport interface Order {\n id: string\n name: string\n lineItems: {\n productTitle: string\n variantTitle: string | null\n quantity: number\n product: Product | null\n }[]\n shop: Shop | null\n}\n\nexport interface BuyerAttributes {\n genderAffinity?: Gender\n categoryAffinities: TaxonomyCategory[]\n}\n\nexport enum Gender {\n Male = 'MALE',\n Female = 'FEMALE',\n Neutral = 'NEUTRAL',\n}\n\nexport interface TaxonomyCategory {\n id: string\n name: string\n ancestors?: TaxonomyCategory[]\n}\n\n/**\n * A user profile.\n */\nexport interface UserProfile {\n /**\n * The display name of the user.\n */\n displayName?: string | null\n /**\n * The avatar image of the user.\n */\n avatarImage?: {\n url: string\n } | null\n}\n\n/**\n * A user metafield.\n */\nexport interface UserMetafield {\n /**\n * The key of the user metafield.\n */\n key: string\n /**\n * The value of the user metafield.\n */\n value: string\n}\n\nexport interface ContentImage {\n id: string | null\n url: string\n width: number | null\n height: number | null\n}\n\nexport interface ContentProduct {\n id: string\n title: string\n featuredImage: ContentImage | null\n}\n\nexport type ContentVisibility = 'DISCOVERABLE' | 'LINKABLE'\n\nexport interface Content {\n publicId: string\n externalId: string | null\n image: ContentImage\n title: string\n description: string | null\n visibility: ContentVisibility[]\n shareableUrl: string | null\n products: ContentProduct[] | null\n}\n\n/**\n * The fetch policy to use. `cache-first` will only fetch from the network if there is no\n * cached data. `network-only` will fetch from the network regardless of whether there\n * is cached data.\n */\nexport type DataHookFetchPolicy = 'cache-first' | 'network-only'\n\nexport interface DataHookOptionsBase {\n /**\n * When true, the data will not be fetched immediately.\n */\n skip?: boolean\n /**\n * The fetch policy to use for the initial data load. Subsequent loads may use different policies.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface PaginatedDataHookOptionsBase extends DataHookOptionsBase {\n /**\n * The number of products to fetch.\n * @default 20\n */\n first?: number\n}\n\nexport interface DataHookReturnsBase {\n /**\n * Whether data is loading. Represents the initial data load but not `refetch`/`fetchMore` calls.\n */\n loading: boolean\n /**\n * The error that occurred while loading. Represents the initial data load and `refetch` calls but not `fetchMore`\n */\n error: Error | null\n /**\n * Refetch the data. Data is updated in place. The `loading` state will not update but the `error` state will.\n */\n refetch: () => Promise<void>\n}\n\nexport interface PaginatedDataHookReturnsBase extends DataHookReturnsBase {\n /**\n * Whether there is a next page to fetch.\n */\n hasNextPage: boolean\n /**\n * Fetch more data. Data is updated in place. The `loading` and `error` states will not update\n */\n fetchMore: () => Promise<void>\n}\n\nexport const Consent = {\n MiniConsent: 'mini_consent',\n CameraConsent: 'camera_consent',\n PhotoLibraryConsent: 'photo_library_consent',\n MicrophoneConsent: 'microphone_consent',\n} as const\n\nexport const ConsentStatus = {\n Granted: 'granted',\n Dismissed: 'dismissed',\n Idle: 'idle',\n} as const\n\nexport type ConsentType = (typeof Consent)[keyof typeof Consent]\n\nexport type ConsentStatusType =\n (typeof ConsentStatus)[keyof typeof ConsentStatus]\n\nexport interface PaginatedDataHookPageInfo {\n /**\n * Whether there is a next page to fetch.\n */\n hasNextPage: boolean\n /**\n * The cursor to use for the next page of data.\n */\n endCursor: string | null\n}\n\nexport type ProductColorFilter =\n | 'BEIGE'\n | 'BLACK'\n | 'BLUE'\n | 'BROWN'\n | 'GOLD'\n | 'GREEN'\n | 'GREY'\n | 'NAVY'\n | 'ORANGE'\n | 'PINK'\n | 'PURPLE'\n | 'RED'\n | 'SILVER'\n | 'WHITE'\n | 'YELLOW'\n\nexport type ProductApparelSizeFilter =\n | 'SIZE_3XL'\n | 'SIZE_4XL'\n | 'SIZE_5XL'\n | 'SIZE_L'\n | 'SIZE_M'\n | 'SIZE_S'\n | 'SIZE_XL'\n | 'SIZE_XS'\n | 'SIZE_XXL'\n | 'SIZE_XXS'\n\nexport interface ProductFilters {\n /**\n * The apparel sizes to filter by.\n */\n apparelSize?: ProductApparelSizeFilter[]\n /**\n * Whether the product is in stock or not.\n */\n available?: boolean\n /**\n * The category IDs to filter by.\n */\n category?: string[]\n /**\n * The colors to filter by.\n */\n color?: ProductColorFilter[]\n /**\n * The gender to filter by.\n */\n gender?: 'MALE' | 'FEMALE' | 'NEUTRAL'\n /**\n * The shop IDs to include in the search.\n */\n includeShopIds?: string[]\n /**\n * The minimum rating to filter by.\n */\n minimumRating?: number\n /**\n * The price range to filter by.\n */\n price?: {\n min?: number\n max?: number\n }\n /**\n * The shoe sizes to filter by.\n */\n shoeSize?: ProductShoeSizeFilter[]\n}\n\nexport type ProductShoeSizeFilter =\n | 'SIZE_4'\n | 'SIZE_4_5'\n | 'SIZE_5'\n | 'SIZE_5_5'\n | 'SIZE_6'\n | 'SIZE_6_5'\n | 'SIZE_7'\n | 'SIZE_7_5'\n | 'SIZE_8'\n | 'SIZE_8_5'\n | 'SIZE_9'\n | 'SIZE_9_5'\n | 'SIZE_10'\n | 'SIZE_10_5'\n | 'SIZE_11'\n | 'SIZE_11_5'\n | 'SIZE_12'\n | 'SIZE_12_5'\n | 'SIZE_13'\n | 'SIZE_13_5'\n | 'SIZE_14'\n | 'SIZE_14_5'\n | 'SIZE_15'\n\nexport type ProductSizeFilter =\n | 'SIZE_XS'\n | 'SIZE_S'\n | 'SIZE_M'\n | 'SIZE_L'\n | 'SIZE_XL'\n | 'SIZE_XXL'\n | 'SIZE_XXS'\n\nexport type ProductSearchSortBy =\n | 'MOST_RECENT'\n | 'PRICE_HIGH_TO_LOW'\n | 'PRICE_LOW_TO_HIGH'\n | 'RELEVANCE'\n\ndeclare global {\n interface Window {\n minisSDK: ShopActions\n minisParams: MinisParams\n }\n}\n\nexport {}\n"],"names":["CurrencyCode","Gender","Consent","ConsentStatus"],"mappings":"AAs2BY,IAAAA,sBAAAA,OACVA,EAAA,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A,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OAjKIA,IAAAA,KAAA,CAAA,CAAA,GA0WAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,UAAU,WAHAA,IAAAA,KAAA,CAAA,CAAA;AAwHL,MAAMC,IAAU;AAAA,EACrB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAEaC,IAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AACR;"}
|
package/package.json
CHANGED
|
@@ -213,8 +213,8 @@ function MerchantCard({shop, touchable = true}: MerchantCardProps) {
|
|
|
213
213
|
const {
|
|
214
214
|
id,
|
|
215
215
|
name,
|
|
216
|
-
logoImage,
|
|
217
216
|
reviewAnalytics: {averageRating, reviewCount},
|
|
217
|
+
visualTheme,
|
|
218
218
|
} = shop
|
|
219
219
|
|
|
220
220
|
const handlePress = React.useCallback(() => {
|
|
@@ -227,7 +227,10 @@ function MerchantCard({shop, touchable = true}: MerchantCardProps) {
|
|
|
227
227
|
<MerchantCardImageContainer>
|
|
228
228
|
{/* TODO: Add featured image */}
|
|
229
229
|
<MerchantCardImage src={undefined} alt={`${name} featured image`} />
|
|
230
|
-
<MerchantCardLogo
|
|
230
|
+
<MerchantCardLogo
|
|
231
|
+
src={visualTheme?.logoImage?.url}
|
|
232
|
+
alt={`${name} logo`}
|
|
233
|
+
/>
|
|
231
234
|
</MerchantCardImageContainer>
|
|
232
235
|
|
|
233
236
|
<MerchantCardInfo>
|
|
@@ -238,7 +241,6 @@ function MerchantCard({shop, touchable = true}: MerchantCardProps) {
|
|
|
238
241
|
)
|
|
239
242
|
}
|
|
240
243
|
|
|
241
|
-
// Export with Object.assign pattern
|
|
242
244
|
export const MerchantCardPrimitive = Object.assign(MerchantCardRoot, {
|
|
243
245
|
ImageContainer: MerchantCardImageContainer,
|
|
244
246
|
Image: MerchantCardImage,
|
|
@@ -6,6 +6,7 @@ import {Slot as SlotPrimitive} from 'radix-ui'
|
|
|
6
6
|
|
|
7
7
|
import {useShopNavigation} from '../../hooks/navigation/useShopNavigation'
|
|
8
8
|
import {useSavedProductsActions} from '../../hooks/user/useSavedProductsActions'
|
|
9
|
+
import {formatMoney} from '../../lib/formatMoney'
|
|
9
10
|
import {cn} from '../../lib/utils'
|
|
10
11
|
import {type Product} from '../../types/minisSDK.generated.d'
|
|
11
12
|
import {Button} from '../atoms/button'
|
|
@@ -254,9 +255,13 @@ function ProductLink({product}: ProductLinkProps) {
|
|
|
254
255
|
const reviewCount = reviewAnalytics?.reviewCount
|
|
255
256
|
const currencyCode = price?.currencyCode
|
|
256
257
|
const amount = price?.amount
|
|
258
|
+
? formatMoney(price?.amount, price?.currencyCode)
|
|
259
|
+
: undefined
|
|
257
260
|
const imageUrl = featuredImage?.url
|
|
258
261
|
const imageAltText = featuredImage?.altText || title
|
|
259
262
|
const compareAtPriceAmount = compareAtPrice?.amount
|
|
263
|
+
? formatMoney(compareAtPrice?.amount, compareAtPrice?.currencyCode)
|
|
264
|
+
: undefined
|
|
260
265
|
const compareAtPriceCurrencyCode = compareAtPrice?.currencyCode
|
|
261
266
|
const hasDiscount = compareAtPriceAmount && compareAtPriceAmount !== amount
|
|
262
267
|
|
|
@@ -350,17 +355,13 @@ function ProductLink({product}: ProductLinkProps) {
|
|
|
350
355
|
<ProductLinkPrice>
|
|
351
356
|
{hasDiscount ? (
|
|
352
357
|
<>
|
|
353
|
-
<ProductLinkDiscountPrice>
|
|
354
|
-
{currencyCode} {amount}
|
|
355
|
-
</ProductLinkDiscountPrice>
|
|
358
|
+
<ProductLinkDiscountPrice>{amount}</ProductLinkDiscountPrice>
|
|
356
359
|
<ProductLinkOriginalPrice>
|
|
357
|
-
{
|
|
360
|
+
{compareAtPriceAmount}
|
|
358
361
|
</ProductLinkOriginalPrice>
|
|
359
362
|
</>
|
|
360
363
|
) : (
|
|
361
|
-
<ProductLinkCurrentPrice>
|
|
362
|
-
{currencyCode} {amount}
|
|
363
|
-
</ProductLinkCurrentPrice>
|
|
364
|
+
<ProductLinkCurrentPrice>{amount}</ProductLinkCurrentPrice>
|
|
364
365
|
)}
|
|
365
366
|
</ProductLinkPrice>
|
|
366
367
|
</ProductLinkInfo>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @shopify/typescript/prefer-pascal-case-enums */
|
|
2
2
|
// Auto-generated type definitions for MinisSDK
|
|
3
|
-
// Generated on: 2025-06-
|
|
3
|
+
// Generated on: 2025-06-27T14:04:00.340Z
|
|
4
4
|
// Do not edit this file manually - run the generation script instead
|
|
5
5
|
// Source: useShopActionsImplementationV3.ts + shopActionsV3Definitions.ts + shopActionsV3Types.ts
|
|
6
6
|
// Generated using TypeScript compiler API for reliable AST parsing
|
|
@@ -1135,6 +1135,56 @@ export interface Product {
|
|
|
1135
1135
|
compareAtPrice?: Money | null
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
1138
|
+
export interface Image {
|
|
1139
|
+
url: string
|
|
1140
|
+
altText?: string | null
|
|
1141
|
+
height?: number | null
|
|
1142
|
+
width?: number | null
|
|
1143
|
+
sensitive: boolean
|
|
1144
|
+
thumbhash?: string | null
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
export interface ColorTheme {
|
|
1148
|
+
id: string
|
|
1149
|
+
primary?: string | null
|
|
1150
|
+
secondary?: string | null
|
|
1151
|
+
secondaryText?: string | null
|
|
1152
|
+
statusBarStyle?: string | null
|
|
1153
|
+
logoAverage?: string | null
|
|
1154
|
+
logoDominant?: string | null
|
|
1155
|
+
coverDominant?: string | null
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
export interface LogoTheme {
|
|
1159
|
+
id: string
|
|
1160
|
+
logoImage?: Image | null
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export interface HeaderTheme {
|
|
1164
|
+
id: string
|
|
1165
|
+
coverImage?: Image | null
|
|
1166
|
+
thumbnailImage?: Image | null
|
|
1167
|
+
wordmark?: Image | null
|
|
1168
|
+
videoUrl?: string | null
|
|
1169
|
+
startingScrimColor?: string | null
|
|
1170
|
+
endingScrimColor?: string | null
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
export interface BrandSettings {
|
|
1174
|
+
id: string
|
|
1175
|
+
colors?: ColorTheme | null
|
|
1176
|
+
logos?: LogoTheme | null
|
|
1177
|
+
headerTheme?: HeaderTheme | null
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
export interface VisualTheme {
|
|
1181
|
+
id: string
|
|
1182
|
+
logoImage?: Image | null
|
|
1183
|
+
featuredImages: Image[]
|
|
1184
|
+
description?: string | null
|
|
1185
|
+
brandSettings?: BrandSettings | null
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1138
1188
|
export interface Shop {
|
|
1139
1189
|
id: string
|
|
1140
1190
|
name: string
|
|
@@ -1148,6 +1198,7 @@ export interface Shop {
|
|
|
1148
1198
|
averageRating?: number | null
|
|
1149
1199
|
reviewCount: number
|
|
1150
1200
|
}
|
|
1201
|
+
visualTheme?: VisualTheme | null
|
|
1151
1202
|
}
|
|
1152
1203
|
|
|
1153
1204
|
export interface QueryOptions {
|