@shopify/shop-minis-react 0.0.27 → 0.0.28

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,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js";
3
- var t = /* @__PURE__ */ o();
4
- const l = /* @__PURE__ */ r(t);
2
+ import { __require as o } from "../shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js";
3
+ var t = o();
4
+ const a = /* @__PURE__ */ r(t);
5
5
  export {
6
- l as default
6
+ a as default
7
7
  };
8
8
  //# sourceMappingURL=index2.js.map
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js";
3
- var t = o();
4
- const a = /* @__PURE__ */ r(t);
2
+ import { __require as o } from "../shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js";
3
+ var t = /* @__PURE__ */ o();
4
+ const l = /* @__PURE__ */ r(t);
5
5
  export {
6
- a as default
6
+ l as default
7
7
  };
8
8
  //# sourceMappingURL=index3.js.map
@@ -0,0 +1,22 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useShopActions as n } from "../../internal/useShopActions.js";
3
+ import { LongPressDetector as s } from "./long-press-detector.js";
4
+ function c({
5
+ publicId: o,
6
+ children: r
7
+ }) {
8
+ const { showFeedbackSheet: t } = n();
9
+ return /* @__PURE__ */ e(
10
+ s,
11
+ {
12
+ onLongPress: () => {
13
+ o && t({ publicId: o });
14
+ },
15
+ children: r
16
+ }
17
+ );
18
+ }
19
+ export {
20
+ c as ContentMonitor
21
+ };
22
+ //# sourceMappingURL=content-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-monitor.js","sources":["../../../src/components/atoms/content-monitor.tsx"],"sourcesContent":["import {useShopActions} from '../../internal/useShopActions'\n\nimport {LongPressDetector} from './long-press-detector'\n\nexport function ContentMonitor({\n publicId,\n children,\n}: {\n publicId?: string\n children: React.ReactNode\n}) {\n const {showFeedbackSheet} = useShopActions()\n\n return (\n <LongPressDetector\n onLongPress={() => {\n if (!publicId) return\n\n showFeedbackSheet({publicId})\n }}\n >\n {children}\n </LongPressDetector>\n )\n}\n"],"names":["ContentMonitor","publicId","children","showFeedbackSheet","useShopActions","jsx","LongPressDetector"],"mappings":";;;AAIO,SAASA,EAAe;AAAA,EAC7B,UAAAC;AAAA,EACA,UAAAC;AACF,GAGG;AACK,QAAA,EAAC,mBAAAC,EAAiB,IAAIC,EAAe;AAGzC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAa,MAAM;AACjB,QAAKL,KAEaE,EAAA,EAAC,UAAAF,GAAS;AAAA,MAC9B;AAAA,MAEC,UAAAC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -0,0 +1,18 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useContent as c } from "../../hooks/content/useContent.js";
3
+ import { ContentMonitor as m } from "./content-monitor.js";
4
+ function C({
5
+ publicId: o,
6
+ externalId: r,
7
+ children: e
8
+ }) {
9
+ const { content: i, loading: t } = c({
10
+ identifiers: [{ publicId: o, externalId: r }],
11
+ skip: !o && !r
12
+ }), n = i?.[0];
13
+ return t || !n ? e({ loading: t }) : /* @__PURE__ */ p(m, { publicId: n.publicId, children: e({ content: n, loading: t }) });
14
+ }
15
+ export {
16
+ C as ContentWrapper
17
+ };
18
+ //# sourceMappingURL=content-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-wrapper.js","sources":["../../../src/components/atoms/content-wrapper.tsx"],"sourcesContent":["import {useContent} from '../../hooks/content/useContent'\nimport {Content} from '../../types'\n\nimport {ContentMonitor} from './content-monitor'\n\ninterface BaseContentWrapperProps {\n children: ({\n content,\n loading,\n }: {\n content?: Content\n loading: boolean\n }) => JSX.Element | null\n}\n\ninterface PublicIdContentWrapperProps extends BaseContentWrapperProps {\n publicId: string\n externalId?: never\n}\n\ninterface ExternalIdContentWrapperProps extends BaseContentWrapperProps {\n externalId: string\n publicId?: never\n}\n\ntype ContentWrapperProps =\n | PublicIdContentWrapperProps\n | ExternalIdContentWrapperProps\n\n// It's too messy in the docs to show the complete types here so we show a simplified version\nexport interface ContentWrapperPropsForDocs extends BaseContentWrapperProps {\n publicId?: string\n externalId?: string\n}\n\nexport function ContentWrapper({\n publicId,\n externalId,\n children,\n}: ContentWrapperProps) {\n const {content, loading} = useContent({\n identifiers: [{publicId, externalId}],\n skip: !publicId && !externalId,\n })\n\n const contentItem = content?.[0]\n\n if (loading || !contentItem) {\n return children({loading})\n }\n\n return (\n <ContentMonitor publicId={contentItem.publicId}>\n {children({content: contentItem, loading})}\n </ContentMonitor>\n )\n}\n"],"names":["ContentWrapper","publicId","externalId","children","content","loading","useContent","contentItem","jsx","ContentMonitor"],"mappings":";;;AAmCO,SAASA,EAAe;AAAA,EAC7B,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AACF,GAAwB;AACtB,QAAM,EAAC,SAAAC,GAAS,SAAAC,EAAO,IAAIC,EAAW;AAAA,IACpC,aAAa,CAAC,EAAC,UAAAL,GAAU,YAAAC,GAAW;AAAA,IACpC,MAAM,CAACD,KAAY,CAACC;AAAA,EAAA,CACrB,GAEKK,IAAcH,IAAU,CAAC;AAE3B,SAAAC,KAAW,CAACE,IACPJ,EAAS,EAAC,SAAAE,GAAQ,IAIzB,gBAAAG,EAACC,GAAe,EAAA,UAAUF,EAAY,UACnC,UAASJ,EAAA,EAAC,SAASI,GAAa,SAAAF,EAAO,CAAC,EAC3C,CAAA;AAEJ;"}
@@ -0,0 +1,33 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { motion as s } from "../../shop-minis-react/node_modules/.pnpm/motion@12.17.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/motion/dist/es/framer-motion/dist/es/render/components/motion/proxy.js";
4
+ const l = ({
5
+ onLongPress: e,
6
+ delay: o = 500,
7
+ children: c,
8
+ ...a
9
+ }) => {
10
+ const r = t.useRef(void 0), u = t.useCallback(() => {
11
+ r.current = window.setTimeout(() => {
12
+ e(), r.current = void 0;
13
+ }, o);
14
+ }, [e, o]), n = t.useCallback(() => {
15
+ r.current && (clearTimeout(r.current), r.current = void 0);
16
+ }, []);
17
+ return t.useEffect(() => () => {
18
+ r.current && clearTimeout(r.current);
19
+ }, []), /* @__PURE__ */ i(
20
+ s.div,
21
+ {
22
+ onTapStart: u,
23
+ onTap: n,
24
+ onTapCancel: n,
25
+ ...a,
26
+ children: c
27
+ }
28
+ );
29
+ };
30
+ export {
31
+ l as LongPressDetector
32
+ };
33
+ //# sourceMappingURL=long-press-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-press-detector.js","sources":["../../../src/components/atoms/long-press-detector.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {motion, HTMLMotionProps} from 'motion/react'\n\ninterface LongPressDetectorProps extends HTMLMotionProps<'div'> {\n onLongPress: () => void\n delay?: number\n children: React.ReactNode\n}\n\nexport const LongPressDetector = ({\n onLongPress,\n delay = 500,\n children,\n ...motionProps\n}: LongPressDetectorProps) => {\n const longPressTimeoutRef = React.useRef<number | undefined>(undefined)\n\n const handleTapStart = React.useCallback(() => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n onLongPress()\n longPressTimeoutRef.current = undefined\n }, delay)\n }, [onLongPress, delay])\n\n const handleTapEnd = React.useCallback(() => {\n if (longPressTimeoutRef.current) {\n clearTimeout(longPressTimeoutRef.current)\n longPressTimeoutRef.current = undefined\n }\n }, [])\n\n // Cleanup timer on unmount\n React.useEffect(() => {\n return () => {\n if (longPressTimeoutRef.current) {\n clearTimeout(longPressTimeoutRef.current)\n }\n }\n }, [])\n\n return (\n <motion.div\n onTapStart={handleTapStart}\n onTap={handleTapEnd}\n onTapCancel={handleTapEnd}\n {...motionProps}\n >\n {children}\n </motion.div>\n )\n}\n"],"names":["LongPressDetector","onLongPress","delay","children","motionProps","longPressTimeoutRef","React","handleTapStart","handleTapEnd","jsx","motion"],"mappings":";;;AAUO,MAAMA,IAAoB,CAAC;AAAA,EAChC,aAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,GAAGC;AACL,MAA8B;AACtB,QAAAC,IAAsBC,EAAM,OAA2B,MAAS,GAEhEC,IAAiBD,EAAM,YAAY,MAAM;AACzB,IAAAD,EAAA,UAAU,OAAO,WAAW,MAAM;AACxC,MAAAJ,EAAA,GACZI,EAAoB,UAAU;AAAA,OAC7BH,CAAK;AAAA,EAAA,GACP,CAACD,GAAaC,CAAK,CAAC,GAEjBM,IAAeF,EAAM,YAAY,MAAM;AAC3C,IAAID,EAAoB,YACtB,aAAaA,EAAoB,OAAO,GACxCA,EAAoB,UAAU;AAAA,EAElC,GAAG,EAAE;AAGL,SAAAC,EAAM,UAAU,MACP,MAAM;AACX,IAAID,EAAoB,WACtB,aAAaA,EAAoB,OAAO;AAAA,EAE5C,GACC,EAAE,GAGH,gBAAAI;AAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,YAAYH;AAAA,MACZ,OAAOC;AAAA,MACP,aAAaA;AAAA,MACZ,GAAGJ;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -0,0 +1,27 @@
1
+ import { jsx as r, Fragment as a } from "react/jsx-runtime";
2
+ import { ContentWrapper as f } from "../atoms/content-wrapper.js";
3
+ function h({
4
+ onLoad: i,
5
+ width: m,
6
+ height: p,
7
+ className: l,
8
+ publicId: o,
9
+ externalId: t,
10
+ Loader: e
11
+ }) {
12
+ return /* @__PURE__ */ r(f, { ...t ? { externalId: t } : { publicId: o }, children: ({ content: n, loading: u }) => u ? e ? /* @__PURE__ */ r(a, { children: e }) : null : /* @__PURE__ */ r(
13
+ "img",
14
+ {
15
+ src: n?.image?.url,
16
+ width: m,
17
+ height: p,
18
+ alt: n?.title,
19
+ onLoad: i,
20
+ className: l
21
+ }
22
+ ) });
23
+ }
24
+ export {
25
+ h as ImageContentWrapper
26
+ };
27
+ //# sourceMappingURL=image-content-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-content-wrapper.js","sources":["../../../src/components/content/image-content-wrapper.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport {ContentWrapper} from '../atoms/content-wrapper'\n\ntype ImageContentWrapperProps = (\n | {publicId: string; externalId?: never}\n | {externalId: string; publicId?: never}\n) & {\n onLoad?: () => void\n width?: number\n height?: number\n className?: string\n Loader?: React.ReactNode | string\n}\n\nexport function ImageContentWrapper({\n onLoad,\n width,\n height,\n className,\n publicId,\n externalId,\n Loader,\n}: ImageContentWrapperProps) {\n return (\n <ContentWrapper {...(externalId ? {externalId} : {publicId: publicId!})}>\n {({content, loading}) => {\n if (loading) return Loader ? <>{Loader}</> : null\n\n return (\n <img\n src={content?.image?.url}\n width={width}\n height={height}\n alt={content?.title}\n onLoad={onLoad}\n className={className}\n />\n )\n }}\n </ContentWrapper>\n )\n}\n"],"names":["ImageContentWrapper","onLoad","width","height","className","publicId","externalId","Loader","jsx","ContentWrapper","content","loading","Fragment"],"mappings":";;AAcO,SAASA,EAAoB;AAAA,EAClC,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AACF,GAA6B;AAC3B,SACG,gBAAAC,EAAAC,GAAA,EAAgB,GAAIH,IAAa,EAAC,YAAAA,EAAU,IAAI,EAAC,UAAAD,EAC/C,GAAA,UAAA,CAAC,EAAC,SAAAK,GAAS,SAAAC,QACNA,IAAgBJ,IAAS,gBAAAC,EAAAI,GAAA,EAAG,YAAO,CAAA,IAAM,OAG3C,gBAAAJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKE,GAAS,OAAO;AAAA,MACrB,OAAAR;AAAA,MACA,QAAAC;AAAA,MACA,KAAKO,GAAS;AAAA,MACd,QAAAT;AAAA,MACA,WAAAG;AAAA,IAAA;AAAA,EACF,GAGN;AAEJ;"}
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { DATA_NAVIGATION_TYPE_ATTRIBUTE as o, NAVIGATION_TYPES as t } from "./types/index.js";
2
- import { MinisContainer as i } from "./components/MinisContainer.js";
2
+ import { MinisContainer as p } from "./components/MinisContainer.js";
3
3
  import { ProductCard as l } from "./components/commerce/product-card.js";
