@goodhood-web/nebenan-base 4.4.0-development.2 → 4.4.0-development.4

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.
Files changed (70) hide show
  1. package/index.js +120 -120
  2. package/index.mjs +16113 -14697
  3. package/lib/ContentCreator/ContentCreator.d.ts +1 -1
  4. package/lib/ContentCreator/ContentCreator.types.d.ts +19 -4
  5. package/lib/ContentCreator/Store/contentCreator.d.ts +11 -0
  6. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/ContentCreatorFieldsWrapper.d.ts +1 -1
  7. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.d.ts +3 -3
  8. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.types.d.ts +10 -4
  9. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.d.ts +1 -1
  10. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types.d.ts +5 -0
  11. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventFields.d.ts +3 -0
  12. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventFields.types.d.ts +3 -0
  13. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/CategoryModalField.d.ts +3 -0
  14. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/DropdownButton.d.ts +3 -0
  15. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormCategory.d.ts +4 -0
  16. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormLocation.d.ts +5 -0
  17. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormModalsFields.types.d.ts +6 -0
  18. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/network.d.ts +12 -0
  19. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/ListModalField.types.d.ts +26 -0
  20. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/LocationModalField.d.ts +3 -0
  21. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/FormCurrencyInput.d.ts +4 -0
  22. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/FormMarketplaceImageCropper.d.ts +11 -0
  23. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.d.ts +2 -1
  24. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.types.d.ts +8 -0
  25. package/lib/ContentCreator/{validationSchemas/searchSchema.d.ts → components/ContentCreatorFieldWrapper/components/PostFields/FormRichTextArea.d.ts} +64 -57
  26. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeField.d.ts +1 -1
  27. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/index.d.ts +1 -1
  28. package/lib/ContentCreator/constants.d.ts +81 -0
  29. package/lib/ContentCreator/network.d.ts +2 -1
  30. package/lib/ContentCreator/utils/general.d.ts +23 -0
  31. package/lib/ContentCreator/utils/images.d.ts +15 -0
  32. package/lib/ContentCreator/utils/payloadGenerators.d.ts +46 -0
  33. package/lib/ContentCreator/validationSchemas/commonSchemas.d.ts +3 -2
  34. package/lib/ContentCreator/validationSchemas/dynamicValidationSchema.d.ts +158 -17
  35. package/lib/ContentCreator/validationSchemas/eventSchema.d.ts +61 -3
  36. package/lib/ContentCreator/validationSchemas/index.d.ts +0 -2
  37. package/lib/ContentCreator/validationSchemas/marketplaceSchema.d.ts +96 -4
  38. package/lib/ContentCreator/validationSchemas/postSchema.d.ts +246 -3
  39. package/lib/Feed/Aggregators/GridFeedAggregator/utils.d.ts +2 -2
  40. package/lib/Forms/Fields/FormDateTimeInput.d.ts +9 -0
  41. package/lib/Forms/Fields/FormSwitcherToggle.d.ts +10 -0
  42. package/lib/Gallery/Gallery.types.d.ts +1 -1
  43. package/lib/ImageAttachment/ImageAttachment.types.d.ts +5 -1
  44. package/lib/ImageAttachment/components/SwiperImageAttachment/SwiperImageAttachment.d.ts +3 -1
  45. package/lib/MarketplaceImageCropper/MarketplaceImageCropper.d.ts +1 -1
  46. package/lib/MarketplaceImageCropper/MarketplaceImageCropper.types.d.ts +4 -0
  47. package/lib/MarketplaceImageCropper/components/ImageThumbnailGrid/ImageThumbnailGrid.d.ts +2 -1
  48. package/lib/MarketplaceImageCropper/constants.d.ts +1 -0
  49. package/lib/MultiImageCropper/MultiImageCropper.d.ts +1 -1
  50. package/lib/MultiImageCropper/MultiImageCropper.types.d.ts +1 -1
  51. package/lib/RichTextArea/RichTextArea.types.d.ts +3 -0
  52. package/lib/RichTextArea/components/POI/POIRecommendation.d.ts +1 -1
  53. package/lib/RichTextArea/components/POI/POIRecommendation.types.d.ts +9 -0
  54. package/lib/RichTextArea/components/POI/components/Intro/Intro.d.ts +1 -3
  55. package/lib/RichTextArea/components/POI/components/NewItemAddition/NewItemAddition.d.ts +6 -0
  56. package/lib/RichTextArea/components/POI/network.d.ts +1 -1
  57. package/lib/RichTextArea/lexical/LexicalImagesPreview.d.ts +4 -1
  58. package/lib/RichTextArea/useImageUpload.d.ts +5 -1
  59. package/lib/SearchableList/SearchableList.types.d.ts +1 -0
  60. package/lib/SearchableList/components/Content/Content.d.ts +1 -1
  61. package/lib/SearchableList/components/Content/Content.types.d.ts +1 -0
  62. package/lib/utils/client.d.ts +1 -1
  63. package/package.json +1 -1
  64. package/style.css +1 -1
  65. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventField.d.ts +0 -2
  66. package/lib/ContentCreator/utils.d.ts +0 -14
  67. package/lib/ContentCreator/validationSchemas/recommendationSchema.d.ts +0 -127
  68. package/lib/Forms/Fields/FormRichTextArea.d.ts +0 -10
  69. package/lib/RichTextArea/ImagesPreview/ImagesPreview.d.ts +0 -7
  70. /package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/{ReachTypeFields.type.d.ts → ReachTypeFields.types.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  import { ContentCreatorProps } from './ContentCreator.types';
2
- declare const ContentCreator: ({ imageUrl, post, postId, userId }: ContentCreatorProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ContentCreator: ({ contentType, hoodGroupId, onDismiss, onSubmitSuccess, open, post, }: ContentCreatorProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ContentCreator;
@@ -1,18 +1,33 @@
1
1
  import { components } from '../../../../api/src/lib/core';
2
+ import { ContentFormData } from './validationSchemas';
2
3
  export type PostItem = components['schemas']['Core_V3_Input_HoodMessage'];
3
4
  export type FailureError = {
4
5
  failures: components['schemas']['Core_V3_Failure_List'];
5
6
  };
7
+ export type HoodMessage = components['schemas']['Core_V3_HoodMessage'];
6
8
  export type ContentCreatorProps = {
7
- imageUrl?: string;
9
+ contentType?: 'post' | 'event' | 'marketplace' | 'search' | 'recommendation';
10
+ hoodGroupId?: number | null;
11
+ onDismiss: () => void;
12
+ onSubmitSuccess: (response: HoodMessage) => void;
13
+ open: boolean;
8
14
  post?: PostItem;
9
- postId?: number;
10
- userId?: number;
11
15
  };
12
- export type ContentCreatorFormProps = Pick<ContentCreatorProps, 'imageUrl' | 'userId'> & {
16
+ export type ContentCreatorFormProps = {
13
17
  formError?: string | null;
14
18
  isEditMode?: boolean;
15
19
  isFormSheetOpen: boolean;
20
+ isSubmitting: boolean;
21
+ onContentCreatorDismiss: () => void;
16
22
  onFormSheetClose: () => void;
17
23
  onFormSheetOpen: () => void;
18
24
  };
25
+ export type PostFormData = Extract<ContentFormData, {
26
+ content_type: 'post' | 'search' | 'recommendation';
27
+ }>;
28
+ export type EventFormData = Extract<ContentFormData, {
29
+ content_type: 'event';
30
+ }>;
31
+ export type MarketplaceFormData = Extract<ContentFormData, {
32
+ content_type: 'marketplace';
33
+ }>;
@@ -0,0 +1,11 @@
1
+ import { Poi } from '../../../../../api/src/lib/core_v2';
2
+ import { ImageFile } from '../../RichTextArea/RichTextArea.types';
3
+ export declare const contentCreatorImages: import('jotai').PrimitiveAtom<ImageFile[] | null> & {
4
+ init: ImageFile[] | null;
5
+ };
6
+ export declare const selectedContentCreatorImage: import('jotai').PrimitiveAtom<ImageFile | null> & {
7
+ init: ImageFile | null;
8
+ };
9
+ export declare const eventLocation: import('jotai').PrimitiveAtom<Poi | null> & {
10
+ init: Poi | null;
11
+ };
@@ -1,3 +1,3 @@
1
1
  import { ContentCreatorFormProps } from '../../ContentCreator.types';
2
- declare const ContentCreatorFieldsWrapper: ({ formError, imageUrl, isEditMode, isFormSheetOpen, onFormSheetClose, onFormSheetOpen, userId, }: ContentCreatorFormProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ContentCreatorFieldsWrapper: ({ formError, isEditMode, isFormSheetOpen, isSubmitting, onContentCreatorDismiss, onFormSheetClose, onFormSheetOpen, }: ContentCreatorFormProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ContentCreatorFieldsWrapper;
@@ -1,4 +1,4 @@
1
1
  import { ContentProps, FooterProps, HeaderProps } from './ContentFieldsSheet.types';
2
- export declare const Header: ({ imageUrl, onContentTypeSelectorOpen, onDismiss, userId, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
3
- export declare const Content: ({ onPoiDismiss, poiClicked, richTextAreaRef }: ContentProps) => import("react/jsx-runtime").JSX.Element;
4
- export declare const Footer: ({ formError, onImageUploadClick, onPoiOpen, setReachTypeSelectorOpen, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Header: ({ isSubmitting, onContentTypeSelectorOpen, onDismiss, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Content: ({ onOpenReachTypeSelector, onPoiDismiss, poiClicked, richTextAreaRef, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const Footer: ({ formError, isSubmitting, onImageUploadClick, onOpenReachTypeSelector, onPoiOpen, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,22 @@
1
- import { Dispatch, RefObject, SetStateAction } from 'react';
1
+ import { RefObject } from 'react';
2
2
  import { RichTextAreaRef } from '../../../../../RichTextArea/RichTextArea.types';
3
3
  export type HeaderProps = {
4
- imageUrl?: string;
4
+ isSubmitting: boolean;
5
5
  onContentTypeSelectorOpen: () => void;
6
6
  onDismiss: () => void;
7
- userId?: number;
8
7
  };
9
8
  export type ContentProps = {
9
+ onOpenReachTypeSelector: () => void;
10
10
  onPoiDismiss: () => void;
11
11
  poiClicked: boolean;
12
12
  richTextAreaRef?: RefObject<RichTextAreaRef>;
13
13
  };
14
14
  export type FooterProps = {
15
15
  formError?: string | null;
16
+ isSubmitting: boolean;
16
17
  onImageUploadClick: () => void;
18
+ onOpenReachTypeSelector: () => void;
17
19
  onPoiOpen: () => void;
18
- setReachTypeSelectorOpen: Dispatch<SetStateAction<boolean>>;
19
20
  };
20
21
  export type Lang = {
21
22
  contentTypes: {
@@ -25,6 +26,11 @@ export type Lang = {
25
26
  recommendation: string;
26
27
  search: string;
27
28
  };
29
+ marketplaceAndEventReachTypeLabels: {
30
+ extended: string;
31
+ hood: string;
32
+ public: string;
33
+ };
28
34
  reachTypes: {
29
35
  extended: string;
30
36
  hood: string;
@@ -1,3 +1,3 @@
1
1
  import { ContentTypeSheetProps } from './ContentTypeField.types';
2
- declare const ContentTypeField: ({ onClose, onFormSheetOpen, open }: ContentTypeSheetProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ContentTypeField: ({ onClose, onFormSheetOpen, onSelect, open, }: ContentTypeSheetProps) => import("react/jsx-runtime").JSX.Element | null;
3
3
  export default ContentTypeField;
@@ -2,6 +2,7 @@ import { Icon32 } from '../../../../../../../../ui/src/lib/Base/Icon/Icon.types'
2
2
  export type ContentTypeSheetProps = {
3
3
  onClose: () => void;
4
4
  onFormSheetOpen: () => void;
5
+ onSelect: () => void;
5
6
  open: boolean;
6
7
  };
7
8
  export type OptionType = {
@@ -11,3 +12,7 @@ export type OptionType = {
11
12
  value: string;
12
13
  };
13
14
  export type ContentType = 'post' | 'search' | 'recommendation' | 'event' | 'marketplace';
15
+ export declare enum MarketplaceContentType {
16
+ MARKETPLACE_FREE = "marketplace_free",
17
+ MARKETPLACE_SELL = "marketplace_sell"
18
+ }
@@ -0,0 +1,3 @@
1
+ import { EventFieldsProps } from './EventFields.types';
2
+ declare const EventFields: ({ onOpenReachTypeSelector }: EventFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default EventFields;
@@ -0,0 +1,3 @@
1
+ export type EventFieldsProps = {
2
+ onOpenReachTypeSelector: () => void;
3
+ };
@@ -0,0 +1,3 @@
1
+ import { CategoryModalFieldProps } from './ListModalField.types';
2
+ declare const CategoryModalField: ({ disabled, errorMessage, floatingLabel, items, onChange, value, }: CategoryModalFieldProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default CategoryModalField;
@@ -0,0 +1,3 @@
1
+ import { DropdownButtonProps } from './ListModalField.types';
2
+ declare const DropdownButton: ({ disabled, hasError, isFilled, label, onOpen, value, }: DropdownButtonProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default DropdownButton;
@@ -0,0 +1,4 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { CategoryModalFieldProps } from '../ListModalField.types';
3
+ export type FormCategoryFieldProps = UseControllerProps & Partial<CategoryModalFieldProps>;
4
+ export default function FormCategory({ isMarketplaceCategory, name, value, ...props }: FormCategoryFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { ContentFormData } from '../../../../../validationSchemas';
3
+ import { LocationModalFieldProps } from '../ListModalField.types';
4
+ export type FormLocationFieldProps = UseControllerProps<ContentFormData> & Partial<LocationModalFieldProps>;
5
+ export default function FormLocation({ name, value, ...props }: FormLocationFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { components } from '../../../../../../../../../api/src/lib/core';
2
+ export type CategoryItem = components['schemas']['Core_V3_Category'];
3
+ export type LocationValue = {
4
+ gid?: string;
5
+ label: string;
6
+ };
@@ -0,0 +1,12 @@
1
+ export declare function fetchEventCategories(): Promise<{
2
+ title: string;
3
+ id: number;
4
+ slug: string;
5
+ icon: string;
6
+ }[] | undefined>;
7
+ export declare function fetchMarketplaceCategories(): Promise<{
8
+ title: string;
9
+ id: number;
10
+ slug: string;
11
+ icon: string;
12
+ }[] | undefined>;
@@ -0,0 +1,26 @@
1
+ import { SelectValueType } from '../../../../../../../../ui/src/lib/Atoms/Dropdowns/DropdownItem/DropdownItem.types';
2
+ import { CategoryItem, LocationValue } from './FormModalFields/FormModalsFields.types';
3
+ export type CategoryModalFieldProps = {
4
+ disabled?: boolean;
5
+ errorMessage?: string;
6
+ floatingLabel?: string;
7
+ isMarketplaceCategory?: boolean;
8
+ items?: CategoryItem[];
9
+ onChange: (value: SelectValueType) => void;
10
+ value: SelectValueType;
11
+ };
12
+ export type LocationModalFieldProps = {
13
+ disabled?: boolean;
14
+ errorMessage?: string;
15
+ floatingLabel?: string;
16
+ onChange: (value: LocationValue) => void;
17
+ value: LocationValue;
18
+ };
19
+ export type DropdownButtonProps = {
20
+ disabled?: boolean;
21
+ hasError?: boolean;
22
+ isFilled: boolean;
23
+ label?: string;
24
+ onOpen: () => void;
25
+ value?: string;
26
+ };
@@ -0,0 +1,3 @@
1
+ import { LocationModalFieldProps } from './ListModalField.types';
2
+ declare const LocationModalField: ({ disabled, errorMessage, floatingLabel, onChange, value, }: LocationModalFieldProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default LocationModalField;
@@ -0,0 +1,4 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { TextInputProps } from '../../../../../../../../ui/src/lib/Atoms/Inputs/TextInput/TextInput.types';
3
+ export type FormTextInputProps = UseControllerProps & Partial<TextInputProps>;
4
+ export default function FormCurrencyInput({ colorScheme, disabled, hintText, id, label, name, size, value, ...props }: FormTextInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { MarketplaceImageCropperProps } from '../../../../../MarketplaceImageCropper/MarketplaceImageCropper.types';
3
+ import { ImageFile } from '../../../../../RichTextArea/RichTextArea.types';
4
+ export type FormImageCropperProps = UseControllerProps & Partial<MarketplaceImageCropperProps> & {
5
+ CCFormSelectedImage?: ImageFile | null;
6
+ isInContentCreator?: boolean;
7
+ name: string;
8
+ withoutHint?: boolean;
9
+ };
10
+ declare const FormMarketplaceImageCropper: ({ CCFormSelectedImage, isEventImageCropper, isInContentCreator, name, }: FormImageCropperProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default FormMarketplaceImageCropper;
@@ -1,2 +1,3 @@
1
- declare const MarketplaceFields: () => import("react/jsx-runtime").JSX.Element;
1
+ import { MarketplaceFieldsProps } from './MarketplaceFields.types';
2
+ declare const MarketplaceFields: ({ onOpenReachTypeSelector }: MarketplaceFieldsProps) => import("react/jsx-runtime").JSX.Element;
2
3
  export default MarketplaceFields;
@@ -0,0 +1,8 @@
1
+ export type MarketplaceFieldsProps = {
2
+ onOpenReachTypeSelector: () => void;
3
+ };
4
+ export type MarketplaceItemsType = 'verschenken' | 'verkaufen';
5
+ export declare enum MarketplaceItems {
6
+ GIVEAWAY = "verschenken",
7
+ SELL = "verkaufen"
8
+ }
@@ -1,53 +1,31 @@
1
- import { z } from 'zod';
2
- export declare const searchValidationSchema: z.ZodObject<{
3
- content: z.ZodObject<{
4
- attachments: z.ZodOptional<z.ZodObject<{
5
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
6
- croppedImg: z.ZodType<File, z.ZodTypeDef, File>;
7
- id: z.ZodString;
8
- originalImg: z.ZodType<File, z.ZodTypeDef, File>;
9
- signedId: z.ZodOptional<z.ZodString>;
10
- }, "strip", z.ZodTypeAny, {
11
- id: string;
12
- croppedImg: File;
13
- originalImg: File;
14
- signedId?: string | undefined;
15
- }, {
16
- id: string;
17
- croppedImg: File;
18
- originalImg: File;
19
- signedId?: string | undefined;
20
- }>, "many">>;
21
- }, "strip", z.ZodTypeAny, {
22
- images?: {
23
- id: string;
24
- croppedImg: File;
25
- originalImg: File;
26
- signedId?: string | undefined;
27
- }[] | undefined;
28
- }, {
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { RichTextAreaProps, RichTextAreaRef } from '../../../../../RichTextArea/RichTextArea.types';
3
+ import { ContentFormData } from '../../../../validationSchemas';
4
+ export type FormRichTextAreaInputProps = UseControllerProps<ContentFormData> & Partial<RichTextAreaProps> & {
5
+ name: string;
6
+ };
7
+ declare const FormRichTextAreaInput: import('react').ForwardRefExoticComponent<UseControllerProps<{
8
+ content: {
9
+ body: string;
10
+ embeddables?: {
11
+ role: "link" | "profile" | "mention";
12
+ gid: string;
13
+ indices?: number[] | null | undefined;
14
+ }[] | null | undefined;
15
+ attachments?: {
29
16
  images?: {
30
17
  id: string;
31
18
  croppedImg: File;
32
19
  originalImg: File;
33
20
  signedId?: string | undefined;
34
21
  }[] | undefined;
35
- }>>;
36
- body: z.ZodString;
37
- embeddables: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
38
- gid: z.ZodString;
39
- indices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
40
- role: z.ZodEnum<["mention", "link", "profile"]>;
41
- }, "strip", z.ZodTypeAny, {
42
- role: "link" | "profile" | "mention";
43
- gid: string;
44
- indices?: number[] | null | undefined;
45
- }, {
46
- role: "link" | "profile" | "mention";
47
- gid: string;
48
- indices?: number[] | null | undefined;
49
- }>, "many">>>;
50
- }, "strip", z.ZodTypeAny, {
22
+ } | undefined;
23
+ };
24
+ content_type: "post";
25
+ subject: string;
26
+ reach: "profile" | "public" | "hood" | "extended";
27
+ } | {
28
+ content: {
51
29
  body: string;
52
30
  embeddables?: {
53
31
  role: "link" | "profile" | "mention";
@@ -62,7 +40,12 @@ export declare const searchValidationSchema: z.ZodObject<{
62
40
  signedId?: string | undefined;
63
41
  }[] | undefined;
64
42
  } | undefined;
65
- }, {
43
+ };
44
+ content_type: "search";
45
+ subject: string;
46
+ reach: "profile" | "public" | "hood" | "extended";
47
+ } | {
48
+ content: {
66
49
  body: string;
67
50
  embeddables?: {
68
51
  role: "link" | "profile" | "mention";
@@ -77,12 +60,11 @@ export declare const searchValidationSchema: z.ZodObject<{
77
60
  signedId?: string | undefined;
78
61
  }[] | undefined;
79
62
  } | undefined;
80
- }>;
81
- content_type: z.ZodLiteral<"search">;
82
- hood_group_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
83
- reach: z.ZodEnum<["profile", "hood", "extended", "public"]>;
84
- subject: z.ZodString;
85
- }, "strip", z.ZodTypeAny, {
63
+ };
64
+ content_type: "recommendation";
65
+ subject: string;
66
+ reach: "profile" | "public" | "hood" | "extended";
67
+ } | {
86
68
  content: {
87
69
  body: string;
88
70
  embeddables?: {
@@ -99,11 +81,25 @@ export declare const searchValidationSchema: z.ZodObject<{
99
81
  }[] | undefined;
100
82
  } | undefined;
101
83
  };
102
- content_type: "search";
84
+ category: string;
85
+ location: {
86
+ label: string;
87
+ gid?: string | undefined;
88
+ };
89
+ content_type: "event";
103
90
  subject: string;
104
91
  reach: "profile" | "public" | "hood" | "extended";
105
- hood_group_id?: number | null | undefined;
106
- }, {
92
+ starts_at_date: Date;
93
+ starts_at_time: Date;
94
+ images?: {
95
+ id: string;
96
+ croppedImg: File;
97
+ originalImg: File;
98
+ signedId?: string | undefined;
99
+ }[] | undefined;
100
+ ends_at_date?: Date | null | undefined;
101
+ ends_at_time?: Date | null | undefined;
102
+ } | {
107
103
  content: {
108
104
  body: string;
109
105
  embeddables?: {
@@ -120,8 +116,19 @@ export declare const searchValidationSchema: z.ZodObject<{
120
116
  }[] | undefined;
121
117
  } | undefined;
122
118
  };
123
- content_type: "search";
119
+ category: string;
120
+ content_type: "marketplace";
124
121
  subject: string;
125
122
  reach: "profile" | "public" | "hood" | "extended";
126
- hood_group_id?: number | null | undefined;
127
- }>;
123
+ marketplace_item_type: string;
124
+ images?: {
125
+ id: string;
126
+ croppedImg: File;
127
+ originalImg: File;
128
+ signedId?: string | undefined;
129
+ }[] | undefined;
130
+ price?: string | null | undefined;
131
+ }> & Partial<RichTextAreaProps> & {
132
+ name: string;
133
+ } & import('react').RefAttributes<RichTextAreaRef>>;
134
+ export default FormRichTextAreaInput;
@@ -1,3 +1,3 @@
1
- import { ReachTypeFieldProps } from './ReachTypeFields.type';
1
+ import { ReachTypeFieldProps } from './ReachTypeFields.types';
2
2
  declare const ReachTypeField: ({ onClose, open }: ReachTypeFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ReachTypeField;
@@ -1,6 +1,6 @@
1
1
  export { default as ContentTypeField } from './ContentTypeField/ContentTypeField';
2
2
  export { default as PostFields } from './PostFields/PostFields';
3
- export { default as EventFields } from './EventFields/EventField';
3
+ export { default as EventFields } from './EventFields/EventFields';
4
4
  export { default as MarketplaceFields } from './MarketplaceFields/MarketplaceFields';
5
5
  export { Header, Content, Footer } from './ContentFieldsSheet/ContentFieldsSheet';
6
6
  export { default as ReachTypeField } from './ReachTypeField/ReachTypeField';
@@ -1,4 +1,6 @@
1
+ import { MarketplaceItems } from './components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.types';
1
2
  export declare const DEFAULT_FORM_VALUES: {
3
+ category: string;
2
4
  content: {
3
5
  attachments: {
4
6
  images: never[];
@@ -7,6 +9,85 @@ export declare const DEFAULT_FORM_VALUES: {
7
9
  embeddables: never[];
8
10
  };
9
11
  content_type: string;
12
+ ends_at_date: null;
13
+ ends_at_time: null;
14
+ images: never[];
15
+ location: {
16
+ label: string;
17
+ };
18
+ marketplace_item_type: MarketplaceItems;
19
+ price: null;
10
20
  reach: string;
21
+ starts_at_date: Date;
22
+ starts_at_time: Date;
23
+ subject: string;
24
+ };
25
+ export declare const POST_DEFAULT_VALUES: {
26
+ content_type: string;
27
+ category: string;
28
+ content: {
29
+ attachments: {
30
+ images: never[];
31
+ };
32
+ body: string;
33
+ embeddables: never[];
34
+ };
35
+ ends_at_date: null;
36
+ ends_at_time: null;
37
+ images: never[];
38
+ location: {
39
+ label: string;
40
+ };
41
+ marketplace_item_type: MarketplaceItems;
42
+ price: null;
43
+ reach: string;
44
+ starts_at_date: Date;
45
+ starts_at_time: Date;
46
+ subject: string;
47
+ };
48
+ export declare const EVENT_DEFAULT_VALUES: {
49
+ content_type: string;
50
+ category: string;
51
+ content: {
52
+ attachments: {
53
+ images: never[];
54
+ };
55
+ body: string;
56
+ embeddables: never[];
57
+ };
58
+ ends_at_date: null;
59
+ ends_at_time: null;
60
+ images: never[];
61
+ location: {
62
+ label: string;
63
+ };
64
+ marketplace_item_type: MarketplaceItems;
65
+ price: null;
66
+ reach: string;
67
+ starts_at_date: Date;
68
+ starts_at_time: Date;
69
+ subject: string;
70
+ };
71
+ export declare const MARKETPLACE_DEFAULT_VALUES: {
72
+ content_type: string;
73
+ reach: string;
74
+ category: string;
75
+ content: {
76
+ attachments: {
77
+ images: never[];
78
+ };
79
+ body: string;
80
+ embeddables: never[];
81
+ };
82
+ ends_at_date: null;
83
+ ends_at_time: null;
84
+ images: never[];
85
+ location: {
86
+ label: string;
87
+ };
88
+ marketplace_item_type: MarketplaceItems;
89
+ price: null;
90
+ starts_at_date: Date;
91
+ starts_at_time: Date;
11
92
  subject: string;
12
93
  };
@@ -1,4 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { OnFormSubmitType } from '../Forms/Form/Form.types';
3
+ import { HoodMessage } from './ContentCreator.types';
3
4
  import { ContentFormData } from './validationSchemas';
4
- export declare const handleSubmit: (data: OnFormSubmitType<ContentFormData>, isEditMode: boolean, onClose: () => void, onReset: () => void, setFormError: Dispatch<SetStateAction<string | null>>, postId?: number | null) => Promise<boolean>;
5
+ export declare const handleSubmit: (data: OnFormSubmitType<ContentFormData>, isEditMode: boolean, setFormError: Dispatch<SetStateAction<string | null>>, hoodGroupId?: number | null, onSuccess?: (responseData: HoodMessage | undefined) => void, onError?: (error: unknown) => void) => Promise<boolean | undefined>;
@@ -0,0 +1,23 @@
1
+ import { DefaultValues } from 'react-hook-form';
2
+ import { FailureError, PostItem } from '../ContentCreator.types';
3
+ import { ContentType } from '../components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types';
4
+ import { LocationValue } from '../components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormModalsFields.types';
5
+ import { ContentFormData } from '../validationSchemas';
6
+ import { BodyWithEmbeds } from '../validationSchemas/commonSchemas';
7
+ export declare const transformBackendFieldError: (error: FailureError) => {
8
+ failures: {
9
+ field: string;
10
+ code: "url" | "already_confirmed" | "confirmation_period_expired" | "expired" | "not_found" | "not_locked" | "not_saved" | "accepted" | "bad_content" | "blank" | "confirmation" | "email" | "empty" | "equal_to" | "even" | "exclusion" | "forbidden" | "greater_than_or_equal_to" | "greater_than" | "in_between" | "in" | "inclusion" | "invalid" | "less_than_or_equal_to" | "less_than" | "model_invalid" | "not_a_number" | "not_an_integer" | "odd" | "other_than" | "password_too_long" | "present" | "required" | "spoofed_media_type" | "taken" | "timeout" | "unauthorized" | "unreachable" | "service_unavailable" | "can_not_be_before_start_date" | "too_long" | "too_short" | "wrong_length" | "self_intersection";
11
+ message: string;
12
+ }[];
13
+ };
14
+ export declare const getInitialValues: (post: PostItem) => DefaultValues<ContentFormData>;
15
+ export declare const getDefaultFormValues: (contentType: ContentType) => DefaultValues<ContentFormData>;
16
+ export declare const combineDateAndTimeStrings: (type: "start" | "end", dateStr: Date | null, timeStr: Date | null) => string | null | undefined;
17
+ export declare const navigateTo: (contentType: string | undefined) => "/feed/marketplace" | "/feed";
18
+ export declare const formatLocation: (location: LocationValue) => string;
19
+ export declare const removePoiFromContent: (content: BodyWithEmbeds) => {
20
+ role: "link" | "profile" | "mention";
21
+ gid: string;
22
+ indices?: number[] | null | undefined;
23
+ }[];
@@ -0,0 +1,15 @@
1
+ import { ImageFile } from '../../RichTextArea/RichTextArea.types';
2
+ import { BodyWithEmbeds } from '../validationSchemas/commonSchemas';
3
+ export declare function injectImagesToContent(content: BodyWithEmbeds | undefined, images: ImageFile[]): {
4
+ attachments: {
5
+ images: ImageFile[];
6
+ };
7
+ body: string;
8
+ embeddables?: {
9
+ role: "link" | "profile" | "mention";
10
+ gid: string;
11
+ indices?: number[] | null | undefined;
12
+ }[] | null | undefined;
13
+ } | undefined;
14
+ export declare const getImagesSignedIds: (images: ImageFile[] | null | undefined) => string[] | null;
15
+ export declare const generateImageObject: (imageUrls: string[]) => never[] | undefined;
@@ -0,0 +1,46 @@
1
+ import { EventFormData, MarketplaceFormData, PostFormData } from '../ContentCreator.types';
2
+ import { MarketplaceContentType } from '../components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types';
3
+ export declare const generatePostPayload: (data: PostFormData) => {
4
+ body: string;
5
+ content_type: "search" | "post" | "recommendation";
6
+ embeds: {
7
+ role: "link" | "profile" | "mention";
8
+ gid: string;
9
+ indices?: number[] | null | undefined;
10
+ }[] | null | undefined;
11
+ images: string[] | null;
12
+ reach: "profile" | "public" | "hood" | "extended";
13
+ subject: string;
14
+ };
15
+ export declare const generateEventPayload: (data: EventFormData) => {
16
+ body: string;
17
+ category: string;
18
+ content_type: "event";
19
+ embeds: {
20
+ role: "link" | "profile" | "mention";
21
+ gid: string;
22
+ indices?: number[] | null | undefined;
23
+ }[];
24
+ ends_all_day: boolean;
25
+ ends_at: string | null | undefined;
26
+ images: string[] | null;
27
+ location: string;
28
+ reach: "profile" | "public" | "hood" | "extended";
29
+ starts_all_day: boolean;
30
+ starts_at: string;
31
+ subject: string;
32
+ };
33
+ export declare const generateMarketplacePayload: (data: MarketplaceFormData) => {
34
+ body: string;
35
+ category: string;
36
+ content_type: MarketplaceContentType;
37
+ embeds: {
38
+ role: "link" | "profile" | "mention";
39
+ gid: string;
40
+ indices?: number[] | null | undefined;
41
+ }[];
42
+ images: string[] | null;
43
+ price: number | null;
44
+ reach: "profile" | "public" | "hood" | "extended";
45
+ subject: string;
46
+ };
@@ -12,7 +12,7 @@ export declare const embedSchema: z.ZodObject<{
12
12
  gid: string;
13
13
  indices?: number[] | null | undefined;
14
14
  }>;
15
- declare const imageFileSchema: z.ZodObject<{
15
+ export declare const imageFileSchema: z.ZodObject<{
16
16
  croppedImg: z.ZodType<File, z.ZodTypeDef, File>;
17
17
  id: z.ZodString;
18
18
  originalImg: z.ZodType<File, z.ZodTypeDef, File>;
@@ -109,4 +109,5 @@ export declare const bodyWithEmbedsSchema: z.ZodObject<{
109
109
  }[] | undefined;
110
110
  } | undefined;
111
111
  }>;
112
- export {};
112
+ export declare const categorySchema: z.ZodString;
113
+ export type BodyWithEmbeds = z.infer<typeof bodyWithEmbedsSchema>;