@shopify/shop-minis-react 0.0.21 → 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.
Files changed (210) hide show
  1. package/dist/_virtual/___vite-browser-external.js +7 -0
  2. package/dist/_virtual/___vite-browser-external.js.map +1 -0
  3. package/dist/_virtual/__vite-browser-external.js +5 -0
  4. package/dist/_virtual/__vite-browser-external.js.map +1 -0
  5. package/dist/_virtual/_commonjsHelpers.js +24 -4
  6. package/dist/_virtual/_commonjsHelpers.js.map +1 -1
  7. package/dist/_virtual/browser-index.js +8 -0
  8. package/dist/_virtual/browser-index.js.map +1 -0
  9. package/dist/_virtual/browser-index2.js +5 -0
  10. package/dist/_virtual/browser-index2.js.map +1 -0
  11. package/dist/_virtual/clock.js +6 -0
  12. package/dist/_virtual/clock.js.map +1 -0
  13. package/dist/_virtual/conventions.js +5 -0
  14. package/dist/_virtual/conventions.js.map +1 -0
  15. package/dist/_virtual/document.js +8 -0
  16. package/dist/_virtual/document.js.map +1 -0
  17. package/dist/_virtual/dom-parser.js +5 -0
  18. package/dist/_virtual/dom-parser.js.map +1 -0
  19. package/dist/_virtual/dom.js +5 -0
  20. package/dist/_virtual/dom.js.map +1 -0
  21. package/dist/_virtual/entities.js +5 -0
  22. package/dist/_virtual/entities.js.map +1 -0
  23. package/dist/_virtual/extends.js +5 -0
  24. package/dist/_virtual/extends.js.map +1 -0
  25. package/dist/_virtual/index10.js +5 -0
  26. package/dist/_virtual/index10.js.map +1 -0
  27. package/dist/_virtual/index11.js +5 -0
  28. package/dist/_virtual/index11.js.map +1 -0
  29. package/dist/_virtual/index2.js +5 -2
  30. package/dist/_virtual/index2.js.map +1 -1
  31. package/dist/_virtual/index3.js +5 -3
  32. package/dist/_virtual/index3.js.map +1 -1
  33. package/dist/_virtual/index5.js +6 -0
  34. package/dist/_virtual/index5.js.map +1 -0
  35. package/dist/_virtual/index6.js +6 -0
  36. package/dist/_virtual/index6.js.map +1 -0
  37. package/dist/_virtual/index7.js +5 -0
  38. package/dist/_virtual/index7.js.map +1 -0
  39. package/dist/_virtual/index8.js +5 -0
  40. package/dist/_virtual/index8.js.map +1 -0
  41. package/dist/_virtual/index9.js +5 -0
  42. package/dist/_virtual/index9.js.map +1 -0
  43. package/dist/_virtual/parse-sidx.js +8 -0
  44. package/dist/_virtual/parse-sidx.js.map +1 -0
  45. package/dist/_virtual/sax.js +5 -0
  46. package/dist/_virtual/sax.js.map +1 -0
  47. package/dist/_virtual/window.js +8 -0
  48. package/dist/_virtual/window.js.map +1 -0
  49. package/dist/components/atoms/video-player.js +121 -0
  50. package/dist/components/atoms/video-player.js.map +1 -0
  51. package/dist/components/commerce/merchant-card.js +236 -106
  52. package/dist/components/commerce/merchant-card.js.map +1 -1
  53. package/dist/index.js +199 -192
  54. package/dist/index.js.map +1 -1
  55. package/dist/mocks.js +114 -87
  56. package/dist/mocks.js.map +1 -1
  57. package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js +20 -0
  58. package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js.map +1 -0
  59. 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
  60. 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
  61. 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
  62. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/codecs.js +102 -0
  63. 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
  64. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/containers.js +149 -0
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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
  80. 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
  81. 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
  82. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/stream.js +33 -0
  83. 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
  84. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/http-handler.js +42 -0
  85. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/http-handler.js.map +1 -0
  86. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js +169 -0
  87. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js.map +1 -0
  88. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/interceptors.js +75 -0
  89. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/interceptors.js.map +1 -0
  90. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/retry.js +70 -0
  91. package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/retry.js.map +1 -0
  92. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js +124 -0
  93. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js.map +1 -0
  94. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom-parser.js +151 -0
  95. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom-parser.js.map +1 -0
  96. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom.js +993 -0
  97. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom.js.map +1 -0
  98. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/entities.js +2146 -0
  99. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/entities.js.map +1 -0
  100. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js +14 -0
  101. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js.map +1 -0
  102. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/sax.js +346 -0
  103. package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/sax.js.map +1 -0
  104. package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +308 -0
  105. package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js.map +1 -0
  106. package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +41 -0
  107. package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js.map +1 -0
  108. package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +53 -0
  109. package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js.map +1 -0
  110. package/dist/shop-minis-react/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +157 -0
  111. package/dist/shop-minis-react/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js.map +1 -0
  112. package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js +103 -0
  113. package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js.map +1 -0
  114. package/dist/shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js +269 -0
  115. package/dist/shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js.map +1 -0
  116. package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/document.js +13 -0
  117. package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/document.js.map +1 -0
  118. package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/window.js +12 -0
  119. package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/window.js.map +1 -0
  120. package/dist/shop-minis-react/node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js +10 -0
  121. package/dist/shop-minis-react/node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js.map +1 -0
  122. package/dist/shop-minis-react/node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js +18 -0
  123. package/dist/shop-minis-react/node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js.map +1 -0
  124. package/dist/shop-minis-react/node_modules/.pnpm/m3u8-parser@7.2.0/node_modules/m3u8-parser/dist/m3u8-parser.es.js +855 -0
  125. 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
  126. package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js +1102 -0
  127. 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
  128. package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/tools/parse-sidx.js +32 -0
  129. 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
  130. package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/clock.js +34 -0
  131. package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/clock.js.map +1 -0
  132. package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/numbers.js +17 -0
  133. package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/numbers.js.map +1 -0
  134. package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
  135. package/dist/shop-minis-react/node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js +23 -0
  136. package/dist/shop-minis-react/node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js.map +1 -0
  137. 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
  138. package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js +27824 -0
  139. package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js.map +1 -0
  140. 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
  141. 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
  142. package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vtt.js +802 -0
  143. 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
  144. package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttcue.js +188 -0
  145. 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
  146. package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttregion.js +104 -0
  147. 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
  148. package/dist/shop-minis-react.css +1 -1
  149. package/dist/utils/colors.js +6 -0
  150. package/dist/utils/colors.js.map +1 -0
  151. package/dist/utils/merchant-card.js +44 -0
  152. package/dist/utils/merchant-card.js.map +1 -0
  153. package/package.json +5 -1
  154. package/src/components/atoms/video-player.tsx +213 -0
  155. package/src/components/commerce/merchant-card.tsx +219 -49
  156. package/src/components/index.ts +1 -0
  157. package/src/mocks.ts +148 -16
  158. package/src/stories/MerchantCard.stories.tsx +63 -9
  159. package/src/utils/colors.ts +5 -0
  160. package/src/utils/index.ts +1 -0
  161. package/src/utils/merchant-card.ts +99 -0
  162. package/src/hooks/navigation/useCloseMini.doc.ts +0 -32
  163. package/src/hooks/navigation/useCloseMini.example.tsx +0 -7
  164. package/src/hooks/navigation/useDeeplink.doc.ts +0 -32
  165. package/src/hooks/navigation/useDeeplink.example.tsx +0 -7
  166. package/src/hooks/navigation/useShopNavigation.doc.ts +0 -32
  167. package/src/hooks/navigation/useShopNavigation.example.tsx +0 -32
  168. package/src/hooks/product/useCuratedProducts.doc.ts +0 -32
  169. package/src/hooks/product/useCuratedProducts.example.tsx +0 -10
  170. package/src/hooks/product/useProductList.doc.ts +0 -32
  171. package/src/hooks/product/useProductList.example.tsx +0 -9
  172. package/src/hooks/product/useProductListActions.doc.ts +0 -32
  173. package/src/hooks/product/useProductListActions.example.tsx +0 -60
  174. package/src/hooks/product/useProductLists.doc.ts +0 -32
  175. package/src/hooks/product/useProductLists.example.tsx +0 -9
  176. package/src/hooks/product/useProductSearch.doc.ts +0 -32
  177. package/src/hooks/product/useProductSearch.example.tsx +0 -13
  178. package/src/hooks/product/useRecommendedProducts.doc.ts +0 -32
  179. package/src/hooks/product/useRecommendedProducts.example.tsx +0 -7
  180. package/src/hooks/shop/useRecommendedShops.doc.ts +0 -32
  181. package/src/hooks/shop/useRecommendedShops.example.tsx +0 -7
  182. package/src/hooks/shop/useShop.doc.ts +0 -31
  183. package/src/hooks/shop/useShop.example.tsx +0 -7
  184. package/src/hooks/shop/useShopCartActions.doc.ts +0 -32
  185. package/src/hooks/shop/useShopCartActions.example.tsx +0 -28
  186. package/src/hooks/storage/useAsyncStorage.doc.ts +0 -32
  187. package/src/hooks/storage/useAsyncStorage.example.tsx +0 -30
  188. package/src/hooks/storage/useImageUpload.doc.ts +0 -32
  189. package/src/hooks/storage/useImageUpload.example.tsx +0 -20
  190. package/src/hooks/storage/useSecureStorage.doc.ts +0 -32
  191. package/src/hooks/storage/useSecureStorage.example.tsx +0 -23
  192. package/src/hooks/user/useBuyerAttributes.doc.ts +0 -32
  193. package/src/hooks/user/useBuyerAttributes.example.tsx +0 -14
  194. package/src/hooks/user/useCurrentUser.doc.ts +0 -31
  195. package/src/hooks/user/useCurrentUser.example.tsx +0 -7
  196. package/src/hooks/user/useFollowedShopsActions.doc.ts +0 -32
  197. package/src/hooks/user/useFollowedShopsActions.example.tsx +0 -16
  198. package/src/hooks/user/useOrders.doc.ts +0 -32
  199. package/src/hooks/user/useOrders.example.tsx +0 -7
  200. package/src/hooks/user/useRecentProducts.doc.ts +0 -32
  201. package/src/hooks/user/useRecentProducts.example.tsx +0 -13
  202. package/src/hooks/user/useSavedProducts.doc.ts +0 -32
  203. package/src/hooks/user/useSavedProducts.example.tsx +0 -13
  204. package/src/hooks/user/useSavedProductsActions.doc.ts +0 -32
  205. package/src/hooks/user/useSavedProductsActions.example.tsx +0 -32
  206. package/src/hooks/util/useErrorScreen.doc.ts +0 -32
  207. package/src/hooks/util/useErrorScreen.example.tsx +0 -15
  208. package/src/hooks/util/useErrorToast.doc.ts +0 -32
  209. package/src/hooks/util/useErrorToast.example.tsx +0 -15
  210. package/src/hooks/util/useImagePicker.example.tsx +0 -77
