@goodhood-web/nebenan-base 4.12.0-development.1 → 4.12.0-development.10

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 {};
@@ -1,4 +1,3 @@
1
- import { Poi } from '../../../../../api/src/lib/core_v2';
2
1
  import { ImageFile } from '../../RichTextArea/RichTextArea.types';
3
2
  export declare const contentCreatorImages: import('jotai').PrimitiveAtom<ImageFile[] | null> & {
4
3
  init: ImageFile[] | null;
@@ -6,6 +5,42 @@ export declare const contentCreatorImages: import('jotai').PrimitiveAtom<ImageFi
6
5
  export declare const selectedContentCreatorImage: import('jotai').PrimitiveAtom<ImageFile | null> & {
7
6
  init: ImageFile | null;
8
7
  };
9
- export declare const eventLocation: import('jotai').PrimitiveAtom<Poi | null> & {
10
- init: Poi | null;
8
+ export declare const eventLocation: import('jotai').PrimitiveAtom<{
9
+ id: string;
10
+ categories: import('../../../../../api/src/lib/core').components["schemas"]["Core_V3_NOPE_Category_List"];
11
+ gid: string;
12
+ kind: "business" | "organization";
13
+ legacy_gid: string;
14
+ recommendations_count: number;
15
+ subcategories: import('../../../../../api/src/lib/core').components["schemas"]["Core_V3_NOPE_Category_List"];
16
+ supporter: boolean;
17
+ title?: string | null;
18
+ city?: string | null;
19
+ house_number?: string | null;
20
+ location?: import('../../../../../api/src/lib/core').components["schemas"]["Core_V3_Point"] | null;
21
+ street?: string | null;
22
+ zip_code?: string | null;
23
+ banner_url?: string | null;
24
+ logo_url?: string | null;
25
+ representative_image_url?: string | null;
26
+ } | null> & {
27
+ init: {
28
+ id: string;
29
+ categories: import('../../../../../api/src/lib/core').components["schemas"]["Core_V3_NOPE_Category_List"];
30
+ gid: string;
31
+ kind: "business" | "organization";
32
+ legacy_gid: string;
33
+ recommendations_count: number;
34
+ subcategories: import('../../../../../api/src/lib/core').components["schemas"]["Core_V3_NOPE_Category_List"];
35
+ supporter: boolean;
36
+ title?: string | null;
37
+ city?: string | null;
38
+ house_number?: string | null;
39
+ location?: import('../../../../../api/src/lib/core').components["schemas"]["Core_V3_Point"] | null;
40
+ street?: string | null;
41
+ zip_code?: string | null;
42
+ banner_url?: string | null;
43
+ logo_url?: string | null;
44
+ representative_image_url?: string | null;
45
+ } | null;
11
46
  };
@@ -48,7 +48,7 @@ export type EmbeddableType = CoreV3Embed;
48
48
  export type ContentEmbeddable = CoreV3Embed;
49
49
  export type RichTextAreaValueType = {
50
50
  attachments?: {
51
- images?: ImageFile[];
51
+ images?: ImageFile[] | string[];
52
52
  };
53
53
  body: string;
54
54
  embeddables: EmbeddableType[] | [];
@@ -1,3 +1,3 @@
1
1
  import { POIRecommendationProps } from './POIRecommendation.types';
2
- declare const POIRecommendation: ({ onAddLocation, onDismiss, onSelect, openSheet, purpose, searchableListProps, }: POIRecommendationProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const POIRecommendation: ({ onAddLocation, onDismiss, onSelect, openSheet, searchableListProps, }: POIRecommendationProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default POIRecommendation;
@@ -1,12 +1,11 @@
1
1
  import { components } from '../../../../../../api/src/lib/core';
2
- import { Poi } from '../../../../../../api/src/lib/core_v2';
3
2
  import { SearchableListProps } from '../../../SearchableList/SearchableList.types';
3
+ export type V3BusinessProfile = components['schemas']['Core_V3_NOPE_Profile'];
4
4
  export type POIRecommendationProps = {
5
5
  onAddLocation?: (name: string) => void;
6
6
  onDismiss: () => void;
7
- onSelect: (poi: Poi) => void;
7
+ onSelect: (poi: V3BusinessProfile) => void;
8
8
  openSheet: boolean;
9
- purpose?: 'recommendation' | 'event_location';
10
9
  searchableListProps?: {
11
10
  headerProps?: SearchableListProps['headerProps'];
12
11
  inputProps?: SearchableListProps['inputProps'];
@@ -20,4 +19,3 @@ export type POICategory = {
20
19
  key?: string;
21
20
  label: string;
22
21
  };
23
- export type V3BusinessProfile = components['schemas']['Core_V3_NOPE_Profile'];
@@ -1,5 +1,5 @@
1
- import { Poi } from '../../../../../../../../api/src/lib/core_v2';
1
+ import { V3BusinessProfile } from '../../POIRecommendation.types';
2
2
  export type SuggestionsProps = {
3
- onSelect: (poi: Poi) => void;
4
- pois: Poi[] | null;
3
+ onSelect: (poi: V3BusinessProfile) => void;
4
+ pois: V3BusinessProfile[] | null;
5
5
  };
@@ -19,4 +19,22 @@ export declare const fetchBusinessProfileV3: (uuid: string) => Promise<{
19
19
  representative_image_url?: string | null;
20
20
  } | undefined>;
21
21
  export declare const fetchProfile: () => Promise<import('../../../../../../api/src/lib/core_v2').ProfileResponse>;
22
- export declare const fetchPOIs: (searchQuery: string, purpose: string) => Promise<import('../../../../../../api/src/lib/core_v2').Poi[]>;
22
+ export declare const fetchNopeProfiles: (query: string) => Promise<{
23
+ id: string;
24
+ categories: import('../../../../../../api/src/lib/core').components["schemas"]["Core_V3_NOPE_Category_List"];
25
+ gid: string;
26
+ kind: "business" | "organization";
27
+ legacy_gid: string;
28
+ recommendations_count: number;
29
+ subcategories: import('../../../../../../api/src/lib/core').components["schemas"]["Core_V3_NOPE_Category_List"];
30
+ supporter: boolean;
31
+ title?: string | null;
32
+ city?: string | null;
33
+ house_number?: string | null;
34
+ location?: import('../../../../../../api/src/lib/core').components["schemas"]["Core_V3_Point"] | null;
35
+ street?: string | null;
36
+ zip_code?: string | null;
37
+ banner_url?: string | null;
38
+ logo_url?: string | null;
39
+ representative_image_url?: string | null;
40
+ }[] | undefined>;
@@ -3,12 +3,12 @@ import { ProfileResponse } from '../../../../../../api/src/lib/core_v2/types';
3
3
  import { LinkedBusinessProfile } from '../../../../../../api/src/lib/types/newsFeeds';
4
4
  import { POICategory, V3BusinessProfile } from './POIRecommendation.types';
5
5
  export declare const formatAddressFull: (item: Poi | LinkedBusinessProfile | V3BusinessProfile, joiner?: string) => string;
6
- export declare const getLikedProp: (object_type: string) => "recommends_unclaimed_profile_ids" | "recommends_organization_profile_ids" | "recommends_business_profile_ids" | undefined;
7
- export declare const hasLiked: (profile: ProfileResponse, poi: Poi) => boolean;
6
+ export declare const getLikedProp: (model: string) => "recommends_unclaimed_profile_ids" | "recommends_organization_profile_ids" | "recommends_business_profile_ids" | undefined;
7
+ export declare const hasLiked: (profile: ProfileResponse, poi: V3BusinessProfile) => boolean;
8
8
  export declare const getItemCategoryLabel: (categories_labels?: POICategory[], subcategories_labels?: POICategory[]) => string | null;
9
9
  export declare const getPoiPlaceholderIconName: (type: string) => "business" | "special_place" | "organisation";
10
10
  export declare const generateBadgeType: (badges: string[]) => "commercial_supporter" | "organization_supporter";
11
11
  export declare const generateBadgeTypeV3: (kind: "business" | "organization") => "commercial_supporter" | "organization_supporter";
12
- export declare const generateLocationGid: (value: Poi) => string;
12
+ export declare const generateLocationGid: (value: V3BusinessProfile) => string;
13
13
  export declare const extractPoiUuidFromAssociatedGid: (gid: string) => string | null;
14
14
  export declare const parseKindType: (kind: V3BusinessProfile["kind"]) => "business" | "organisation";
@@ -3,9 +3,9 @@ export declare const POI_CATEGORY_BUSINESS = "biz";
3
3
  export declare const BADGE_ORGANIZATION_SPONSOR = "organization_supporter";
4
4
  export declare const BADGE_COMMERCIAL_SPONSOR = "commercial_supporter";
5
5
  export declare const DISPLAY_ADDRESS_ORDER = "street,house_number,zip_code,city";
6
- export declare const POI_TYPE_UNCLAIMED = "unclaimed_profile";
7
- export declare const POI_TYPE_ORGANIZATION = "organization_profile";
8
- export declare const POI_TYPE_BUSINESS = "business_profile";
6
+ export declare const POI_TYPE_UNCLAIMED = "UnclaimedProfile";
7
+ export declare const POI_TYPE_ORGANIZATION = "OrganizationProfile";
8
+ export declare const POI_TYPE_BUSINESS = "BusinessProfile";
9
9
  export declare const POI_SUBCATEGORY_ORGANIZATION_OTHER = "other";
10
10
  export declare const POI_SUBCATEGORY_BUSINESS_OTHER = "other";
11
11
  export declare const POI_SUBCATEGORY_SPECIAL_OTHER = "other";
@@ -0,0 +1,3 @@
1
+ import { ImageFile } from './RichTextArea.types';
2
+ export declare const isStringArray: (arr: unknown) => arr is string[];
3
+ export declare const isImageFileArray: (arr: unknown) => arr is ImageFile[];
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/nebenan-base",
3
- "version": "4.12.0-development.1",
3
+ "version": "4.12.0-development.10",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",