@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,60 +0,0 @@
1
- import {useProductListActions, Button} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {
5
- addProductList,
6
- removeProductList,
7
- renameProductList,
8
- addProductListItem,
9
- removeProductListItem,
10
- } = useProductListActions()
11
-
12
- return (
13
- <>
14
- <Button onClick={() => addProductList({name: 'My product list'})}>
15
- Add product list
16
- </Button>
17
- <Button
18
- onClick={() => removeProductList({id: 'gid://shopapp/ProductList/123'})}
19
- >
20
- Remove product list
21
- </Button>
22
- <Button
23
- onClick={() =>
24
- renameProductList({
25
- id: 'gid://shopapp/ProductList/123',
26
- name: 'My renamed product list',
27
- })
28
- }
29
- >
30
- Rename product list
31
- </Button>
32
- <Button
33
- onClick={() =>
34
- addProductListItem({
35
- shopId: 'gid://shopify/Shop/42',
36
- productId: 'gid://shopify/Product/123',
37
- productVariantId: 'gid://shopify/ProductVariant/101',
38
- listId: 'gid://shopapp/ProductList/99',
39
- publicListId: 'abc123',
40
- })
41
- }
42
- >
43
- Add product to list
44
- </Button>
45
- <Button
46
- onClick={() =>
47
- removeProductListItem({
48
- shopId: 'gid://shopify/Shop/42',
49
- productId: 'gid://shopify/Product/123',
50
- productVariantId: 'gid://shopify/ProductVariant/101',
51
- listId: 'gid://shopapp/ProductList/99',
52
- publicListId: 'abc123',
53
- })
54
- }
55
- >
56
- Remove product from list
57
- </Button>
58
- </>
59
- )
60
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useProductLists',
5
- category: 'hooks',
6
- subCategory: 'product',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useProductLists` hook fetches all the users product lists.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useProductLists.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseProductListsGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,9 +0,0 @@
1
- import {useProductLists} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {productLists, loading, error} = useProductLists({
5
- first: 10,
6
- })
7
-
8
- console.log({productLists, loading, error})
9
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useProductSearch',
5
- category: 'hooks',
6
- subCategory: 'product',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useProductSearch` hook fetches products based on a search query.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useProductSearch.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseProductSearchGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,13 +0,0 @@
1
- import {useProductSearch} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {products, loading} = useProductSearch({
5
- query: 'shirt',
6
- first: 10,
7
- filters: {
8
- color: ['RED'],
9
- },
10
- })
11
-
12
- console.log({products, loading})
13
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useRecommendedProducts',
5
- category: 'hooks',
6
- subCategory: 'product',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useRecommendedProducts` hook enables fetching a list of recommended products for the user. The list may be empty if the user has no recommended products.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useRecommendedProducts.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseRecommendedProductsGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,7 +0,0 @@
1
- import {useRecommendedProducts} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {products, loading, error} = useRecommendedProducts()
5
-
6
- console.log({products, loading, error})
7
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useRecommendedShops',
5
- category: 'hooks',
6
- subCategory: 'shop',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useRecommendedShops` hook enables fetching a list of recommended shops for the user. The list may be empty if the user has no recommended shops.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useRecommendedShops.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseRecommendedShopsGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,7 +0,0 @@
1
- import {useRecommendedShops} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {shops, loading, error} = useRecommendedShops()
5
-
6
- console.log({shops, loading, error})
7
- }
@@ -1,31 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useShop',
5
- category: 'hooks',
6
- subCategory: 'shop',
7
- isVisualComponent: false,
8
- related: [],
9
- description: 'The `useShop` hook enables fetching a shop by its ID.',
10
- type: 'hook',
11
- defaultExample: {
12
- codeblock: {
13
- tabs: [
14
- {
15
- code: './useShop.example.tsx',
16
- language: 'tsx',
17
- },
18
- ],
19
- title: 'Example code',
20
- },
21
- },
22
- definitions: [
23
- {
24
- title: '',
25
- type: 'UseShopGeneratedType',
26
- description: '',
27
- },
28
- ],
29
- }
30
-
31
- export default data
@@ -1,7 +0,0 @@
1
- import {useShop} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {shop, loading, error} = useShop({id: 'gid://shopify/Shop/1234567890'})
5
-
6
- console.log({shop, loading, error})
7
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useShopCartActions',
5
- category: 'hooks',
6
- subCategory: 'shop',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useShopCartActions` hook provides functions for managing the shopping cart. It includes operations for adding products to the cart and buying products directly.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useShopCartActions.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseShopCartActionsGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,28 +0,0 @@
1
- import {Button, useShopCartActions} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {addToCart, buyProduct} = useShopCartActions()
5
-
6
- const handleAddToCart = async () => {
7
- await addToCart({
8
- productId: 'gid://shopify/Product/123',
9
- productVariantId: 'gid://shopify/ProductVariant/456',
10
- quantity: 1,
11
- })
12
- }
13
-
14
- const handleBuyNow = async () => {
15
- await buyProduct({
16
- productId: 'gid://shopify/Product/123',
17
- productVariantId: 'gid://shopify/ProductVariant/456',
18
- quantity: 1,
19
- })
20
- }
21
-
22
- return (
23
- <>
24
- <Button onClick={handleAddToCart}>Add to cart</Button>
25
- <Button onClick={handleBuyNow}>Buy now</Button>
26
- </>
27
- )
28
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useAsyncStorage',
5
- category: 'hooks',
6
- subCategory: 'storage',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useAsyncStorage` hook provides functions to interact with persistent storage. It allows you to store, retrieve, and manage data that persists between app sessions.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useAsyncStorage.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseAsyncStorageGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,30 +0,0 @@
1
- import {useEffect} from 'react'
2
-
3
- import {useAsyncStorage} from '@shopify/shop-minis-react'
4
-
5
- export default function MyComponent() {
6
- const {getItem, setItem, removeItem, getAllKeys, clear} = useAsyncStorage()
7
-
8
- useEffect(() => {
9
- async function handleStorageOperations() {
10
- // Get an item from storage
11
- const value = await getItem({key: 'myKey'})
12
- console.log({value})
13
-
14
- // Set an item in storage
15
- await setItem({key: 'myKey', value: 'Hello, World!'})
16
-
17
- // Remove an item from storage
18
- await removeItem({key: 'myKey'})
19
-
20
- // Get all keys in storage
21
- const keys = await getAllKeys()
22
- console.log({keys})
23
-
24
- // Clear all items from storage
25
- await clear()
26
- }
27
-
28
- handleStorageOperations()
29
- }, [getItem, removeItem, setItem, getAllKeys, clear])
30
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useImageUpload',
5
- category: 'hooks',
6
- subCategory: 'storage',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useImageUpload` hook provides functionality for uploading images attached to the current user. It handles the upload process, including getting upload links, uploading to storage, and polling for completion.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useImageUpload.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseImageUploadGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,20 +0,0 @@
1
- import {useCallback} from 'react'
2
-
3
- import {useImageUpload, Button} from '@shopify/shop-minis-react'
4
-
5
- export default function MyComponent() {
6
- const {uploadImage} = useImageUpload()
7
-
8
- const handleUpload = useCallback(async () => {
9
- const result = await uploadImage([
10
- {
11
- mimeType: 'image/jpeg',
12
- fileSize: 1024 * 1024, // 1MB
13
- uri: 'file://path/to/image.jpg',
14
- },
15
- ])
16
- console.log('Uploaded image:', result[0])
17
- }, [uploadImage])
18
-
19
- return <Button onClick={handleUpload}>Upload image</Button>
20
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useSecureStorage',
5
- category: 'hooks',
6
- subCategory: 'storage',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useSecureStorage` hook provides functions to interact with secure storage. It allows you to store, retrieve, and manage sensitive data that requires encryption and secure handling. You can currently only set one secret per Mini.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useSecureStorage.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseSecureStorageGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,23 +0,0 @@
1
- import {useEffect} from 'react'
2
-
3
- import {useSecureStorage} from '@shopify/shop-minis-react'
4
-
5
- export default function MyComponent() {
6
- const {getSecret, setSecret, removeSecret} = useSecureStorage()
7
-
8
- useEffect(() => {
9
- async function handleSecureStorageOperations() {
10
- // Get a secret from secure storage
11
- const secret = await getSecret()
12
- console.log({secret})
13
-
14
- // Set a secret in secure storage
15
- await setSecret({value: 'Sensitive Data'})
16
-
17
- // Remove a secret from secure storage
18
- await removeSecret()
19
- }
20
-
21
- handleSecureStorageOperations()
22
- }, [getSecret, setSecret, removeSecret])
23
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useBuyerAttributes',
5
- category: 'hooks',
6
- subCategory: 'user',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useBuyerAttributes` hook fetches the current buyer attributes, such as gender affinity and category affinities.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useBuyerAttributes.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: 'Props',
26
- type: 'UseBuyerAttributesGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,14 +0,0 @@
1
- import {useEffect} from 'react'
2
-
3
- import {useBuyerAttributes} from '@shopify/shop-minis-react'
4
-
5
- export default function MyComponent() {
6
- const {buyerAttributes} = useBuyerAttributes()
7
-
8
- useEffect(() => {
9
- if (buyerAttributes) {
10
- const {genderAffinity, categoryAffinities} = buyerAttributes
11
- console.log({genderAffinity, categoryAffinities})
12
- }
13
- }, [buyerAttributes])
14
- }
@@ -1,31 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useCurrentUser',
5
- category: 'hooks',
6
- subCategory: 'user',
7
- isVisualComponent: false,
8
- related: [],
9
- description: 'The `useCurrentUser` hook fetches the current user.',
10
- type: 'hook',
11
- defaultExample: {
12
- codeblock: {
13
- tabs: [
14
- {
15
- code: './useCurrentUser.example.tsx',
16
- language: 'tsx',
17
- },
18
- ],
19
- title: 'Example code',
20
- },
21
- },
22
- definitions: [
23
- {
24
- title: '',
25
- type: 'UseCurrentUserGeneratedType',
26
- description: '',
27
- },
28
- ],
29
- }
30
-
31
- export default data
@@ -1,7 +0,0 @@
1
- import {useCurrentUser} from '@shopify/shop-minis-react'
2
-
3
- export default function MyComponent() {
4
- const {currentUser} = useCurrentUser()
5
-
6
- console.log(currentUser)
7
- }
@@ -1,32 +0,0 @@
1
- import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
2
-
3
- const data: ReferenceEntityTemplateSchema = {
4
- name: 'useFollowedShopsActions',
5
- category: 'hooks',
6
- subCategory: 'user',
7
- isVisualComponent: false,
8
- related: [],
9
- description:
10
- 'The `useFollowedShopsActions` hook allows following and unfollowing shops for the current user.',
11
- type: 'hook',
12
- defaultExample: {
13
- codeblock: {
14
- tabs: [
15
- {
16
- code: './useFollowedShopsActions.example.tsx',
17
- language: 'tsx',
18
- },
19
- ],
20
- title: 'Example code',
21
- },
22
- },
23
- definitions: [
24
- {
25
- title: '',
26
- type: 'UseUpdateFollowedShopsGeneratedType',
27
- description: '',
28
- },
29
- ],
30
- }
31
-
32
- export default data
@@ -1,16 +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 onClick={() => followShop({shopId: 'gid://shopify/Shop/123'})}>
9
- Follow shop
10
- </Button>
11
- <Button onClick={() => unfollowShop({shopId: 'gid://shopify/Shop/123'})}>
12
- Unfollow shop
13
- </Button>
14
- </>
15
- )
16
- }