@shopify/shop-minis-react 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MinisContainer.js +13 -11
- package/dist/components/MinisContainer.js.map +1 -1
- package/dist/components/atoms/list.js +52 -0
- package/dist/components/atoms/list.js.map +1 -0
- package/dist/components/atoms/pagination.js +10 -0
- package/dist/components/atoms/pagination.js.map +1 -0
- package/dist/components/atoms/tracking-pixel.js +32 -0
- package/dist/components/atoms/tracking-pixel.js.map +1 -0
- package/dist/index.js +187 -185
- package/dist/index.js.map +1 -1
- package/dist/internal/useShopActions.js.map +1 -1
- package/dist/internal/useShopActionsDataFetching.js +26 -26
- package/dist/internal/useShopActionsDataFetching.js.map +1 -1
- package/dist/internal/useShopActionsPaginatedDataFetching.js.map +1 -1
- package/dist/mocks.js +267 -0
- package/dist/mocks.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
- package/dist/shop-minis-react/node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-intersection-observer@9.16.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-intersection-observer/dist/index.js +135 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-intersection-observer@9.16.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-intersection-observer/dist/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-window@1.8.11_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-window/dist/index.esm.js +375 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-window@1.8.11_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-window/dist/index.esm.js.map +1 -0
- package/dist/shop-minis-react.css +1 -0
- package/package.json +9 -4
- package/src/components/MinisContainer.tsx +4 -1
- package/src/components/atoms/list.tsx +101 -0
- package/src/components/atoms/pagination.tsx +19 -0
- package/src/components/atoms/tracking-pixel.tsx +40 -0
- package/src/components/index.ts +1 -0
- package/src/index.css +1 -0
- package/src/internal/useShopActions.ts +1 -1
- package/src/internal/useShopActionsDataFetching.ts +6 -7
- package/src/internal/useShopActionsPaginatedDataFetching.ts +3 -6
- package/src/mocks.ts +20 -8
- package/src/stories/List.stories.tsx +68 -0
- package/src/styles/utilities.css +22 -0
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useEffect as l } from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { injectMocks as u } from "../mocks.js";
|
|
4
|
+
import { ImagePickerProvider as f } from "../providers/ImagePickerProvider.js";
|
|
5
|
+
u();
|
|
6
|
+
function S({ children: a }) {
|
|
7
|
+
const [i, t] = m(!1);
|
|
6
8
|
return l(() => {
|
|
7
9
|
const n = () => window.minisSDK ? (t(!0), !0) : !1;
|
|
8
10
|
if (n())
|
|
9
11
|
return;
|
|
10
12
|
const e = (o) => {
|
|
11
|
-
const { type:
|
|
12
|
-
|
|
13
|
+
const { type: c } = JSON.parse(o.data);
|
|
14
|
+
c === "MINIS_SDK_READY" && t(!0);
|
|
13
15
|
};
|
|
14
16
|
window.addEventListener("message", e), document.addEventListener("message", e);
|
|
15
|
-
const
|
|
16
|
-
n() && clearInterval(
|
|
17
|
+
const s = setInterval(() => {
|
|
18
|
+
n() && clearInterval(s);
|
|
17
19
|
}, 100);
|
|
18
20
|
return () => {
|
|
19
|
-
window.removeEventListener("message", e), document.removeEventListener("message", e);
|
|
21
|
+
clearInterval(s), window.removeEventListener("message", e), document.removeEventListener("message", e);
|
|
20
22
|
};
|
|
21
|
-
}, []),
|
|
23
|
+
}, []), i ? /* @__PURE__ */ r(f, { children: a }) : /* @__PURE__ */ r("div", { className: "h-screen bg-gray-50 flex items-center justify-center", children: /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
22
24
|
/* @__PURE__ */ r("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 mx-auto mb-4" }),
|
|
23
25
|
/* @__PURE__ */ r("p", { className: "text-gray-600", children: "Loading..." })
|
|
24
26
|
] }) });
|
|
25
27
|
}
|
|
26
28
|
export {
|
|
27
|
-
|
|
29
|
+
S as MinisContainer
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=MinisContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinisContainer.js","sources":["../../src/components/MinisContainer.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react'\n\nimport {ImagePickerProvider} from '../providers/ImagePickerProvider'\n\nexport function MinisContainer({children}: {children: React.ReactNode}) {\n const [isSDKReady, setIsSDKReady] = useState(false)\n\n useEffect(() => {\n // Function to check if SDK is ready\n const checkSDKReady = () => {\n if (window.minisSDK) {\n setIsSDKReady(true)\n return true\n }\n return false\n }\n\n // Check immediately\n if (checkSDKReady()) {\n return\n }\n\n // If not ready, set up a listener for the MINIS_SDK_READY event\n const handleSDKReady = (event: any) => {\n const {type} = JSON.parse(event.data)\n\n if (type === 'MINIS_SDK_READY') {\n setIsSDKReady(true)\n }\n }\n\n // Listen for the MINIS_SDK_READY event\n window.addEventListener('message', handleSDKReady)\n document.addEventListener('message', handleSDKReady)\n\n // Also poll for SDK availability as a fallback\n const pollInterval = setInterval(() => {\n if (checkSDKReady()) {\n clearInterval(pollInterval)\n }\n }, 100)\n\n // Cleanup\n return () => {\n
|
|
1
|
+
{"version":3,"file":"MinisContainer.js","sources":["../../src/components/MinisContainer.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react'\n\nimport {injectMocks} from '../mocks'\nimport {ImagePickerProvider} from '../providers/ImagePickerProvider'\n\ninjectMocks()\n\nexport function MinisContainer({children}: {children: React.ReactNode}) {\n const [isSDKReady, setIsSDKReady] = useState(false)\n\n useEffect(() => {\n // Function to check if SDK is ready\n const checkSDKReady = () => {\n if (window.minisSDK) {\n setIsSDKReady(true)\n return true\n }\n return false\n }\n\n // Check immediately\n if (checkSDKReady()) {\n return\n }\n\n // If not ready, set up a listener for the MINIS_SDK_READY event\n const handleSDKReady = (event: any) => {\n const {type} = JSON.parse(event.data)\n\n if (type === 'MINIS_SDK_READY') {\n setIsSDKReady(true)\n }\n }\n\n // Listen for the MINIS_SDK_READY event\n window.addEventListener('message', handleSDKReady)\n document.addEventListener('message', handleSDKReady)\n\n // Also poll for SDK availability as a fallback\n const pollInterval = setInterval(() => {\n if (checkSDKReady()) {\n clearInterval(pollInterval)\n }\n }, 100)\n\n // Cleanup\n return () => {\n clearInterval(pollInterval)\n window.removeEventListener('message', handleSDKReady)\n document.removeEventListener('message', handleSDKReady)\n }\n }, [])\n\n // Don't render anything until SDK is ready\n if (!isSDKReady) {\n return (\n <div className=\"h-screen bg-gray-50 flex items-center justify-center\">\n <div className=\"text-center\">\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 mx-auto mb-4\" />\n <p className=\"text-gray-600\">Loading...</p>\n </div>\n </div>\n )\n }\n\n return <ImagePickerProvider>{children}</ImagePickerProvider>\n}\n"],"names":["injectMocks","MinisContainer","children","isSDKReady","setIsSDKReady","useState","useEffect","checkSDKReady","handleSDKReady","event","type","pollInterval","jsx","ImagePickerProvider","jsxs"],"mappings":";;;;AAKAA,EAAY;AAEI,SAAAC,EAAe,EAAC,UAAAC,KAAwC;AACtE,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK;AA8ClD,SA5CAC,EAAU,MAAM;AAEd,UAAMC,IAAgB,MAChB,OAAO,YACTH,EAAc,EAAI,GACX,MAEF;AAIT,QAAIG;AACF;AAII,UAAAC,IAAiB,CAACC,MAAe;AACrC,YAAM,EAAC,MAAAC,EAAI,IAAI,KAAK,MAAMD,EAAM,IAAI;AAEpC,MAAIC,MAAS,qBACXN,EAAc,EAAI;AAAA,IAEtB;AAGO,WAAA,iBAAiB,WAAWI,CAAc,GACxC,SAAA,iBAAiB,WAAWA,CAAc;AAG7C,UAAAG,IAAe,YAAY,MAAM;AACrC,MAAIJ,OACF,cAAcI,CAAY;AAAA,OAE3B,GAAG;AAGN,WAAO,MAAM;AACX,oBAAcA,CAAY,GACnB,OAAA,oBAAoB,WAAWH,CAAc,GAC3C,SAAA,oBAAoB,WAAWA,CAAc;AAAA,IACxD;AAAA,EACF,GAAG,EAAE,GAGAL,IAWE,gBAAAS,EAACC,KAAqB,UAAAX,GAAS,sBATjC,OAAI,EAAA,WAAU,wDACb,UAAC,gBAAAY,EAAA,OAAA,EAAI,WAAU,eACb,UAAA;AAAA,IAAC,gBAAAF,EAAA,OAAA,EAAI,WAAU,4EAA4E,CAAA;AAAA,IAC1F,gBAAAA,EAAA,KAAA,EAAE,WAAU,iBAAgB,UAAU,aAAA,CAAA;AAAA,EAAA,EAAA,CACzC,EACF,CAAA;AAKN;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as f } from "react";
|
|
3
|
+
import { VariableSizeList as V } from "../../shop-minis-react/node_modules/.pnpm/react-window@1.8.11_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-window/dist/index.esm.js";
|
|
4
|
+
import { cn as j } from "../../lib/utils.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { Pagination as C } from "./pagination.js";
|
|
7
|
+
const N = V;
|
|
8
|
+
function q({
|
|
9
|
+
items: r,
|
|
10
|
+
height: p,
|
|
11
|
+
renderItem: l,
|
|
12
|
+
className: m,
|
|
13
|
+
showScrollbar: v = !1,
|
|
14
|
+
header: t,
|
|
15
|
+
headerHeight: n,
|
|
16
|
+
itemSizeForRow: s,
|
|
17
|
+
fetchMore: a,
|
|
18
|
+
overscanCount: b,
|
|
19
|
+
...L
|
|
20
|
+
}) {
|
|
21
|
+
const g = f(
|
|
22
|
+
({ index: i, style: c }) => t && i === 0 ? /* @__PURE__ */ u("div", { style: c, children: [
|
|
23
|
+
t,
|
|
24
|
+
/* @__PURE__ */ o("div", { style: { top: n }, children: l(r[0], 0) })
|
|
25
|
+
] }) : a && i === r.length - 1 ? /* @__PURE__ */ u("div", { style: c, children: [
|
|
26
|
+
l(r[i], i),
|
|
27
|
+
/* @__PURE__ */ o("div", { style: { bottom: 0 }, children: /* @__PURE__ */ o(C, { fetchMore: a }) })
|
|
28
|
+
] }) : /* @__PURE__ */ o("div", { style: c, children: l(r[i], i) }),
|
|
29
|
+
[r, l, t, a, n]
|
|
30
|
+
), z = f(
|
|
31
|
+
(i) => t && i === 0 ? (n || 0) + s(i) : s(i),
|
|
32
|
+
[s, t, n]
|
|
33
|
+
), S = j(v ? void 0 : "no-scrollbars", m);
|
|
34
|
+
return /* @__PURE__ */ o(
|
|
35
|
+
N,
|
|
36
|
+
{
|
|
37
|
+
className: S,
|
|
38
|
+
height: p,
|
|
39
|
+
direction: "vertical",
|
|
40
|
+
width: "100%",
|
|
41
|
+
itemCount: r.length,
|
|
42
|
+
overscanCount: b,
|
|
43
|
+
itemSize: z,
|
|
44
|
+
...L,
|
|
45
|
+
children: g
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
q as List
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sources":["../../../src/components/atoms/list.tsx"],"sourcesContent":["import {ComponentType, useCallback} from 'react'\n\nimport {\n VariableSizeList as _VariableSizeList,\n VariableSizeListProps,\n} from 'react-window'\n\nimport {cn} from '../../lib/utils'\nimport '../../styles/utilities.css'\n\nimport {Pagination} from './pagination'\n\nconst VariableSizeList =\n _VariableSizeList as unknown as ComponentType<VariableSizeListProps>\n\ninterface Props<T = any>\n extends Omit<\n VariableSizeListProps<T>,\n 'children' | 'itemCount' | 'width' | 'itemSize' | 'direction'\n > {\n items: T[]\n renderItem: (item: T, index: number) => React.ReactNode\n itemSizeForRow: (index: number) => number\n showScrollbar?: boolean\n header?: React.ReactNode\n headerHeight?: number\n fetchMore?: () => void\n}\n\nexport function List<T = any>({\n items,\n height,\n renderItem,\n className,\n showScrollbar = false,\n header,\n headerHeight,\n itemSizeForRow,\n fetchMore,\n overscanCount,\n ...listProps\n}: Props<T>) {\n const rowRenderer = useCallback(\n ({index, style}: {index: number; style: React.CSSProperties}) => {\n // prepend the header to the first row if it exists\n if (header && index === 0) {\n return (\n <div style={style}>\n {header}\n <div style={{top: headerHeight}}>{renderItem(items[0], 0)}</div>\n </div>\n )\n }\n\n // append the pagination spinner to the last row if fetchMore exists\n if (fetchMore && index === items.length - 1) {\n return (\n <div style={style}>\n {renderItem(items[index], index)}\n <div style={{bottom: 0}}>\n <Pagination fetchMore={fetchMore} />\n </div>\n </div>\n )\n }\n\n return <div style={style}>{renderItem(items[index], index)}</div>\n },\n [items, renderItem, header, fetchMore, headerHeight]\n )\n\n const getItemSize = useCallback(\n (index: number) => {\n // include the header height in the first row height\n if (header && index === 0) {\n const _headerHeight = headerHeight || 0\n return _headerHeight + itemSizeForRow(index)\n }\n\n return itemSizeForRow(index)\n },\n [itemSizeForRow, header, headerHeight]\n )\n\n const classNames = cn(showScrollbar ? undefined : 'no-scrollbars', className)\n\n return (\n <VariableSizeList\n className={classNames}\n height={height}\n direction=\"vertical\"\n width=\"100%\"\n itemCount={items.length}\n overscanCount={overscanCount}\n itemSize={getItemSize}\n {...listProps}\n >\n {rowRenderer}\n </VariableSizeList>\n )\n}\n"],"names":["VariableSizeList","_VariableSizeList","List","items","height","renderItem","className","showScrollbar","header","headerHeight","itemSizeForRow","fetchMore","overscanCount","listProps","rowRenderer","useCallback","index","style","jsxs","jsx","Pagination","getItemSize","classNames","cn"],"mappings":";;;;;;AAYA,MAAMA,IACJC;AAgBK,SAASC,EAAc;AAAA,EAC5B,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,GAAa;AACX,QAAMC,IAAcC;AAAA,IAClB,CAAC,EAAC,OAAAC,GAAO,OAAAC,QAEHT,KAAUQ,MAAU,IAEpB,gBAAAE,EAAC,SAAI,OAAAD,GACF,UAAA;AAAA,MAAAT;AAAA,MACA,gBAAAW,EAAA,OAAA,EAAI,OAAO,EAAC,KAAKV,EAAA,GAAgB,UAAAJ,EAAWF,EAAM,CAAC,GAAG,CAAC,EAAE,CAAA;AAAA,IAAA,GAC5D,IAKAQ,KAAaK,MAAUb,EAAM,SAAS,IAEtC,gBAAAe,EAAC,SAAI,OAAAD,GACF,UAAA;AAAA,MAAWZ,EAAAF,EAAMa,CAAK,GAAGA,CAAK;AAAA,MAC/B,gBAAAG,EAAC,OAAI,EAAA,OAAO,EAAC,QAAQ,KACnB,UAAA,gBAAAA,EAACC,GAAW,EAAA,WAAAT,EAAsB,CAAA,EACpC,CAAA;AAAA,IAAA,GACF,IAIG,gBAAAQ,EAAC,SAAI,OAAAF,GAAe,UAAAZ,EAAWF,EAAMa,CAAK,GAAGA,CAAK,GAAE;AAAA,IAE7D,CAACb,GAAOE,GAAYG,GAAQG,GAAWF,CAAY;AAAA,EACrD,GAEMY,IAAcN;AAAA,IAClB,CAACC,MAEKR,KAAUQ,MAAU,KACAP,KAAgB,KACfC,EAAeM,CAAK,IAGtCN,EAAeM,CAAK;AAAA,IAE7B,CAACN,GAAgBF,GAAQC,CAAY;AAAA,EACvC,GAEMa,IAAaC,EAAGhB,IAAgB,SAAY,iBAAiBD,CAAS;AAG1E,SAAA,gBAAAa;AAAA,IAACnB;AAAA,IAAA;AAAA,MACC,WAAWsB;AAAA,MACX,QAAAlB;AAAA,MACA,WAAU;AAAA,MACV,OAAM;AAAA,MACN,WAAWD,EAAM;AAAA,MACjB,eAAAS;AAAA,MACA,UAAUS;AAAA,MACT,GAAGR;AAAA,MAEH,UAAAC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton as e } from "../ui/skeleton.js";
|
|
3
|
+
import { TrackingPixel as i } from "./tracking-pixel.js";
|
|
4
|
+
function c({ loadingComponent: r, fetchMore: n }) {
|
|
5
|
+
return /* @__PURE__ */ o(i, { onImpression: n, children: r ?? /* @__PURE__ */ o(e, { className: "h-10 w-full p-8" }) });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
c as Pagination
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../../src/components/atoms/pagination.tsx"],"sourcesContent":["import {Skeleton} from '../ui/skeleton'\n\nimport {TrackingPixel} from './tracking-pixel'\n\ninterface Props {\n loadingComponent?: React.ReactNode\n isFetchingMore?: boolean\n fetchMore: () => void\n}\n\nexport function Pagination({loadingComponent, fetchMore}: Props) {\n const loadingPlaceholder = loadingComponent ?? (\n <Skeleton className=\"h-10 w-full p-8\" />\n )\n\n return (\n <TrackingPixel onImpression={fetchMore}>{loadingPlaceholder}</TrackingPixel>\n )\n}\n"],"names":["Pagination","loadingComponent","fetchMore","jsx","TrackingPixel","Skeleton"],"mappings":";;;AAUO,SAASA,EAAW,EAAC,kBAAAC,GAAkB,WAAAC,KAAmB;AAK/D,SACG,gBAAAC,EAAAC,GAAA,EAAc,cAAcF,GAAY,UALhBD,KACxB,gBAAAE,EAAAE,GAAA,EAAS,WAAU,mBAAkB,GAIsB;AAEhE;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as n } from "react";
|
|
3
|
+
import { InView as c } from "../../shop-minis-react/node_modules/.pnpm/react-intersection-observer@9.16.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-intersection-observer/dist/index.js";
|
|
4
|
+
const x = ({
|
|
5
|
+
children: o,
|
|
6
|
+
onImpression: r,
|
|
7
|
+
triggerOnce: i = !1,
|
|
8
|
+
threshold: t,
|
|
9
|
+
className: a
|
|
10
|
+
}) => {
|
|
11
|
+
const e = n(
|
|
12
|
+
(f) => {
|
|
13
|
+
f && r?.();
|
|
14
|
+
},
|
|
15
|
+
[r]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ m(
|
|
18
|
+
c,
|
|
19
|
+
{
|
|
20
|
+
as: "div",
|
|
21
|
+
onChange: e,
|
|
22
|
+
triggerOnce: i,
|
|
23
|
+
className: a,
|
|
24
|
+
threshold: t,
|
|
25
|
+
children: o
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
x as TrackingPixel
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=tracking-pixel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking-pixel.js","sources":["../../../src/components/atoms/tracking-pixel.tsx"],"sourcesContent":["import {useCallback} from 'react'\n\nimport {InView} from 'react-intersection-observer'\n\ninterface Props {\n children: React.ReactNode\n onImpression?: () => void\n triggerOnce?: boolean\n threshold?: number\n className?: string\n}\n\nexport const TrackingPixel = ({\n children,\n onImpression,\n triggerOnce = false,\n threshold,\n className,\n}: Props) => {\n const onChange = useCallback(\n (inView: boolean) => {\n if (inView) {\n onImpression?.()\n }\n },\n [onImpression]\n )\n\n return (\n <InView\n as=\"div\"\n onChange={onChange}\n triggerOnce={triggerOnce}\n className={className}\n threshold={threshold}\n >\n {children}\n </InView>\n )\n}\n"],"names":["TrackingPixel","children","onImpression","triggerOnce","threshold","className","onChange","useCallback","inView","jsx","InView"],"mappings":";;;AAYO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,WAAAC;AACF,MAAa;AACX,QAAMC,IAAWC;AAAA,IACf,CAACC,MAAoB;AACnB,MAAIA,KACaN,IAAA;AAAA,IAEnB;AAAA,IACA,CAACA,CAAY;AAAA,EACf;AAGE,SAAA,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,UAAAJ;AAAA,MACA,aAAAH;AAAA,MACA,WAAAE;AAAA,MACA,WAAAD;AAAA,MAEC,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 i } from "./components/MinisContainer.js";
|
|
3
3
|
import { ProductCard as p } from "./components/commerce/product-card.js";
|
|
4
4
|
import { ProductLink as m } from "./components/commerce/product-link.js";
|
|
5
5
|
import { MerchantCard as u, MerchantCardPrimitive as x } from "./components/commerce/merchant-card.js";
|
|
@@ -13,206 +13,208 @@ import { IconButton as v } from "./components/atoms/icon-button.js";
|
|
|
13
13
|
import { ThumbhashImage as k } from "./components/atoms/thumbhash-image.js";
|
|
14
14
|
import { Touchable as F } from "./components/atoms/touchable.js";
|
|
15
15
|
import { AlertDialogAtom as M } from "./components/atoms/alert-dialog.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
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 {
|
|
16
|
+
import { List as B } from "./components/atoms/list.js";
|
|
17
|
+
import { Accordion as y, AccordionContent as G, AccordionItem as H, AccordionTrigger as O } from "./components/ui/accordion.js";
|
|
18
|
+
import { Alert as V, AlertDescription as _, AlertTitle as z } from "./components/ui/alert.js";
|
|
19
|
+
import { AlertDialog as W, AlertDialogAction as j, AlertDialogCancel as q, AlertDialogContent as J, AlertDialogDescription as K, AlertDialogFooter as Q, AlertDialogHeader as X, AlertDialogOverlay as Z, AlertDialogPortal as $, AlertDialogTitle as rr, AlertDialogTrigger as er } from "./components/ui/alert-dialog.js";
|
|
20
|
+
import { Avatar as tr, AvatarFallback as ar, AvatarImage as ir } from "./components/ui/avatar.js";
|
|
21
|
+
import { Card as pr, CardAction as sr, CardContent as mr, CardDescription as nr, CardFooter as ur, CardHeader as xr, CardTitle as fr } from "./components/ui/card.js";
|
|
22
|
+
import { Carousel as dr, CarouselContent as Sr, CarouselItem as gr, CarouselNext as Dr, CarouselPrevious as Ar } from "./components/ui/carousel.js";
|
|
23
|
+
import { Checkbox as Pr } from "./components/ui/checkbox.js";
|
|
24
|
+
import { Dialog as hr, DialogClose as Ir, DialogContent as wr, DialogDescription as vr, DialogFooter as br, DialogHeader as kr, DialogOverlay as Er, DialogPortal as Fr, DialogTitle as Rr, DialogTrigger as Mr } from "./components/ui/dialog.js";
|
|
25
|
+
import { Drawer as Br, DrawerClose as Lr, DrawerContent as yr, DrawerDescription as Gr, DrawerFooter as Hr, DrawerHeader as Or, DrawerOverlay as Ur, DrawerPortal as Vr, DrawerTitle as _r, DrawerTrigger as zr } from "./components/ui/drawer.js";
|
|
26
|
+
import { Input as Wr } from "./components/ui/input.js";
|
|
27
|
+
import { Label as qr } from "./components/ui/label.js";
|
|
28
|
+
import { Progress as Kr } from "./components/ui/progress.js";
|
|
29
|
+
import { RadioGroup as Xr, RadioGroupItem as Zr } from "./components/ui/radio-group.js";
|
|
30
|
+
import { ResizableHandle as re, ResizablePanel as ee, ResizablePanelGroup as oe } from "./components/ui/resizable.js";
|
|
31
|
+
import { ScrollArea as ae, ScrollBar as ie } from "./components/ui/scroll-area.js";
|
|
32
|
+
import { Select as pe, SelectContent as se, SelectGroup as me, SelectItem as ne, SelectLabel as ue, SelectScrollDownButton as xe, SelectScrollUpButton as fe, SelectSeparator as ce, SelectTrigger as de, SelectValue as Se } from "./components/ui/select.js";
|
|
33
|
+
import { Separator as De } from "./components/ui/separator.js";
|
|
34
|
+
import { Sheet as Ce, SheetClose as Pe, SheetContent as Te, SheetDescription as he, SheetFooter as Ie, SheetHeader as we, SheetTitle as ve, SheetTrigger as be } from "./components/ui/sheet.js";
|
|
35
|
+
import { Toaster as Ee } from "./components/ui/sonner.js";
|
|
36
|
+
import { Skeleton as Re } from "./components/ui/skeleton.js";
|
|
37
|
+
import { useRecentProducts as Ne } from "./hooks/user/useRecentProducts.js";
|
|
38
|
+
import { useRecentShops as Le } from "./hooks/user/useRecentShops.js";
|
|
39
|
+
import { useSavedProducts as Ge } from "./hooks/user/useSavedProducts.js";
|
|
40
|
+
import { useSavedProductsActions as Oe } from "./hooks/user/useSavedProductsActions.js";
|
|
41
|
+
import { useFollowedShops as Ve } from "./hooks/user/useFollowedShops.js";
|
|
42
|
+
import { useFollowedShopsActions as ze } from "./hooks/user/useFollowedShopsActions.js";
|
|
43
|
+
import { useCurrentUser as We } from "./hooks/user/useCurrentUser.js";
|
|
44
|
+
import { useOrders as qe } from "./hooks/user/useOrders.js";
|
|
45
|
+
import { useBuyerAttributes as Ke } from "./hooks/user/useBuyerAttributes.js";
|
|
46
|
+
import { useProductListActions as Xe } from "./hooks/product/useProductListActions.js";
|
|
47
|
+
import { useProductLists as $e } from "./hooks/product/useProductLists.js";
|
|
48
|
+
import { useProductList as eo } from "./hooks/product/useProductList.js";
|
|
49
|
+
import { useProduct as to } from "./hooks/product/useProduct.js";
|
|
50
|
+
import { useProducts as io } from "./hooks/product/useProducts.js";
|
|
51
|
+
import { useProductVariants as po } from "./hooks/product/useProductVariants.js";
|
|
52
|
+
import { useProductMedia as mo } from "./hooks/product/useProductMedia.js";
|
|
53
|
+
import { useProductSearch as uo } from "./hooks/product/useProductSearch.js";
|
|
54
|
+
import { useRecommendedProducts as fo } from "./hooks/product/useRecommendedProducts.js";
|
|
55
|
+
import { usePopularProducts as So } from "./hooks/product/usePopularProducts.js";
|
|
56
|
+
import { useCuratedProducts as Do } from "./hooks/product/useCuratedProducts.js";
|
|
57
|
+
import { useAsyncStorage as Co } from "./hooks/storage/useAsyncStorage.js";
|
|
58
|
+
import { useSecureStorage as To } from "./hooks/storage/useSecureStorage.js";
|
|
59
|
+
import { useImageUpload as Io } from "./hooks/storage/useImageUpload.js";
|
|
60
|
+
import { useShopNavigation as vo } from "./hooks/navigation/useShopNavigation.js";
|
|
61
|
+
import { useCloseMini as ko } from "./hooks/navigation/useCloseMini.js";
|
|
62
|
+
import { useDeeplink as Fo } from "./hooks/navigation/useDeeplink.js";
|
|
63
|
+
import { useNavigateWithTransition as Mo } from "./hooks/navigation/useNavigateWithTransition.js";
|
|
64
|
+
import { useShop as Bo } from "./hooks/shop/useShop.js";
|
|
65
|
+
import { useShopCartActions as yo } from "./hooks/shop/useShopCartActions.js";
|
|
66
|
+
import { useRecommendedShops as Ho } from "./hooks/shop/useRecommendedShops.js";
|
|
67
|
+
import { useErrorToast as Uo } from "./hooks/util/useErrorToast.js";
|
|
68
|
+
import { useErrorScreen as _o } from "./hooks/util/useErrorScreen.js";
|
|
69
|
+
import { useShare as Yo } from "./hooks/util/useShare.js";
|
|
70
|
+
import { useImagePicker as jo } from "./hooks/util/useImagePicker.js";
|
|
71
|
+
import { MiniEntityNotFoundError as Jo, MiniError as Ko, MiniNetworkError as Qo, formatError as Xo } from "./utils/errors.js";
|
|
72
|
+
import { parseUrl as $o } from "./utils/parseUrl.js";
|
|
73
|
+
import { Consent as et, ConsentStatus as ot } from "./shop-minis-platform/src/types/permissions.js";
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
y as Accordion,
|
|
76
|
+
G as AccordionContent,
|
|
77
|
+
H as AccordionItem,
|
|
78
|
+
O as AccordionTrigger,
|
|
79
|
+
V as Alert,
|
|
80
|
+
_ as AlertDescription,
|
|
81
|
+
W as AlertDialog,
|
|
82
|
+
j as AlertDialogAction,
|
|
82
83
|
M as AlertDialogAtom,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
q as AlertDialogCancel,
|
|
85
|
+
J as AlertDialogContent,
|
|
86
|
+
K as AlertDialogDescription,
|
|
87
|
+
Q as AlertDialogFooter,
|
|
88
|
+
X as AlertDialogHeader,
|
|
89
|
+
Z as AlertDialogOverlay,
|
|
90
|
+
$ as AlertDialogPortal,
|
|
91
|
+
rr as AlertDialogTitle,
|
|
92
|
+
er as AlertDialogTrigger,
|
|
93
|
+
z as AlertTitle,
|
|
94
|
+
tr as Avatar,
|
|
95
|
+
ar as AvatarFallback,
|
|
96
|
+
ir as AvatarImage,
|
|
96
97
|
T as Button,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
98
|
+
pr as Card,
|
|
99
|
+
sr as CardAction,
|
|
100
|
+
mr as CardContent,
|
|
101
|
+
nr as CardDescription,
|
|
102
|
+
ur as CardFooter,
|
|
103
|
+
xr as CardHeader,
|
|
104
|
+
fr as CardTitle,
|
|
105
|
+
dr as Carousel,
|
|
106
|
+
Sr as CarouselContent,
|
|
107
|
+
gr as CarouselItem,
|
|
108
|
+
Dr as CarouselNext,
|
|
109
|
+
Ar as CarouselPrevious,
|
|
110
|
+
Pr as Checkbox,
|
|
111
|
+
et as Consent,
|
|
112
|
+
ot as ConsentStatus,
|
|
112
113
|
o as DATA_NAVIGATION_TYPE_ATTRIBUTE,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
hr as Dialog,
|
|
115
|
+
Ir as DialogClose,
|
|
116
|
+
wr as DialogContent,
|
|
117
|
+
vr as DialogDescription,
|
|
118
|
+
br as DialogFooter,
|
|
119
|
+
kr as DialogHeader,
|
|
120
|
+
Er as DialogOverlay,
|
|
121
|
+
Fr as DialogPortal,
|
|
122
|
+
Rr as DialogTitle,
|
|
123
|
+
Mr as DialogTrigger,
|
|
124
|
+
Br as Drawer,
|
|
125
|
+
Lr as DrawerClose,
|
|
126
|
+
yr as DrawerContent,
|
|
127
|
+
Gr as DrawerDescription,
|
|
128
|
+
Hr as DrawerFooter,
|
|
129
|
+
Or as DrawerHeader,
|
|
130
|
+
Ur as DrawerOverlay,
|
|
131
|
+
Vr as DrawerPortal,
|
|
132
|
+
_r as DrawerTitle,
|
|
133
|
+
zr as DrawerTrigger,
|
|
133
134
|
I as FavoriteButton,
|
|
134
135
|
v as IconButton,
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
Wr as Input,
|
|
137
|
+
qr as Label,
|
|
138
|
+
B as List,
|
|
137
139
|
u as MerchantCard,
|
|
138
140
|
x as MerchantCardPrimitive,
|
|
139
141
|
S as MerchantCardSkeleton,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
Jo as MiniEntityNotFoundError,
|
|
143
|
+
Ko as MiniError,
|
|
144
|
+
Qo as MiniNetworkError,
|
|
145
|
+
i as MinisContainer,
|
|
144
146
|
t as NAVIGATION_TYPES,
|
|
145
147
|
p as ProductCard,
|
|
146
148
|
c as ProductCardSkeleton,
|
|
147
149
|
m as ProductLink,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
150
|
+
Kr as Progress,
|
|
151
|
+
Xr as RadioGroup,
|
|
152
|
+
Zr as RadioGroupItem,
|
|
153
|
+
re as ResizableHandle,
|
|
154
|
+
ee as ResizablePanel,
|
|
155
|
+
oe as ResizablePanelGroup,
|
|
156
|
+
ae as ScrollArea,
|
|
157
|
+
ie as ScrollBar,
|
|
158
|
+
pe as Select,
|
|
159
|
+
se as SelectContent,
|
|
160
|
+
me as SelectGroup,
|
|
161
|
+
ne as SelectItem,
|
|
162
|
+
ue as SelectLabel,
|
|
163
|
+
xe as SelectScrollDownButton,
|
|
164
|
+
fe as SelectScrollUpButton,
|
|
165
|
+
ce as SelectSeparator,
|
|
166
|
+
de as SelectTrigger,
|
|
167
|
+
Se as SelectValue,
|
|
168
|
+
De as Separator,
|
|
169
|
+
Ce as Sheet,
|
|
170
|
+
Pe as SheetClose,
|
|
171
|
+
Te as SheetContent,
|
|
172
|
+
he as SheetDescription,
|
|
173
|
+
Ie as SheetFooter,
|
|
174
|
+
we as SheetHeader,
|
|
175
|
+
ve as SheetTitle,
|
|
176
|
+
be as SheetTrigger,
|
|
177
|
+
Re as Skeleton,
|
|
176
178
|
k as ThumbhashImage,
|
|
177
|
-
|
|
179
|
+
Ee as Toaster,
|
|
178
180
|
F as Touchable,
|
|
179
181
|
D as TransitionContainer,
|
|
180
182
|
C as TransitionLink,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
183
|
+
Xo as formatError,
|
|
184
|
+
$o as parseUrl,
|
|
185
|
+
Co as useAsyncStorage,
|
|
186
|
+
Ke as useBuyerAttributes,
|
|
187
|
+
ko as useCloseMini,
|
|
188
|
+
Do as useCuratedProducts,
|
|
189
|
+
We as useCurrentUser,
|
|
190
|
+
Fo as useDeeplink,
|
|
191
|
+
_o as useErrorScreen,
|
|
192
|
+
Uo as useErrorToast,
|
|
193
|
+
Ve as useFollowedShops,
|
|
194
|
+
ze as useFollowedShopsActions,
|
|
195
|
+
jo as useImagePicker,
|
|
196
|
+
Io as useImageUpload,
|
|
197
|
+
Mo as useNavigateWithTransition,
|
|
198
|
+
qe as useOrders,
|
|
199
|
+
So as usePopularProducts,
|
|
200
|
+
to as useProduct,
|
|
201
|
+
eo as useProductList,
|
|
202
|
+
Xe as useProductListActions,
|
|
203
|
+
$e as useProductLists,
|
|
204
|
+
mo as useProductMedia,
|
|
205
|
+
uo as useProductSearch,
|
|
206
|
+
po as useProductVariants,
|
|
207
|
+
io as useProducts,
|
|
208
|
+
Ne as useRecentProducts,
|
|
209
|
+
Le as useRecentShops,
|
|
210
|
+
fo as useRecommendedProducts,
|
|
211
|
+
Ho as useRecommendedShops,
|
|
212
|
+
Ge as useSavedProducts,
|
|
213
|
+
Oe as useSavedProductsActions,
|
|
214
|
+
To as useSecureStorage,
|
|
215
|
+
Yo as useShare,
|
|
216
|
+
Bo as useShop,
|
|
217
|
+
yo as useShopCartActions,
|
|
218
|
+
vo as useShopNavigation
|
|
217
219
|
};
|
|
218
220
|
//# 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShopActions.js","sources":["../../src/internal/useShopActions.ts"],"sourcesContent":["import {ShopActions} from '
|
|
1
|
+
{"version":3,"file":"useShopActions.js","sources":["../../src/internal/useShopActions.ts"],"sourcesContent":["import {ShopActions} from '@shopify/shop-minis-platform/actions'\n\nexport function useShopActions(): ShopActions {\n return window.minisSDK\n}\n"],"names":["useShopActions"],"mappings":"AAEO,SAASA,IAA8B;AAC5C,SAAO,OAAO;AAChB;"}
|