hey-pharmacist-ecommerce 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +233 -34
- package/dist/index.d.ts +233 -34
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/providers/EcommerceProvider.tsx +3 -2
- package/styles/base.css +34 -0
- package/styles/globals.css +3 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { LucideIcon } from 'lucide-react';
|
|
3
3
|
|
|
4
4
|
interface EcommerceConfig {
|
|
@@ -49,8 +49,9 @@ interface Category {
|
|
|
49
49
|
interface EcommerceProviderProps {
|
|
50
50
|
config: EcommerceConfig;
|
|
51
51
|
children: React.ReactNode;
|
|
52
|
+
withToaster?: boolean;
|
|
52
53
|
}
|
|
53
|
-
declare function EcommerceProvider({ config, children }: EcommerceProviderProps): React.JSX.Element;
|
|
54
|
+
declare function EcommerceProvider({ config, children, withToaster }: EcommerceProviderProps): React.JSX.Element;
|
|
54
55
|
|
|
55
56
|
interface ThemeContextValue {
|
|
56
57
|
config: EcommerceConfig;
|
|
@@ -2220,6 +2221,141 @@ interface LoginDto {
|
|
|
2220
2221
|
password: string;
|
|
2221
2222
|
}
|
|
2222
2223
|
|
|
2224
|
+
/**
|
|
2225
|
+
* Hey Pharamcist API
|
|
2226
|
+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
2227
|
+
*
|
|
2228
|
+
* OpenAPI spec version: 1.0
|
|
2229
|
+
*
|
|
2230
|
+
*
|
|
2231
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
2232
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
2233
|
+
* Do not edit the class manually.
|
|
2234
|
+
*/
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
*
|
|
2238
|
+
* @export
|
|
2239
|
+
* @interface Product
|
|
2240
|
+
*/
|
|
2241
|
+
interface Product {
|
|
2242
|
+
_id?: string;
|
|
2243
|
+
/**
|
|
2244
|
+
*
|
|
2245
|
+
* @type {Date}
|
|
2246
|
+
* @memberof Product
|
|
2247
|
+
*/
|
|
2248
|
+
createdAt: Date;
|
|
2249
|
+
/**
|
|
2250
|
+
*
|
|
2251
|
+
* @type {Date}
|
|
2252
|
+
* @memberof Product
|
|
2253
|
+
*/
|
|
2254
|
+
updatedAt: Date;
|
|
2255
|
+
/**
|
|
2256
|
+
*
|
|
2257
|
+
* @type {string}
|
|
2258
|
+
* @memberof Product
|
|
2259
|
+
*/
|
|
2260
|
+
id: string;
|
|
2261
|
+
/**
|
|
2262
|
+
*
|
|
2263
|
+
* @type {Array<string>}
|
|
2264
|
+
* @memberof Product
|
|
2265
|
+
*/
|
|
2266
|
+
parentSubCategories: Array<string>;
|
|
2267
|
+
/**
|
|
2268
|
+
*
|
|
2269
|
+
* @type {Array<string>}
|
|
2270
|
+
* @memberof Product
|
|
2271
|
+
*/
|
|
2272
|
+
parentCategories: Array<string>;
|
|
2273
|
+
/**
|
|
2274
|
+
*
|
|
2275
|
+
* @type {Array<string>}
|
|
2276
|
+
* @memberof Product
|
|
2277
|
+
*/
|
|
2278
|
+
productVariants: Array<string>;
|
|
2279
|
+
/**
|
|
2280
|
+
*
|
|
2281
|
+
* @type {string}
|
|
2282
|
+
* @memberof Product
|
|
2283
|
+
*/
|
|
2284
|
+
storeId: string;
|
|
2285
|
+
/**
|
|
2286
|
+
*
|
|
2287
|
+
* @type {string}
|
|
2288
|
+
* @memberof Product
|
|
2289
|
+
*/
|
|
2290
|
+
name: string;
|
|
2291
|
+
/**
|
|
2292
|
+
*
|
|
2293
|
+
* @type {string}
|
|
2294
|
+
* @memberof Product
|
|
2295
|
+
*/
|
|
2296
|
+
description: string;
|
|
2297
|
+
/**
|
|
2298
|
+
*
|
|
2299
|
+
* @type {Array<SingleProductMedia>}
|
|
2300
|
+
* @memberof Product
|
|
2301
|
+
*/
|
|
2302
|
+
productMedia: Array<SingleProductMedia>;
|
|
2303
|
+
/**
|
|
2304
|
+
*
|
|
2305
|
+
* @type {Array<string>}
|
|
2306
|
+
* @memberof Product
|
|
2307
|
+
*/
|
|
2308
|
+
tags: Array<string>;
|
|
2309
|
+
/**
|
|
2310
|
+
*
|
|
2311
|
+
* @type {boolean}
|
|
2312
|
+
* @memberof Product
|
|
2313
|
+
*/
|
|
2314
|
+
isActive: boolean;
|
|
2315
|
+
/**
|
|
2316
|
+
*
|
|
2317
|
+
* @type {string}
|
|
2318
|
+
* @memberof Product
|
|
2319
|
+
*/
|
|
2320
|
+
brand: string;
|
|
2321
|
+
/**
|
|
2322
|
+
*
|
|
2323
|
+
* @type {Array<string>}
|
|
2324
|
+
* @memberof Product
|
|
2325
|
+
*/
|
|
2326
|
+
embedding: Array<string>;
|
|
2327
|
+
/**
|
|
2328
|
+
*
|
|
2329
|
+
* @type {string}
|
|
2330
|
+
* @memberof Product
|
|
2331
|
+
*/
|
|
2332
|
+
sku: string;
|
|
2333
|
+
/**
|
|
2334
|
+
*
|
|
2335
|
+
* @type {Array<string>}
|
|
2336
|
+
* @memberof Product
|
|
2337
|
+
*/
|
|
2338
|
+
frequentlyBoughtProducts: Array<string>;
|
|
2339
|
+
/**
|
|
2340
|
+
*
|
|
2341
|
+
* @type {boolean}
|
|
2342
|
+
* @memberof Product
|
|
2343
|
+
*/
|
|
2344
|
+
showStock: boolean;
|
|
2345
|
+
/**
|
|
2346
|
+
*
|
|
2347
|
+
* @type {Array<string>}
|
|
2348
|
+
* @memberof Product
|
|
2349
|
+
*/
|
|
2350
|
+
reviews: Array<string>;
|
|
2351
|
+
/**
|
|
2352
|
+
*
|
|
2353
|
+
* @type {string}
|
|
2354
|
+
* @memberof Product
|
|
2355
|
+
*/
|
|
2356
|
+
upc: string;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2223
2359
|
/**
|
|
2224
2360
|
* Hey Pharamcist API
|
|
2225
2361
|
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
@@ -3573,6 +3709,56 @@ declare enum UpdateUserDtoCustomerTypeEnum {
|
|
|
3573
3709
|
Regular = "Regular"
|
|
3574
3710
|
}
|
|
3575
3711
|
|
|
3712
|
+
/**
|
|
3713
|
+
* Hey Pharamcist API
|
|
3714
|
+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
3715
|
+
*
|
|
3716
|
+
* OpenAPI spec version: 1.0
|
|
3717
|
+
*
|
|
3718
|
+
*
|
|
3719
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
3720
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
3721
|
+
* Do not edit the class manually.
|
|
3722
|
+
*/
|
|
3723
|
+
/**
|
|
3724
|
+
*
|
|
3725
|
+
* @export
|
|
3726
|
+
* @interface Wishlist
|
|
3727
|
+
*/
|
|
3728
|
+
interface Wishlist {
|
|
3729
|
+
_id?: string;
|
|
3730
|
+
/**
|
|
3731
|
+
*
|
|
3732
|
+
* @type {Date}
|
|
3733
|
+
* @memberof Wishlist
|
|
3734
|
+
*/
|
|
3735
|
+
createdAt: Date;
|
|
3736
|
+
/**
|
|
3737
|
+
*
|
|
3738
|
+
* @type {Date}
|
|
3739
|
+
* @memberof Wishlist
|
|
3740
|
+
*/
|
|
3741
|
+
updatedAt: Date;
|
|
3742
|
+
/**
|
|
3743
|
+
*
|
|
3744
|
+
* @type {string}
|
|
3745
|
+
* @memberof Wishlist
|
|
3746
|
+
*/
|
|
3747
|
+
userId: string;
|
|
3748
|
+
/**
|
|
3749
|
+
*
|
|
3750
|
+
* @type {Array<string>}
|
|
3751
|
+
* @memberof Wishlist
|
|
3752
|
+
*/
|
|
3753
|
+
products: Array<string>;
|
|
3754
|
+
/**
|
|
3755
|
+
*
|
|
3756
|
+
* @type {number}
|
|
3757
|
+
* @memberof Wishlist
|
|
3758
|
+
*/
|
|
3759
|
+
itemCount: number;
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3576
3762
|
interface AuthContextValue {
|
|
3577
3763
|
user: UserEntity | null;
|
|
3578
3764
|
isAuthenticated: boolean;
|
|
@@ -3604,37 +3790,6 @@ interface CartProviderProps {
|
|
|
3604
3790
|
}
|
|
3605
3791
|
declare function CartProvider({ children }: CartProviderProps): React.JSX.Element;
|
|
3606
3792
|
|
|
3607
|
-
interface ShopScreenProps {
|
|
3608
|
-
initialFilters?: ProductFilters;
|
|
3609
|
-
categoryName?: string;
|
|
3610
|
-
}
|
|
3611
|
-
declare function ShopScreen({ initialFilters, categoryName }: ShopScreenProps): React.JSX.Element;
|
|
3612
|
-
|
|
3613
|
-
interface ProductDetailScreenProps {
|
|
3614
|
-
productId: string;
|
|
3615
|
-
}
|
|
3616
|
-
declare function ProductDetailScreen({ productId }: ProductDetailScreenProps): React.JSX.Element;
|
|
3617
|
-
|
|
3618
|
-
declare function CartScreen(): React.JSX.Element;
|
|
3619
|
-
|
|
3620
|
-
declare function CheckoutScreen(): React.JSX.Element | null;
|
|
3621
|
-
|
|
3622
|
-
declare function LoginScreen(): React.JSX.Element;
|
|
3623
|
-
|
|
3624
|
-
declare function RegisterScreen(): React.JSX.Element;
|
|
3625
|
-
|
|
3626
|
-
declare function ProfileScreen(): React.JSX.Element | null;
|
|
3627
|
-
|
|
3628
|
-
declare function OrdersScreen(): React.JSX.Element;
|
|
3629
|
-
|
|
3630
|
-
declare function CurrentOrdersScreen(): React.JSX.Element;
|
|
3631
|
-
|
|
3632
|
-
declare function AddressesScreen(): React.JSX.Element;
|
|
3633
|
-
|
|
3634
|
-
declare function Header(): React.JSX.Element;
|
|
3635
|
-
|
|
3636
|
-
declare function Footer(): React.JSX.Element;
|
|
3637
|
-
|
|
3638
3793
|
/**
|
|
3639
3794
|
* Hey Pharamcist API
|
|
3640
3795
|
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
@@ -3700,6 +3855,50 @@ declare class Configuration {
|
|
|
3700
3855
|
constructor(param?: ConfigurationParameters);
|
|
3701
3856
|
}
|
|
3702
3857
|
|
|
3858
|
+
interface WishlistContextType extends Wishlist {
|
|
3859
|
+
addToWishlist: (product: Product) => Promise<void>;
|
|
3860
|
+
removeFromWishlist: (productId: string) => Promise<void>;
|
|
3861
|
+
isInWishlist: (productId: string) => boolean;
|
|
3862
|
+
getWishlistCount: () => number;
|
|
3863
|
+
refreshWishlist: () => Promise<void>;
|
|
3864
|
+
clearWishlist: () => Promise<void>;
|
|
3865
|
+
}
|
|
3866
|
+
declare function WishlistProvider({ children }: {
|
|
3867
|
+
children: ReactNode;
|
|
3868
|
+
}): React.JSX.Element;
|
|
3869
|
+
declare const useWishlist: () => WishlistContextType;
|
|
3870
|
+
|
|
3871
|
+
interface ShopScreenProps {
|
|
3872
|
+
initialFilters?: ProductFilters;
|
|
3873
|
+
categoryName?: string;
|
|
3874
|
+
}
|
|
3875
|
+
declare function ShopScreen({ initialFilters, categoryName }: ShopScreenProps): React.JSX.Element;
|
|
3876
|
+
|
|
3877
|
+
interface ProductDetailScreenProps {
|
|
3878
|
+
productId: string;
|
|
3879
|
+
}
|
|
3880
|
+
declare function ProductDetailScreen({ productId }: ProductDetailScreenProps): React.JSX.Element;
|
|
3881
|
+
|
|
3882
|
+
declare function CartScreen(): React.JSX.Element;
|
|
3883
|
+
|
|
3884
|
+
declare function CheckoutScreen(): React.JSX.Element | null;
|
|
3885
|
+
|
|
3886
|
+
declare function LoginScreen(): React.JSX.Element;
|
|
3887
|
+
|
|
3888
|
+
declare function RegisterScreen(): React.JSX.Element;
|
|
3889
|
+
|
|
3890
|
+
declare function ProfileScreen(): React.JSX.Element | null;
|
|
3891
|
+
|
|
3892
|
+
declare function OrdersScreen(): React.JSX.Element;
|
|
3893
|
+
|
|
3894
|
+
declare function CurrentOrdersScreen(): React.JSX.Element;
|
|
3895
|
+
|
|
3896
|
+
declare function AddressesScreen(): React.JSX.Element;
|
|
3897
|
+
|
|
3898
|
+
declare function Header(): React.JSX.Element;
|
|
3899
|
+
|
|
3900
|
+
declare function Footer(): React.JSX.Element;
|
|
3901
|
+
|
|
3703
3902
|
interface ProductCardProps {
|
|
3704
3903
|
product: ExtendedProductDTO;
|
|
3705
3904
|
onClickProduct?: (product: ExtendedProductDTO) => void;
|
|
@@ -3881,4 +4080,4 @@ declare function generateColorShades(baseColor: string): {
|
|
|
3881
4080
|
950: string;
|
|
3882
4081
|
};
|
|
3883
4082
|
|
|
3884
|
-
export { AddressesScreen, AuthProvider, Badge, Button, CartItem, CartProvider, CartScreen, type Category, CheckoutScreen, CurrentOrdersScreen, type EcommerceConfig, EcommerceProvider, EmptyState, Footer, Header, Input, LoginScreen, Modal, OrderCard, OrderCardSkeleton, OrderStatus, OrdersScreen, ProductCard, ProductCardSkeleton, ProductDetailScreen, type ProductFilters, ProfileScreen, RegisterScreen, ShopScreen, Skeleton, ThemeProvider, formatDate, formatPrice, generateColorShades, getApiConfiguration, getInitials, hexToRgb, initializeApiAdapter, truncate, useAddresses, useAuth, useCart, useCategories, useCurrentOrders, useOrder, useOrders, useProduct, useProducts, useTheme };
|
|
4083
|
+
export { AddressesScreen, AuthProvider, Badge, Button, CartItem, CartProvider, CartScreen, type Category, CheckoutScreen, CurrentOrdersScreen, type EcommerceConfig, EcommerceProvider, EmptyState, Footer, Header, Input, LoginScreen, Modal, OrderCard, OrderCardSkeleton, OrderStatus, OrdersScreen, ProductCard, ProductCardSkeleton, ProductDetailScreen, type ProductFilters, ProfileScreen, RegisterScreen, ShopScreen, Skeleton, ThemeProvider, WishlistProvider, formatDate, formatPrice, generateColorShades, getApiConfiguration, getInitials, hexToRgb, initializeApiAdapter, truncate, useAddresses, useAuth, useCart, useCategories, useCurrentOrders, useOrder, useOrders, useProduct, useProducts, useTheme, useWishlist };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { LucideIcon } from 'lucide-react';
|
|
3
3
|
|
|
4
4
|
interface EcommerceConfig {
|
|
@@ -49,8 +49,9 @@ interface Category {
|
|
|
49
49
|
interface EcommerceProviderProps {
|
|
50
50
|
config: EcommerceConfig;
|
|
51
51
|
children: React.ReactNode;
|
|
52
|
+
withToaster?: boolean;
|
|
52
53
|
}
|
|
53
|
-
declare function EcommerceProvider({ config, children }: EcommerceProviderProps): React.JSX.Element;
|
|
54
|
+
declare function EcommerceProvider({ config, children, withToaster }: EcommerceProviderProps): React.JSX.Element;
|
|
54
55
|
|
|
55
56
|
interface ThemeContextValue {
|
|
56
57
|
config: EcommerceConfig;
|
|
@@ -2220,6 +2221,141 @@ interface LoginDto {
|
|
|
2220
2221
|
password: string;
|
|
2221
2222
|
}
|
|
2222
2223
|
|
|
2224
|
+
/**
|
|
2225
|
+
* Hey Pharamcist API
|
|
2226
|
+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
2227
|
+
*
|
|
2228
|
+
* OpenAPI spec version: 1.0
|
|
2229
|
+
*
|
|
2230
|
+
*
|
|
2231
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
2232
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
2233
|
+
* Do not edit the class manually.
|
|
2234
|
+
*/
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
*
|
|
2238
|
+
* @export
|
|
2239
|
+
* @interface Product
|
|
2240
|
+
*/
|
|
2241
|
+
interface Product {
|
|
2242
|
+
_id?: string;
|
|
2243
|
+
/**
|
|
2244
|
+
*
|
|
2245
|
+
* @type {Date}
|
|
2246
|
+
* @memberof Product
|
|
2247
|
+
*/
|
|
2248
|
+
createdAt: Date;
|
|
2249
|
+
/**
|
|
2250
|
+
*
|
|
2251
|
+
* @type {Date}
|
|
2252
|
+
* @memberof Product
|
|
2253
|
+
*/
|
|
2254
|
+
updatedAt: Date;
|
|
2255
|
+
/**
|
|
2256
|
+
*
|
|
2257
|
+
* @type {string}
|
|
2258
|
+
* @memberof Product
|
|
2259
|
+
*/
|
|
2260
|
+
id: string;
|
|
2261
|
+
/**
|
|
2262
|
+
*
|
|
2263
|
+
* @type {Array<string>}
|
|
2264
|
+
* @memberof Product
|
|
2265
|
+
*/
|
|
2266
|
+
parentSubCategories: Array<string>;
|
|
2267
|
+
/**
|
|
2268
|
+
*
|
|
2269
|
+
* @type {Array<string>}
|
|
2270
|
+
* @memberof Product
|
|
2271
|
+
*/
|
|
2272
|
+
parentCategories: Array<string>;
|
|
2273
|
+
/**
|
|
2274
|
+
*
|
|
2275
|
+
* @type {Array<string>}
|
|
2276
|
+
* @memberof Product
|
|
2277
|
+
*/
|
|
2278
|
+
productVariants: Array<string>;
|
|
2279
|
+
/**
|
|
2280
|
+
*
|
|
2281
|
+
* @type {string}
|
|
2282
|
+
* @memberof Product
|
|
2283
|
+
*/
|
|
2284
|
+
storeId: string;
|
|
2285
|
+
/**
|
|
2286
|
+
*
|
|
2287
|
+
* @type {string}
|
|
2288
|
+
* @memberof Product
|
|
2289
|
+
*/
|
|
2290
|
+
name: string;
|
|
2291
|
+
/**
|
|
2292
|
+
*
|
|
2293
|
+
* @type {string}
|
|
2294
|
+
* @memberof Product
|
|
2295
|
+
*/
|
|
2296
|
+
description: string;
|
|
2297
|
+
/**
|
|
2298
|
+
*
|
|
2299
|
+
* @type {Array<SingleProductMedia>}
|
|
2300
|
+
* @memberof Product
|
|
2301
|
+
*/
|
|
2302
|
+
productMedia: Array<SingleProductMedia>;
|
|
2303
|
+
/**
|
|
2304
|
+
*
|
|
2305
|
+
* @type {Array<string>}
|
|
2306
|
+
* @memberof Product
|
|
2307
|
+
*/
|
|
2308
|
+
tags: Array<string>;
|
|
2309
|
+
/**
|
|
2310
|
+
*
|
|
2311
|
+
* @type {boolean}
|
|
2312
|
+
* @memberof Product
|
|
2313
|
+
*/
|
|
2314
|
+
isActive: boolean;
|
|
2315
|
+
/**
|
|
2316
|
+
*
|
|
2317
|
+
* @type {string}
|
|
2318
|
+
* @memberof Product
|
|
2319
|
+
*/
|
|
2320
|
+
brand: string;
|
|
2321
|
+
/**
|
|
2322
|
+
*
|
|
2323
|
+
* @type {Array<string>}
|
|
2324
|
+
* @memberof Product
|
|
2325
|
+
*/
|
|
2326
|
+
embedding: Array<string>;
|
|
2327
|
+
/**
|
|
2328
|
+
*
|
|
2329
|
+
* @type {string}
|
|
2330
|
+
* @memberof Product
|
|
2331
|
+
*/
|
|
2332
|
+
sku: string;
|
|
2333
|
+
/**
|
|
2334
|
+
*
|
|
2335
|
+
* @type {Array<string>}
|
|
2336
|
+
* @memberof Product
|
|
2337
|
+
*/
|
|
2338
|
+
frequentlyBoughtProducts: Array<string>;
|
|
2339
|
+
/**
|
|
2340
|
+
*
|
|
2341
|
+
* @type {boolean}
|
|
2342
|
+
* @memberof Product
|
|
2343
|
+
*/
|
|
2344
|
+
showStock: boolean;
|
|
2345
|
+
/**
|
|
2346
|
+
*
|
|
2347
|
+
* @type {Array<string>}
|
|
2348
|
+
* @memberof Product
|
|
2349
|
+
*/
|
|
2350
|
+
reviews: Array<string>;
|
|
2351
|
+
/**
|
|
2352
|
+
*
|
|
2353
|
+
* @type {string}
|
|
2354
|
+
* @memberof Product
|
|
2355
|
+
*/
|
|
2356
|
+
upc: string;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2223
2359
|
/**
|
|
2224
2360
|
* Hey Pharamcist API
|
|
2225
2361
|
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
@@ -3573,6 +3709,56 @@ declare enum UpdateUserDtoCustomerTypeEnum {
|
|
|
3573
3709
|
Regular = "Regular"
|
|
3574
3710
|
}
|
|
3575
3711
|
|
|
3712
|
+
/**
|
|
3713
|
+
* Hey Pharamcist API
|
|
3714
|
+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
3715
|
+
*
|
|
3716
|
+
* OpenAPI spec version: 1.0
|
|
3717
|
+
*
|
|
3718
|
+
*
|
|
3719
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
3720
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
3721
|
+
* Do not edit the class manually.
|
|
3722
|
+
*/
|
|
3723
|
+
/**
|
|
3724
|
+
*
|
|
3725
|
+
* @export
|
|
3726
|
+
* @interface Wishlist
|
|
3727
|
+
*/
|
|
3728
|
+
interface Wishlist {
|
|
3729
|
+
_id?: string;
|
|
3730
|
+
/**
|
|
3731
|
+
*
|
|
3732
|
+
* @type {Date}
|
|
3733
|
+
* @memberof Wishlist
|
|
3734
|
+
*/
|
|
3735
|
+
createdAt: Date;
|
|
3736
|
+
/**
|
|
3737
|
+
*
|
|
3738
|
+
* @type {Date}
|
|
3739
|
+
* @memberof Wishlist
|
|
3740
|
+
*/
|
|
3741
|
+
updatedAt: Date;
|
|
3742
|
+
/**
|
|
3743
|
+
*
|
|
3744
|
+
* @type {string}
|
|
3745
|
+
* @memberof Wishlist
|
|
3746
|
+
*/
|
|
3747
|
+
userId: string;
|
|
3748
|
+
/**
|
|
3749
|
+
*
|
|
3750
|
+
* @type {Array<string>}
|
|
3751
|
+
* @memberof Wishlist
|
|
3752
|
+
*/
|
|
3753
|
+
products: Array<string>;
|
|
3754
|
+
/**
|
|
3755
|
+
*
|
|
3756
|
+
* @type {number}
|
|
3757
|
+
* @memberof Wishlist
|
|
3758
|
+
*/
|
|
3759
|
+
itemCount: number;
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3576
3762
|
interface AuthContextValue {
|
|
3577
3763
|
user: UserEntity | null;
|
|
3578
3764
|
isAuthenticated: boolean;
|
|
@@ -3604,37 +3790,6 @@ interface CartProviderProps {
|
|
|
3604
3790
|
}
|
|
3605
3791
|
declare function CartProvider({ children }: CartProviderProps): React.JSX.Element;
|
|
3606
3792
|
|
|
3607
|
-
interface ShopScreenProps {
|
|
3608
|
-
initialFilters?: ProductFilters;
|
|
3609
|
-
categoryName?: string;
|
|
3610
|
-
}
|
|
3611
|
-
declare function ShopScreen({ initialFilters, categoryName }: ShopScreenProps): React.JSX.Element;
|
|
3612
|
-
|
|
3613
|
-
interface ProductDetailScreenProps {
|
|
3614
|
-
productId: string;
|
|
3615
|
-
}
|
|
3616
|
-
declare function ProductDetailScreen({ productId }: ProductDetailScreenProps): React.JSX.Element;
|
|
3617
|
-
|
|
3618
|
-
declare function CartScreen(): React.JSX.Element;
|
|
3619
|
-
|
|
3620
|
-
declare function CheckoutScreen(): React.JSX.Element | null;
|
|
3621
|
-
|
|
3622
|
-
declare function LoginScreen(): React.JSX.Element;
|
|
3623
|
-
|
|
3624
|
-
declare function RegisterScreen(): React.JSX.Element;
|
|
3625
|
-
|
|
3626
|
-
declare function ProfileScreen(): React.JSX.Element | null;
|
|
3627
|
-
|
|
3628
|
-
declare function OrdersScreen(): React.JSX.Element;
|
|
3629
|
-
|
|
3630
|
-
declare function CurrentOrdersScreen(): React.JSX.Element;
|
|
3631
|
-
|
|
3632
|
-
declare function AddressesScreen(): React.JSX.Element;
|
|
3633
|
-
|
|
3634
|
-
declare function Header(): React.JSX.Element;
|
|
3635
|
-
|
|
3636
|
-
declare function Footer(): React.JSX.Element;
|
|
3637
|
-
|
|
3638
3793
|
/**
|
|
3639
3794
|
* Hey Pharamcist API
|
|
3640
3795
|
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
@@ -3700,6 +3855,50 @@ declare class Configuration {
|
|
|
3700
3855
|
constructor(param?: ConfigurationParameters);
|
|
3701
3856
|
}
|
|
3702
3857
|
|
|
3858
|
+
interface WishlistContextType extends Wishlist {
|
|
3859
|
+
addToWishlist: (product: Product) => Promise<void>;
|
|
3860
|
+
removeFromWishlist: (productId: string) => Promise<void>;
|
|
3861
|
+
isInWishlist: (productId: string) => boolean;
|
|
3862
|
+
getWishlistCount: () => number;
|
|
3863
|
+
refreshWishlist: () => Promise<void>;
|
|
3864
|
+
clearWishlist: () => Promise<void>;
|
|
3865
|
+
}
|
|
3866
|
+
declare function WishlistProvider({ children }: {
|
|
3867
|
+
children: ReactNode;
|
|
3868
|
+
}): React.JSX.Element;
|
|
3869
|
+
declare const useWishlist: () => WishlistContextType;
|
|
3870
|
+
|
|
3871
|
+
interface ShopScreenProps {
|
|
3872
|
+
initialFilters?: ProductFilters;
|
|
3873
|
+
categoryName?: string;
|
|
3874
|
+
}
|
|
3875
|
+
declare function ShopScreen({ initialFilters, categoryName }: ShopScreenProps): React.JSX.Element;
|
|
3876
|
+
|
|
3877
|
+
interface ProductDetailScreenProps {
|
|
3878
|
+
productId: string;
|
|
3879
|
+
}
|
|
3880
|
+
declare function ProductDetailScreen({ productId }: ProductDetailScreenProps): React.JSX.Element;
|
|
3881
|
+
|
|
3882
|
+
declare function CartScreen(): React.JSX.Element;
|
|
3883
|
+
|
|
3884
|
+
declare function CheckoutScreen(): React.JSX.Element | null;
|
|
3885
|
+
|
|
3886
|
+
declare function LoginScreen(): React.JSX.Element;
|
|
3887
|
+
|
|
3888
|
+
declare function RegisterScreen(): React.JSX.Element;
|
|
3889
|
+
|
|
3890
|
+
declare function ProfileScreen(): React.JSX.Element | null;
|
|
3891
|
+
|
|
3892
|
+
declare function OrdersScreen(): React.JSX.Element;
|
|
3893
|
+
|
|
3894
|
+
declare function CurrentOrdersScreen(): React.JSX.Element;
|
|
3895
|
+
|
|
3896
|
+
declare function AddressesScreen(): React.JSX.Element;
|
|
3897
|
+
|
|
3898
|
+
declare function Header(): React.JSX.Element;
|
|
3899
|
+
|
|
3900
|
+
declare function Footer(): React.JSX.Element;
|
|
3901
|
+
|
|
3703
3902
|
interface ProductCardProps {
|
|
3704
3903
|
product: ExtendedProductDTO;
|
|
3705
3904
|
onClickProduct?: (product: ExtendedProductDTO) => void;
|
|
@@ -3881,4 +4080,4 @@ declare function generateColorShades(baseColor: string): {
|
|
|
3881
4080
|
950: string;
|
|
3882
4081
|
};
|
|
3883
4082
|
|
|
3884
|
-
export { AddressesScreen, AuthProvider, Badge, Button, CartItem, CartProvider, CartScreen, type Category, CheckoutScreen, CurrentOrdersScreen, type EcommerceConfig, EcommerceProvider, EmptyState, Footer, Header, Input, LoginScreen, Modal, OrderCard, OrderCardSkeleton, OrderStatus, OrdersScreen, ProductCard, ProductCardSkeleton, ProductDetailScreen, type ProductFilters, ProfileScreen, RegisterScreen, ShopScreen, Skeleton, ThemeProvider, formatDate, formatPrice, generateColorShades, getApiConfiguration, getInitials, hexToRgb, initializeApiAdapter, truncate, useAddresses, useAuth, useCart, useCategories, useCurrentOrders, useOrder, useOrders, useProduct, useProducts, useTheme };
|
|
4083
|
+
export { AddressesScreen, AuthProvider, Badge, Button, CartItem, CartProvider, CartScreen, type Category, CheckoutScreen, CurrentOrdersScreen, type EcommerceConfig, EcommerceProvider, EmptyState, Footer, Header, Input, LoginScreen, Modal, OrderCard, OrderCardSkeleton, OrderStatus, OrdersScreen, ProductCard, ProductCardSkeleton, ProductDetailScreen, type ProductFilters, ProfileScreen, RegisterScreen, ShopScreen, Skeleton, ThemeProvider, WishlistProvider, formatDate, formatPrice, generateColorShades, getApiConfiguration, getInitials, hexToRgb, initializeApiAdapter, truncate, useAddresses, useAuth, useCart, useCategories, useCurrentOrders, useOrder, useOrders, useProduct, useProducts, useTheme, useWishlist };
|
package/dist/index.js
CHANGED
|
@@ -6950,14 +6950,14 @@ var useWishlist = () => {
|
|
|
6950
6950
|
}
|
|
6951
6951
|
return context;
|
|
6952
6952
|
};
|
|
6953
|
-
function EcommerceProvider({ config, children }) {
|
|
6953
|
+
function EcommerceProvider({ config, children, withToaster = true }) {
|
|
6954
6954
|
React19.useEffect(() => {
|
|
6955
6955
|
initializeApiAdapter(config);
|
|
6956
6956
|
}, [config]);
|
|
6957
6957
|
const [client] = React19__default.default.useState(
|
|
6958
6958
|
new reactQuery.QueryClient({ defaultOptions: { queries: { staleTime: 5e3 } } })
|
|
6959
6959
|
);
|
|
6960
|
-
return /* @__PURE__ */ React19__default.default.createElement(reactQuery.QueryClientProvider, { client }, /* @__PURE__ */ React19__default.default.createElement(ThemeProvider, { config }, /* @__PURE__ */ React19__default.default.createElement(AuthProvider, null, /* @__PURE__ */ React19__default.default.createElement(CartProvider, null, /* @__PURE__ */ React19__default.default.createElement(WishlistProvider, null, children, /* @__PURE__ */ React19__default.default.createElement(sonner.Toaster, { position: "top-right", richColors: true }))))));
|
|
6960
|
+
return /* @__PURE__ */ React19__default.default.createElement(reactQuery.QueryClientProvider, { client }, /* @__PURE__ */ React19__default.default.createElement(ThemeProvider, { config }, /* @__PURE__ */ React19__default.default.createElement(AuthProvider, null, /* @__PURE__ */ React19__default.default.createElement(CartProvider, null, /* @__PURE__ */ React19__default.default.createElement(WishlistProvider, null, children, withToaster && /* @__PURE__ */ React19__default.default.createElement(sonner.Toaster, { position: "top-right", richColors: true }))))));
|
|
6961
6961
|
}
|
|
6962
6962
|
|
|
6963
6963
|
// src/lib/utils/format.ts
|
|
@@ -10886,6 +10886,7 @@ exports.RegisterScreen = RegisterScreen;
|
|
|
10886
10886
|
exports.ShopScreen = ShopScreen;
|
|
10887
10887
|
exports.Skeleton = Skeleton;
|
|
10888
10888
|
exports.ThemeProvider = ThemeProvider;
|
|
10889
|
+
exports.WishlistProvider = WishlistProvider;
|
|
10889
10890
|
exports.formatDate = formatDate;
|
|
10890
10891
|
exports.formatPrice = formatPrice;
|
|
10891
10892
|
exports.generateColorShades = generateColorShades;
|
|
@@ -10904,5 +10905,6 @@ exports.useOrders = useOrders;
|
|
|
10904
10905
|
exports.useProduct = useProduct;
|
|
10905
10906
|
exports.useProducts = useProducts;
|
|
10906
10907
|
exports.useTheme = useTheme;
|
|
10908
|
+
exports.useWishlist = useWishlist;
|
|
10907
10909
|
//# sourceMappingURL=index.js.map
|
|
10908
10910
|
//# sourceMappingURL=index.js.map
|