@goodhood-web/nebenan-base 4.12.0-development.9 → 4.12.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.
@@ -0,0 +1,21 @@
1
+ import { default as React, ComponentType, PropsWithChildren } from 'react';
2
+ import { ContentCreatorProps, HoodMessage } from './ContentCreatorForm.types';
3
+ export type OpenPayload = Omit<ContentCreatorProps & {
4
+ autoOpenImageUpload?: boolean;
5
+ config: {
6
+ chargebee: {
7
+ site: string;
8
+ };
9
+ };
10
+ }, 'open'>;
11
+ type ProviderProps = PropsWithChildren<{
12
+ invalidateCache?: (res: HoodMessage) => void;
13
+ }>;
14
+ interface ContentCreatorContextValue {
15
+ closeCC: () => void;
16
+ openCC: (props: OpenPayload) => void;
17
+ }
18
+ export declare const useContentCreator: () => ContentCreatorContextValue;
19
+ export declare const ContentCreatorProvider: ({ children, invalidateCache }: ProviderProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare function withContentCreator<TProps extends Record<string, unknown>, TRef = unknown>(Component: ComponentType<TProps & ContentCreatorContextValue>): React.ForwardRefExoticComponent<React.PropsWithoutRef<TProps> & React.RefAttributes<TRef>>;
21
+ export {};
@@ -0,0 +1,6 @@
1
+ interface PremiumFeatureCompletionModalProps {
2
+ isSuccess: boolean;
3
+ loading: boolean;
4
+ }
5
+ export declare const PremiumFeatureCompletionModal: ({ isSuccess, loading, }: PremiumFeatureCompletionModalProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -6,3 +6,4 @@ export * from './gidParser';
6
6
  export * from './priceFormatter';
7
7
  export * from './usePremiumFeatureCheckout';
8
8
  export * from './usePremiumFeatureCheckoutCompletion';
9
+ export * from './PremiumFeatureCompletionModal';
@@ -1,7 +1,8 @@
1
+ import { HoodMessage } from '../ContentCreator/ContentCreatorForm.types';
1
2
  /**
2
3
  * Hook to handle Premium Feature checkout with Chargebee.
3
4
  */
4
- export declare const usePremiumFeatureCheckout: () => {
5
+ export declare const usePremiumFeatureCheckout: (finalizeSubmit?: (response: HoodMessage) => void) => {
5
6
  PremiumFeatureCheckoutModal: import("react/jsx-runtime").JSX.Element;
6
- startCheckout: (postId: string, productId: string) => Promise<void>;
7
+ startCheckout: (postId: string, productId: string, res?: HoodMessage | undefined) => Promise<void>;
7
8
  };
@@ -1,8 +1,16 @@
1
+ interface SentryReporter {
2
+ captureException: (error: Error, context?: Record<string, unknown>) => void;
3
+ }
1
4
  /**
2
- * Hook to handle completion of Premium Feature checkout after redirect.
3
- * @param postId - ID of the post associated with the checkout
5
+ * Bulletproof hook to handle Chargebee payment confirmation after redirect.
6
+ * Returns confirmation state without any UI - component decides what to render.
7
+ *
8
+ * @param postId - ID of the post associated with the checkout (optional for global usage)
9
+ * @param sentryReporter - Sentry instance for error reporting (optional)
10
+ * @returns {isSuccess, loading} - Confirmation state
4
11
  */
5
- export declare const usePremiumFeatureCheckoutCompletion: (postId: string) => {
6
- PremiumFeatureCompletionModal: import("react/jsx-runtime").JSX.Element;
12
+ export declare const usePremiumFeatureCheckoutCompletion: (postId?: string, sentryReporter?: SentryReporter) => {
13
+ isSuccess: boolean;
7
14
  loading: boolean;
8
15
  };
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/nebenan-base",
3
- "version": "4.12.0-development.9",
3
+ "version": "4.12.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",