@@ -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,7 +0,0 @@
1
- import {useOrders} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {orders, loading, error} = useOrders()
5
-
6
- console.log({orders, loading, error})
7
- }
@@ -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,32 +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
- onClick={() =>
10
- saveProduct({
11
- productId: 'gid://shopify/Product/123',
12
- productVariantId: 'gid://shopify/ProductVariant/456',
13
- shopId: 'gid://shopify/Shop/42',
14
- })
15
- }
16
- >
17
- Save product
18
- </Button>
19
- <Button
20
- onClick={() =>
21
- unsaveProduct({
22
- productId: 'gid://shopify/Product/123',
23
- productVariantId: 'gid://shopify/ProductVariant/456',
24
- shopId: 'gid://shopify/Shop/42',
25
- })
26
- }
27
- >
28
- Unsave product
29
- </Button>
30
- </>
31
- )
32
- }
@@ -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,15 +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
- })
12
- }, [showErrorScreen])
13
-
14
- return <Button onClick={handleError}>Show error screen</Button>
15
- }
@@ -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 onClick={handleError}>Show error toast</Button>
15
- }
@@ -1,77 +0,0 @@
1
- import React, {useState} from 'react'
2
-
3
- import {Button} from '../../components/atoms/button'
4
- import {Alert, AlertDescription, AlertTitle} from '../../components/ui/alert'
5
- import {
6
- Card,
7
- CardContent,
8
- CardHeader,
9
- CardTitle,
10
- } from '../../components/ui/card'
11
-
12
- import {useImagePicker} from './useImagePicker'
13
-
14
- export const UseImagePickerExample = () => {
15
- const [selectedImage, setSelectedImage] = useState<string | null>(null)
16
- const [error, setError] = useState<string | null>(null)
17
- const {openCamera, openGallery} = useImagePicker()
18
-
19
- const handleCameraCapture = async () => {
20
- try {
21
- setError(null)
22
- const file = await openCamera('front')
23
- const url = URL.createObjectURL(file)
24
- setSelectedImage(url)
25
- } catch (err) {
26
- setError(err instanceof Error ? err.message : 'Failed to capture image')
27
- }
28
- }
29
-
30
- const handleGallerySelect = async () => {
31
- try {
32
- setError(null)
33
- const file = await openGallery()
34
- const url = URL.createObjectURL(file)
35
- setSelectedImage(url)
36
- } catch (err) {
37
- setError(err instanceof Error ? err.message : 'Failed to select image')
38
- }
39
- }
40
-
41
- return (
42
- <Card>
43
- <CardHeader>
44
- <CardTitle>Image Picker Example</CardTitle>
45
- </CardHeader>
46
- <CardContent className="space-y-4">
47
- <div className="flex gap-2">
48
- <Button onClick={handleCameraCapture} variant="default">
49
- Open Camera
50
- </Button>
51
-
52
- <Button onClick={handleGallerySelect} variant="secondary">
53
- Open Gallery
54
- </Button>
55
- </div>
56
-
57
- {error && (
58
- <Alert variant="destructive">
59
- <AlertTitle>Error</AlertTitle>
60
- <AlertDescription>{error}</AlertDescription>
61
- </Alert>
62
- )}
63
-
64
- {selectedImage && (
65
- <div className="space-y-2">
66
- <h3 className="text-sm font-medium">Selected Image:</h3>
67
- <img
68
- src={selectedImage}
69
- alt="Selected"
70
- className="w-full rounded-md border"
71
- />
72
- </div>
73
- )}
74
- </CardContent>
75
- </Card>
76
- )
77
- }