4
4
  import { ProductLink as s } from "./components/commerce/product-link.js";
5
5
  import { MerchantCard as f, MerchantCardPrimitive as x } from "./components/commerce/merchant-card.js";
6
6
  import { ProductCardSkeleton as c } from "./components/commerce/product-card-skeleton.js";
7
7
  import { MerchantCardSkeleton as g } from "./components/commerce/merchant-card-skeleton.js";
8
8
  import { QuantitySelector as C } from "./components/commerce/quantity-selector.js";
9
- import { Search as A, SearchInput as h, SearchProvider as P, SearchResultsList as T } from "./components/commerce/search.js";
10
- import { ContentWrapper as v } from "./components/content/content-wrapper.js";
9
+ import { Search as A, SearchInput as P, SearchProvider as h, SearchResultsList as T } from "./components/commerce/search.js";
10
+ import { ImageContentWrapper as v } from "./components/content/image-content-wrapper.js";
11
11
  import { TransitionContainer as R } from "./components/navigation/transition-container.js";
12
12
  import { TransitionLink as E } from "./components/navigation/transition-link.js";
13
13
  import { Button as k } from "./components/atoms/button.js";
@@ -15,231 +15,233 @@ import { FavoriteButton as L } from "./components/atoms/favorite-button.js";
15
15
  import { IconButton as N } from "./components/atoms/icon-button.js";
