@shopify/shop-minis-react 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- var e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index4.js.map
@@ -1,6 +1,5 @@
1
- import { __require as r } from "../shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js";
2
- var i = r();
1
+ var e = { exports: {} };
3
2
  export {
4
- i as l
3
+ e as __module
5
4
  };
6
5
  //# sourceMappingURL=index5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +1,6 @@
1
- var r = {};
1
+ import { __require as r } from "../shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js";
2
+ var i = r();
2
3
  export {
3
- r as __exports
4
+ i as l
4
5
  };
5
6
  //# sourceMappingURL=index6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index.js CHANGED
@@ -2,12 +2,12 @@ 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 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";
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 D, ProductCardTitle as A } from "./components/commerce/product-card.js";
6
6
  import { ProductLink as T } from "./components/commerce/product-link.js";
7
7
  import { MerchantCard as I, MerchantCardContainer as R, MerchantCardHeader as v, MerchantCardInfo as w, MerchantCardName as B, MerchantCardRating as E } from "./components/commerce/merchant-card.js";
8
8
  import { ProductCardSkeleton as F } from "./components/commerce/product-card-skeleton.js";
9
- import { MerchantCardSkeleton as L } from "./components/commerce/merchant-card-skeleton.js";
10
- import { QuantitySelector as N } from "./components/commerce/quantity-selector.js";
9
+ import { MerchantCardSkeleton as b } from "./components/commerce/merchant-card-skeleton.js";
10
+ import { QuantitySelector as k } from "./components/commerce/quantity-selector.js";
11
11
  import { Search as O, SearchInput as _, SearchProvider as y, SearchResultsList as G } 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";
@@ -24,20 +24,20 @@ import { VideoPlayer as lr } from "./components/atoms/video-player.js";
24
24
  import { TextInput as fr } from "./components/atoms/text-input.js";
25
25
  import { ContentWrapper as cr } from "./components/atoms/content-wrapper.js";
26
26
  import { ProductVariantPrice as Cr } from "./components/atoms/product-variant-price.js";
27
- import { Accordion as Sr, AccordionContent as Ar, AccordionItem as Dr, AccordionTrigger as Pr } from "./components/ui/accordion.js";
27
+ import { Accordion as Sr, AccordionContent as Dr, AccordionItem as Ar, AccordionTrigger as Pr } from "./components/ui/accordion.js";
28
28
  import { Alert as hr, AlertDescription as Ir, AlertTitle as Rr } from "./components/ui/alert.js";
29
- import { AlertDialog as wr, AlertDialogAction as Br, AlertDialogCancel as Er, AlertDialogContent as Mr, AlertDialogDescription as Fr, AlertDialogFooter as Ur, AlertDialogHeader as Lr, AlertDialogOverlay as br, AlertDialogPortal as Nr, AlertDialogTitle as kr, AlertDialogTrigger as Or } from "./components/ui/alert-dialog.js";
29
+ import { AlertDialog as wr, AlertDialogAction as Br, AlertDialogCancel as Er, AlertDialogContent as Mr, AlertDialogDescription as Fr, AlertDialogFooter as Ur, AlertDialogHeader as br, AlertDialogOverlay as Lr, AlertDialogPortal as kr, AlertDialogTitle as Nr, AlertDialogTrigger as Or } from "./components/ui/alert-dialog.js";
30
30
  import { Avatar as yr, AvatarFallback as Gr, 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 Re, DrawerPortal as ve, DrawerTitle as we, DrawerTrigger as Be } from "./components/ui/drawer.js";
36
+ import { Drawer as De, DrawerClose as Ae, DrawerContent as Pe, DrawerDescription as Te, DrawerFooter as he, DrawerHeader as Ie, DrawerOverlay as Re, DrawerPortal as ve, DrawerTitle as we, DrawerTrigger as Be } from "./components/ui/drawer.js";
37
37
  import { Input as Me } from "./components/ui/input.js";
38
38
  import { Label as Ue } from "./components/ui/label.js";
