@shopify/shop-minis-react 0.0.1 → 0.0.2
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/README.md +110 -90
- package/dist/_virtual/_commonjsHelpers.js +9 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/components/ui/alert-dialog.js +141 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/button.js +50 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.js +91 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/sonner.js +23 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/hooks/navigation/useCloseMini.js +12 -0
- package/dist/hooks/navigation/useCloseMini.js.map +1 -0
- package/dist/hooks/navigation/useShopNavigation.js +20 -0
- package/dist/hooks/navigation/useShopNavigation.js.map +1 -0
- package/dist/hooks/product/usePopularProducts.js +20 -0
- package/dist/hooks/product/usePopularProducts.js.map +1 -0
- package/dist/hooks/product/useProductList.js +29 -0
- package/dist/hooks/product/useProductList.js.map +1 -0
- package/dist/hooks/product/useProductListActions.js +22 -0
- package/dist/hooks/product/useProductListActions.js.map +1 -0
- package/dist/hooks/product/useProductLists.js +20 -0
- package/dist/hooks/product/useProductLists.js.map +1 -0
- package/dist/hooks/product/useRecommendedProducts.js +20 -0
- package/dist/hooks/product/useRecommendedProducts.js.map +1 -0
- package/dist/hooks/shop/useRecommendedShops.js +21 -0
- package/dist/hooks/shop/useRecommendedShops.js.map +1 -0
- package/dist/hooks/shop/useShopCartActions.js +13 -0
- package/dist/hooks/shop/useShopCartActions.js.map +1 -0
- package/dist/hooks/storage/useAsyncStorage.js +22 -0
- package/dist/hooks/storage/useAsyncStorage.js.map +1 -0
- package/dist/hooks/storage/useImageUpload.js +62 -0
- package/dist/hooks/storage/useImageUpload.js.map +1 -0
- package/dist/hooks/storage/useSecureStorage.js +14 -0
- package/dist/hooks/storage/useSecureStorage.js.map +1 -0
- package/dist/hooks/user/useBuyerAttributes.js +20 -0
- package/dist/hooks/user/useBuyerAttributes.js.map +1 -0
- package/dist/hooks/user/useCurrentUser.js +20 -0
- package/dist/hooks/user/useCurrentUser.js.map +1 -0
- package/dist/hooks/user/useFollowedShopsActions.js +13 -0
- package/dist/hooks/user/useFollowedShopsActions.js.map +1 -0
- package/dist/hooks/user/useOrders.js +20 -0
- package/dist/hooks/user/useOrders.js.map +1 -0
- package/dist/hooks/user/useSavedProductsActions.js +13 -0
- package/dist/hooks/user/useSavedProductsActions.js.map +1 -0
- package/dist/hooks/util/useErrorScreen.js +9 -0
- package/dist/hooks/util/useErrorScreen.js.map +1 -0
- package/dist/hooks/util/useErrorToast.js +9 -0
- package/dist/hooks/util/useErrorToast.js.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/useHandleAction.js +13 -0
- package/dist/internal/useHandleAction.js.map +1 -0
- package/dist/internal/useShopActions.js +7 -0
- package/dist/internal/useShopActions.js.map +1 -0
- package/dist/internal/useShopActionsDataFetching.js +79 -0
- package/dist/internal/useShopActionsDataFetching.js.map +1 -0
- package/dist/internal/useShopActionsPaginatedDataFetching.js +96 -0
- package/dist/internal/useShopActionsPaginatedDataFetching.js.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js +10 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react_5smkpul3xqqoqjowwwfk226yey/node_modules/@radix-ui/react-alert-dialog/dist/index.js +127 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react_5smkpul3xqqoqjowwwfk226yey/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js +69 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1._sjczexpvrqz6fttoobpwnns2oa/node_modules/@radix-ui/react-dialog/dist/index.js +259 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1._sjczexpvrqz6fttoobpwnns2oa/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.10_@types_react-dom@19.1.6_@types_react@19.1.6__@types__ipor64qsap4jnr6m7nflv4q5v4/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.10_@types_react-dom@19.1.6_@types_react@19.1.6__@types__ipor64qsap4jnr6m7nflv4q5v4/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.js +18 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@1_zpdtvgogfsfavk62phevpdv4fu/node_modules/@radix-ui/react-focus-scope/dist/index.js +137 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@1_zpdtvgogfsfavk62phevpdv4fu/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js +14 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1.6_sr45arufxpp6hzdn2l7kcrtvqe/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1.6_sr45arufxpp6hzdn2l7kcrtvqe/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.4_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1_5ga5lr7i6zouk7rhd63vbsmjyu/node_modules/@radix-ui/react-presence/dist/index.js +71 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.4_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1_5ga5lr7i6zouk7rhd63vbsmjyu/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js +59 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +11 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +53 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +15 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +53 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js.map +1 -0
- package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js +36 -0
- package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js.map +1 -0
- package/dist/node_modules/.pnpm/next-themes@0.4.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next-themes/dist/index.js +34 -0
- package/dist/node_modules/.pnpm/next-themes@0.4.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next-themes/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +44 -0
- package/dist/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js +72 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +26 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js +12 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +113 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js +32 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +17 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +69 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js +6 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js +8 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js +12 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js +16 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js +31 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -0
- package/dist/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js +25 -0
- package/dist/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js.map +1 -0
- package/dist/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js +743 -0
- package/dist/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.js +2265 -0
- package/dist/node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +28 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js +133 -0
- package/dist/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js.map +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js +7 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +27 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js +26 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js +19 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js +68 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -0
- package/dist/types/minisSDK.generated.d.js +18 -0
- package/dist/types/minisSDK.generated.d.js.map +1 -0
- package/dist/utils/errors.js +39 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/parseUrl.js +8 -0
- package/dist/utils/parseUrl.js.map +1 -0
- package/package.json +29 -14
- package/src/components/index.ts +4 -7
- package/src/components/ui/alert-dialog.tsx +151 -0
- package/src/components/ui/button.tsx +60 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/dev.tsx +116 -38
- package/src/hooks/index.ts +31 -5
- package/src/hooks/navigation/useCloseMini.doc.ts +32 -0
- package/src/hooks/navigation/useCloseMini.example.tsx +7 -0
- package/src/hooks/navigation/useCloseMini.ts +17 -0
- package/src/hooks/navigation/useShopNavigation.doc.ts +32 -0
- package/src/hooks/navigation/useShopNavigation.example.tsx +29 -0
- package/src/hooks/navigation/useShopNavigation.ts +41 -0
- package/src/hooks/product/usePopularProducts.ts +37 -0
- package/src/hooks/product/useProductList.doc.ts +32 -0
- package/src/hooks/product/useProductList.example.tsx +9 -0
- package/src/hooks/product/useProductList.ts +56 -0
- package/src/hooks/product/useProductListActions.doc.ts +32 -0
- package/src/hooks/product/useProductListActions.example.tsx +57 -0
- package/src/hooks/product/useProductListActions.ts +51 -0
- package/src/hooks/product/useProductLists.doc.ts +32 -0
- package/src/hooks/product/useProductLists.example.tsx +9 -0
- package/src/hooks/product/useProductLists.ts +39 -0
- package/src/hooks/product/useRecommendedProducts.doc.ts +32 -0
- package/src/hooks/product/useRecommendedProducts.example.tsx +7 -0
- package/src/hooks/product/useRecommendedProducts.ts +37 -0
- package/src/hooks/shop/useRecommendedShops.doc.ts +32 -0
- package/src/hooks/shop/useRecommendedShops.example.tsx +7 -0
- package/src/hooks/shop/useRecommendedShops.ts +43 -0
- package/src/hooks/shop/useShopCartActions.doc.ts +32 -0
- package/src/hooks/shop/useShopCartActions.example.tsx +28 -0
- package/src/hooks/shop/useShopCartActions.ts +23 -0
- package/src/hooks/storage/useAsyncStorage.doc.ts +32 -0
- package/src/hooks/storage/useAsyncStorage.example.tsx +30 -0
- package/src/hooks/storage/useAsyncStorage.ts +48 -0
- package/src/hooks/storage/useImageUpload.doc.ts +32 -0
- package/src/hooks/storage/useImageUpload.example.tsx +20 -0
- package/src/hooks/storage/useImageUpload.ts +135 -0
- package/src/hooks/storage/useSecureStorage.doc.ts +32 -0
- package/src/hooks/storage/useSecureStorage.example.tsx +23 -0
- package/src/hooks/storage/useSecureStorage.ts +28 -0
- package/src/hooks/user/useBuyerAttributes.doc.ts +32 -0
- package/src/hooks/user/useBuyerAttributes.example.tsx +14 -0
- package/src/hooks/user/useBuyerAttributes.ts +34 -0
- package/src/hooks/user/useCurrentUser.doc.ts +31 -0
- package/src/hooks/user/useCurrentUser.example.tsx +7 -0
- package/src/hooks/user/useCurrentUser.ts +37 -0
- package/src/hooks/user/useFollowedShopsActions.doc.ts +32 -0
- package/src/hooks/user/useFollowedShopsActions.example.tsx +18 -0
- package/src/hooks/user/useFollowedShopsActions.ts +23 -0
- package/src/hooks/user/useOrders.doc.ts +32 -0
- package/src/hooks/user/useOrders.example.tsx +7 -0
- package/src/hooks/user/useOrders.ts +32 -0
- package/src/hooks/user/useSavedProductsActions.doc.ts +32 -0
- package/src/hooks/user/useSavedProductsActions.example.tsx +30 -0
- package/src/hooks/user/useSavedProductsActions.ts +23 -0
- package/src/hooks/util/useErrorScreen.doc.ts +32 -0
- package/src/hooks/util/useErrorScreen.example.tsx +16 -0
- package/src/hooks/util/useErrorScreen.ts +15 -0
- package/src/hooks/util/useErrorToast.doc.ts +32 -0
- package/src/hooks/util/useErrorToast.example.tsx +15 -0
- package/src/hooks/util/useErrorToast.ts +15 -0
- package/src/index.css +120 -2
- package/src/internal/useHandleAction.ts +24 -0
- package/src/internal/useShopActions.ts +5 -0
- package/src/internal/useShopActionsDataFetching.ts +153 -0
- package/src/internal/useShopActionsPaginatedDataFetching.ts +193 -0
- package/src/lib/utils.ts +9 -0
- package/src/types/index.ts +2 -0
- package/src/types/minisSDK.generated.d.ts +2 -74
- package/src/utils/errors.ts +86 -0
- package/src/utils/index.ts +2 -11
- package/src/utils/parseUrl.ts +5 -0
- package/tailwind.config.js +3 -0
- package/src/components/HelloWorld/HelloWorld.tsx +0 -43
- package/src/components/HelloWorld/index.ts +0 -2
- package/src/tailwind-theme.css +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @shopify/typescript/prefer-pascal-case-enums */
|
|
2
2
|
// Auto-generated type definitions for MinisSDK
|
|
3
|
-
// Generated on: 2025-06-
|
|
3
|
+
// Generated on: 2025-06-06T15:17:55.440Z
|
|
4
4
|
// Do not edit this file manually - run the generation script instead
|
|
5
5
|
// Source: useShopActionsImplementationV3.ts + shopActionsV3Definitions.ts + shopActionsV3Types.ts
|
|
6
6
|
// Generated using TypeScript compiler API for reliable AST parsing
|
|
@@ -1114,81 +1114,9 @@ export interface PaginatedDataHookPageInfo {
|
|
|
1114
1114
|
endCursor: string | null
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
|
-
// ============================================================================
|
|
1118
|
-
// MinisSDK Interface
|
|
1119
|
-
// ============================================================================
|
|
1120
|
-
|
|
1121
|
-
interface MinisSDK {
|
|
1122
|
-
getRecommendedProducts(): Promise<
|
|
1123
|
-
ShopActionResult<GetRecommendedProductsResponse>
|
|
1124
|
-
>
|
|
1125
|
-
getRecommendedShops(): Promise<ShopActionResult<GetRecommendedShopsResponse>>
|
|
1126
|
-
searchProductsByShop(): Promise<
|
|
1127
|
-
ShopActionResult<SearchProductsByShopResponse>
|
|
1128
|
-
>
|
|
1129
|
-
getShopAppInformation(): Promise<ShopActionResult<void>>
|
|
1130
|
-
getOrders(): Promise<ShopActionResult<GetOrdersResponse>>
|
|
1131
|
-
getBuyerAttributes(): Promise<ShopActionResult<GetBuyerAttributesResponse>>
|
|
1132
|
-
getCurrentUser(): Promise<ShopActionResult<GetCurrentUserResponse>>
|
|
1133
|
-
getProductLists(): Promise<ShopActionResult<GetProductListsResponse>>
|
|
1134
|
-
getDeeplinkPaths(): Promise<ShopActionResult<GetDeeplinkPathsResponse>>
|
|
1135
|
-
getAllPersistedKeys(): Promise<ShopActionResult<string[]>>
|
|
1136
|
-
getSecret(): Promise<ShopActionResult<string | null>>
|
|
1137
|
-
closeMini(): Promise<ShopActionResult<void>>
|
|
1138
|
-
getAllInternalPersistedKeys(): Promise<ShopActionResult<string[]>>
|
|
1139
|
-
clearInternalPersistedItems(): Promise<ShopActionResult<void>>
|
|
1140
|
-
getPopularProducts(): Promise<ShopActionResult<GetPopularProductsResponse>>
|
|
1141
|
-
getProductList(params: any): Promise<ShopActionResult<GetProductListResponse>>
|
|
1142
|
-
getPersistedItem(params: any): Promise<ShopActionResult<string | null>>
|
|
1143
|
-
getAccountInformation(
|
|
1144
|
-
params: any
|
|
1145
|
-
): Promise<ShopActionResult<GetAccountInformationResponse>>
|
|
1146
|
-
navigateToProduct(params: any): Promise<ShopActionResult<void>>
|
|
1147
|
-
navigateToCheckout(params: any): Promise<ShopActionResult<void>>
|
|
1148
|
-
createOrderAttribution(params: any): Promise<ShopActionResult<void>>
|
|
1149
|
-
addToCart(params: any): Promise<ShopActionResult<void>>
|
|
1150
|
-
buyProduct(params: any): Promise<ShopActionResult<void>>
|
|
1151
|
-
buyProducts(params: any): Promise<ShopActionResult<void>>
|
|
1152
|
-
navigateToShop(params: any): Promise<ShopActionResult<void>>
|
|
1153
|
-
showErrorScreen(params: any): Promise<ShopActionResult<void>>
|
|
1154
|
-
showErrorToast(params: any): Promise<ShopActionResult<void>>
|
|
1155
|
-
productRecommendationImpression(params: any): Promise<ShopActionResult<void>>
|
|
1156
|
-
productRecommendationClick(params: any): Promise<ShopActionResult<void>>
|
|
1157
|
-
followShop(params: any): Promise<ShopActionResult<boolean>>
|
|
1158
|
-
unfollowShop(params: any): Promise<ShopActionResult<boolean>>
|
|
1159
|
-
hideEntryPoint(params: any): Promise<ShopActionResult<void>>
|
|
1160
|
-
navigateToOrder(params: any): Promise<ShopActionResult<void>>
|
|
1161
|
-
navigateToDeeplink(params: any): Promise<ShopActionResult<void>>
|
|
1162
|
-
createImageUploadLink(
|
|
1163
|
-
params: any
|
|
1164
|
-
): Promise<ShopActionResult<CreateImageUploadLinkResponse>>
|
|
1165
|
-
completeImageUpload(
|
|
1166
|
-
params: any
|
|
1167
|
-
): Promise<ShopActionResult<CompleteImageUploadResponse>>
|
|
1168
|
-
setPersistedItem(params: any): Promise<ShopActionResult<void>>
|
|
1169
|
-
removePersistedItem(params: any): Promise<ShopActionResult<void>>
|
|
1170
|
-
clearPersistedItems(params: any): Promise<ShopActionResult<void>>
|
|
1171
|
-
setSecret(params: any): Promise<ShopActionResult<void>>
|
|
1172
|
-
removeSecret(params: any): Promise<ShopActionResult<void>>
|
|
1173
|
-
reportInteraction(params: any): Promise<ShopActionResult<void>>
|
|
1174
|
-
reportImpression(params: any): Promise<ShopActionResult<void>>
|
|
1175
|
-
reportContentImpression(params: any): Promise<ShopActionResult<void>>
|
|
1176
|
-
addProductList(params: any): Promise<ShopActionResult<ProductList>>
|
|
1177
|
-
removeProductList(params: any): Promise<ShopActionResult<void>>
|
|
1178
|
-
renameProductList(params: any): Promise<ShopActionResult<ProductList>>
|
|
1179
|
-
addProductListItem(params: any): Promise<ShopActionResult<void>>
|
|
1180
|
-
removeProductListItem(params: any): Promise<ShopActionResult<void>>
|
|
1181
|
-
showFeedbackSheet(params: any): Promise<ShopActionResult<void>>
|
|
1182
|
-
getInternalPersistedItem(
|
|
1183
|
-
params: any
|
|
1184
|
-
): Promise<ShopActionResult<string | null>>
|
|
1185
|
-
setInternalPersistedItem(params: any): Promise<ShopActionResult<void>>
|
|
1186
|
-
removeInternalPersistedItem(params: any): Promise<ShopActionResult<void>>
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
1117
|
declare global {
|
|
1190
1118
|
interface Window {
|
|
1191
|
-
minisSDK:
|
|
1119
|
+
minisSDK: ShopActions
|
|
1192
1120
|
}
|
|
1193
1121
|
}
|
|
1194
1122
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
interface MiniErrorSource {
|
|
2
|
+
component?: string
|
|
3
|
+
hook?: string
|
|
4
|
+
func?: string
|
|
5
|
+
callback?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface MiniErrorParams extends MiniErrorSource {
|
|
9
|
+
message: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Base class for all Mini errors
|
|
13
|
+
// We can give richer error messages by using this throughout the SDK
|
|
14
|
+
// In future we could add instrumentation to track these errors too
|
|
15
|
+
export class MiniError extends Error {
|
|
16
|
+
constructor({
|
|
17
|
+
component,
|
|
18
|
+
hook,
|
|
19
|
+
func,
|
|
20
|
+
callback,
|
|
21
|
+
message = 'Unknown Error',
|
|
22
|
+
}: MiniErrorParams) {
|
|
23
|
+
let formattedMessage = message
|
|
24
|
+
|
|
25
|
+
if (component || hook || func) {
|
|
26
|
+
if (component) {
|
|
27
|
+
formattedMessage = `<${component} />`
|
|
28
|
+
} else if (hook) {
|
|
29
|
+
formattedMessage = hook
|
|
30
|
+
} else if (func) {
|
|
31
|
+
formattedMessage = `${func}()`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (callback) {
|
|
35
|
+
formattedMessage = `${formattedMessage} ${callback}()`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
formattedMessage = `${formattedMessage}: ${message}`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
super(formattedMessage)
|
|
42
|
+
this.name = 'MiniError'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class MiniNetworkError extends MiniError {
|
|
47
|
+
constructor(params: Partial<MiniErrorParams>) {
|
|
48
|
+
super({message: 'Network Error', ...params})
|
|
49
|
+
this.name = 'MiniNetworkError'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class MiniEntityNotFoundError extends MiniError {
|
|
54
|
+
constructor(params: Partial<MiniErrorParams>) {
|
|
55
|
+
super({message: 'Entity Not Found', ...params})
|
|
56
|
+
this.name = 'MiniEntityNotFoundError'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const formatError = (
|
|
61
|
+
source: MiniErrorSource,
|
|
62
|
+
error: any
|
|
63
|
+
): MiniError | MiniNetworkError | null => {
|
|
64
|
+
if (!error) {
|
|
65
|
+
return null
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (error.networkError) {
|
|
69
|
+
return new MiniNetworkError({
|
|
70
|
+
...source,
|
|
71
|
+
message: error.networkError?.message,
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (error.code) {
|
|
76
|
+
return new MiniError({
|
|
77
|
+
...source,
|
|
78
|
+
message: `${error.code}${error.message ? `: ${error.message}` : ''}`,
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return new MiniError({
|
|
83
|
+
...source,
|
|
84
|
+
message: error?.message,
|
|
85
|
+
})
|
|
86
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Utility function to merge Tailwind CSS classes with proper conflict resolution
|
|
6
|
-
*/
|
|
7
|
-
export function cn(...inputs: ClassValue[]) {
|
|
8
|
-
return twMerge(clsx(inputs))
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Export other utility functions here as needed
|
|
1
|
+
export * from './errors'
|
|
2
|
+
export * from './parseUrl'
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import {cn} from '../../utils'
|
|
4
|
-
|
|
5
|
-
import type {BaseComponentProps} from '../../types'
|
|
6
|
-
|
|
7
|
-
export interface HelloWorldProps extends BaseComponentProps {
|
|
8
|
-
/**
|
|
9
|
-
* The name to greet
|
|
10
|
-
*/
|
|
11
|
-
name?: string
|
|
12
|
-
/**
|
|
13
|
-
* The size variant of the component
|
|
14
|
-
*/
|
|
15
|
-
size?: 'sm' | 'md' | 'lg'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const HelloWorld: React.FC<HelloWorldProps> = ({
|
|
19
|
-
name = 'World',
|
|
20
|
-
size = 'md',
|
|
21
|
-
className,
|
|
22
|
-
children,
|
|
23
|
-
...props
|
|
24
|
-
}) => {
|
|
25
|
-
const sizeClasses = {
|
|
26
|
-
sm: 'text-sm px-2 py-1',
|
|
27
|
-
md: 'text-base px-4 py-2',
|
|
28
|
-
lg: 'text-lg px-6 py-3',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div
|
|
33
|
-
className={cn(
|
|
34
|
-
'inline-flex items-center justify-center rounded-lg bg-primary-500 text-white font-medium shadow-sm hover:bg-primary-600 transition-colors',
|
|
35
|
-
sizeClasses[size],
|
|
36
|
-
className
|
|
37
|
-
)}
|
|
38
|
-
{...props}
|
|
39
|
-
>
|
|
40
|
-
{children || `Hello, ${name}!`}
|
|
41
|
-
</div>
|
|
42
|
-
)
|
|
43
|
-
}
|
package/src/tailwind-theme.css
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
@theme {
|
|
4
|
-
/* Primary colors */
|
|
5
|
-
--color-primary-50: #f0f9ff;
|
|
6
|
-
--color-primary-100: #e0f2fe;
|
|
7
|
-
--color-primary-200: #bae6fd;
|
|
8
|
-
--color-primary-300: #7dd3fc;
|
|
9
|
-
--color-primary-400: #38bdf8;
|
|
10
|
-
--color-primary-500: #0ea5e9;
|
|
11
|
-
--color-primary-600: #0284c7;
|
|
12
|
-
--color-primary-700: #0369a1;
|
|
13
|
-
--color-primary-800: #075985;
|
|
14
|
-
--color-primary-900: #0c4a6e;
|
|
15
|
-
|
|
16
|
-
/* Secondary colors */
|
|
17
|
-
--color-secondary-50: #fafafa;
|
|
18
|
-
--color-secondary-100: #f4f4f5;
|
|
19
|
-
--color-secondary-200: #e4e4e7;
|
|
20
|
-
--color-secondary-300: #d4d4d8;
|
|
21
|
-
--color-secondary-400: #a1a1aa;
|
|
22
|
-
--color-secondary-500: #71717a;
|
|
23
|
-
--color-secondary-600: #52525b;
|
|
24
|
-
--color-secondary-700: #3f3f46;
|
|
25
|
-
--color-secondary-800: #27272a;
|
|
26
|
-
--color-secondary-900: #18181b;
|
|
27
|
-
|
|
28
|
-
/* Typography */
|
|
29
|
-
--font-sans: 'Inter', 'ui-sans-serif', 'system-ui';
|
|
30
|
-
|
|
31
|
-
/* Spacing */
|
|
32
|
-
--spacing-18: 4.5rem;
|
|
33
|
-
--spacing-88: 22rem;
|
|
34
|
-
|
|
35
|
-
/* Border radius */
|
|
36
|
-
--radius-xl: 0.75rem;
|
|
37
|
-
--radius-2xl: 1rem;
|
|
38
|
-
--radius-3xl: 1.5rem;
|
|
39
|
-
}
|