@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.
- package/dist/_virtual/index2.js +4 -4
- package/dist/_virtual/index3.js +4 -4
- package/dist/components/atoms/content-monitor.js +22 -0
- package/dist/components/atoms/content-monitor.js.map +1 -0
- package/dist/components/atoms/content-wrapper.js +18 -0
- package/dist/components/atoms/content-wrapper.js.map +1 -0
- package/dist/components/atoms/long-press-detector.js +33 -0
- package/dist/components/atoms/long-press-detector.js.map +1 -0
- package/dist/components/content/image-content-wrapper.js +27 -0
- package/dist/components/content/image-content-wrapper.js.map +1 -0
- package/dist/index.js +212 -210
- package/dist/index.js.map +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/package.json +1 -1
- package/src/components/atoms/content-monitor.tsx +25 -0
- package/src/components/{content → atoms}/content-wrapper.tsx +1 -0
- package/src/components/atoms/long-press-detector.tsx +52 -0
- package/src/components/content/image-content-wrapper.tsx +42 -0
- package/src/components/index.ts +2 -1
- package/dist/components/content/content-monitor.js +0 -17
- package/dist/components/content/content-monitor.js.map +0 -1
- package/dist/components/content/content-wrapper.js +0 -17
- package/dist/components/content/content-wrapper.js.map +0 -1
- package/src/components/content/content-monitor.tsx +0 -23
package/dist/_virtual/index2.js
CHANGED
|
@@ -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
|
|
3
|
-
var t =
|
|
4
|
-
const
|
|
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
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index2.js.map
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -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
|
|
3
|
-
var t = o();
|
|
4
|
-
const
|
|
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
|
-
|
|
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
|
|
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
|
|
10
|
-
import {
|
|
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 {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
149
|
-
le as
|
|
150
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
164
|
+
fe as Progress,
|
|
163
165
|
C as QuantitySelector,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
173
|
-
|
|
174
|
+
P as SearchInput,
|
|
175
|
+
h as SearchProvider,
|
|
174
176
|
T as SearchResultsList,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
198
|
+
Ye as Toaster,
|
|
197
199
|
H as Touchable,
|
|
198
200
|
R as TransitionContainer,
|
|
199
201
|
E as TransitionLink,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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/
|
|
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";
|
package/dist/utils/colors.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -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
|
-
}
|