39
- import { Progress as be } from "./components/ui/progress.js";
40
- import { RadioGroup as ke, RadioGroupItem as Oe } from "./components/ui/radio-group.js";
39
+ import { Progress as Le } from "./components/ui/progress.js";
40
+ import { RadioGroup as Ne, RadioGroupItem as Oe } from "./components/ui/radio-group.js";
41
41
  import { ResizableHandle as ye, ResizablePanel as Ge, 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";
@@ -45,15 +45,15 @@ import { Separator as to } from "./components/ui/separator.js";
45
45
  import { Sheet as io, SheetClose as po, SheetContent as no, SheetDescription as mo, SheetFooter as so, SheetHeader as lo, SheetTitle as uo, SheetTrigger as fo } from "./components/ui/sheet.js";
46
46
  import { Toaster as co } from "./components/ui/sonner.js";
47
47
  import { toast as go } from "./shop-minis-react/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js";
48
- import { Skeleton as Ao } from "./components/ui/skeleton.js";
48
+ import { Skeleton as Do } 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 Ro } from "./hooks/user/useSavedProducts.js";
52
52
  import { useSavedProductsActions as wo } from "./hooks/user/useSavedProductsActions.js";
53
53
  import { useFollowedShops as Eo } from "./hooks/user/useFollowedShops.js";
54
54
  import { useFollowedShopsActions as Fo } from "./hooks/user/useFollowedShopsActions.js";
55
- import { useCurrentUser as Lo } from "./hooks/user/useCurrentUser.js";
56
- import { useOrders as No } from "./hooks/user/useOrders.js";
55
+ import { useCurrentUser as bo } from "./hooks/user/useCurrentUser.js";
56
+ import { useOrders as ko } from "./hooks/user/useOrders.js";
57
57
  import { useBuyerAttributes as Oo } from "./hooks/user/useBuyerAttributes.js";
58
58
  import { useGenerateUserToken as yo } from "./hooks/user/useGenerateUserToken.js";
59
59
  import { useProductListActions as Ho } from "./hooks/product/useProductListActions.js";
@@ -72,15 +72,15 @@ import { useSecureStorage as ut } from "./hooks/storage/useSecureStorage.js";
72
72
  import { useImageUpload as xt } from "./hooks/storage/useImageUpload.js";
73
73
  import { useShopNavigation as dt } from "./hooks/navigation/useShopNavigation.js";
74
74
  import { useCloseMini as gt } from "./hooks/navigation/useCloseMini.js";
75
- import { useDeeplink as At } from "./hooks/navigation/useDeeplink.js";
75
+ import { useDeeplink as Dt } 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 Rt } from "./hooks/shop/useRecommendedShops.js";
79
79
  import { useCreateImageContent as wt } from "./hooks/content/useCreateImageContent.js";
80
80
  import { useErrorToast as Et } from "./hooks/util/useErrorToast.js";
81
81
  import { useErrorScreen as Ft } from "./hooks/util/useErrorScreen.js";
82
- import { useShare as Lt } from "./hooks/util/useShare.js";
83
- import { useImagePicker as Nt } from "./hooks/util/useImagePicker.js";
82
+ import { useShare as bt } from "./hooks/util/useShare.js";
83
+ import { useImagePicker as kt } from "./hooks/util/useImagePicker.js";
84
84
  import { useKeyboardAvoidingView as Ot } from "./hooks/util/useKeyboardAvoidingView.js";
85
85
  import { useRequestPermissions as yt } from "./hooks/util/useRequestPermissions.js";
86
86
  import { useOnMiniFocus as Ht } from "./hooks/events/useOnMiniFocus.js";
@@ -88,19 +88,20 @@ import { useOnMiniBlur as zt } from "./hooks/events/useOnMiniBlur.js";
88
88
  import { useOnMiniClose as Yt } from "./hooks/events/useOnMiniClose.js";
89
89
  import { useOnAppStateChange as Kt } from "./hooks/events/useOnAppStateChange.js";
90
90
  import { useOnNavigateBack as Zt } from "./hooks/events/useOnNavigateBack.js";
