@caseparts-org/casecore 0.0.11 → 0.0.12
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.ts
CHANGED
|
@@ -10,4 +10,3 @@ export type { Pricing, CustomerClass } from './cart/ClassPricing';
|
|
|
10
10
|
export { getClassPricing } from './cart/ClassPricing';
|
|
11
11
|
export type { BaseCartItem, Cart, CartConfig, CartContextValue, CreateCartReturn, PricingResolver, CartProviderProps } from './cart/CreateCart';
|
|
12
12
|
export { createCart } from './cart/CreateCart';
|
|
13
|
-
export { useCartContext, DomainCartProvider } from './cart/DomainCartProvider';
|
package/dist/index.js
CHANGED
|
@@ -7,4 +7,3 @@ export { buildClaimsFromPayload } from './utils/ClaimsUtils';
|
|
|
7
7
|
export { default as useMicroFlex } from './hooks/useMicroFlex';
|
|
8
8
|
export { getClassPricing } from './cart/ClassPricing';
|
|
9
9
|
export { createCart } from './cart/CreateCart';
|
|
10
|
-
export { useCartContext, DomainCartProvider } from './cart/DomainCartProvider';
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { BaseCartItem } from './CreateCart';
|
|
2
|
-
export declare const useCartContext: () => import("./CreateCart").CartContextValue<BaseCartItem>;
|
|
3
|
-
export declare function DomainCartProvider({ children }: {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createCart } from './CreateCart';
|
|
3
|
-
import { useAuthContext } from '../authentication/AuthContext';
|
|
4
|
-
import { getClassPricing } from './ClassPricing';
|
|
5
|
-
const CartApi = createCart({ storageKey: 'CPC.cart' });
|
|
6
|
-
export const { useCartContext } = CartApi;
|
|
7
|
-
export function DomainCartProvider({ children }) {
|
|
8
|
-
const auth = useAuthContext();
|
|
9
|
-
const resolver = (item) => getClassPricing(auth.discountLevel, item.Pricing) ?? 0;
|
|
10
|
-
return (_jsx(CartApi.CartProvider, { pricingResolver: resolver, children: children }));
|
|
11
|
-
}
|