@shopify/shop-minis-react 0.0.20 → 0.0.22
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/___vite-browser-external.js +7 -0
- package/dist/_virtual/___vite-browser-external.js.map +1 -0
- package/dist/_virtual/__vite-browser-external.js +5 -0
- package/dist/_virtual/__vite-browser-external.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +24 -4
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/browser-index.js +8 -0
- package/dist/_virtual/browser-index.js.map +1 -0
- package/dist/_virtual/browser-index2.js +5 -0
- package/dist/_virtual/browser-index2.js.map +1 -0
- package/dist/_virtual/clock.js +6 -0
- package/dist/_virtual/clock.js.map +1 -0
- package/dist/_virtual/conventions.js +5 -0
- package/dist/_virtual/conventions.js.map +1 -0
- package/dist/_virtual/document.js +8 -0
- package/dist/_virtual/document.js.map +1 -0
- package/dist/_virtual/dom-parser.js +5 -0
- package/dist/_virtual/dom-parser.js.map +1 -0
- package/dist/_virtual/dom.js +5 -0
- package/dist/_virtual/dom.js.map +1 -0
- package/dist/_virtual/entities.js +5 -0
- package/dist/_virtual/entities.js.map +1 -0
- package/dist/_virtual/extends.js +5 -0
- package/dist/_virtual/extends.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index2.js +5 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +5 -3
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index5.js +6 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +6 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/parse-sidx.js +8 -0
- package/dist/_virtual/parse-sidx.js.map +1 -0
- package/dist/_virtual/sax.js +5 -0
- package/dist/_virtual/sax.js.map +1 -0
- package/dist/_virtual/window.js +8 -0
- package/dist/_virtual/window.js.map +1 -0
- package/dist/components/atoms/video-player.js +121 -0
- package/dist/components/atoms/video-player.js.map +1 -0
- package/dist/components/commerce/merchant-card.js +236 -106
- package/dist/components/commerce/merchant-card.js.map +1 -1
- package/dist/hooks/storage/useImageUpload.js.map +1 -1
- package/dist/hooks/util/useErrorScreen.js.map +1 -1
- package/dist/hooks/util/useErrorToast.js.map +1 -1
- package/dist/index.js +205 -195
- package/dist/index.js.map +1 -1
- package/dist/mocks.js +114 -87
- package/dist/mocks.js.map +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js +20 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/byte-helpers.js +79 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/byte-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/codecs.js +102 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/codecs.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/containers.js +149 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/containers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/ebml-helpers.js +77 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/ebml-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/id3-helpers.js +15 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/id3-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-groups.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-groups.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-types.js +7 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-types.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/mp4-helpers.js +31 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/mp4-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/nal-helpers.js +39 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/nal-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/resolve-url.js +14 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/resolve-url.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/stream.js +33 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/stream.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/http-handler.js +42 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/http-handler.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js +169 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/interceptors.js +75 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/interceptors.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/retry.js +70 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/retry.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js +124 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom-parser.js +151 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom-parser.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom.js +993 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/entities.js +2146 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/entities.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js +14 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/sax.js +346 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/sax.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +308 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +41 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +53 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +157 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js +103 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js +269 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/document.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/document.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/window.js +12 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/window.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js +10 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js +18 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/m3u8-parser@7.2.0/node_modules/m3u8-parser/dist/m3u8-parser.es.js +855 -0
- package/dist/shop-minis-react/node_modules/.pnpm/m3u8-parser@7.2.0/node_modules/m3u8-parser/dist/m3u8-parser.es.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js +1102 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/tools/parse-sidx.js +32 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/tools/parse-sidx.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/clock.js +34 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/clock.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/numbers.js +17 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/numbers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js +23 -0
- package/dist/shop-minis-react/node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js +27824 -0
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/browser-index.js +26 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/browser-index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vtt.js +802 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vtt.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttcue.js +188 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttcue.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttregion.js +104 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttregion.js.map +1 -0
- package/dist/shop-minis-react.css +1 -1
- package/dist/utils/colors.js +6 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/merchant-card.js +44 -0
- package/dist/utils/merchant-card.js.map +1 -0
- package/package.json +6 -2
- package/src/components/atoms/video-player.tsx +213 -0
- package/src/components/commerce/merchant-card.tsx +219 -49
- package/src/components/index.ts +2 -0
- package/src/hooks/storage/useImageUpload.ts +3 -2
- package/src/hooks/util/useErrorScreen.ts +2 -1
- package/src/hooks/util/useErrorToast.ts +2 -1
- package/src/mocks.ts +148 -16
- package/src/stories/MerchantCard.stories.tsx +63 -9
- package/src/utils/colors.ts +5 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/merchant-card.ts +99 -0
- package/src/hooks/navigation/useCloseMini.doc.ts +0 -32
- package/src/hooks/navigation/useCloseMini.example.tsx +0 -7
- package/src/hooks/navigation/useDeeplink.doc.ts +0 -32
- package/src/hooks/navigation/useDeeplink.example.tsx +0 -7
- package/src/hooks/navigation/useShopNavigation.doc.ts +0 -32
- package/src/hooks/navigation/useShopNavigation.example.tsx +0 -29
- package/src/hooks/product/useCuratedProducts.doc.ts +0 -32
- package/src/hooks/product/useCuratedProducts.example.tsx +0 -10
- package/src/hooks/product/useProductList.doc.ts +0 -32
- package/src/hooks/product/useProductList.example.tsx +0 -9
- package/src/hooks/product/useProductListActions.doc.ts +0 -32
- package/src/hooks/product/useProductListActions.example.tsx +0 -57
- package/src/hooks/product/useProductLists.doc.ts +0 -32
- package/src/hooks/product/useProductLists.example.tsx +0 -9
- package/src/hooks/product/useProductSearch.doc.ts +0 -32
- package/src/hooks/product/useProductSearch.example.tsx +0 -13
- package/src/hooks/product/useRecommendedProducts.doc.ts +0 -32
- package/src/hooks/product/useRecommendedProducts.example.tsx +0 -7
- package/src/hooks/shop/useRecommendedShops.doc.ts +0 -32
- package/src/hooks/shop/useRecommendedShops.example.tsx +0 -7
- package/src/hooks/shop/useShop.doc.ts +0 -31
- package/src/hooks/shop/useShop.example.tsx +0 -7
- package/src/hooks/shop/useShopCartActions.doc.ts +0 -32
- package/src/hooks/shop/useShopCartActions.example.tsx +0 -28
- package/src/hooks/storage/useAsyncStorage.doc.ts +0 -32
- package/src/hooks/storage/useAsyncStorage.example.tsx +0 -30
- package/src/hooks/storage/useImageUpload.doc.ts +0 -32
- package/src/hooks/storage/useImageUpload.example.tsx +0 -20
- package/src/hooks/storage/useSecureStorage.doc.ts +0 -32
- package/src/hooks/storage/useSecureStorage.example.tsx +0 -23
- package/src/hooks/user/useBuyerAttributes.doc.ts +0 -32
- package/src/hooks/user/useBuyerAttributes.example.tsx +0 -14
- package/src/hooks/user/useCurrentUser.doc.ts +0 -31
- package/src/hooks/user/useCurrentUser.example.tsx +0 -7
- package/src/hooks/user/useFollowedShopsActions.doc.ts +0 -32
- package/src/hooks/user/useFollowedShopsActions.example.tsx +0 -18
- package/src/hooks/user/useOrders.doc.ts +0 -32
- package/src/hooks/user/useOrders.example.tsx +0 -7
- package/src/hooks/user/useRecentProducts.doc.ts +0 -32
- package/src/hooks/user/useRecentProducts.example.tsx +0 -13
- package/src/hooks/user/useSavedProducts.doc.ts +0 -32
- package/src/hooks/user/useSavedProducts.example.tsx +0 -13
- package/src/hooks/user/useSavedProductsActions.doc.ts +0 -32
- package/src/hooks/user/useSavedProductsActions.example.tsx +0 -30
- package/src/hooks/util/useErrorScreen.doc.ts +0 -32
- package/src/hooks/util/useErrorScreen.example.tsx +0 -16
- package/src/hooks/util/useErrorToast.doc.ts +0 -32
- package/src/hooks/util/useErrorToast.example.tsx +0 -15
- package/src/hooks/util/useImagePicker.example.tsx +0 -85
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {useFollowedShopsActions, Button} from '@shopify/shop-minis-react'
|
|
2
|
-
|
|
3
|
-
export default function MyComponent() {
|
|
4
|
-
const {followShop, unfollowShop} = useFollowedShopsActions()
|
|
5
|
-
|
|
6
|
-
return (
|
|
7
|
-
<>
|
|
8
|
-
<Button
|
|
9
|
-
onPress={() => followShop({shopId: 'gid://shopify/Shop/123'})}
|
|
10
|
-
text="Follow shop"
|
|
11
|
-
/>
|
|
12
|
-
<Button
|
|
13
|
-
onPress={() => unfollowShop({shopId: 'gid://shopify/Shop/123'})}
|
|
14
|
-
text="Unfollow shop"
|
|
15
|
-
/>
|
|
16
|
-
</>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useOrders',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useOrders` hook returns a set of recent Shopify orders for the current user.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useOrders.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseOrdersGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useRecentProducts',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
"The `useRecentProducts` hook fetches the current user's recently viewed products.",
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useRecentProducts.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseRecentProductsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {useEffect} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useRecentProducts, Button} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {products, fetchMore} = useRecentProducts({first: 10})
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
console.log(products)
|
|
10
|
-
}, [products])
|
|
11
|
-
|
|
12
|
-
return <Button onClick={fetchMore}>Fetch more</Button>
|
|
13
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useSavedProducts',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
"The `useSavedProducts` hook fetches the current user's saved products.",
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useSavedProducts.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseSavedProductsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {useEffect} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useSavedProducts, Button} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {products, fetchMore} = useSavedProducts({first: 10})
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
console.log(products)
|
|
10
|
-
}, [products])
|
|
11
|
-
|
|
12
|
-
return <Button onClick={fetchMore}>Fetch more</Button>
|
|
13
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useSavedProductsActions',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useSavedProductsActions` hook allows saving and unsaving products for the current user.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useSavedProductsActions.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseUpdateSavedProductsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {useSavedProductsActions, Button} from '@shopify/shop-minis-react'
|
|
2
|
-
|
|
3
|
-
export default function MyComponent() {
|
|
4
|
-
const {saveProduct, unsaveProduct} = useSavedProductsActions()
|
|
5
|
-
|
|
6
|
-
return (
|
|
7
|
-
<>
|
|
8
|
-
<Button
|
|
9
|
-
onPress={() =>
|
|
10
|
-
saveProduct({
|
|
11
|
-
productId: 'gid://shopify/Product/123',
|
|
12
|
-
productVariantId: 'gid://shopify/ProductVariant/456',
|
|
13
|
-
shopId: 'gid://shopify/Shop/42',
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
text="Save product"
|
|
17
|
-
/>
|
|
18
|
-
<Button
|
|
19
|
-
onPress={() =>
|
|
20
|
-
unsaveProduct({
|
|
21
|
-
productId: 'gid://shopify/Product/123',
|
|
22
|
-
productVariantId: 'gid://shopify/ProductVariant/456',
|
|
23
|
-
shopId: 'gid://shopify/Shop/42',
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
text="Unsave product"
|
|
27
|
-
/>
|
|
28
|
-
</>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useErrorScreen',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'util',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useErrorScreen` hook provides functionality for showing error screens. It returns a function that can be used to display an error screen with a given error message.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useErrorScreen.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseErrorScreenGeneratedType',
|
|
27
|
-
description: 'A hook that returns a function to show an error screen.',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {useCallback} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useErrorScreen, Button} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {showErrorScreen} = useErrorScreen()
|
|
7
|
-
|
|
8
|
-
const handleError = useCallback(() => {
|
|
9
|
-
showErrorScreen({
|
|
10
|
-
message: 'Something went wrong',
|
|
11
|
-
title: 'Error',
|
|
12
|
-
})
|
|
13
|
-
}, [showErrorScreen])
|
|
14
|
-
|
|
15
|
-
return <Button onPress={handleError} text="Show error screen" />
|
|
16
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useErrorToast',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'util',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useErrorToast` hook provides functionality for showing error toasts. It returns a function that can be used to display an error toast with a given error message.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useErrorToast.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseErrorToastGeneratedType',
|
|
27
|
-
description: 'A hook that returns a function to show an error toast.',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {useCallback} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useErrorToast, Button} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {showErrorToast} = useErrorToast()
|
|
7
|
-
|
|
8
|
-
const handleError = useCallback(() => {
|
|
9
|
-
showErrorToast({
|
|
10
|
-
message: 'Something went wrong',
|
|
11
|
-
})
|
|
12
|
-
}, [showErrorToast])
|
|
13
|
-
|
|
14
|
-
return <Button onPress={handleError} text="Show error toast" />
|
|
15
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react'
|
|
2
|
-
|
|
3
|
-
import {Camera, Image} from 'lucide-react'
|
|
4
|
-
|
|
5
|
-
import {Alert, AlertDescription, AlertTitle} from '../../components/ui/alert'
|
|
6
|
-
import {Button} from '../../components/ui/button'
|
|
7
|
-
import {
|
|
8
|
-
Card,
|
|
9
|
-
CardContent,
|
|
10
|
-
CardHeader,
|
|
11
|
-
CardTitle,
|
|
12
|
-
} from '../../components/ui/card'
|
|
13
|
-
|
|
14
|
-
import {useImagePicker} from './useImagePicker'
|
|
15
|
-
|
|
16
|
-
export const UseImagePickerExample = () => {
|
|
17
|
-
const [selectedImage, setSelectedImage] = useState<string | null>(null)
|
|
18
|
-
const [error, setError] = useState<string | null>(null)
|
|
19
|
-
const {openCamera, openGallery, ImagePickerInputs} = useImagePicker({
|
|
20
|
-
cameraFacing: 'user',
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const handleCameraCapture = async () => {
|
|
24
|
-
try {
|
|
25
|
-
setError(null)
|
|
26
|
-
const file = await openCamera()
|
|
27
|
-
const url = URL.createObjectURL(file)
|
|
28
|
-
setSelectedImage(url)
|
|
29
|
-
} catch (err) {
|
|
30
|
-
setError(err instanceof Error ? err.message : 'Failed to capture image')
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const handleGallerySelect = async () => {
|
|
35
|
-
try {
|
|
36
|
-
setError(null)
|
|
37
|
-
const file = await openGallery()
|
|
38
|
-
const url = URL.createObjectURL(file)
|
|
39
|
-
setSelectedImage(url)
|
|
40
|
-
} catch (err) {
|
|
41
|
-
setError(err instanceof Error ? err.message : 'Failed to select image')
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<Card>
|
|
47
|
-
<CardHeader>
|
|
48
|
-
<CardTitle>Image Picker Example</CardTitle>
|
|
49
|
-
</CardHeader>
|
|
50
|
-
<CardContent className="space-y-4">
|
|
51
|
-
<ImagePickerInputs />
|
|
52
|
-
|
|
53
|
-
<div className="flex gap-2">
|
|
54
|
-
<Button onClick={handleCameraCapture} variant="primary">
|
|
55
|
-
<Camera className="mr-2 h-4 w-4" />
|
|
56
|
-
Open Camera
|
|
57
|
-
</Button>
|
|
58
|
-
|
|
59
|
-
<Button onClick={handleGallerySelect} variant="secondary">
|
|
60
|
-
<Image className="mr-2 h-4 w-4" />
|
|
61
|
-
Open Gallery
|
|
62
|
-
</Button>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
{error && (
|
|
66
|
-
<Alert variant="destructive">
|
|
67
|
-
<AlertTitle>Error</AlertTitle>
|
|
68
|
-
<AlertDescription>{error}</AlertDescription>
|
|
69
|
-
</Alert>
|
|
70
|
-
)}
|
|
71
|
-
|
|
72
|
-
{selectedImage && (
|
|
73
|
-
<div className="space-y-2">
|
|
74
|
-
<h3 className="text-sm font-medium">Selected Image:</h3>
|
|
75
|
-
<img
|
|
76
|
-
src={selectedImage}
|
|
77
|
-
alt="Selected"
|
|
78
|
-
className="w-full rounded-md border"
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
)}
|
|
82
|
-
</CardContent>
|
|
83
|
-
</Card>
|
|
84
|
-
)
|
|
85
|
-
}
|