91
- import { MiniEntityNotFoundError as Jt, MiniError as Xt, MiniNetworkError as $t, formatError as ra } from "./utils/errors.js";
92
- import { extractBrandTheme as oa, formatReviewCount as ta, getFeaturedImages as aa, normalizeRating as ia } from "./utils/merchant-card.js";
93
- import { parseUrl as na } from "./utils/parseUrl.js";
94
- import { dataURLToBlob as sa, fileToDataUri as la, getResizedImageUrl as ua, getThumbhashBlobURL as fa, getThumbhashDataURL as xa } from "./utils/image.js";
95
- import { formatMoney as da } from "./utils/formatMoney.js";
96
- import { UserState as ga, UserTokenGenerateUserErrorCode as Sa } from "./shop-minis-platform/src/types/user.js";
97
- import { ContentCreateUserErrorCode as Da, MinisContentStatus as Pa } from "./shop-minis-platform/src/types/content.js";
98
- import { Social as ha } from "./shop-minis-platform/src/types/share.js";
99
- import { DATA_FETCHING_DEFAULT_FETCH_POLICY as Ra, DATA_FETCHING_DEFAULT_PAGE_SIZE as va } from "./shop-minis-platform/src/constants.js";
91
+ import { buildDeeplinkUrl as Jt } from "./utils/buildDeeplinkUrl.js";
92
+ import { MiniEntityNotFoundError as $t, MiniError as ra, MiniNetworkError as ea, formatError as oa } from "./utils/errors.js";
93
+ import { extractBrandTheme as aa, formatReviewCount as ia, getFeaturedImages as pa, normalizeRating as na } from "./utils/merchant-card.js";
94
+ import { parseUrl as sa } from "./utils/parseUrl.js";
95
+ import { dataURLToBlob as ua, fileToDataUri as fa, getResizedImageUrl as xa, getThumbhashBlobURL as ca, getThumbhashDataURL as da } from "./utils/image.js";
96
+ import { formatMoney as ga } from "./utils/formatMoney.js";
97
+ import { UserState as Da, UserTokenGenerateUserErrorCode as Aa } from "./shop-minis-platform/src/types/user.js";
98
+ import { ContentCreateUserErrorCode as Ta, MinisContentStatus as ha } from "./shop-minis-platform/src/types/content.js";
99
+ import { Social as Ra } from "./shop-minis-platform/src/types/share.js";
100
+ import { DATA_FETCHING_DEFAULT_FETCH_POLICY as wa, DATA_FETCHING_DEFAULT_PAGE_SIZE as Ba } from "./shop-minis-platform/src/constants.js";
100
101
  export {
101
102
  Sr as Accordion,
102
- Ar as AccordionContent,
103
- Dr as AccordionItem,
103
+ Dr as AccordionContent,
104
+ Ar as AccordionItem,
104
105
  Pr as AccordionTrigger,
105
106
  n as AddToCartButton,
106
107
  hr as Alert,
@@ -112,10 +113,10 @@ export {
112
113
  Mr as AlertDialogContent,
113
114
  Fr as AlertDialogDescription,
114
115
  Ur as AlertDialogFooter,
115
- Lr as AlertDialogHeader,
116
- br as AlertDialogOverlay,
117
- Nr as AlertDialogPortal,
118
- kr as AlertDialogTitle,
116
+ br as AlertDialogHeader,
117
+ Lr as AlertDialogOverlay,
118
+ kr as AlertDialogPortal,
119
+ Nr as AlertDialogTitle,
119
120
  Or as AlertDialogTrigger,
120
121
  Rr as AlertTitle,
121
122
  yr as Avatar,
@@ -137,10 +138,10 @@ export {
137
138
  te as CarouselNext,
138
139
  ae as CarouselPrevious,
139
140
  pe as Checkbox,
140
- Da as ContentCreateUserErrorCode,
141
+ Ta as ContentCreateUserErrorCode,
141
142
  cr as ContentWrapper,
142
- Ra as DATA_FETCHING_DEFAULT_FETCH_POLICY,
143
- va as DATA_FETCHING_DEFAULT_PAGE_SIZE,
143
+ wa as DATA_FETCHING_DEFAULT_FETCH_POLICY,
144
+ Ba as DATA_FETCHING_DEFAULT_PAGE_SIZE,
144
145
  o as DATA_NAVIGATION_TYPE_ATTRIBUTE,
145
146
  me as Dialog,
146
147
  se as DialogClose,
@@ -152,8 +153,8 @@ export {
152
153
  de as DialogPortal,
153
154
  Ce as DialogTitle,
154
155
  ge as DialogTrigger,
155
- Ae as Drawer,
156
- De as DrawerClose,
156
+ De as Drawer,
157
+ Ae as DrawerClose,
157
158
  Pe as DrawerContent,
158
159
  Te as DrawerDescription,
159
160
  he as DrawerFooter,
@@ -176,12 +177,12 @@ export {
176
177
  w as MerchantCardInfo,
177
178
  B as MerchantCardName,
178
179
  E as MerchantCardRating,
179
- L as MerchantCardSkeleton,
180
- Jt as MiniEntityNotFoundError,
181
- Xt as MiniError,
182
- $t as MiniNetworkError,
180
+ b as MerchantCardSkeleton,
181
+ $t as MiniEntityNotFoundError,
182
+ ra as MiniError,
183
+ ea as MiniNetworkError,
183
184
  i as MinisContainer,
184
- Pa as MinisContentStatus,
185
+ ha as MinisContentStatus,
185
186
  q as MinisRouter,
186
187
  t as NAVIGATION_TYPES,
187
188
  u as ProductCard,
@@ -192,14 +193,14 @@ export {
192
193
  C as ProductCardImageContainer,
193
194
  g as ProductCardInfo,
194
195
  S as ProductCardPrice,
195
- A as ProductCardReviewStars,
196
+ D as ProductCardReviewStars,
196
197
  F as ProductCardSkeleton,
197
- D as ProductCardTitle,
198
+ A as ProductCardTitle,
198
199
  T as ProductLink,
199
200
  Cr as ProductVariantPrice,
200
- be as Progress,
201
- N as QuantitySelector,
202
- ke as RadioGroup,
201
+ Le as Progress,
202
+ k as QuantitySelector,
203
+ Ne as RadioGroup,
203
204
  Oe as RadioGroupItem,
204
205
  ye as ResizableHandle,
205
206
  Ge as ResizablePanel,
@@ -229,41 +230,42 @@ export {
229
230
  lo as SheetHeader,
230
231
  uo as SheetTitle,
231
232
  fo as SheetTrigger,
232
- Ao as Skeleton,
233
- ha as Social,
233
+ Do as Skeleton,
234
+ Ra as Social,
234
235
  fr as TextInput,
235
236
  co as Toaster,
236
237
  or as Touchable,
237
238
  Q as TransitionLink,
238
- ga as UserState,
239
- Sa as UserTokenGenerateUserErrorCode,
239
+ Da as UserState,
240
+ Aa as UserTokenGenerateUserErrorCode,
240
241
  lr as VideoPlayer,
241
242
  Wr as badgeVariants,
242
- sa as dataURLToBlob,
243
- oa as extractBrandTheme,
244
- la as fileToDataUri,
245
- ra as formatError,
246
- da as formatMoney,
247
- ta as formatReviewCount,
248
- aa as getFeaturedImages,
249
- ua as getResizedImageUrl,
250
- fa as getThumbhashBlobURL,
251
- xa as getThumbhashDataURL,
252
- ia as normalizeRating,
253
- na as parseUrl,
243
+ Jt as buildDeeplinkUrl,
244
+ ua as dataURLToBlob,
245
+ aa as extractBrandTheme,
246
+ fa as fileToDataUri,
247
+ oa as formatError,
248
+ ga as formatMoney,
249
+ ia as formatReviewCount,
250
+ pa as getFeaturedImages,
251
+ xa as getResizedImageUrl,
252
+ ca as getThumbhashBlobURL,
253
+ da as getThumbhashDataURL,
254
+ na as normalizeRating,
255
+ sa as parseUrl,
254
256
  go as toast,
255
257
  st as useAsyncStorage,
256
258
  Oo as useBuyerAttributes,
257
259
  gt as useCloseMini,
258
260
  wt as useCreateImageContent,
259
- Lo as useCurrentUser,
260
- At as useDeeplink,
261
+ bo as useCurrentUser,
262
+ Dt as useDeeplink,
261
263
  Ft as useErrorScreen,
262
264
  Et as useErrorToast,
263
265
  Eo as useFollowedShops,
264
266
  Fo as useFollowedShopsActions,
265
267
  yo as useGenerateUserToken,
266
- Nt as useImagePicker,
268
+ kt as useImagePicker,
267
269
  xt as useImageUpload,
268
270
  Ot as useKeyboardAvoidingView,
269
271
  Pt as useNavigateWithTransition,
@@ -272,7 +274,7 @@ export {
272
274
  Yt as useOnMiniClose,
273
275
  Ht as useOnMiniFocus,
274
276
  Zt as useOnNavigateBack,
275
- No as useOrders,
277
+ ko as useOrders,
276
278
  nt as usePopularProducts,
277
279
  Ko as useProduct,
278
280
  Yo as useProductList,
@@ -291,7 +293,7 @@ export {
291
293
  Ro as useSavedProducts,
292
294
  wo as useSavedProductsActions,
293
295
  ut as useSecureStorage,
294
- Lt as useShare,
296
+ bt as useShare,
295
297
  ht as useShop,
296
298
  dt as useShopNavigation
297
299
  };
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { __module as q } from "../../../../../../../../_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];
@@ -1,4 +1,4 @@
1
- import { __exports as i } from "../../../../../../_virtual/index6.js";
1
+ import { __exports as i } from "../../../../../../_virtual/index4.js";
2
2
  var c;
3
3
  function d() {
4
4
  if (c) return i;
@@ -0,0 +1,10 @@
1
+ function r(i) {
2
+ const { handle: n } = window.minisParams;
3
+ if (!n)
4
+ throw new Error("Mini handle is not set");
5
+ return `https://shop.app/mini/${n}${i}`;
6
+ }
7
+ export {
8
+ r as buildDeeplinkUrl
9
+ };
10
+ //# sourceMappingURL=buildDeeplinkUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildDeeplinkUrl.js","sources":["../../src/utils/buildDeeplinkUrl.ts"],"sourcesContent":["/**\n * Builds a deeplink URL for a Shop Mini.\n *\n * @param path - The path within the mini (should start with '/').\n * @returns The full deeplink URL. Structure: https://shop.app/mini/{handle}{path}\n *\n * @example\n * buildDeeplinkUrl('/products/123')\n * // Returns: 'https://shop.app/mini/my-mini/products/123'\n */\nexport function buildDeeplinkUrl(path: string): string {\n const {handle} = window.minisParams\n\n if (!handle) {\n throw new Error('Mini handle is not set')\n }\n\n return `https://shop.app/mini/${handle}${path}`\n}\n"],"names":["buildDeeplinkUrl","path","handle"],"mappings":"AAUO,SAASA,EAAiBC,GAAsB;AAC/C,QAAA,EAAC,QAAAC,MAAU,OAAO;AAExB,MAAI,CAACA;AACG,UAAA,IAAI,MAAM,wBAAwB;AAGnC,SAAA,yBAAyBA,CAAM,GAAGD,CAAI;AAC/C;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shopify/shop-minis-react",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "engines": {
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Builds a deeplink URL for a Shop Mini.
3
+ *
4
+ * @param path - The path within the mini (should start with '/').
5
+ * @returns The full deeplink URL. Structure: https://shop.app/mini/{handle}{path}
6
+ *
7
+ * @example
8
+ * buildDeeplinkUrl('/products/123')
9
+ * // Returns: 'https://shop.app/mini/my-mini/products/123'
10
+ */
11
+ export function buildDeeplinkUrl(path: string): string {
12
+ const {handle} = window.minisParams
13
+
14
+ if (!handle) {
15
+ throw new Error('Mini handle is not set')
16
+ }
17
+
18
+ return `https://shop.app/mini/${handle}${path}`
19
+ }
@@ -1,3 +1,4 @@
1
+ export * from './buildDeeplinkUrl'
1
2
  export * from './errors'
2
3
  export * from './merchant-card'
3
4
  export * from './parseUrl'