16
16
  import { ThumbhashImage as U } from "./components/atoms/thumbhash-image.js";
17
17
  import { Touchable as H } from "./components/atoms/touchable.js";
18
- import { AlertDialogAtom as V } from "./components/atoms/alert-dialog.js";
19
- import { List as _ } from "./components/atoms/list.js";
20
- import { VideoPlayer as Y } from "./components/atoms/video-player.js";
21
- import { Accordion as j, AccordionContent as q, AccordionItem as J, AccordionTrigger as K } from "./components/ui/accordion.js";
22
- import { Alert as Z, AlertDescription as $, AlertTitle as rr } from "./components/ui/alert.js";
23
- import { AlertDialog as or, AlertDialogAction as tr, AlertDialogCancel as ar, AlertDialogContent as ir, AlertDialogDescription as pr, AlertDialogFooter as lr, AlertDialogHeader as mr, AlertDialogOverlay as sr, AlertDialogPortal as nr, AlertDialogTitle as fr, AlertDialogTrigger as xr } from "./components/ui/alert-dialog.js";
24
- import { Avatar as cr, AvatarFallback as dr, AvatarImage as gr } from "./components/ui/avatar.js";
25
- import { Badge as Cr, badgeVariants as Dr } from "./components/ui/badge.js";
26
- import { Card as hr, CardAction as Pr, CardContent as Tr, CardDescription as Ir, CardFooter as vr, CardHeader as wr, CardTitle as Rr } from "./components/ui/card.js";
27
- import { Carousel as Er, CarouselContent as Fr, CarouselItem as kr, CarouselNext as Br, CarouselPrevious as Lr } from "./components/ui/carousel.js";
28
- import { Checkbox as Nr } from "./components/ui/checkbox.js";
29
- import { Dialog as Ur, DialogClose as Gr, DialogContent as Hr, DialogDescription as Or, DialogFooter as Vr, DialogHeader as zr, DialogOverlay as _r, DialogPortal as Wr, DialogTitle as Yr, DialogTrigger as Qr } from "./components/ui/dialog.js";
30
- import { Drawer as qr, DrawerClose as Jr, DrawerContent as Kr, DrawerDescription as Xr, DrawerFooter as Zr, DrawerHeader as $r, DrawerOverlay as re, DrawerPortal as ee, DrawerTitle as oe, DrawerTrigger as te } from "./components/ui/drawer.js";
31
- import { Input as ie } from "./components/ui/input.js";
32
- import { Label as le } from "./components/ui/label.js";
33
- import { Progress as se } from "./components/ui/progress.js";
34
- import { RadioGroup as fe, RadioGroupItem as xe } from "./components/ui/radio-group.js";
35
- import { ResizableHandle as ce, ResizablePanel as de, ResizablePanelGroup as ge } from "./components/ui/resizable.js";
36
- import { ScrollArea as Ce, ScrollBar as De } from "./components/ui/scroll-area.js";
37
- import { Select as he, SelectContent as Pe, SelectGroup as Te, SelectItem as Ie, SelectLabel as ve, SelectScrollDownButton as we, SelectScrollUpButton as Re, SelectSeparator as be, SelectTrigger as Ee, SelectValue as Fe } from "./components/ui/select.js";
38
- import { Separator as Be } from "./components/ui/separator.js";
39
- import { Sheet as Me, SheetClose as Ne, SheetContent as ye, SheetDescription as Ue, SheetFooter as Ge, SheetHeader as He, SheetTitle as Oe, SheetTrigger as Ve } from "./components/ui/sheet.js";
40
- import { Toaster as _e } from "./components/ui/sonner.js";
41
- import { Skeleton as Ye } from "./components/ui/skeleton.js";
42
- import { useRecentProducts as je } from "./hooks/user/useRecentProducts.js";
43
- import { useRecentShops as Je } from "./hooks/user/useRecentShops.js";
44
- import { useSavedProducts as Xe } from "./hooks/user/useSavedProducts.js";
45
- import { useSavedProductsActions as $e } from "./hooks/user/useSavedProductsActions.js";
46
- import { useFollowedShops as eo } from "./hooks/user/useFollowedShops.js";
47
- import { useFollowedShopsActions as to } from "./hooks/user/useFollowedShopsActions.js";
48
- import { useCurrentUser as io } from "./hooks/user/useCurrentUser.js";
49
- import { useOrders as lo } from "./hooks/user/useOrders.js";
50
- import { useBuyerAttributes as so } from "./hooks/user/useBuyerAttributes.js";
51
- import { useProductListActions as fo } from "./hooks/product/useProductListActions.js";
52
- import { useProductLists as uo } from "./hooks/product/useProductLists.js";
53
- import { useProductList as go } from "./hooks/product/useProductList.js";
54
- import { useProduct as Co } from "./hooks/product/useProduct.js";
55
- import { useProducts as Ao } from "./hooks/product/useProducts.js";
56
- import { useProductVariants as Po } from "./hooks/product/useProductVariants.js";
57
- import { useProductMedia as Io } from "./hooks/product/useProductMedia.js";
58
- import { useProductSearch as wo } from "./hooks/product/useProductSearch.js";
59
- import { useRecommendedProducts as bo } from "./hooks/product/useRecommendedProducts.js";
60
- import { usePopularProducts as Fo } from "./hooks/product/usePopularProducts.js";
61
- import { useCuratedProducts as Bo } from "./hooks/product/useCuratedProducts.js";
62
- import { useAsyncStorage as Mo } from "./hooks/storage/useAsyncStorage.js";
63
- import { useSecureStorage as yo } from "./hooks/storage/useSecureStorage.js";
64
- import { useImageUpload as Go } from "./hooks/storage/useImageUpload.js";
65
- import { useShopNavigation as Oo } from "./hooks/navigation/useShopNavigation.js";
66
- import { useCloseMini as zo } from "./hooks/navigation/useCloseMini.js";
67
- import { useDeeplink as Wo } from "./hooks/navigation/useDeeplink.js";
68
- import { useNavigateWithTransition as Qo } from "./hooks/navigation/useNavigateWithTransition.js";
69
- import { useShop as qo } from "./hooks/shop/useShop.js";
70
- import { useShopCartActions as Ko } from "./hooks/shop/useShopCartActions.js";
71
- import { useRecommendedShops as Zo } from "./hooks/shop/useRecommendedShops.js";
72
- import { useCreateImageContent as rt } from "./hooks/content/useCreateImageContent.js";
73
- import { useErrorToast as ot } from "./hooks/util/useErrorToast.js";
74
- import { useErrorScreen as at } from "./hooks/util/useErrorScreen.js";
75
- import { useShare as pt } from "./hooks/util/useShare.js";
76
- import { useImagePicker as mt } from "./hooks/util/useImagePicker.js";
77
- import { MiniEntityNotFoundError as nt, MiniError as ft, MiniNetworkError as xt, formatError as ut } from "./utils/errors.js";
78
- import { extractBrandTheme as dt, formatReviewCount as gt, getFeaturedImages as St, normalizeRating as Ct } from "./utils/merchant-card.js";
79
- import { parseUrl as At } from "./utils/parseUrl.js";
80
- import { fileToDataUri as Pt } from "./utils/imageToDataUri.js";
81
- import { ContentCreateUserErrorCode as It } from "./shop-minis-platform/src/types/content.js";
82
- import { Consent as wt, ConsentStatus as Rt } from "./shop-minis-platform/src/types/permissions.js";
18
+ import { LongPressDetector as V } from "./components/atoms/long-press-detector.js";
19
+ import { AlertDialogAtom as _ } from "./components/atoms/alert-dialog.js";
20
+ import { List as Y } from "./components/atoms/list.js";
21
+ import { VideoPlayer as j } from "./components/atoms/video-player.js";
22
+ import { Accordion as J, AccordionContent as K, AccordionItem as X, AccordionTrigger as Z } from "./components/ui/accordion.js";
23
+ import { Alert as rr, AlertDescription as er, AlertTitle as or } from "./components/ui/alert.js";
24
+ import { AlertDialog as ar, AlertDialogAction as pr, AlertDialogCancel as ir, AlertDialogContent as lr, AlertDialogDescription as mr, AlertDialogFooter as sr, AlertDialogHeader as nr, AlertDialogOverlay as fr, AlertDialogPortal as xr, AlertDialogTitle as ur, AlertDialogTrigger as cr } from "./components/ui/alert-dialog.js";
25
+ import { Avatar as gr, AvatarFallback as Sr, AvatarImage as Cr } from "./components/ui/avatar.js";
26
+ import { Badge as Ar, badgeVariants as Pr } from "./components/ui/badge.js";
27
+ import { Card as Tr, CardAction as Ir, CardContent as vr, CardDescription as wr, CardFooter as Rr, CardHeader as br, CardTitle as Er } from "./components/ui/card.js";
28
+ import { Carousel as kr, CarouselContent as Br, CarouselItem as Lr, CarouselNext as Mr, CarouselPrevious as Nr } from "./components/ui/carousel.js";
29
+ import { Checkbox as Ur } from "./components/ui/checkbox.js";
30
+ import { Dialog as Hr, DialogClose as Or, DialogContent as Vr, DialogDescription as zr, DialogFooter as _r, DialogHeader as Wr, DialogOverlay as Yr, DialogPortal as Qr, DialogTitle as jr, DialogTrigger as qr } from "./components/ui/dialog.js";
31
+ import { Drawer as Kr, DrawerClose as Xr, DrawerContent as Zr, DrawerDescription as $r, DrawerFooter as re, DrawerHeader as ee, DrawerOverlay as oe, DrawerPortal as te, DrawerTitle as ae, DrawerTrigger as pe } from "./components/ui/drawer.js";
32
+ import { Input as le } from "./components/ui/input.js";
33
+ import { Label as se } from "./components/ui/label.js";
34
+ import { Progress as fe } from "./components/ui/progress.js";
35
+ import { RadioGroup as ue, RadioGroupItem as ce } from "./components/ui/radio-group.js";
36
+ import { ResizableHandle as ge, ResizablePanel as Se, ResizablePanelGroup as Ce } from "./components/ui/resizable.js";
37
+ import { ScrollArea as Ae, ScrollBar as Pe } from "./components/ui/scroll-area.js";
38
+ import { Select as Te, SelectContent as Ie, SelectGroup as ve, SelectItem as we, SelectLabel as Re, SelectScrollDownButton as be, SelectScrollUpButton as Ee, SelectSeparator as Fe, SelectTrigger as ke, SelectValue as Be } from "./components/ui/select.js";
39
+ import { Separator as Me } from "./components/ui/separator.js";
40
+ import { Sheet as ye, SheetClose as Ue, SheetContent as Ge, SheetDescription as He, SheetFooter as Oe, SheetHeader as Ve, SheetTitle as ze, SheetTrigger as _e } from "./components/ui/sheet.js";
41
+ import { Toaster as Ye } from "./components/ui/sonner.js";
42
+ import { Skeleton as je } from "./components/ui/skeleton.js";
43
+ import { useRecentProducts as Je } from "./hooks/user/useRecentProducts.js";
44
+ import { useRecentShops as Xe } from "./hooks/user/useRecentShops.js";
45
+ import { useSavedProducts as $e } from "./hooks/user/useSavedProducts.js";
46
+ import { useSavedProductsActions as eo } from "./hooks/user/useSavedProductsActions.js";
47
+ import { useFollowedShops as to } from "./hooks/user/useFollowedShops.js";
48
+ import { useFollowedShopsActions as po } from "./hooks/user/useFollowedShopsActions.js";
49
+ import { useCurrentUser as lo } from "./hooks/user/useCurrentUser.js";
50
+ import { useOrders as so } from "./hooks/user/useOrders.js";
51
+ import { useBuyerAttributes as fo } from "./hooks/user/useBuyerAttributes.js";
52
+ import { useProductListActions as uo } from "./hooks/product/useProductListActions.js";
53
+ import { useProductLists as go } from "./hooks/product/useProductLists.js";
54
+ import { useProductList as Co } from "./hooks/product/useProductList.js";
55
+ import { useProduct as Ao } from "./hooks/product/useProduct.js";
56
+ import { useProducts as ho } from "./hooks/product/useProducts.js";
57
+ import { useProductVariants as Io } from "./hooks/product/useProductVariants.js";
58
+ import { useProductMedia as wo } from "./hooks/product/useProductMedia.js";
59
+ import { useProductSearch as bo } from "./hooks/product/useProductSearch.js";
60
+ import { useRecommendedProducts as Fo } from "./hooks/product/useRecommendedProducts.js";
61
+ import { usePopularProducts as Bo } from "./hooks/product/usePopularProducts.js";
62
+ import { useCuratedProducts as Mo } from "./hooks/product/useCuratedProducts.js";
63
+ import { useAsyncStorage as yo } from "./hooks/storage/useAsyncStorage.js";
64
+ import { useSecureStorage as Go } from "./hooks/storage/useSecureStorage.js";
65
+ import { useImageUpload as Oo } from "./hooks/storage/useImageUpload.js";
66
+ import { useShopNavigation as zo } from "./hooks/navigation/useShopNavigation.js";
67
+ import { useCloseMini as Wo } from "./hooks/navigation/useCloseMini.js";
68
+ import { useDeeplink as Qo } from "./hooks/navigation/useDeeplink.js";
69
+ import { useNavigateWithTransition as qo } from "./hooks/navigation/useNavigateWithTransition.js";
70
+ import { useShop as Ko } from "./hooks/shop/useShop.js";
71
+ import { useShopCartActions as Zo } from "./hooks/shop/useShopCartActions.js";
72
+ import { useRecommendedShops as rt } from "./hooks/shop/useRecommendedShops.js";
73
+ import { useCreateImageContent as ot } from "./hooks/content/useCreateImageContent.js";
74
+ import { useErrorToast as at } from "./hooks/util/useErrorToast.js";
75
+ import { useErrorScreen as it } from "./hooks/util/useErrorScreen.js";
76
+ import { useShare as mt } from "./hooks/util/useShare.js";
77
+ import { useImagePicker as nt } from "./hooks/util/useImagePicker.js";
78
+ import { MiniEntityNotFoundError as xt, MiniError as ut, MiniNetworkError as ct, formatError as dt } from "./utils/errors.js";
79
+ import { extractBrandTheme as St, formatReviewCount as Ct, getFeaturedImages as Dt, normalizeRating as At } from "./utils/merchant-card.js";
80
+ import { parseUrl as ht } from "./utils/parseUrl.js";
81
+ import { fileToDataUri as It } from "./utils/imageToDataUri.js";
82
+ import { ContentCreateUserErrorCode as wt } from "./shop-minis-platform/src/types/content.js";
83
+ import { Consent as bt, ConsentStatus as Et } from "./shop-minis-platform/src/types/permissions.js";
83
84
  export {
84
- j as Accordion,
85
- q as AccordionContent,
86
- J as AccordionItem,
87
- K as AccordionTrigger,
88
- Z as Alert,
89
- $ as AlertDescription,
90
- or as AlertDialog,
91
- tr as AlertDialogAction,
92
- V as AlertDialogAtom,
93
- ar as AlertDialogCancel,
94
- ir as AlertDialogContent,
95
- pr as AlertDialogDescription,
96
- lr as AlertDialogFooter,
97
- mr as AlertDialogHeader,
98
- sr as AlertDialogOverlay,
99
- nr as AlertDialogPortal,
100
- fr as AlertDialogTitle,
101
- xr as AlertDialogTrigger,
102
- rr as AlertTitle,
103
- cr as Avatar,
104
- dr as AvatarFallback,
105
- gr as AvatarImage,
106
- Cr as Badge,
85
+ J as Accordion,
86
+ K as AccordionContent,
87
+ X as AccordionItem,
88
+ Z as AccordionTrigger,
89
+ rr as Alert,
90
+ er as AlertDescription,
91
+ ar as AlertDialog,
92
+ pr as AlertDialogAction,
93
+ _ as AlertDialogAtom,
94
+ ir as AlertDialogCancel,
95
+ lr as AlertDialogContent,
96
+ mr as AlertDialogDescription,
97
+ sr as AlertDialogFooter,
98
+ nr as AlertDialogHeader,
99
+ fr as AlertDialogOverlay,
100
+ xr as AlertDialogPortal,
101
+ ur as AlertDialogTitle,
102
+ cr as AlertDialogTrigger,
103
+ or as AlertTitle,
104
+ gr as Avatar,
105
+ Sr as AvatarFallback,
106
+ Cr as AvatarImage,
107
+ Ar as Badge,
107
108
  k as Button,
108
- hr as Card,
109
- Pr as CardAction,
110
- Tr as CardContent,
111
- Ir as CardDescription,
112
- vr as CardFooter,
113
- wr as CardHeader,
114
- Rr as CardTitle,
115
- Er as Carousel,
116
- Fr as CarouselContent,
117
- kr as CarouselItem,
118
- Br as CarouselNext,
119
- Lr as CarouselPrevious,
120
- Nr as Checkbox,
121
- wt as Consent,
122
- Rt as ConsentStatus,
123
- It as ContentCreateUserErrorCode,
124
- v as ContentWrapper,
109
+ Tr as Card,
110
+ Ir as CardAction,
111
+ vr as CardContent,
112
+ wr as CardDescription,
113
+ Rr as CardFooter,
114
+ br as CardHeader,
115
+ Er as CardTitle,
116
+ kr as Carousel,
117
+ Br as CarouselContent,
118
+ Lr as CarouselItem,
119
+ Mr as CarouselNext,
120
+ Nr as CarouselPrevious,
121
+ Ur as Checkbox,
122
+ bt as Consent,
123
+ Et as ConsentStatus,
124
+ wt as ContentCreateUserErrorCode,
125
125
  o as DATA_NAVIGATION_TYPE_ATTRIBUTE,
126
- Ur as Dialog,
127
- Gr as DialogClose,
128
- Hr as DialogContent,
129
- Or as DialogDescription,
130
- Vr as DialogFooter,
131
- zr as DialogHeader,
132
- _r as DialogOverlay,
133
- Wr as DialogPortal,
134
- Yr as DialogTitle,
135
- Qr as DialogTrigger,
136
- qr as Drawer,
137
- Jr as DrawerClose,
138
- Kr as DrawerContent,
139
- Xr as DrawerDescription,
140
- Zr as DrawerFooter,
141
- $r as DrawerHeader,
142
- re as DrawerOverlay,
143
- ee as DrawerPortal,
144
- oe as DrawerTitle,
145
- te as DrawerTrigger,
126
+ Hr as Dialog,
127
+ Or as DialogClose,
128
+ Vr as DialogContent,
129
+ zr as DialogDescription,
130
+ _r as DialogFooter,
131
+ Wr as DialogHeader,
132
+ Yr as DialogOverlay,
133
+ Qr as DialogPortal,
134
+ jr as DialogTitle,
135
+ qr as DialogTrigger,
136
+ Kr as Drawer,
137
+ Xr as DrawerClose,
138
+ Zr as DrawerContent,
139
+ $r as DrawerDescription,
140
+ re as DrawerFooter,
141
+ ee as DrawerHeader,
142
+ oe as DrawerOverlay,
143
+ te as DrawerPortal,
144
+ ae as DrawerTitle,
145
+ pe as DrawerTrigger,
146
146
  L as FavoriteButton,
147
147
  N as IconButton,
148
- ie as Input,
149
- le as Label,
150
- _ as List,
148
+ v as ImageContentWrapper,
149
+ le as Input,
150
+ se as Label,
151
+ Y as List,
152
+ V as LongPressDetector,
151
153
  f as MerchantCard,
152
154
  x as MerchantCardPrimitive,
153
155
  g as MerchantCardSkeleton,
154
- nt as MiniEntityNotFoundError,
155
- ft as MiniError,
156
- xt as MiniNetworkError,
157
- i as MinisContainer,
156
+ xt as MiniEntityNotFoundError,
157
+ ut as MiniError,
158
+ ct as MiniNetworkError,
159
+ p as MinisContainer,
158
160
  t as NAVIGATION_TYPES,
159
161
  l as ProductCard,
160
162
  c as ProductCardSkeleton,
161
163
  s as ProductLink,
162
- se as Progress,
164
+ fe as Progress,
163
165
  C as QuantitySelector,
164
- fe as RadioGroup,
165
- xe as RadioGroupItem,
166
- ce as ResizableHandle,
167
- de as ResizablePanel,
168
- ge as ResizablePanelGroup,
169
- Ce as ScrollArea,
170
- De as ScrollBar,
166
+ ue as RadioGroup,
167
+ ce as RadioGroupItem,
168
+ ge as ResizableHandle,
169
+ Se as ResizablePanel,
170
+ Ce as ResizablePanelGroup,
171
+ Ae as ScrollArea,
172
+ Pe as ScrollBar,
171
173
  A as Search,
172
- h as SearchInput,
173
- P as SearchProvider,
174
+ P as SearchInput,
175
+ h as SearchProvider,
174
176
  T as SearchResultsList,
175
- he as Select,
176
- Pe as SelectContent,
177
- Te as SelectGroup,
178
- Ie as SelectItem,
179
- ve as SelectLabel,
180
- we as SelectScrollDownButton,
181
- Re as SelectScrollUpButton,
182
- be as SelectSeparator,
183
- Ee as SelectTrigger,
184
- Fe as SelectValue,
185
- Be as Separator,
186
- Me as Sheet,
187
- Ne as SheetClose,
188
- ye as SheetContent,
189
- Ue as SheetDescription,
190
- Ge as SheetFooter,
191
- He as SheetHeader,
192
- Oe as SheetTitle,
193
- Ve as SheetTrigger,
194
- Ye as Skeleton,
177
+ Te as Select,
178
+ Ie as SelectContent,
179
+ ve as SelectGroup,
180
+ we as SelectItem,
181
+ Re as SelectLabel,
182
+ be as SelectScrollDownButton,
183
+ Ee as SelectScrollUpButton,
184
+ Fe as SelectSeparator,
185
+ ke as SelectTrigger,
186
+ Be as SelectValue,
187
+ Me as Separator,
188
+ ye as Sheet,
189
+ Ue as SheetClose,
190
+ Ge as SheetContent,
191
+ He as SheetDescription,
192
+ Oe as SheetFooter,
193
+ Ve as SheetHeader,
194
+ ze as SheetTitle,
195
+ _e as SheetTrigger,
196
+ je as Skeleton,
195
197
  U as ThumbhashImage,
196
- _e as Toaster,
198
+ Ye as Toaster,
197
199
  H as Touchable,
198
200
  R as TransitionContainer,
199
201
  E as TransitionLink,
200
- Y as VideoPlayer,
201
- Dr as badgeVariants,
202
- dt as extractBrandTheme,
203
- Pt as fileToDataUri,
204
- ut as formatError,
205
- gt as formatReviewCount,
206
- St as getFeaturedImages,
207
- Ct as normalizeRating,
208
- At as parseUrl,
209
- Mo as useAsyncStorage,
210
- so as useBuyerAttributes,
211
- zo as useCloseMini,
212
- rt as useCreateImageContent,
213
- Bo as useCuratedProducts,
214
- io as useCurrentUser,
215
- Wo as useDeeplink,
216
- at as useErrorScreen,
217
- ot as useErrorToast,
218
- eo as useFollowedShops,
219
- to as useFollowedShopsActions,
220
- mt as useImagePicker,
221
- Go as useImageUpload,
222
- Qo as useNavigateWithTransition,
223
- lo as useOrders,
224
- Fo as usePopularProducts,
225
- Co as useProduct,
226
- go as useProductList,
227
- fo as useProductListActions,
228
- uo as useProductLists,
229
- Io as useProductMedia,
230
- wo as useProductSearch,
231
- Po as useProductVariants,
232
- Ao as useProducts,
233
- je as useRecentProducts,
234
- Je as useRecentShops,
235
- bo as useRecommendedProducts,
236
- Zo as useRecommendedShops,
237
- Xe as useSavedProducts,
238
- $e as useSavedProductsActions,
239
- yo as useSecureStorage,
240
- pt as useShare,
241
- qo as useShop,
242
- Ko as useShopCartActions,
243
- Oo as useShopNavigation
202
+ j as VideoPlayer,
203
+ Pr as badgeVariants,
204
+ St as extractBrandTheme,
205
+ It as fileToDataUri,
206
+ dt as formatError,
207
+ Ct as formatReviewCount,
208
+ Dt as getFeaturedImages,
209
+ At as normalizeRating,
210
+ ht as parseUrl,
211
+ yo as useAsyncStorage,
212
+ fo as useBuyerAttributes,
213
+ Wo as useCloseMini,
214
+ ot as useCreateImageContent,
215
+ Mo as useCuratedProducts,
216
+ lo as useCurrentUser,
217
+ Qo as useDeeplink,
218
+ it as useErrorScreen,
219
+ at as useErrorToast,
220
+ to as useFollowedShops,
221
+ po as useFollowedShopsActions,
222
+ nt as useImagePicker,
223
+ Oo as useImageUpload,
224
+ qo as useNavigateWithTransition,
225
+ so as useOrders,
226
+ Bo as usePopularProducts,
227
+ Ao as useProduct,
228
+ Co as useProductList,
229
+ uo as useProductListActions,
230
+ go as useProductLists,
231
+ wo as useProductMedia,
232
+ bo as useProductSearch,
233
+ Io as useProductVariants,
234
+ ho as useProducts,
235
+ Je as useRecentProducts,
236
+ Xe as useRecentShops,
237
+ Fo as useRecommendedProducts,
238
+ rt as useRecommendedShops,
239
+ $e as useSavedProducts,
240
+ eo as useSavedProductsActions,
241
+ Go as useSecureStorage,
242
+ mt as useShare,
243
+ Ko as useShop,
244
+ Zo as useShopCartActions,
245
+ zo as useShopNavigation
244
246
  };
