@shopify/shop-minis-react 0.4.13 → 0.4.16

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.
Files changed (35) hide show
  1. package/dist/_virtual/index4.js +2 -2
  2. package/dist/_virtual/index5.js +2 -3
  3. package/dist/_virtual/index5.js.map +1 -1
  4. package/dist/_virtual/index6.js +3 -2
  5. package/dist/_virtual/index6.js.map +1 -1
  6. package/dist/components/atoms/product-variant-price.js +1 -1
  7. package/dist/components/atoms/product-variant-price.js.map +1 -1
  8. package/dist/components/commerce/product-card.js +1 -1
  9. package/dist/components/commerce/product-card.js.map +1 -1
  10. package/dist/components/commerce/product-link.js +1 -1
  11. package/dist/components/commerce/product-link.js.map +1 -1
  12. package/dist/hooks/storage/useImageUpload.js +32 -24
  13. package/dist/hooks/storage/useImageUpload.js.map +1 -1
  14. package/dist/index.js +48 -46
  15. package/dist/index.js.map +1 -1
  16. package/dist/mocks.js +70 -50
  17. package/dist/mocks.js.map +1 -1
  18. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js +1 -1
  19. package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js +1 -1
  20. package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
  21. package/dist/utils/formatMoney.js.map +1 -0
  22. package/eslint/rules/validate-manifest.cjs +91 -41
  23. package/package.json +2 -2
  24. package/src/components/atoms/product-variant-price.test.tsx +1 -1
  25. package/src/components/atoms/product-variant-price.tsx +1 -1
  26. package/src/components/commerce/product-card.test.tsx +1 -1
  27. package/src/components/commerce/product-card.tsx +1 -1
  28. package/src/components/commerce/product-link.test.tsx +1 -1
  29. package/src/components/commerce/product-link.tsx +1 -1
  30. package/src/hooks/storage/useImageUpload.ts +13 -0
  31. package/src/mocks.ts +48 -19
  32. package/src/utils/index.ts +1 -0
  33. package/dist/lib/formatMoney.js.map +0 -1
  34. /package/dist/{lib → utils}/formatMoney.js +0 -0
  35. /package/src/{lib → utils}/formatMoney.ts +0 -0
package/dist/index.js CHANGED
@@ -4,11 +4,11 @@ import { AddToCartButton as n } from "./components/commerce/add-to-cart.js";
4
4
  import { BuyNowButton as s } from "./components/commerce/buy-now.js";
5
5
  import { ProductCard as u, ProductCardBadge as f, ProductCardContainer as x, ProductCardFavoriteButton as c, ProductCardImage as d, ProductCardImageContainer as C, ProductCardInfo as g, ProductCardPrice as S, ProductCardReviewStars as A, ProductCardTitle as D } from "./components/commerce/product-card.js";
6
6
  import { ProductLink as T } from "./components/commerce/product-link.js";
7
- import { MerchantCard as I, MerchantCardContainer as E, MerchantCardHeader as R, MerchantCardInfo as w, MerchantCardName as F, MerchantCardRating as M } from "./components/commerce/merchant-card.js";
7
+ import { MerchantCard as I, MerchantCardContainer as E, MerchantCardHeader as M, MerchantCardInfo as R, MerchantCardName as w, MerchantCardRating as F } from "./components/commerce/merchant-card.js";
8
8
  import { ProductCardSkeleton as B } from "./components/commerce/product-card-skeleton.js";
9
9
  import { MerchantCardSkeleton as L } from "./components/commerce/merchant-card-skeleton.js";
10
10
  import { QuantitySelector as b } from "./components/commerce/quantity-selector.js";
11
- import { Search as _, SearchInput as G, SearchProvider as O, SearchResultsList as y } from "./components/commerce/search.js";
11
+ import { Search as _, SearchInput as y, SearchProvider as G, SearchResultsList as O } from "./components/commerce/search.js";
12
12
  import { FavoriteButton as V } from "./components/commerce/favorite-button.js";
13
13
  import { ImageContentWrapper as W } from "./components/content/image-content-wrapper.js";
14
14
  import { MinisRouter as q } from "./components/navigation/minis-router.js";
@@ -26,19 +26,19 @@ import { ContentWrapper as cr } from "./components/atoms/content-wrapper.js";
26
26
  import { ProductVariantPrice as Cr } from "./components/atoms/product-variant-price.js";
27
27
  import { Accordion as Sr, AccordionContent as Ar, AccordionItem as Dr, AccordionTrigger as Pr } from "./components/ui/accordion.js";
28
28
  import { Alert as hr, AlertDescription as Ir, AlertTitle as Er } from "./components/ui/alert.js";
29
- import { AlertDialog as wr, AlertDialogAction as Fr, AlertDialogCancel as Mr, AlertDialogContent as vr, AlertDialogDescription as Br, AlertDialogFooter as Ur, AlertDialogHeader as Lr, AlertDialogOverlay as Nr, AlertDialogPortal as br, AlertDialogTitle as kr, AlertDialogTrigger as _r } from "./components/ui/alert-dialog.js";
30
- import { Avatar as Or, AvatarFallback as yr, AvatarImage as Hr } from "./components/ui/avatar.js";
29
+ import { AlertDialog as Rr, AlertDialogAction as wr, AlertDialogCancel as Fr, AlertDialogContent as vr, AlertDialogDescription as Br, AlertDialogFooter as Ur, AlertDialogHeader as Lr, AlertDialogOverlay as Nr, AlertDialogPortal as br, AlertDialogTitle as kr, AlertDialogTrigger as _r } from "./components/ui/alert-dialog.js";
30
+ import { Avatar as Gr, AvatarFallback as Or, AvatarImage as Hr } from "./components/ui/avatar.js";
31
31
  import { Badge as zr, badgeVariants as Wr } from "./components/ui/badge.js";
32
32
  import { Card as qr, CardAction as Kr, CardContent as Qr, CardDescription as Zr, CardFooter as jr, CardHeader as Jr, CardTitle as Xr } from "./components/ui/card.js";
33
33
  import { Carousel as re, CarouselContent as ee, CarouselItem as oe, CarouselNext as te, CarouselPrevious as ae } from "./components/ui/carousel.js";
34
34
  import { Checkbox as pe } from "./components/ui/checkbox.js";
35
35
  import { Dialog as me, DialogClose as se, DialogContent as le, DialogDescription as ue, DialogFooter as fe, DialogHeader as xe, DialogOverlay as ce, DialogPortal as de, DialogTitle as Ce, DialogTrigger as ge } from "./components/ui/dialog.js";
36
- import { Drawer as Ae, DrawerClose as De, DrawerContent as Pe, DrawerDescription as Te, DrawerFooter as he, DrawerHeader as Ie, DrawerOverlay as Ee, DrawerPortal as Re, DrawerTitle as we, DrawerTrigger as Fe } from "./components/ui/drawer.js";
36
+ import { Drawer as Ae, DrawerClose as De, DrawerContent as Pe, DrawerDescription as Te, DrawerFooter as he, DrawerHeader as Ie, DrawerOverlay as Ee, DrawerPortal as Me, DrawerTitle as Re, DrawerTrigger as we } from "./components/ui/drawer.js";
37
37
  import { Input as ve } from "./components/ui/input.js";
38
38
  import { Label as Ue } from "./components/ui/label.js";
39
39
  import { Progress as Ne } from "./components/ui/progress.js";
40
40
  import { RadioGroup as ke, RadioGroupItem as _e } from "./components/ui/radio-group.js";
41
- import { ResizableHandle as Oe, ResizablePanel as ye, ResizablePanelGroup as He } from "./components/ui/resizable.js";
41
+ import { ResizableHandle as Ge, ResizablePanel as Oe, ResizablePanelGroup as He } from "./components/ui/resizable.js";
42
42
  import { ScrollArea as ze, ScrollBar as We } from "./components/ui/scroll-area.js";
43
43
  import { Select as qe, SelectContent as Ke, SelectGroup as Qe, SelectItem as Ze, SelectLabel as je, SelectScrollDownButton as Je, SelectScrollUpButton as Xe, SelectSeparator as $e, SelectTrigger as ro, SelectValue as eo } from "./components/ui/select.js";
44
44
  import { Separator as to } from "./components/ui/separator.js";
@@ -49,13 +49,13 @@ import { Skeleton as Ao } from "./components/ui/skeleton.js";
49
49
  import { useRecentProducts as Po } from "./hooks/user/useRecentProducts.js";
50
50
  import { useRecentShops as ho } from "./hooks/user/useRecentShops.js";
51
51
  import { useSavedProducts as Eo } from "./hooks/user/useSavedProducts.js";
