@shopify/shop-minis-react 0.0.0-snapshot.20251216112959 → 0.0.0-snapshot.20251216185714
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/alert-dialog.js.map +1 -1
- package/dist/components/atoms/button.js.map +1 -1
- package/dist/components/atoms/icon-button.js.map +1 -1
- package/dist/components/atoms/image.js +65 -51
- package/dist/components/atoms/image.js.map +1 -1
- package/dist/components/atoms/list.js.map +1 -1
- package/dist/components/atoms/product-variant-price.js +1 -1
- package/dist/components/atoms/product-variant-price.js.map +1 -1
- package/dist/components/atoms/text-input.js.map +1 -1
- package/dist/components/atoms/touchable.js.map +1 -1
- package/dist/components/atoms/video-player.js +1 -1
- package/dist/components/atoms/video-player.js.map +1 -1
- package/dist/components/commerce/add-to-cart.js.map +1 -1
- package/dist/components/commerce/buy-now.js.map +1 -1
- package/dist/components/commerce/favorite-button.js +1 -4
- package/dist/components/commerce/favorite-button.js.map +1 -1
- package/dist/components/commerce/merchant-card.js.map +1 -1
- package/dist/components/commerce/product-card.js +1 -1
- package/dist/components/commerce/product-card.js.map +1 -1
- package/dist/components/commerce/product-link.js +1 -1
- package/dist/components/commerce/product-link.js.map +1 -1
- package/dist/components/commerce/quantity-selector.js.map +1 -1
- package/dist/components/content/image-content-wrapper.js.map +1 -1
- package/dist/components/navigation/minis-router.js.map +1 -1
- package/dist/components/navigation/transition-link.js.map +1 -1
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/hooks/storage/useImageUpload.js +32 -24
- package/dist/hooks/storage/useImageUpload.js.map +1 -1
- package/dist/index.js +92 -88
- package/dist/index.js.map +1 -1
- package/dist/mocks.js +70 -50
- package/dist/mocks.js.map +1 -1
- package/dist/utils/formatMoney.js.map +1 -0
- package/dist/utils/image.js +44 -24
- package/dist/utils/image.js.map +1 -1
- package/eslint/rules/validate-manifest.cjs +91 -41
- package/package.json +2 -2
- package/src/components/atoms/alert-dialog.tsx +3 -3
- package/src/components/atoms/button.tsx +22 -0
- package/src/components/atoms/icon-button.tsx +16 -8
- package/src/components/atoms/image.tsx +41 -8
- package/src/components/atoms/list.tsx +25 -2
- package/src/components/atoms/product-variant-price.test.tsx +1 -1
- package/src/components/atoms/product-variant-price.tsx +1 -1
- package/src/components/atoms/text-input.tsx +3 -1
- package/src/components/atoms/touchable.tsx +15 -4
- package/src/components/atoms/video-player.tsx +16 -6
- package/src/components/commerce/add-to-cart.tsx +7 -11
- package/src/components/commerce/buy-now.tsx +7 -10
- package/src/components/commerce/favorite-button.tsx +6 -5
- package/src/components/commerce/merchant-card.tsx +4 -0
- package/src/components/commerce/product-card.test.tsx +1 -1
- package/src/components/commerce/product-card.tsx +1 -1
- package/src/components/commerce/product-link.test.tsx +1 -1
- package/src/components/commerce/product-link.tsx +16 -1
- package/src/components/commerce/quantity-selector.tsx +6 -1
- package/src/components/content/image-content-wrapper.tsx +16 -1
- package/src/components/navigation/minis-router.tsx +2 -2
- package/src/components/navigation/transition-link.tsx +11 -1
- package/src/components/ui/alert.tsx +7 -0
- package/src/components/ui/badge.tsx +9 -0
- package/src/components/ui/input.tsx +15 -0
- package/src/hooks/storage/useImageUpload.ts +13 -0
- package/src/mocks.ts +48 -19
- package/src/utils/image.ts +38 -0
- package/src/utils/index.ts +1 -0
- package/dist/lib/formatMoney.js.map +0 -1
- /package/dist/{lib → utils}/formatMoney.js +0 -0
- /package/src/{lib → utils}/formatMoney.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import { DATA_NAVIGATION_TYPE_ATTRIBUTE as o, NAVIGATION_TYPES as t } from "./ty
|
|
|
2
2
|
import { MinisContainer as i } from "./components/MinisContainer.js";
|
|
3
3
|
import { AddToCartButton as n } from "./components/commerce/add-to-cart.js";
|
|
4
4
|
import { BuyNowButton as s } from "./components/commerce/buy-now.js";
|
|
5
|
-
import { ProductCard as u, ProductCardBadge as f, ProductCardContainer as x, ProductCardFavoriteButton as
|
|
5
|
+
import { ProductCard as u, ProductCardBadge as f, ProductCardContainer as x, ProductCardFavoriteButton as d, ProductCardImage as c, 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
|
|
8
|
-
import { ProductCardSkeleton as
|
|
7
|
+
import { MerchantCard as I, MerchantCardContainer as R, MerchantCardHeader as E, MerchantCardInfo as M, MerchantCardName as w, MerchantCardRating as B } from "./components/commerce/merchant-card.js";
|
|
8
|
+
import { ProductCardSkeleton as v } from "./components/commerce/product-card-skeleton.js";
|
|
9
9
|
import { MerchantCardSkeleton as L } from "./components/commerce/merchant-card-skeleton.js";
|
|
10
|
-
import { QuantitySelector as
|
|
11
|
-
import { Search as _, SearchInput as
|
|
10
|
+
import { QuantitySelector as N } from "./components/commerce/quantity-selector.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";
|
|
@@ -22,23 +22,23 @@ import { AlertDialogAtom as pr } from "./components/atoms/alert-dialog.js";
|
|
|
22
22
|
import { List as mr } from "./components/atoms/list.js";
|
|
23
23
|
import { VideoPlayer as lr } from "./components/atoms/video-player.js";
|
|
24
24
|
import { TextInput as fr } from "./components/atoms/text-input.js";
|
|
25
|
-
import { ContentWrapper as
|
|
25
|
+
import { ContentWrapper as dr } 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
|
-
import { Alert as hr, AlertDescription as Ir, AlertTitle as
|
|
29
|
-
import { AlertDialog as
|
|
30
|
-
import { Avatar as
|
|
28
|
+
import { Alert as hr, AlertDescription as Ir, AlertTitle as Rr } from "./components/ui/alert.js";
|
|
29
|
+
import { AlertDialog as Mr, AlertDialogAction as wr, AlertDialogCancel as Br, AlertDialogContent as Fr, AlertDialogDescription as vr, AlertDialogFooter as Ur, AlertDialogHeader as Lr, AlertDialogOverlay as br, AlertDialogPortal as Nr, 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
|
-
import { Dialog as me, DialogClose as se, DialogContent as le, DialogDescription as ue, DialogFooter as fe, DialogHeader as xe, DialogOverlay as
|
|
36
|
-
import { Drawer as Ae, DrawerClose as De, DrawerContent as Pe, DrawerDescription as Te, DrawerFooter as he, DrawerHeader as Ie, DrawerOverlay as
|
|
37
|
-
import { Input as
|
|
35
|
+
import { Dialog as me, DialogClose as se, DialogContent as le, DialogDescription as ue, DialogFooter as fe, DialogHeader as xe, DialogOverlay as de, DialogPortal as ce, 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 Re, DrawerPortal as Ee, DrawerTitle as Me, DrawerTrigger as we } from "./components/ui/drawer.js";
|
|
37
|
+
import { Input as Fe } from "./components/ui/input.js";
|
|
38
38
|
import { Label as Ue } from "./components/ui/label.js";
|
|
39
|
-
import { Progress as
|
|
39
|
+
import { Progress as be } from "./components/ui/progress.js";
|
|
40
40
|
import { RadioGroup as ke, RadioGroupItem as _e } from "./components/ui/radio-group.js";
|
|
41
|
-
import { ResizableHandle as
|
|
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";
|
|
@@ -48,14 +48,14 @@ import { toast as go } from "./shop-minis-react/node_modules/.pnpm/sonner@2.0.5_
|
|
|
48
48
|
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
|
-
import { useSavedProducts as
|
|
52
|
-
import { useSavedProductsActions as
|
|
53
|
-
import { useFollowedShops as
|
|
54
|
-
import { useFollowedShopsActions as
|
|
51
|
+
import { useSavedProducts as Ro } from "./hooks/user/useSavedProducts.js";
|
|
52
|
+
import { useSavedProductsActions as Mo } from "./hooks/user/useSavedProductsActions.js";
|
|
53
|
+
import { useFollowedShops as Bo } from "./hooks/user/useFollowedShops.js";
|
|
54
|
+
import { useFollowedShopsActions as vo } from "./hooks/user/useFollowedShopsActions.js";
|
|
55
55
|
import { useCurrentUser as Lo } from "./hooks/user/useCurrentUser.js";
|
|
56
|
-
import { useOrders as
|
|
56
|
+
import { useOrders as No } from "./hooks/user/useOrders.js";
|
|
57
57
|
import { useBuyerAttributes as _o } from "./hooks/user/useBuyerAttributes.js";
|
|
58
|
-
import { useGenerateUserToken as
|
|
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";
|
|
@@ -70,19 +70,19 @@ import { useCuratedProducts as nt } from "./hooks/product/useCuratedProducts.js"
|
|
|
70
70
|
import { useAsyncStorage as st } from "./hooks/storage/useAsyncStorage.js";
|
|
71
71
|
import { useSecureStorage as ut } from "./hooks/storage/useSecureStorage.js";
|
|
72
72
|
import { useImageUpload as xt } from "./hooks/storage/useImageUpload.js";
|
|
73
|
-
import { useShopNavigation as
|
|
73
|
+
import { useShopNavigation as ct } from "./hooks/navigation/useShopNavigation.js";
|
|
74
74
|
import { useCloseMini as gt } from "./hooks/navigation/useCloseMini.js";
|
|
75
75
|
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
|
-
import { useRecommendedShops as
|
|
79
|
-
import { useCreateImageContent as
|
|
80
|
-
import { useErrorToast as
|
|
81
|
-
import { useErrorScreen as
|
|
78
|
+
import { useRecommendedShops as Rt } from "./hooks/shop/useRecommendedShops.js";
|
|
79
|
+
import { useCreateImageContent as Mt } from "./hooks/content/useCreateImageContent.js";
|
|
80
|
+
import { useErrorToast as Bt } from "./hooks/util/useErrorToast.js";
|
|
81
|
+
import { useErrorScreen as vt } from "./hooks/util/useErrorScreen.js";
|
|
82
82
|
import { useShare as Lt } from "./hooks/util/useShare.js";
|
|
83
|
-
import { useImagePicker as
|
|
83
|
+
import { useImagePicker as Nt } from "./hooks/util/useImagePicker.js";
|
|
84
84
|
import { useKeyboardAvoidingView as _t } from "./hooks/util/useKeyboardAvoidingView.js";
|
|
85
|
-
import { useRequestPermissions as
|
|
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";
|
|
@@ -90,11 +90,12 @@ import { useOnAppStateChange as Kt } from "./hooks/events/useOnAppStateChange.js
|
|
|
90
90
|
import { MiniEntityNotFoundError as Zt, MiniError as jt, MiniNetworkError as Jt, formatError as Xt } from "./utils/errors.js";
|
|
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
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
93
|
+
import { dataURLToBlob as na, fileToDataUri as ma, getResizedImageUrl as sa, getThumbhashBlobURL as la, getThumbhashDataURL as ua } from "./utils/image.js";
|
|
94
|
+
import { formatMoney as xa } from "./utils/formatMoney.js";
|
|
95
|
+
import { UserState as ca, UserTokenGenerateUserErrorCode as Ca } from "./shop-minis-platform/src/types/user.js";
|
|
96
|
+
import { ContentCreateUserErrorCode as Sa, MinisContentStatus as Aa } from "./shop-minis-platform/src/types/content.js";
|
|
97
|
+
import { Social as Pa } from "./shop-minis-platform/src/types/share.js";
|
|
98
|
+
import { DATA_FETCHING_DEFAULT_FETCH_POLICY as ha, DATA_FETCHING_DEFAULT_PAGE_SIZE as Ia } from "./shop-minis-platform/src/constants.js";
|
|
98
99
|
export {
|
|
99
100
|
Sr as Accordion,
|
|
100
101
|
Ar as AccordionContent,
|
|
@@ -103,21 +104,21 @@ export {
|
|
|
103
104
|
n as AddToCartButton,
|
|
104
105
|
hr as Alert,
|
|
105
106
|
Ir as AlertDescription,
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
Mr as AlertDialog,
|
|
108
|
+
wr as AlertDialogAction,
|
|
108
109
|
pr as AlertDialogAtom,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
Br as AlertDialogCancel,
|
|
111
|
+
Fr as AlertDialogContent,
|
|
112
|
+
vr as AlertDialogDescription,
|
|
112
113
|
Ur as AlertDialogFooter,
|
|
113
114
|
Lr as AlertDialogHeader,
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
br as AlertDialogOverlay,
|
|
116
|
+
Nr as AlertDialogPortal,
|
|
116
117
|
kr as AlertDialogTitle,
|
|
117
118
|
_r as AlertDialogTrigger,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
Rr as AlertTitle,
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
Sa as ContentCreateUserErrorCode,
|
|
140
|
+
dr as ContentWrapper,
|
|
141
|
+
ha as DATA_FETCHING_DEFAULT_FETCH_POLICY,
|
|
142
|
+
Ia as DATA_FETCHING_DEFAULT_PAGE_SIZE,
|
|
142
143
|
o as DATA_NAVIGATION_TYPE_ATTRIBUTE,
|
|
143
144
|
me as Dialog,
|
|
144
145
|
se as DialogClose,
|
|
@@ -146,8 +147,8 @@ export {
|
|
|
146
147
|
ue as DialogDescription,
|
|
147
148
|
fe as DialogFooter,
|
|
148
149
|
xe as DialogHeader,
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
de as DialogOverlay,
|
|
151
|
+
ce as DialogPortal,
|
|
151
152
|
Ce as DialogTitle,
|
|
152
153
|
ge as DialogTrigger,
|
|
153
154
|
Ae as Drawer,
|
|
@@ -156,58 +157,58 @@ export {
|
|
|
156
157
|
Te as DrawerDescription,
|
|
157
158
|
he as DrawerFooter,
|
|
158
159
|
Ie as DrawerHeader,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
Re as DrawerOverlay,
|
|
161
|
+
Ee as DrawerPortal,
|
|
162
|
+
Me as DrawerTitle,
|
|
163
|
+
we as DrawerTrigger,
|
|
163
164
|
V as FavoriteButton,
|
|
164
165
|
X as IconButton,
|
|
165
166
|
rr as Image,
|
|
166
167
|
W as ImageContentWrapper,
|
|
167
|
-
|
|
168
|
+
Fe as Input,
|
|
168
169
|
Ue as Label,
|
|
169
170
|
mr as List,
|
|
170
171
|
ar as LongPressDetector,
|
|
171
172
|
I as MerchantCard,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
R as MerchantCardContainer,
|
|
174
|
+
E as MerchantCardHeader,
|
|
175
|
+
M as MerchantCardInfo,
|
|
176
|
+
w as MerchantCardName,
|
|
177
|
+
B 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
|
-
|
|
183
|
+
Aa as MinisContentStatus,
|
|
183
184
|
q as MinisRouter,
|
|
184
185
|
t as NAVIGATION_TYPES,
|
|
185
186
|
u as ProductCard,
|
|
186
187
|
f as ProductCardBadge,
|
|
187
188
|
x as ProductCardContainer,
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
d as ProductCardFavoriteButton,
|
|
190
|
+
c as ProductCardImage,
|
|
190
191
|
C as ProductCardImageContainer,
|
|
191
192
|
g as ProductCardInfo,
|
|
192
193
|
S as ProductCardPrice,
|
|
193
194
|
A as ProductCardReviewStars,
|
|
194
|
-
|
|
195
|
+
v as ProductCardSkeleton,
|
|
195
196
|
D as ProductCardTitle,
|
|
196
197
|
T as ProductLink,
|
|
197
198
|
Cr as ProductVariantPrice,
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
be as Progress,
|
|
200
|
+
N as QuantitySelector,
|
|
200
201
|
ke as RadioGroup,
|
|
201
202
|
_e as RadioGroupItem,
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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,38 +229,41 @@ export {
|
|
|
228
229
|
uo as SheetTitle,
|
|
229
230
|
fo as SheetTrigger,
|
|
230
231
|
Ao as Skeleton,
|
|
231
|
-
|
|
232
|
+
Pa as Social,
|
|
232
233
|
fr as TextInput,
|
|
233
234
|
co as Toaster,
|
|
234
235
|
or as Touchable,
|
|
235
236
|
Q as TransitionLink,
|
|
236
|
-
|
|
237
|
-
|
|
237
|
+
ca as UserState,
|
|
238
|
+
Ca as UserTokenGenerateUserErrorCode,
|
|
238
239
|
lr as VideoPlayer,
|
|
239
240
|
Wr as badgeVariants,
|
|
241
|
+
na as dataURLToBlob,
|
|
240
242
|
ra as extractBrandTheme,
|
|
241
|
-
|
|
243
|
+
ma as fileToDataUri,
|
|
242
244
|
Xt as formatError,
|
|
245
|
+
xa as formatMoney,
|
|
243
246
|
ea as formatReviewCount,
|
|
244
247
|
oa as getFeaturedImages,
|
|
245
|
-
|
|
246
|
-
|
|
248
|
+
sa as getResizedImageUrl,
|
|
249
|
+
la as getThumbhashBlobURL,
|
|
250
|
+
ua as getThumbhashDataURL,
|
|
247
251
|
ta as normalizeRating,
|
|
248
252
|
ia as parseUrl,
|
|
249
253
|
go as toast,
|
|
250
254
|
st as useAsyncStorage,
|
|
251
255
|
_o as useBuyerAttributes,
|
|
252
256
|
gt as useCloseMini,
|
|
253
|
-
|
|
257
|
+
Mt as useCreateImageContent,
|
|
254
258
|
nt as useCuratedProducts,
|
|
255
259
|
Lo as useCurrentUser,
|
|
256
260
|
At as useDeeplink,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
vt as useErrorScreen,
|
|
262
|
+
Bt as useErrorToast,
|
|
263
|
+
Bo as useFollowedShops,
|
|
264
|
+
vo as useFollowedShopsActions,
|
|
265
|
+
Go as useGenerateUserToken,
|
|
266
|
+
Nt as useImagePicker,
|
|
263
267
|
xt as useImageUpload,
|
|
264
268
|
_t as useKeyboardAvoidingView,
|
|
265
269
|
Pt as useNavigateWithTransition,
|
|
@@ -267,7 +271,7 @@ export {
|
|
|
267
271
|
zt as useOnMiniBlur,
|
|
268
272
|
Yt as useOnMiniClose,
|
|
269
273
|
Ht as useOnMiniFocus,
|
|
270
|
-
|
|
274
|
+
No as useOrders,
|
|
271
275
|
it as usePopularProducts,
|
|
272
276
|
Ko as useProduct,
|
|
273
277
|
Yo as useProductList,
|
|
@@ -280,13 +284,13 @@ export {
|
|
|
280
284
|
Po as useRecentProducts,
|
|
281
285
|
ho as useRecentShops,
|
|
282
286
|
tt as useRecommendedProducts,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
+
Rt as useRecommendedShops,
|
|
288
|
+
Gt as useRequestPermissions,
|
|
289
|
+
Ro as useSavedProducts,
|
|
290
|
+
Mo as useSavedProductsActions,
|
|
287
291
|
ut as useSecureStorage,
|
|
288
292
|
Lt as useShare,
|
|
289
293
|
ht as useShop,
|
|
290
|
-
|
|
294
|
+
ct as useShopNavigation
|
|
291
295
|
};
|
|
292
296
|
//# sourceMappingURL=index.js.map
|
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
|
|
2
|
-
import { MinisContentStatus as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 ${
|
|
23
|
-
})),
|
|
24
|
-
switch (
|
|
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
|
-
},
|
|
55
|
-
if (
|
|
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 ||
|
|
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:
|
|
102
|
+
featuredImages: u,
|
|
90
103
|
logoImage: {
|
|
91
104
|
url: `https://picsum.photos/100/100?random=${o}`,
|
|
92
105
|
sensitive: !1
|
|
93
106
|
},
|
|
94
|
-
brandSettings:
|
|
107
|
+
brandSettings: i ? {
|
|
95
108
|
id: `brand-settings-${o}`,
|
|
96
109
|
colors: {
|
|
97
110
|
id: `colors-${o}`,
|
|
98
|
-
...
|
|
111
|
+
...p()
|
|
99
112
|
},
|
|
100
|
-
headerTheme:
|
|
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
|
-
}),
|
|
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
|
|
126
|
+
function S(o, r) {
|
|
114
127
|
window._mockLogs = window._mockLogs || [], window._mockLogs.push({ action: o, params: r });
|
|
115
128
|
}
|
|
116
|
-
function
|
|
117
|
-
return (t) => (
|
|
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
|
|
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: {
|
|
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
|
-
|
|
196
|
-
|
|
215
|
+
s("list-1", "Wishlist"),
|
|
216
|
+
s("list-2", "Favorites")
|
|
197
217
|
],
|
|
198
218
|
pageInfo: a()
|
|
199
219
|
},
|
|
200
220
|
getProductList: {
|
|
201
|
-
data:
|
|
221
|
+
data: s("list-1", "Wishlist", [
|
|
202
222
|
e("prod-1", "Sample Product")
|
|
203
223
|
]),
|
|
204
224
|
pageInfo: a()
|
|
205
225
|
},
|
|
206
|
-
addProductList:
|
|
226
|
+
addProductList: s("list-3", "New List"),
|
|
207
227
|
removeProductList: void 0,
|
|
208
|
-
renameProductList:
|
|
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:
|
|
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:
|
|
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] =
|
|
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
|
|
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
|
-
},
|
|
445
|
-
|
|
464
|
+
}, A = ({ force: o } = {}) => {
|
|
465
|
+
w() && !o || window.minisSDK || (window.minisSDK = I(), window.minisParams = {
|
|
446
466
|
handle: "mock-handle",
|
|
447
|
-
initialUrl: "/
|
|
467
|
+
initialUrl: "/",
|
|
448
468
|
platform: "web"
|
|
449
469
|
});
|
|
450
470
|
};
|
|
451
471
|
export {
|
|
452
472
|
e as createProduct,
|
|
453
473
|
d as createShop,
|
|
454
|
-
|
|
455
|
-
|
|
474
|
+
A as injectMocks,
|
|
475
|
+
I as makeMockActions
|
|
456
476
|
};
|
|
457
477
|
//# sourceMappingURL=mocks.js.map
|