245
247
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import S from "../../../../../../../_virtual/window.js";
2
2
  import B from "../../../../../../../_virtual/document.js";
3
- import il from "../../../../../../../_virtual/index3.js";
3
+ import il from "../../../../../../../_virtual/index2.js";
4
4
  import ao from "../../../../../../../_virtual/browser-index.js";
5
5
  import xe from "../../../../@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js";
6
6
  import Kc from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/resolve-url.js";
@@ -1,4 +1,4 @@
1
- import o from "../_virtual/index2.js";
1
+ import o from "../_virtual/index3.js";
2
2
  const a = (r) => o(r).darken(0.2).isDark();
3
3
  export {
4
4
  a as isDarkColor
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.0.27",
4
+ "version": "0.0.28",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "engines": {
@@ -0,0 +1,25 @@
1
+ import {useShopActions} from '../../internal/useShopActions'
2
+
3
+ import {LongPressDetector} from './long-press-detector'
4
+
5
+ export function ContentMonitor({
6
+ publicId,
7
+ children,
8
+ }: {
9
+ publicId?: string
10
+ children: React.ReactNode
11
+ }) {
12
+ const {showFeedbackSheet} = useShopActions()
13
+
14
+ return (
15
+ <LongPressDetector
16
+ onLongPress={() => {
17
+ if (!publicId) return
18
+
19
+ showFeedbackSheet({publicId})
20
+ }}
21
+ >
22
+ {children}
23
+ </LongPressDetector>
24
+ )
25
+ }
@@ -40,6 +40,7 @@ export function ContentWrapper({
40
40
  }: ContentWrapperProps) {
41
41
  const {content, loading} = useContent({
42
42
  identifiers: [{publicId, externalId}],
43
+ skip: !publicId && !externalId,
43
44
  })
44
45
 
45
46
  const contentItem = content?.[0]
@@ -0,0 +1,52 @@
1
+ import * as React from 'react'
2
+
3
+ import {motion, HTMLMotionProps} from 'motion/react'
4
+
5
+ interface LongPressDetectorProps extends HTMLMotionProps<'div'> {
6
+ onLongPress: () => void
7
+ delay?: number
8
+ children: React.ReactNode
9
+ }
10
+
11
+ export const LongPressDetector = ({
12
+ onLongPress,
13
+ delay = 500,
14
+ children,
15
+ ...motionProps
16
+ }: LongPressDetectorProps) => {
17
+ const longPressTimeoutRef = React.useRef<number | undefined>(undefined)
18
+
19
+ const handleTapStart = React.useCallback(() => {
20
+ longPressTimeoutRef.current = window.setTimeout(() => {
21
+ onLongPress()
22
+ longPressTimeoutRef.current = undefined
23
+ }, delay)
24
+ }, [onLongPress, delay])
25
+
26
+ const handleTapEnd = React.useCallback(() => {
27
+ if (longPressTimeoutRef.current) {
28
+ clearTimeout(longPressTimeoutRef.current)
29
+ longPressTimeoutRef.current = undefined
30
+ }
31
+ }, [])
32
+
33
+ // Cleanup timer on unmount
34
+ React.useEffect(() => {
35
+ return () => {
36
+ if (longPressTimeoutRef.current) {
37
+ clearTimeout(longPressTimeoutRef.current)
38
+ }
39
+ }
40
+ }, [])
41
+
42
+ return (
43
+ <motion.div
44
+ onTapStart={handleTapStart}
45
+ onTap={handleTapEnd}
46
+ onTapCancel={handleTapEnd}
47
+ {...motionProps}
48
+ >
49
+ {children}
50
+ </motion.div>
51
+ )
52
+ }
@@ -0,0 +1,42 @@
1
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
2
+ import {ContentWrapper} from '../atoms/content-wrapper'
3
+
4
+ type ImageContentWrapperProps = (
5
+ | {publicId: string; externalId?: never}
6
+ | {externalId: string; publicId?: never}
7
+ ) & {
8
+ onLoad?: () => void
9
+ width?: number
10
+ height?: number
11
+ className?: string
12
+ Loader?: React.ReactNode | string
13
+ }
14
+
15
+ export function ImageContentWrapper({
16
+ onLoad,
17
+ width,
18
+ height,
19
+ className,
20
+ publicId,
21
+ externalId,
22
+ Loader,
23
+ }: ImageContentWrapperProps) {
24
+ return (
25
+ <ContentWrapper {...(externalId ? {externalId} : {publicId: publicId!})}>
26
+ {({content, loading}) => {
27
+ if (loading) return Loader ? <>{Loader}</> : null
28
+
29
+ return (
30
+ <img
31
+ src={content?.image?.url}
32
+ width={width}
33
+ height={height}
34
+ alt={content?.title}
35
+ onLoad={onLoad}
36
+ className={className}
37
+ />
38
+ )
39
+ }}
40
+ </ContentWrapper>
41
+ )
42
+ }
@@ -8,7 +8,7 @@ export * from './commerce/merchant-card-skeleton'
8
8
  export * from './commerce/quantity-selector'
9
9
  export * from './commerce/search'
10
10
 
11
- export * from './content/content-wrapper'
11
+ export * from './content/image-content-wrapper'
12
12
 
13
13
  export * from './navigation/transition-container'
14
14
  export * from './navigation/transition-link'
@@ -18,6 +18,7 @@ export * from './atoms/favorite-button'
18
18
  export * from './atoms/icon-button'
19
19
  export * from './atoms/thumbhash-image'
20
20
  export * from './atoms/touchable'
21
+ export * from './atoms/long-press-detector'
21
22
  export * from './atoms/alert-dialog'
22
23
  export * from './atoms/list'
23
24
  export * from './atoms/video-player'
@@ -1,17 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { Touchable as t } from "../atoms/touchable.js";
3
- function i({
4
- // publicId,
5
- children: o
6
- }) {
7
- return /* @__PURE__ */ r(
8
- t,
9
- {
10
- children: o
11
- }
12
- );
13
- }
14
- export {
15
- i as ContentMonitor
16
- };
17
- //# sourceMappingURL=content-monitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-monitor.js","sources":["../../../src/components/content/content-monitor.tsx"],"sourcesContent":["// import {useShopActions} from '../../internal/useShopActions'\nimport {Touchable} from '../atoms/touchable'\n\nexport function ContentMonitor({\n // publicId,\n children,\n}: {\n publicId: string\n children: React.ReactNode\n}) {\n // const {showFeedbackSheet} = useShopActions()\n\n return (\n <Touchable\n // TODO: Add long press support to Touchable\n // onLongPress={() => {\n // showFeedbackSheet({publicId})\n // }}\n >\n {children}\n </Touchable>\n )\n}\n"],"names":["ContentMonitor","children","jsx","Touchable"],"mappings":";;AAGO,SAASA,EAAe;AAAA;AAAA,EAE7B,UAAAC;AACF,GAGG;AAIC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MAME,UAAAF;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -1,17 +0,0 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { useContent as p } from "../../hooks/content/useContent.js";
3
- import { ContentMonitor as m } from "./content-monitor.js";
4
- function d({
5
- publicId: r,
6
- externalId: e,
7
- children: o
8
- }) {
9
- const { content: i, loading: t } = p({
10
- identifiers: [{ publicId: r, externalId: e }]
11
- }), n = i?.[0];
12
- return t || !n ? o({ loading: t }) : /* @__PURE__ */ c(m, { publicId: n.publicId, children: o({ content: n, loading: t }) });
13
- }
14
- export {
15
- d as ContentWrapper
16
- };
17
- //# sourceMappingURL=content-wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-wrapper.js","sources":["../../../src/components/content/content-wrapper.tsx"],"sourcesContent":["import {useContent} from '../../hooks/content/useContent'\nimport {Content} from '../../types'\n\nimport {ContentMonitor} from './content-monitor'\n\ninterface BaseContentWrapperProps {\n children: ({\n content,\n loading,\n }: {\n content?: Content\n loading: boolean\n }) => JSX.Element | null\n}\n\ninterface PublicIdContentWrapperProps extends BaseContentWrapperProps {\n publicId: string\n externalId?: never\n}\n\ninterface ExternalIdContentWrapperProps extends BaseContentWrapperProps {\n externalId: string\n publicId?: never\n}\n\ntype ContentWrapperProps =\n | PublicIdContentWrapperProps\n | ExternalIdContentWrapperProps\n\n// It's too messy in the docs to show the complete types here so we show a simplified version\nexport interface ContentWrapperPropsForDocs extends BaseContentWrapperProps {\n publicId?: string\n externalId?: string\n}\n\nexport function ContentWrapper({\n publicId,\n externalId,\n children,\n}: ContentWrapperProps) {\n const {content, loading} = useContent({\n identifiers: [{publicId, externalId}],\n })\n\n const contentItem = content?.[0]\n\n if (loading || !contentItem) {\n return children({loading})\n }\n\n return (\n <ContentMonitor publicId={contentItem.publicId}>\n {children({content: contentItem, loading})}\n </ContentMonitor>\n )\n}\n"],"names":["ContentWrapper","publicId","externalId","children","content","loading","useContent","contentItem","jsx","ContentMonitor"],"mappings":";;;AAmCO,SAASA,EAAe;AAAA,EAC7B,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AACF,GAAwB;AACtB,QAAM,EAAC,SAAAC,GAAS,SAAAC,EAAO,IAAIC,EAAW;AAAA,IACpC,aAAa,CAAC,EAAC,UAAAL,GAAU,YAAAC,EAAW,CAAA;AAAA,EAAA,CACrC,GAEKK,IAAcH,IAAU,CAAC;AAE3B,SAAAC,KAAW,CAACE,IACPJ,EAAS,EAAC,SAAAE,GAAQ,IAIzB,gBAAAG,EAACC,GAAe,EAAA,UAAUF,EAAY,UACnC,UAASJ,EAAA,EAAC,SAASI,GAAa,SAAAF,EAAO,CAAC,EAC3C,CAAA;AAEJ;"}
@@ -1,23 +0,0 @@
1
- // import {useShopActions} from '../../internal/useShopActions'
2
- import {Touchable} from '../atoms/touchable'
3
-
4
- export function ContentMonitor({
5
- // publicId,
6
- children,
7
- }: {
8
- publicId: string
9
- children: React.ReactNode
10
- }) {
11
- // const {showFeedbackSheet} = useShopActions()
12
-
13
- return (
14
- <Touchable
15
- // TODO: Add long press support to Touchable
16
- // onLongPress={() => {
17
- // showFeedbackSheet({publicId})
18
- // }}
19
- >
20
- {children}
21
- </Touchable>
22
- )
23
- }