52
- import { useSavedProductsActions as wo } from "./hooks/user/useSavedProductsActions.js";
53
- import { useFollowedShops as Mo } from "./hooks/user/useFollowedShops.js";
52
+ import { useSavedProductsActions as Ro } from "./hooks/user/useSavedProductsActions.js";
53
+ import { useFollowedShops as Fo } from "./hooks/user/useFollowedShops.js";
54
54
  import { useFollowedShopsActions as Bo } from "./hooks/user/useFollowedShopsActions.js";
55
55
  import { useCurrentUser as Lo } from "./hooks/user/useCurrentUser.js";
56
56
  import { useOrders as bo } from "./hooks/user/useOrders.js";
57
57
  import { useBuyerAttributes as _o } from "./hooks/user/useBuyerAttributes.js";
58
- import { useGenerateUserToken as Oo } from "./hooks/user/useGenerateUserToken.js";
58
+ import { useGenerateUserToken as Go } from "./hooks/user/useGenerateUserToken.js";
59
59
  import { useProductListActions as Ho } from "./hooks/product/useProductListActions.js";
60
60
  import { useProductLists as zo } from "./hooks/product/useProductLists.js";
61
61
  import { useProductList as Yo } from "./hooks/product/useProductList.js";
@@ -76,13 +76,13 @@ import { useDeeplink as At } from "./hooks/navigation/useDeeplink.js";
76
76
  import { useNavigateWithTransition as Pt } from "./hooks/navigation/useNavigateWithTransition.js";
77
77
  import { useShop as ht } from "./hooks/shop/useShop.js";
78
78
  import { useRecommendedShops as Et } from "./hooks/shop/useRecommendedShops.js";
79
- import { useCreateImageContent as wt } from "./hooks/content/useCreateImageContent.js";
80
- import { useErrorToast as Mt } from "./hooks/util/useErrorToast.js";
79
+ import { useCreateImageContent as Rt } from "./hooks/content/useCreateImageContent.js";
80
+ import { useErrorToast as Ft } from "./hooks/util/useErrorToast.js";
81
81
  import { useErrorScreen as Bt } from "./hooks/util/useErrorScreen.js";
82
82
  import { useShare as Lt } from "./hooks/util/useShare.js";
83
83
  import { useImagePicker as bt } from "./hooks/util/useImagePicker.js";
84
84
  import { useKeyboardAvoidingView as _t } from "./hooks/util/useKeyboardAvoidingView.js";
85
- import { useRequestPermissions as Ot } from "./hooks/util/useRequestPermissions.js";
85
+ import { useRequestPermissions as Gt } from "./hooks/util/useRequestPermissions.js";
86
86
  import { useOnMiniFocus as Ht } from "./hooks/events/useOnMiniFocus.js";
87
87
  import { useOnMiniBlur as zt } from "./hooks/events/useOnMiniBlur.js";
88
88
  import { useOnMiniClose as Yt } from "./hooks/events/useOnMiniClose.js";
@@ -91,10 +91,11 @@ import { MiniEntityNotFoundError as Zt, MiniError as jt, MiniNetworkError as Jt,
91
91
  import { extractBrandTheme as ra, formatReviewCount as ea, getFeaturedImages as oa, normalizeRating as ta } from "./utils/merchant-card.js";
92
92
  import { parseUrl as ia } from "./utils/parseUrl.js";
93
93
  import { fileToDataUri as na, getResizedImageUrl as ma, getThumbhashDataURL as sa } from "./utils/image.js";
94
- import { UserState as ua, UserTokenGenerateUserErrorCode as fa } from "./shop-minis-platform/src/types/user.js";
95
- import { ContentCreateUserErrorCode as ca, MinisContentStatus as da } from "./shop-minis-platform/src/types/content.js";
96
- import { Social as ga } from "./shop-minis-platform/src/types/share.js";
97
- import { DATA_FETCHING_DEFAULT_FETCH_POLICY as Aa, DATA_FETCHING_DEFAULT_PAGE_SIZE as Da } from "./shop-minis-platform/src/constants.js";
94
+ import { formatMoney as ua } from "./utils/formatMoney.js";
95
+ import { UserState as xa, UserTokenGenerateUserErrorCode as ca } from "./shop-minis-platform/src/types/user.js";
96
+ import { ContentCreateUserErrorCode as Ca, MinisContentStatus as ga } from "./shop-minis-platform/src/types/content.js";
97
+ import { Social as Aa } from "./shop-minis-platform/src/types/share.js";
98
+ import { DATA_FETCHING_DEFAULT_FETCH_POLICY as Pa, DATA_FETCHING_DEFAULT_PAGE_SIZE as Ta } from "./shop-minis-platform/src/constants.js";
98
99
  export {
99
100
  Sr as Accordion,
100
101
  Ar as AccordionContent,
@@ -103,10 +104,10 @@ export {
103
104
  n as AddToCartButton,
104
105
  hr as Alert,
105
106
  Ir as AlertDescription,
106
- wr as AlertDialog,
107
- Fr as AlertDialogAction,
107
+ Rr as AlertDialog,
108
+ wr as AlertDialogAction,
108
109
  pr as AlertDialogAtom,
109
- Mr as AlertDialogCancel,
110
+ Fr as AlertDialogCancel,
110
111
  vr as AlertDialogContent,
111
112
  Br as AlertDialogDescription,
112
113
  Ur as AlertDialogFooter,
@@ -116,8 +117,8 @@ export {
116
117
  kr as AlertDialogTitle,
117
118
  _r as AlertDialogTrigger,
118
119
  Er as AlertTitle,
119
- Or as Avatar,
120
- yr as AvatarFallback,
120
+ Gr as Avatar,
121
+ Or as AvatarFallback,
121
122
  Hr as AvatarImage,
122
123
  zr as Badge,
123
124
  j as Button,
@@ -135,10 +136,10 @@ export {
135
136
  te as CarouselNext,
136
137
  ae as CarouselPrevious,
137
138
  pe as Checkbox,
138
- ca as ContentCreateUserErrorCode,
139
+ Ca as ContentCreateUserErrorCode,
139
140
  cr as ContentWrapper,
140
- Aa as DATA_FETCHING_DEFAULT_FETCH_POLICY,
141
- Da as DATA_FETCHING_DEFAULT_PAGE_SIZE,
141
+ Pa as DATA_FETCHING_DEFAULT_FETCH_POLICY,
142
+ Ta as DATA_FETCHING_DEFAULT_PAGE_SIZE,
142
143
  o as DATA_NAVIGATION_TYPE_ATTRIBUTE,
143
144
  me as Dialog,
144
145
  se as DialogClose,
@@ -157,9 +158,9 @@ export {
157
158
  he as DrawerFooter,
158
159
  Ie as DrawerHeader,
159
160
  Ee as DrawerOverlay,
160
- Re as DrawerPortal,
161
- we as DrawerTitle,
162
- Fe as DrawerTrigger,
161
+ Me as DrawerPortal,
162
+ Re as DrawerTitle,
163
+ we as DrawerTrigger,
163
164
  V as FavoriteButton,
164
165
  X as IconButton,
165
166
  rr as Image,
@@ -170,16 +171,16 @@ export {
170
171
  ar as LongPressDetector,
171
172
  I as MerchantCard,
172
173
  E as MerchantCardContainer,
173
- R as MerchantCardHeader,
174
- w as MerchantCardInfo,
175
- F as MerchantCardName,
176
- M as MerchantCardRating,
174
+ M as MerchantCardHeader,
175
+ R as MerchantCardInfo,
176
+ w as MerchantCardName,
177
+ F as MerchantCardRating,
177
178
  L as MerchantCardSkeleton,
178
179
  Zt as MiniEntityNotFoundError,
179
180
  jt as MiniError,
180
181
  Jt as MiniNetworkError,
181
182
  i as MinisContainer,
182
- da as MinisContentStatus,
183
+ ga as MinisContentStatus,
183
184
  q as MinisRouter,
184
185
  t as NAVIGATION_TYPES,
185
186
  u as ProductCard,
@@ -199,15 +200,15 @@ export {
199
200
  b as QuantitySelector,
200
201
  ke as RadioGroup,
201
202
  _e as RadioGroupItem,
202
- Oe as ResizableHandle,
203
- ye as ResizablePanel,
203
+ Ge as ResizableHandle,
204
+ Oe as ResizablePanel,
204
205
  He as ResizablePanelGroup,
205
206
  ze as ScrollArea,
206
207
  We as ScrollBar,
207
208
  _ as Search,
208
- G as SearchInput,
209
- O as SearchProvider,
210
- y as SearchResultsList,
209
+ y as SearchInput,
210
+ G as SearchProvider,
211
+ O as SearchResultsList,
211
212
  qe as Select,
212
213
  Ke as SelectContent,
213
214
  Qe as SelectGroup,
@@ -228,18 +229,19 @@ export {
228
229
  uo as SheetTitle,
229
230
  fo as SheetTrigger,
230
231
  Ao as Skeleton,
231
- ga as Social,
232
+ Aa as Social,
232
233
  fr as TextInput,
233
234
  co as Toaster,
234
235
  or as Touchable,
235
236
  Q as TransitionLink,
236
- ua as UserState,
237
- fa as UserTokenGenerateUserErrorCode,
237
+ xa as UserState,
238
+ ca as UserTokenGenerateUserErrorCode,
238
239
  lr as VideoPlayer,
239
240
  Wr as badgeVariants,
240
241
  ra as extractBrandTheme,
241
242
  na as fileToDataUri,
242
243
  Xt as formatError,
244
+ ua as formatMoney,
243
245
  ea as formatReviewCount,
244
246
  oa as getFeaturedImages,
245
247
  ma as getResizedImageUrl,
@@ -250,15 +252,15 @@ export {
250
252
  st as useAsyncStorage,
251
253
  _o as useBuyerAttributes,
252
254
  gt as useCloseMini,
253
- wt as useCreateImageContent,
255
+ Rt as useCreateImageContent,
254
256
  nt as useCuratedProducts,
255
257
  Lo as useCurrentUser,
256
258
  At as useDeeplink,
257
259
  Bt as useErrorScreen,
258
- Mt as useErrorToast,
259
- Mo as useFollowedShops,
260
+ Ft as useErrorToast,
261
+ Fo as useFollowedShops,
260
262
  Bo as useFollowedShopsActions,
261
- Oo as useGenerateUserToken,
263
+ Go as useGenerateUserToken,
262
264
  bt as useImagePicker,
263
265
  xt as useImageUpload,
264
266
  _t as useKeyboardAvoidingView,
@@ -281,9 +283,9 @@ export {
281
283
  ho as useRecentShops,
282
284
  tt as useRecommendedProducts,
283
285
  Et as useRecommendedShops,
284
- Ot as useRequestPermissions,
286
+ Gt as useRequestPermissions,
285
287
  Eo as useSavedProducts,
286
- wo as useSavedProductsActions,
288
+ Ro as useSavedProductsActions,
287
289
  ut as useSecureStorage,
288
290
  Lt as useShare,
289
291
  ht as useShop,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/mocks.js CHANGED
@@ -1,27 +1,40 @@
1
- import { UserState as g } from "./shop-minis-platform/src/types/user.js";
2
- import { MinisContentStatus as h } from "./shop-minis-platform/src/types/content.js";
3
- const e = (o, r, t = "99.99", i) => ({
4
- id: o,
5
- title: r,
6
- price: { amount: t, currencyCode: "USD" },
7
- ...i && {
8
- compareAtPrice: { amount: i, currencyCode: "USD" }
9
- },
10
- reviewAnalytics: { averageRating: 4.5, reviewCount: 10 },
11
- shop: d("shop1", "Mock Shop"),
12
- defaultVariantId: `variant-${o}`,
13
- isFavorited: !1,
14
- featuredImage: {
15
- url: "https://cdn.shopify.com/static/sample-images/teapot.jpg",
16
- altText: r
17
- }
18
- }), d = (o, r, t) => {
19
- const i = t?.themeType || "none", s = t?.withBrandSettings || i !== "none", l = t?.featuredImagesLimit || 3, m = Array.from({ length: l }, (I, c) => ({
20
- url: `https://picsum.photos/400/400?random=${o}-${c}`,
1
+ import { UserState as h } from "./shop-minis-platform/src/types/user.js";
2
+ import { MinisContentStatus as v } from "./shop-minis-platform/src/types/content.js";
3
+ const m = [
4
+ "garnished.jpeg",
5
+ "bath.jpeg",
6
+ "teapot.jpg",
7
+ "shoes.jpeg"
8
+ ], P = (o) => {
9
+ let r = 0;
10
+ for (let t = 0; t < o.length; t++)
11
+ r = (r << 5) - r + o.charCodeAt(t), r |= 0;
12
+ return Math.abs(r);
13
+ }, e = (o, r, t = "99.99", n) => {
14
+ const i = P(o) % m.length, c = m[i];
15
+ return {
16
+ id: o,
17
+ title: r,
18
+ price: { amount: t, currencyCode: "USD" },
19
+ ...n && {
20
+ compareAtPrice: { amount: n, currencyCode: "USD" }
21
+ },
22
+ reviewAnalytics: { averageRating: 4.5, reviewCount: 10 },
23
+ shop: d("shop1", "Mock Shop"),
24
+ defaultVariantId: `variant-${o}`,
25
+ isFavorited: !1,
26
+ featuredImage: {
27
+ url: `https://cdn.shopify.com/static/sample-images/${c}`,
28
+ altText: r
29
+ }
30
+ };
31
+ }, d = (o, r, t) => {
32
+ const n = t?.themeType || "none", i = t?.withBrandSettings || n !== "none", c = t?.featuredImagesLimit || 3, u = Array.from({ length: c }, (C, l) => ({
33
+ url: `https://picsum.photos/400/400?random=${o}-${l}`,
21
34
  sensitive: !1,
22
- altText: `${r} featured image ${c + 1}`
23
- })), u = () => {
24
- switch (i) {
35
+ altText: `${r} featured image ${l + 1}`
36
+ })), p = () => {
37
+ switch (n) {
25
38
  case "coverImage":
26
39
  return {
27
40
  primary: t?.primaryColor,
@@ -51,8 +64,8 @@ const e = (o, r, t = "99.99", i) => ({
51
64
  coverDominant: t?.coverDominantColor
52
65
  };
53
66
  }
54
- }, p = () => {
55
- if (i === "coverImage" || t?.coverImageUrl)
67
+ }, g = () => {
68
+ if (n === "coverImage" || t?.coverImageUrl)
56
69
  return {
57
70
  id: `header-theme-${o}`,
58
71
  coverImage: {
@@ -61,7 +74,7 @@ const e = (o, r, t = "99.99", i) => ({
61
74
  sensitive: !1,
62
75
  thumbhash: "k9oGHQRnh493V4dIeHeXh4h3iIeI"
63
76
  },
64
- wordmark: t?.wordmarkUrl || i === "coverImage" ? {
77
+ wordmark: t?.wordmarkUrl || n === "coverImage" ? {
65
78
  url: t?.wordmarkUrl || "https://merrypeople.com/cdn/shop/files/Transparent_Background_1.png?v=1696465429&width=1024",
66
79
  altText: `${r} wordmark`,
67
80
  sensitive: !1
@@ -86,37 +99,41 @@ const e = (o, r, t = "99.99", i) => ({
86
99
  reviewAnalytics: { averageRating: 4.3, reviewCount: 50 },
87
100
  visualTheme: {
88
101
  id: `visual-theme-${o}`,
89
- featuredImages: m,
102
+ featuredImages: u,
90
103
  logoImage: {
91
104
  url: `https://picsum.photos/100/100?random=${o}`,
92
105
  sensitive: !1
93
106
  },
94
- brandSettings: s ? {
107
+ brandSettings: i ? {
95
108
  id: `brand-settings-${o}`,
96
109
  colors: {
97
110
  id: `colors-${o}`,
98
- ...u()
111
+ ...p()
99
112
  },
100
- headerTheme: p()
113
+ headerTheme: g()
101
114
  } : void 0
102
115
  }
103
116
  };
104
117
  }, a = (o = !1) => ({
105
118
  hasNextPage: o,
106
119
  endCursor: o ? "cursor123" : null
107
- }), n = (o, r, t = []) => ({
120
+ }), s = (o, r, t = []) => ({
108
121
  id: o,
109
122
  publicId: `public-${o}`,
110
123
  name: r,
111
124
  products: t
112
125
  });
113
- function v(o, r) {
126
+ function S(o, r) {
114
127
  window._mockLogs = window._mockLogs || [], window._mockLogs.push({ action: o, params: r });
115
128
  }
116
- function P(o, r) {
117
- return (t) => (v(String(o), t), Promise.resolve({ ok: !0, data: r }));
129
+ function f(o, r) {
130
+ return (t) => (S(String(o), t), Promise.resolve({
131
+ ok: !0,
132
+ data: r,
133
+ mocked: !0
134
+ }));
118
135
  }
119
- function S() {
136
+ function I() {
120
137
  const o = {
121
138
  translateContentUp: void 0,
122
139
  translateContentDown: void 0,
@@ -157,6 +174,7 @@ function S() {
157
174
  navigateToOrder: void 0,
158
175
  navigateToCheckout: void 0,
159
176
  createImageUploadLink: {
177
+ // This action is mocked in the actual hook. See `useImageUpload` for more details.
160
178
  targets: [
161
179
  {
162
180
  url: "https://example.com/upload",
@@ -170,7 +188,9 @@ function S() {
170
188
  {
171
189
  id: "file-123",
172
190
  fileStatus: "READY",
173
- image: { url: "https://example.com/image.jpg" }
191
+ image: {
192
+ url: "https://example.com/image.jpg"
193
+ }
174
194
  }
175
195
  ]
176
196
  },
@@ -192,20 +212,20 @@ function S() {
192
212
  reportContentImpression: void 0,
193
213
  getProductLists: {
194
214
  data: [
195
- n("list-1", "Wishlist"),
196
- n("list-2", "Favorites")
215
+ s("list-1", "Wishlist"),
216
+ s("list-2", "Favorites")
197
217
  ],
198
218
  pageInfo: a()
199
219
  },
200
220
  getProductList: {
201
- data: n("list-1", "Wishlist", [
221
+ data: s("list-1", "Wishlist", [
202
222
  e("prod-1", "Sample Product")
203
223
  ]),
204
224
  pageInfo: a()
205
225
  },
206
- addProductList: n("list-3", "New List"),
226
+ addProductList: s("list-3", "New List"),
207
227
  removeProductList: void 0,
208
- renameProductList: n("list-1", "Updated Wishlist"),
228
+ renameProductList: s("list-1", "Updated Wishlist"),
209
229
  addProductListItem: void 0,
210
230
  removeProductListItem: void 0,
211
231
  getRecommendedProducts: {
@@ -413,7 +433,7 @@ function S() {
413
433
  },
414
434
  title: "Mock Content",
415
435
  visibility: ["DISCOVERABLE"],
416
- status: h.READY
436
+ status: v.READY
417
437
  }
418
438
  ]
419
439
  },
@@ -421,7 +441,7 @@ function S() {
421
441
  data: {
422
442
  token: "user-token-123",
423
443
  expiresAt: "2025-01-01",
424
- userState: g.VERIFIED
444
+ userState: h.VERIFIED
425
445
  }
426
446
  },
427
447
  navigateToCart: void 0,
@@ -432,26 +452,26 @@ function S() {
432
452
  reportFetch: void 0
433
453
  }, r = {};
434
454
  for (const t in o)
435
- Object.prototype.hasOwnProperty.call(o, t) && (r[t] = P(
455
+ Object.prototype.hasOwnProperty.call(o, t) && (r[t] = f(
436
456
  t,
437
457
  o[t]
438
458
  ));
439
459
  return r;
440
460
  }
441
- const f = () => {
461
+ const w = () => {
442
462
  const o = navigator.userAgent.toLowerCase(), r = /iphone|ipad|ipod/.test(o), t = /android/.test(o);
443
463
  return r || t;
444
- }, y = ({ force: o } = {}) => {
445
- f() && !o || window.minisSDK || (window.minisSDK = S(), window.minisParams = {
464
+ }, A = ({ force: o } = {}) => {
465
+ w() && !o || window.minisSDK || (window.minisSDK = I(), window.minisParams = {
446
466
  handle: "mock-handle",
447
- initialUrl: "/mock-initial-url",
467
+ initialUrl: "/",
448
468
  platform: "web"
449
469
  });
450
470
  };
451
471
  export {
452
472
  e as createProduct,
453
473
  d as createShop,
454
- y as injectMocks,
455
- S as makeMockActions
474
+ A as injectMocks,
475
+ I as makeMockActions
456
476
  };
457
477
  //# sourceMappingURL=mocks.js.map
package/dist/mocks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mocks.js","sources":["../src/mocks.ts"],"sourcesContent":["import {\n Product,\n Gender,\n UserState,\n MinisContentStatus,\n} from '@shopify/shop-minis-platform'\nimport {ShopActions} from '@shopify/shop-minis-platform/actions'\n\n// Helper functions for common data structures\nexport const createProduct = (\n id: string,\n title: string,\n price = '99.99',\n compareAtPrice?: string\n): Product => ({\n id,\n title,\n price: {amount: price, currencyCode: 'USD'},\n ...(compareAtPrice && {\n compareAtPrice: {amount: compareAtPrice, currencyCode: 'USD'},\n }),\n reviewAnalytics: {averageRating: 4.5, reviewCount: 10},\n shop: createShop('shop1', 'Mock Shop'),\n defaultVariantId: `variant-${id}`,\n isFavorited: false,\n featuredImage: {\n url: `https://cdn.shopify.com/static/sample-images/teapot.jpg`,\n altText: title,\n },\n})\n\nexport const createShop = (\n id: string,\n name: string,\n options?: {\n themeType?: 'coverImage' | 'brandColor' | 'logoColor' | 'none'\n withBrandSettings?: boolean\n primaryColor?: string\n logoDominantColor?: string\n logoAverageColor?: string\n coverDominantColor?: string\n wordmarkUrl?: string\n coverImageUrl?: string\n featuredImagesLimit?: number\n }\n) => {\n // Determine theme configuration\n const themeType = options?.themeType || 'none'\n const shouldHaveBrandSettings =\n options?.withBrandSettings || themeType !== 'none'\n\n // Generate featured images\n const featuredImagesCount = options?.featuredImagesLimit || 3\n const featuredImages = Array.from({length: featuredImagesCount}, (_, i) => ({\n url: `https://picsum.photos/400/400?random=${id}-${i}`,\n sensitive: false,\n altText: `${name} featured image ${i + 1}`,\n }))\n\n // Configure colors based on theme type\n const getThemeColors = () => {\n switch (themeType) {\n case 'coverImage':\n return {\n primary: options?.primaryColor,\n logoDominant: options?.logoDominantColor,\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor || '#FF6B35',\n }\n case 'brandColor':\n return {\n primary: options?.primaryColor || '#27AE60',\n logoDominant: options?.logoDominantColor,\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor,\n }\n case 'logoColor':\n return {\n primary: options?.primaryColor,\n logoDominant: options?.logoDominantColor || '#E74C3C',\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor,\n }\n default:\n return {\n primary: options?.primaryColor,\n logoDominant: options?.logoDominantColor,\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor,\n }\n }\n }\n\n // Configure header theme\n const createHeaderTheme = () => {\n if (themeType === 'coverImage' || options?.coverImageUrl) {\n return {\n id: `header-theme-${id}`,\n coverImage: {\n url:\n options?.coverImageUrl ||\n 'https://images.unsplash.com/photo-1441986300917-64674bd600d8?w=800&h=400&fit=crop',\n altText: `${name} cover image`,\n sensitive: false,\n thumbhash: 'k9oGHQRnh493V4dIeHeXh4h3iIeI',\n },\n wordmark:\n options?.wordmarkUrl || themeType === 'coverImage'\n ? {\n url:\n options?.wordmarkUrl ||\n 'https://merrypeople.com/cdn/shop/files/Transparent_Background_1.png?v=1696465429&width=1024',\n altText: `${name} wordmark`,\n sensitive: false,\n }\n : undefined,\n }\n }\n\n if (options?.wordmarkUrl) {\n return {\n id: `header-theme-${id}`,\n wordmark: {\n url: options.wordmarkUrl,\n altText: `${name} wordmark`,\n sensitive: false,\n },\n }\n }\n\n return undefined\n }\n\n return {\n id,\n name,\n primaryDomain: {\n url: `https://${name.toLowerCase().replace(/\\s+/g, '-')}.com`,\n },\n reviewAnalytics: {averageRating: 4.3, reviewCount: 50},\n visualTheme: {\n id: `visual-theme-${id}`,\n featuredImages,\n logoImage: {\n url: `https://picsum.photos/100/100?random=${id}`,\n sensitive: false,\n },\n brandSettings: shouldHaveBrandSettings\n ? {\n id: `brand-settings-${id}`,\n colors: {\n id: `colors-${id}`,\n ...getThemeColors(),\n },\n headerTheme: createHeaderTheme(),\n }\n : undefined,\n },\n }\n}\n\nconst createPagination = (hasNext = false) => ({\n hasNextPage: hasNext,\n endCursor: hasNext ? 'cursor123' : null,\n})\n\nconst createProductList = (id: string, name: string, products: any[] = []) => ({\n id,\n publicId: `public-${id}`,\n name,\n products,\n})\n\n// Helper type to extract the data type from a ShopAction\ntype ShopActionDataType<T> = T extends (\n ...args: any[]\n) => Promise<{ok: true; data: infer R} | {ok: false; error: any}>\n ? R\n : never\n\n// Use window._mockLogs instead of console.log so logs aren't stripped in production builds\n// This allows e2e tests to verify mock actions are being called\nexport interface MockLog {\n action: string\n params?: unknown\n}\n\ndeclare global {\n interface Window {\n _mockLogs?: MockLog[]\n }\n}\n\nfunction logMockAction(action: string, params?: unknown) {\n window._mockLogs = window._mockLogs || []\n window._mockLogs.push({action, params})\n}\n\nfunction makeMockMethod<K extends keyof ShopActions>(\n key: K,\n result: ShopActionDataType<ShopActions[K]>\n): ShopActions[K] {\n return ((params: Parameters<ShopActions[K]>[0]) => {\n logMockAction(String(key), params)\n return Promise.resolve({ok: true as const, data: result})\n }) as ShopActions[K]\n}\n\nexport function makeMockActions(): ShopActions {\n const results: {\n [K in keyof ShopActions]: ShopActionDataType<ShopActions[K]>\n } = {\n translateContentUp: undefined,\n translateContentDown: undefined,\n followShop: true,\n unfollowShop: false,\n favorite: undefined,\n unfavorite: undefined,\n getShopAppInformation: {\n appVersion: '1.0.0',\n buildNumber: '12345',\n buildId: 'dev-build-123',\n },\n productRecommendationImpression: undefined,\n productRecommendationClick: undefined,\n closeMini: undefined,\n getAccountInformation: {\n status: 'available',\n value: 'user@example.com',\n },\n getCurrentUser: {\n data: {\n displayName: 'John Doe',\n avatarImage: {url: 'https://example.com/avatar.jpg'},\n },\n },\n createOrderAttribution: undefined,\n addToCart: undefined,\n buyProduct: undefined,\n buyProducts: undefined,\n showErrorScreen: undefined,\n showErrorToast: undefined,\n getDeeplinkPaths: {\n matchers: ['/products', '/collections', '/cart'],\n },\n navigateToDeeplink: undefined,\n navigateToShop: undefined,\n navigateToProduct: undefined,\n navigateToOrder: undefined,\n navigateToCheckout: undefined,\n createImageUploadLink: {\n targets: [\n {\n url: 'https://example.com/upload',\n resourceUrl: 'https://example.com/resource',\n parameters: [{name: 'key', value: 'upload-123'}],\n },\n ],\n },\n completeImageUpload: {\n files: [\n {\n id: 'file-123',\n fileStatus: 'READY',\n image: {url: 'https://example.com/image.jpg'},\n },\n ],\n },\n getPersistedItem: null,\n setPersistedItem: undefined,\n removePersistedItem: undefined,\n getAllPersistedKeys: ['key1', 'key2', 'key3'],\n clearPersistedItems: undefined,\n getInternalPersistedItem: null,\n setInternalPersistedItem: undefined,\n removeInternalPersistedItem: undefined,\n getAllInternalPersistedKeys: ['internal-key1', 'internal-key2'],\n clearInternalPersistedItems: undefined,\n getSecret: 'secret-value',\n setSecret: undefined,\n removeSecret: undefined,\n reportInteraction: undefined,\n reportImpression: undefined,\n reportContentImpression: undefined,\n getProductLists: {\n data: [\n createProductList('list-1', 'Wishlist'),\n createProductList('list-2', 'Favorites'),\n ],\n pageInfo: createPagination(),\n },\n getProductList: {\n data: createProductList('list-1', 'Wishlist', [\n createProduct('prod-1', 'Sample Product'),\n ]),\n pageInfo: createPagination(),\n },\n addProductList: createProductList('list-3', 'New List'),\n removeProductList: undefined,\n renameProductList: createProductList('list-1', 'Updated Wishlist'),\n addProductListItem: undefined,\n removeProductListItem: undefined,\n getRecommendedProducts: {\n data: [\n createProduct('rec-1', 'Recommended Product 1', '79.99'),\n createProduct('rec-2', 'Recommended Product 2', '129.99'),\n createProduct('rec-3', 'Recommended Product 3', '129.99'),\n createProduct('rec-4', 'Recommended Product 4', '29.99'),\n createProduct('rec-5', 'Recommended Product 5', '39.99'),\n createProduct('rec-6', 'Recommended Product 6', '49.99'),\n createProduct('rec-7', 'Recommended Product 7', '59.99'),\n createProduct('rec-8', 'Recommended Product 8', '69.99'),\n createProduct('rec-9', 'Recommended Product 9', '129.99'),\n ],\n pageInfo: createPagination(),\n },\n getRecommendedShops: {\n data: [\n createShop('shop-1', 'Amazing Store'),\n createShop('shop-2', 'Best Deals Shop'),\n createShop('shop-3', 'Great Products'),\n createShop('shop-4', 'Top Brands'),\n createShop('shop-5', 'Exclusive Offers'),\n ],\n pageInfo: createPagination(),\n },\n searchProductsByShop: {\n data: [\n createProduct('search-1', 'Search Result 1', '59.99'),\n createProduct('search-2', 'Search Result 2', '89.99'),\n createProduct('search-3', 'Search Result 3', '119.99'),\n createProduct('search-4', 'Search Result 4', '149.99'),\n createProduct('search-5', 'Search Result 5', '179.99'),\n ],\n pageInfo: createPagination(),\n },\n getOrders: {\n data: [\n {\n id: 'order-1',\n name: '#1001',\n lineItems: [\n {\n productTitle: 'Sample Product',\n variantTitle: 'Medium',\n quantity: 2,\n product: null,\n },\n ],\n shop: createShop('shop-1', 'Sample Shop'),\n },\n ],\n pageInfo: createPagination(),\n },\n getBuyerAttributes: {\n data: {\n genderAffinity: 'NEUTRAL' as Gender,\n categoryAffinities: [\n {id: 'cat1', name: 'Electronics'},\n {id: 'cat2', name: 'Clothing'},\n ],\n },\n },\n showFeedbackSheet: undefined,\n getPopularProducts: {\n data: [\n createProduct('pop-1', 'The Hero Snowboard', '702.95'),\n createProduct('pop-2', 'Snow Jacket', '605.95', '702.00'),\n createProduct('pop-3', 'Winter Gloves', '89.95'),\n createProduct('pop-4', 'Summer Gloves', '89.95'),\n createProduct('pop-5', 'Spring Gloves', '89.95'),\n createProduct('pop-6', 'Playstation 5', '499.95'),\n createProduct('pop-7', 'Xbox Series X', '499.95'),\n createProduct('pop-8', 'Nintendo Switch', '299.95'),\n createProduct('pop-9', 'Playstation 4', '299.95'),\n createProduct('pop-10', 'Nintendo 3DS', '89.95'),\n ],\n pageInfo: createPagination(),\n },\n share: {\n message: 'Shared!',\n success: true,\n },\n shareSingle: {\n message: 'Shared!',\n success: true,\n },\n getCuratedProducts: {\n data: [\n createProduct('cur-1', 'Curated Product 1', '79.99'),\n createProduct('cur-2', 'Curated Product 2', '129.99'),\n ],\n pageInfo: createPagination(),\n },\n getSavedProducts: {\n data: [\n createProduct('saved-1', 'Saved Product 1', '49.99'),\n createProduct('saved-2', 'Saved Product 2', '59.99'),\n createProduct('saved-3', 'Saved Product 3', '69.99'),\n createProduct('saved-4', 'Saved Product 4', '79.99'),\n createProduct('saved-5', 'Saved Product 5', '89.99'),\n ],\n pageInfo: createPagination(),\n },\n getRecentProducts: {\n data: [\n createProduct('recent-1', 'Recent Product 1', '59.99'),\n createProduct('recent-2', 'Recent Product 2', '69.99'),\n createProduct('recent-3', 'Recent Product 3', '79.99'),\n createProduct('recent-4', 'Recent Product 4', '89.99'),\n createProduct('recent-5', 'Recent Product 5', '99.99'),\n ],\n pageInfo: createPagination(),\n },\n getProductSearch: {\n data: [\n createProduct('search-1', 'Search Product 1', '39.99'),\n createProduct('search-2', 'Search Product 2', '19.99'),\n createProduct('search-3', 'Search Product 3', '29.99'),\n createProduct('search-4', 'Search Product 4', '49.99'),\n createProduct('search-5', 'Search Product 5', '9.99'),\n ],\n pageInfo: createPagination(),\n },\n getProducts: {\n data: [\n createProduct('prod-1', 'Product 1', '9.99'),\n createProduct('prod-2', 'Product 2', '19.99'),\n createProduct('prod-3', 'Product 3', '29.99'),\n createProduct('prod-4', 'Product 4', '39.99'),\n createProduct('prod-5', 'Product 5', '49.99'),\n ],\n },\n getProduct: {data: createProduct('prod-1', 'Sample Product')},\n getProductVariants: {\n data: [\n {\n id: 'variant-1',\n title: 'Variant 1',\n isFavorited: false,\n image: {url: 'https://example.com/variant-1.jpg'},\n price: {amount: '19.99', currencyCode: 'USD'},\n compareAtPrice: {amount: '29.99', currencyCode: 'USD'},\n },\n ],\n pageInfo: createPagination(),\n },\n getProductMedia: {\n data: [\n {\n id: 'media-1',\n image: {url: 'https://example.com/media-1.jpg'},\n mediaContentType: 'IMAGE',\n alt: 'Sample product image',\n },\n ],\n pageInfo: createPagination(),\n },\n getShop: {\n data: createShop('shop-1', 'Sample Shop', {featuredImagesLimit: 4}),\n },\n getRecentShops: {\n data: [\n createShop('recent-shop-1', 'Recent Shop 1'),\n createShop('recent-shop-2', 'Recent Shop 2'),\n createShop('recent-shop-3', 'Recent Shop 3'),\n ],\n pageInfo: createPagination(),\n },\n getFollowedShops: {\n data: [\n createShop('followed-shop-1', 'Followed Shop 1'),\n createShop('followed-shop-2', 'Followed Shop 2'),\n createShop('followed-shop-3', 'Followed Shop 3'),\n ],\n pageInfo: createPagination(),\n },\n previewProductInAr: undefined,\n createContent: {\n data: {\n publicId: 'content-123',\n externalId: null,\n image: {\n id: 'img-123',\n url: 'https://cdn.shopify.com/s/files/1/0633/6574/2742/files/Namnlosdesign-47.png?v=1740438079',\n width: 800,\n height: 600,\n },\n title: 'Mock Content',\n description: 'This is a mock content item',\n visibility: ['DISCOVERABLE'],\n shareableUrl: 'https://example.com/content/123',\n products: null,\n },\n },\n getContent: {\n data: [\n {\n publicId: 'content-123',\n image: {\n id: 'img-123',\n url: 'https://cdn.shopify.com/s/files/1/0633/6574/2742/files/Namnlosdesign-47.png?v=1740438079',\n width: 800,\n height: 600,\n },\n title: 'Mock Content',\n visibility: ['DISCOVERABLE'],\n status: MinisContentStatus.READY,\n },\n ],\n },\n generateUserToken: {\n data: {\n token: 'user-token-123',\n expiresAt: '2025-01-01',\n userState: UserState.VERIFIED,\n },\n },\n navigateToCart: undefined,\n requestPermission: {\n granted: true,\n },\n reportError: undefined,\n reportFetch: undefined,\n } as const\n\n const mock: Partial<ShopActions> = {}\n for (const key in results) {\n if (Object.prototype.hasOwnProperty.call(results, key)) {\n // @ts-expect-error: dynamic assignment is safe due to exhaustive mapping\n mock[key] = makeMockMethod(\n key as keyof ShopActions,\n results[key as keyof typeof results]\n )\n }\n }\n return mock as ShopActions\n}\n\n// Detect if running on a mobile device\nconst isMobile = (): boolean => {\n const userAgent = navigator.userAgent.toLowerCase()\n const isIOS = /iphone|ipad|ipod/.test(userAgent)\n const isAndroid = /android/.test(userAgent)\n\n return isIOS || isAndroid\n}\n\nexport const injectMocks = ({force}: {force?: boolean} = {}) => {\n // Only inject mocks if we aren't on a mobile device or we force it\n if (isMobile() && !force) {\n return\n }\n\n if (!window.minisSDK) {\n window.minisSDK = makeMockActions()\n window.minisParams = {\n handle: 'mock-handle',\n initialUrl: '/mock-initial-url',\n platform: 'web',\n }\n }\n}\n"],"names":["createProduct","id","title","price","compareAtPrice","createShop","name","options","themeType","shouldHaveBrandSettings","featuredImagesCount","featuredImages","_","i","getThemeColors","createHeaderTheme","createPagination","hasNext","createProductList","products","logMockAction","action","params","makeMockMethod","key","result","makeMockActions","results","MinisContentStatus","UserState","mock","isMobile","userAgent","isIOS","isAndroid","injectMocks","force"],"mappings":";;AASO,MAAMA,IAAgB,CAC3BC,GACAC,GACAC,IAAQ,SACRC,OACa;AAAA,EACb,IAAAH;AAAA,EACA,OAAAC;AAAA,EACA,OAAO,EAAC,QAAQC,GAAO,cAAc,MAAK;AAAA,EAC1C,GAAIC,KAAkB;AAAA,IACpB,gBAAgB,EAAC,QAAQA,GAAgB,cAAc,MAAK;AAAA,EAC9D;AAAA,EACA,iBAAiB,EAAC,eAAe,KAAK,aAAa,GAAE;AAAA,EACrD,MAAMC,EAAW,SAAS,WAAW;AAAA,EACrC,kBAAkB,WAAWJ,CAAE;AAAA,EAC/B,aAAa;AAAA,EACb,eAAe;AAAA,IACb,KAAK;AAAA,IACL,SAASC;AAAA,EAAA;AAEb,IAEaG,IAAa,CACxBJ,GACAK,GACAC,MAWG;AAEG,QAAAC,IAAYD,GAAS,aAAa,QAClCE,IACJF,GAAS,qBAAqBC,MAAc,QAGxCE,IAAsBH,GAAS,uBAAuB,GACtDI,IAAiB,MAAM,KAAK,EAAC,QAAQD,EAAmB,GAAG,CAACE,GAAGC,OAAO;AAAA,IAC1E,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,YAAY,GAC5CC,IAAQ,mBAAmB,KAAKD,CAAS,GACzCE,IAAY,UAAU,KAAKF,CAAS;AAE1C,SAAOC,KAASC;AAClB,GAEaC,IAAc,CAAC,EAAC,OAAAC,EAAK,IAAuB,OAAO;AAE1D,EAAAL,EAAA,KAAc,CAACK,KAId,OAAO,aACV,OAAO,WAAWV,EAAgB,GAClC,OAAO,cAAc;AAAA,IACnB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAEJ;"}
1
+ {"version":3,"file":"mocks.js","sources":["../src/mocks.ts"],"sourcesContent":["import {\n Product,\n Gender,\n UserState,\n MinisContentStatus,\n} from '@shopify/shop-minis-platform'\nimport {ShopActions} from '@shopify/shop-minis-platform/actions'\n\nconst SAMPLE_IMAGE_NAMES = [\n 'garnished.jpeg',\n 'bath.jpeg',\n 'teapot.jpg',\n 'shoes.jpeg',\n]\n\n// Simple hash function to get a deterministic index from a string\nconst hashString = (str: string): number => {\n let hash = 0\n for (let i = 0; i < str.length; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i)\n hash |= 0\n }\n return Math.abs(hash)\n}\n\n// Helper functions for common data structures\nexport const createProduct = (\n id: string,\n title: string,\n price = '99.99',\n compareAtPrice?: string\n): Product => {\n const imageIndex = hashString(id) % SAMPLE_IMAGE_NAMES.length\n const imageName = SAMPLE_IMAGE_NAMES[imageIndex]\n\n return {\n id,\n title,\n price: {amount: price, currencyCode: 'USD'},\n ...(compareAtPrice && {\n compareAtPrice: {amount: compareAtPrice, currencyCode: 'USD'},\n }),\n reviewAnalytics: {averageRating: 4.5, reviewCount: 10},\n shop: createShop('shop1', 'Mock Shop'),\n defaultVariantId: `variant-${id}`,\n isFavorited: false,\n featuredImage: {\n url: `https://cdn.shopify.com/static/sample-images/${imageName}`,\n altText: title,\n },\n }\n}\n\nexport const createShop = (\n id: string,\n name: string,\n options?: {\n themeType?: 'coverImage' | 'brandColor' | 'logoColor' | 'none'\n withBrandSettings?: boolean\n primaryColor?: string\n logoDominantColor?: string\n logoAverageColor?: string\n coverDominantColor?: string\n wordmarkUrl?: string\n coverImageUrl?: string\n featuredImagesLimit?: number\n }\n) => {\n // Determine theme configuration\n const themeType = options?.themeType || 'none'\n const shouldHaveBrandSettings =\n options?.withBrandSettings || themeType !== 'none'\n\n // Generate featured images\n const featuredImagesCount = options?.featuredImagesLimit || 3\n const featuredImages = Array.from({length: featuredImagesCount}, (_, i) => ({\n url: `https://picsum.photos/400/400?random=${id}-${i}`,\n sensitive: false,\n altText: `${name} featured image ${i + 1}`,\n }))\n\n // Configure colors based on theme type\n const getThemeColors = () => {\n switch (themeType) {\n case 'coverImage':\n return {\n primary: options?.primaryColor,\n logoDominant: options?.logoDominantColor,\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor || '#FF6B35',\n }\n case 'brandColor':\n return {\n primary: options?.primaryColor || '#27AE60',\n logoDominant: options?.logoDominantColor,\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor,\n }\n case 'logoColor':\n return {\n primary: options?.primaryColor,\n logoDominant: options?.logoDominantColor || '#E74C3C',\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor,\n }\n default:\n return {\n primary: options?.primaryColor,\n logoDominant: options?.logoDominantColor,\n logoAverage: options?.logoAverageColor,\n coverDominant: options?.coverDominantColor,\n }\n }\n }\n\n // Configure header theme\n const createHeaderTheme = () => {\n if (themeType === 'coverImage' || options?.coverImageUrl) {\n return {\n id: `header-theme-${id}`,\n coverImage: {\n url:\n options?.coverImageUrl ||\n 'https://images.unsplash.com/photo-1441986300917-64674bd600d8?w=800&h=400&fit=crop',\n altText: `${name} cover image`,\n sensitive: false,\n thumbhash: 'k9oGHQRnh493V4dIeHeXh4h3iIeI',\n },\n wordmark:\n options?.wordmarkUrl || themeType === 'coverImage'\n ? {\n url:\n options?.wordmarkUrl ||\n 'https://merrypeople.com/cdn/shop/files/Transparent_Background_1.png?v=1696465429&width=1024',\n altText: `${name} wordmark`,\n sensitive: false,\n }\n : undefined,\n }\n }\n\n if (options?.wordmarkUrl) {\n return {\n id: `header-theme-${id}`,\n wordmark: {\n url: options.wordmarkUrl,\n altText: `${name} wordmark`,\n sensitive: false,\n },\n }\n }\n\n return undefined\n }\n\n return {\n id,\n name,\n primaryDomain: {\n url: `https://${name.toLowerCase().replace(/\\s+/g, '-')}.com`,\n },\n reviewAnalytics: {averageRating: 4.3, reviewCount: 50},\n visualTheme: {\n id: `visual-theme-${id}`,\n featuredImages,\n logoImage: {\n url: `https://picsum.photos/100/100?random=${id}`,\n sensitive: false,\n },\n brandSettings: shouldHaveBrandSettings\n ? {\n id: `brand-settings-${id}`,\n colors: {\n id: `colors-${id}`,\n ...getThemeColors(),\n },\n headerTheme: createHeaderTheme(),\n }\n : undefined,\n },\n }\n}\n\nconst createPagination = (hasNext = false) => ({\n hasNextPage: hasNext,\n endCursor: hasNext ? 'cursor123' : null,\n})\n\nconst createProductList = (id: string, name: string, products: any[] = []) => ({\n id,\n publicId: `public-${id}`,\n name,\n products,\n})\n\n// Helper type to extract the data type from a ShopAction\ntype ShopActionDataType<T> = T extends (\n ...args: any[]\n) => Promise<{ok: true; data: infer R} | {ok: false; error: any}>\n ? R\n : never\n\n// Use window._mockLogs instead of console.log so logs aren't stripped in production builds\n// This allows e2e tests to verify mock actions are being called\nexport interface MockLog {\n action: string\n params?: unknown\n}\n\ndeclare global {\n interface Window {\n _mockLogs?: MockLog[]\n }\n}\n\nfunction logMockAction(action: string, params?: unknown) {\n window._mockLogs = window._mockLogs || []\n window._mockLogs.push({action, params})\n}\n\nfunction makeMockMethod<K extends keyof ShopActions>(\n key: K,\n result: ShopActionDataType<ShopActions[K]>\n): ShopActions[K] {\n return ((params: Parameters<ShopActions[K]>[0]) => {\n logMockAction(String(key), params)\n return Promise.resolve({\n ok: true as const,\n data: result,\n mocked: true,\n })\n }) as ShopActions[K]\n}\n\nexport function makeMockActions(): ShopActions {\n const results: {\n [K in keyof ShopActions]: ShopActionDataType<ShopActions[K]>\n } = {\n translateContentUp: undefined,\n translateContentDown: undefined,\n followShop: true,\n unfollowShop: false,\n favorite: undefined,\n unfavorite: undefined,\n getShopAppInformation: {\n appVersion: '1.0.0',\n buildNumber: '12345',\n buildId: 'dev-build-123',\n },\n productRecommendationImpression: undefined,\n productRecommendationClick: undefined,\n closeMini: undefined,\n getAccountInformation: {\n status: 'available',\n value: 'user@example.com',\n },\n getCurrentUser: {\n data: {\n displayName: 'John Doe',\n avatarImage: {url: 'https://example.com/avatar.jpg'},\n },\n },\n createOrderAttribution: undefined,\n addToCart: undefined,\n buyProduct: undefined,\n buyProducts: undefined,\n showErrorScreen: undefined,\n showErrorToast: undefined,\n getDeeplinkPaths: {\n matchers: ['/products', '/collections', '/cart'],\n },\n navigateToDeeplink: undefined,\n navigateToShop: undefined,\n navigateToProduct: undefined,\n navigateToOrder: undefined,\n navigateToCheckout: undefined,\n createImageUploadLink: {\n // This action is mocked in the actual hook. See `useImageUpload` for more details.\n targets: [\n {\n url: 'https://example.com/upload',\n resourceUrl: 'https://example.com/resource',\n parameters: [{name: 'key', value: 'upload-123'}],\n },\n ],\n },\n completeImageUpload: {\n files: [\n {\n id: 'file-123',\n fileStatus: 'READY',\n image: {\n url: 'https://example.com/image.jpg',\n },\n },\n ],\n },\n getPersistedItem: null,\n setPersistedItem: undefined,\n removePersistedItem: undefined,\n getAllPersistedKeys: ['key1', 'key2', 'key3'],\n clearPersistedItems: undefined,\n getInternalPersistedItem: null,\n setInternalPersistedItem: undefined,\n removeInternalPersistedItem: undefined,\n getAllInternalPersistedKeys: ['internal-key1', 'internal-key2'],\n clearInternalPersistedItems: undefined,\n getSecret: 'secret-value',\n setSecret: undefined,\n removeSecret: undefined,\n reportInteraction: undefined,\n reportImpression: undefined,\n reportContentImpression: undefined,\n getProductLists: {\n data: [\n createProductList('list-1', 'Wishlist'),\n createProductList('list-2', 'Favorites'),\n ],\n pageInfo: createPagination(),\n },\n getProductList: {\n data: createProductList('list-1', 'Wishlist', [\n createProduct('prod-1', 'Sample Product'),\n ]),\n pageInfo: createPagination(),\n },\n addProductList: createProductList('list-3', 'New List'),\n removeProductList: undefined,\n renameProductList: createProductList('list-1', 'Updated Wishlist'),\n addProductListItem: undefined,\n removeProductListItem: undefined,\n getRecommendedProducts: {\n data: [\n createProduct('rec-1', 'Recommended Product 1', '79.99'),\n createProduct('rec-2', 'Recommended Product 2', '129.99'),\n createProduct('rec-3', 'Recommended Product 3', '129.99'),\n createProduct('rec-4', 'Recommended Product 4', '29.99'),\n createProduct('rec-5', 'Recommended Product 5', '39.99'),\n createProduct('rec-6', 'Recommended Product 6', '49.99'),\n createProduct('rec-7', 'Recommended Product 7', '59.99'),\n createProduct('rec-8', 'Recommended Product 8', '69.99'),\n createProduct('rec-9', 'Recommended Product 9', '129.99'),\n ],\n pageInfo: createPagination(),\n },\n getRecommendedShops: {\n data: [\n createShop('shop-1', 'Amazing Store'),\n createShop('shop-2', 'Best Deals Shop'),\n createShop('shop-3', 'Great Products'),\n createShop('shop-4', 'Top Brands'),\n createShop('shop-5', 'Exclusive Offers'),\n ],\n pageInfo: createPagination(),\n },\n searchProductsByShop: {\n data: [\n createProduct('search-1', 'Search Result 1', '59.99'),\n createProduct('search-2', 'Search Result 2', '89.99'),\n createProduct('search-3', 'Search Result 3', '119.99'),\n createProduct('search-4', 'Search Result 4', '149.99'),\n createProduct('search-5', 'Search Result 5', '179.99'),\n ],\n pageInfo: createPagination(),\n },\n getOrders: {\n data: [\n {\n id: 'order-1',\n name: '#1001',\n lineItems: [\n {\n productTitle: 'Sample Product',\n variantTitle: 'Medium',\n quantity: 2,\n product: null,\n },\n ],\n shop: createShop('shop-1', 'Sample Shop'),\n },\n ],\n pageInfo: createPagination(),\n },\n getBuyerAttributes: {\n data: {\n genderAffinity: 'NEUTRAL' as Gender,\n categoryAffinities: [\n {id: 'cat1', name: 'Electronics'},\n {id: 'cat2', name: 'Clothing'},\n ],\n },\n },\n showFeedbackSheet: undefined,\n getPopularProducts: {\n data: [\n createProduct('pop-1', 'The Hero Snowboard', '702.95'),\n createProduct('pop-2', 'Snow Jacket', '605.95', '702.00'),\n createProduct('pop-3', 'Winter Gloves', '89.95'),\n createProduct('pop-4', 'Summer Gloves', '89.95'),\n createProduct('pop-5', 'Spring Gloves', '89.95'),\n createProduct('pop-6', 'Playstation 5', '499.95'),\n createProduct('pop-7', 'Xbox Series X', '499.95'),\n createProduct('pop-8', 'Nintendo Switch', '299.95'),\n createProduct('pop-9', 'Playstation 4', '299.95'),\n createProduct('pop-10', 'Nintendo 3DS', '89.95'),\n ],\n pageInfo: createPagination(),\n },\n share: {\n message: 'Shared!',\n success: true,\n },\n shareSingle: {\n message: 'Shared!',\n success: true,\n },\n getCuratedProducts: {\n data: [\n createProduct('cur-1', 'Curated Product 1', '79.99'),\n createProduct('cur-2', 'Curated Product 2', '129.99'),\n ],\n pageInfo: createPagination(),\n },\n getSavedProducts: {\n data: [\n createProduct('saved-1', 'Saved Product 1', '49.99'),\n createProduct('saved-2', 'Saved Product 2', '59.99'),\n createProduct('saved-3', 'Saved Product 3', '69.99'),\n createProduct('saved-4', 'Saved Product 4', '79.99'),\n createProduct('saved-5', 'Saved Product 5', '89.99'),\n ],\n pageInfo: createPagination(),\n },\n getRecentProducts: {\n data: [\n createProduct('recent-1', 'Recent Product 1', '59.99'),\n createProduct('recent-2', 'Recent Product 2', '69.99'),\n createProduct('recent-3', 'Recent Product 3', '79.99'),\n createProduct('recent-4', 'Recent Product 4', '89.99'),\n createProduct('recent-5', 'Recent Product 5', '99.99'),\n ],\n pageInfo: createPagination(),\n },\n getProductSearch: {\n data: [\n createProduct('search-1', 'Search Product 1', '39.99'),\n createProduct('search-2', 'Search Product 2', '19.99'),\n createProduct('search-3', 'Search Product 3', '29.99'),\n createProduct('search-4', 'Search Product 4', '49.99'),\n createProduct('search-5', 'Search Product 5', '9.99'),\n ],\n pageInfo: createPagination(),\n },\n getProducts: {\n data: [\n createProduct('prod-1', 'Product 1', '9.99'),\n createProduct('prod-2', 'Product 2', '19.99'),\n createProduct('prod-3', 'Product 3', '29.99'),\n createProduct('prod-4', 'Product 4', '39.99'),\n createProduct('prod-5', 'Product 5', '49.99'),\n ],\n },\n getProduct: {data: createProduct('prod-1', 'Sample Product')},\n getProductVariants: {\n data: [\n {\n id: 'variant-1',\n title: 'Variant 1',\n isFavorited: false,\n image: {url: 'https://example.com/variant-1.jpg'},\n price: {amount: '19.99', currencyCode: 'USD'},\n compareAtPrice: {amount: '29.99', currencyCode: 'USD'},\n },\n ],\n pageInfo: createPagination(),\n },\n getProductMedia: {\n data: [\n {\n id: 'media-1',\n image: {url: 'https://example.com/media-1.jpg'},\n mediaContentType: 'IMAGE',\n alt: 'Sample product image',\n },\n ],\n pageInfo: createPagination(),\n },\n getShop: {\n data: createShop('shop-1', 'Sample Shop', {featuredImagesLimit: 4}),\n },\n getRecentShops: {\n data: [\n createShop('recent-shop-1', 'Recent Shop 1'),\n createShop('recent-shop-2', 'Recent Shop 2'),\n createShop('recent-shop-3', 'Recent Shop 3'),\n ],\n pageInfo: createPagination(),\n },\n getFollowedShops: {\n data: [\n createShop('followed-shop-1', 'Followed Shop 1'),\n createShop('followed-shop-2', 'Followed Shop 2'),\n createShop('followed-shop-3', 'Followed Shop 3'),\n ],\n pageInfo: createPagination(),\n },\n previewProductInAr: undefined,\n createContent: {\n data: {\n publicId: 'content-123',\n externalId: null,\n image: {\n id: 'img-123',\n url: 'https://cdn.shopify.com/s/files/1/0633/6574/2742/files/Namnlosdesign-47.png?v=1740438079',\n width: 800,\n height: 600,\n },\n title: 'Mock Content',\n description: 'This is a mock content item',\n visibility: ['DISCOVERABLE'],\n shareableUrl: 'https://example.com/content/123',\n products: null,\n },\n },\n getContent: {\n data: [\n {\n publicId: 'content-123',\n image: {\n id: 'img-123',\n url: 'https://cdn.shopify.com/s/files/1/0633/6574/2742/files/Namnlosdesign-47.png?v=1740438079',\n width: 800,\n height: 600,\n },\n title: 'Mock Content',\n visibility: ['DISCOVERABLE'],\n status: MinisContentStatus.READY,\n },\n ],\n },\n generateUserToken: {\n data: {\n token: 'user-token-123',\n expiresAt: '2025-01-01',\n userState: UserState.VERIFIED,\n },\n },\n navigateToCart: undefined,\n requestPermission: {\n granted: true,\n },\n reportError: undefined,\n reportFetch: undefined,\n } as const\n\n const mock: Partial<ShopActions> = {}\n for (const key in results) {\n if (Object.prototype.hasOwnProperty.call(results, key)) {\n // @ts-expect-error: dynamic assignment is safe due to exhaustive mapping\n mock[key] = makeMockMethod(\n key as keyof ShopActions,\n results[key as keyof typeof results]\n )\n }\n }\n return mock as ShopActions\n}\n\n// Detect if running on a mobile device\nconst isMobile = (): boolean => {\n const userAgent = navigator.userAgent.toLowerCase()\n const isIOS = /iphone|ipad|ipod/.test(userAgent)\n const isAndroid = /android/.test(userAgent)\n\n return isIOS || isAndroid\n}\n\nexport const injectMocks = ({force}: {force?: boolean} = {}) => {\n // Only inject mocks if we aren't on a mobile device or we force it\n if (isMobile() && !force) {\n return\n }\n\n if (!window.minisSDK) {\n window.minisSDK = makeMockActions()\n window.minisParams = {\n handle: 'mock-handle',\n initialUrl: '/',\n platform: 'web',\n }\n }\n}\n"],"names":["SAMPLE_IMAGE_NAMES","hashString","str","hash","i","createProduct","id","title","price","compareAtPrice","imageIndex","imageName","createShop","name","options","themeType","shouldHaveBrandSettings","featuredImagesCount","featuredImages","_","getThemeColors","createHeaderTheme","createPagination","hasNext","createProductList","products","logMockAction","action","params","makeMockMethod","key","result","makeMockActions","results","MinisContentStatus","UserState","mock","isMobile","userAgent","isIOS","isAndroid","injectMocks","force"],"mappings":";;AAQA,MAAMA,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAGMC,IAAa,CAACC,MAAwB;AAC1C,MAAIC,IAAO;AACX,WAASC,IAAI,GAAGA,IAAIF,EAAI,QAAQE;AAC9B,IAAAD,KAAQA,KAAQ,KAAKA,IAAOD,EAAI,WAAWE,CAAC,GACpCD,KAA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../../../../_virtual/index4.js";
1
+ import { __module as q } from "../../../../../../../../_virtual/index5.js";
2
2
  import { __require as F } from "../../../../../global@4.4.0/node_modules/global/window.js";
3
3
  import { __require as N } from "../../../../../@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js";
4
4
  import { __require as J } from "../../../../../is-function@1.0.2/node_modules/is-function/index.js";
@@ -2,7 +2,7 @@ import L from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-ut
2
2
  import T from "../../../../../../../_virtual/window.js";
3
3
  import { forEachMediaGroup as Z } from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-groups.js";
4
4
  import J from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js";
5
- import { l as Q } from "../../../../../../../_virtual/index5.js";
5
+ import { l as Q } from "../../../../../../../_virtual/index6.js";
6
6
  /*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */
7
7
  const w = (e) => !!e && typeof e == "object", E = (...e) => e.reduce((n, t) => (typeof t != "object" || Object.keys(t).forEach((r) => {
8
8
  Array.isArray(n[r]) && Array.isArray(t[r]) ? n[r] = n[r].concat(t[r]) : w(n[r]) && w(t[r]) ? n[r] = E(n[r], t[r]) : n[r] = t[r];