@goodhood-web/nebenan-base 4.13.0-development.13 → 4.13.0-development.14

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 (35) hide show
  1. package/index.js +93 -93
  2. package/index.mjs +13745 -13374
  3. package/lib/ContentCreator/ContentCreator.d.ts +1 -1
  4. package/lib/ContentCreator/ContentCreatorForm.types.d.ts +12 -5
  5. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.d.ts +3 -3
  6. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.types.d.ts +4 -1
  7. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventFields.d.ts +1 -1
  8. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventFields.types.d.ts +2 -1
  9. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormCategory.d.ts +1 -1
  10. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormLocation.d.ts +2 -1
  11. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/ListModalField.types.d.ts +2 -1
  12. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ListModalField/LocationModalField.d.ts +1 -1
  13. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/FormCurrencyInput.d.ts +1 -1
  14. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.d.ts +1 -1
  15. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.types.d.ts +1 -0
  16. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/PostFields/FormRichTextArea.d.ts +25 -0
  17. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/PostFields/PostFields.d.ts +1 -1
  18. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/PostFields/PostFields.types.d.ts +2 -1
  19. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeField.d.ts +1 -1
  20. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeFields.types.d.ts +1 -0
  21. package/lib/ContentCreator/components/ErrorModal/ErrorModal.d.ts +7 -0
  22. package/lib/ContentCreator/network.d.ts +20 -2
  23. package/lib/ContentCreator/utils/general.d.ts +9 -2
  24. package/lib/ContentCreator/utils/images.d.ts +5 -1
  25. package/lib/ContentCreator/utils/parsers.d.ts +115 -0
  26. package/lib/ContentCreator/utils/payloadGenerators.d.ts +71 -1
  27. package/lib/ContentCreator/validationSchemas/commonSchemas.d.ts +40 -0
  28. package/lib/ContentCreator/validationSchemas/dynamicValidationSchema.d.ts +185 -0
  29. package/lib/ContentCreator/validationSchemas/eventSchema.d.ts +35 -0
  30. package/lib/ContentCreator/validationSchemas/marketplaceSchema.d.ts +45 -0
  31. package/lib/ContentCreator/validationSchemas/postSchema.d.ts +105 -0
  32. package/lib/MarketplaceImageCropper/MarketplaceImageCropper.d.ts +1 -1
  33. package/lib/MarketplaceImageCropper/MarketplaceImageCropper.types.d.ts +1 -0
  34. package/package.json +1 -1
  35. package/style.css +1 -1
@@ -1,5 +1,5 @@
1
1
  import { ContentCreatorProps } from './ContentCreatorForm.types';
2
- declare const ContentCreator: ({ config, contentCreatorRef, disablePremiumFeature, group, onDismiss, onSubmitSuccess, open, post, postFieldPlaceholders, postId, prefillValues, profile, topic, }: ContentCreatorProps & {
2
+ declare const ContentCreator: ({ config, contentCreatorRef, disablePremiumFeature, editObject, group, onDismiss, onSubmitSuccess, open, postFieldPlaceholders, prefillValues, profile, topic, }: ContentCreatorProps & {
3
3
  config: {
4
4
  chargebee: {
5
5
  site: string;
@@ -1,13 +1,17 @@
1
1
  import { RefObject } from 'react';
2
2
  import { components } from '../../../../api/src/lib/core';
3
3
  import { ProfileResponse } from '../../../../api/src/lib/core_v2';
4
+ import { ContentType } from './components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types';
4
5
  import { ContentFormData } from './validationSchemas';
5
- export type PostItem = components['schemas']['Core_V3_Input_HoodMessage'];
6
6
  export type FailureError = {
7
7
  failures: components['schemas']['Core_V3_Failure_List'];
8
8
  };
9
9
  export type Topic = 'christmas' | 'climate';
10
10
  export type HoodMessage = components['schemas']['Core_V3_HoodMessage'];
11
+ export type HoodMessageEdit = components['schemas']['Core_V3_HoodMessageEdit'];
12
+ export type HoodMessageEventEdit = components['schemas']['Core_V3_HoodMessageEventEdit'];
13
+ export type HoodMessageMarketplaceEdit = components['schemas']['Core_V3_HoodMessageMarketplaceEdit'];
14
+ export type EditPostFetchResponse = HoodMessageEdit | HoodMessageEventEdit | HoodMessageMarketplaceEdit;
11
15
  export type Group = {
12
16
  [key: string]: unknown;
13
17
  id: number;
@@ -20,20 +24,23 @@ export type WrapperRefType = {
20
24
  export type ContentCreatorRefType = {
21
25
  openImageUpload: () => void;
22
26
  };
27
+ export type EditObject = {
28
+ id: number;
29
+ type: ContentType;
30
+ };
23
31
  export type ContentCreatorProps = {
24
32
  className?: string;
25
33
  contentCreatorRef?: RefObject<WrapperRefType>;
26
34
  disablePremiumFeature?: boolean;
35
+ editObject?: EditObject;
27
36
  group?: Group;
28
37
  onDismiss: () => void;
29
38
  onSubmitSuccess: (response: HoodMessage) => void;
30
39
  open: boolean;
31
- post?: PostItem;
32
40
  postFieldPlaceholders?: {
33
41
  contentField?: string;
34
42
  subjectField?: string;
35
43
  };
36
- postId?: number | string;
37
44
  prefillValues?: Partial<ContentFormData> & {
38
45
  sessionId?: string;
39
46
  };
@@ -44,7 +51,7 @@ export type ContentCreatorFormProps = {
44
51
  disablePremiumFeature?: boolean;
45
52
  formError?: string | null;
46
53
  group: Group | null | undefined;
47
- isEditMode?: boolean;
54
+ isEditMode: boolean;
48
55
  isPreSelectedMode: boolean;
49
56
  isSubmitting: boolean;
50
57
  onContentCreatorDismiss: () => void;
@@ -54,7 +61,7 @@ export type ContentCreatorFormProps = {
54
61
  };
55
62
  postId?: number | string;
56
63
  profile: ProfileResponse;
57
- topic?: Topic;
64
+ topic?: Topic | null;
58
65
  };
59
66
  export type PostFormData = Extract<ContentFormData, {
60
67
  content_type: 'post' | 'search' | 'recommendation';
@@ -1,4 +1,4 @@
1
1
  import { AttachmentBarProps, ContentProps, HeaderProps } from './ContentFieldsSheet.types';
2
- export declare const Header: ({ isSubmitting, onContentTypeSelectorOpen, onDismiss, profile, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
3
- export declare const Content: ({ disablePremiumFeature, formError, group, onImageUploadClick, onOpenReachTypeSelector, onPoiDismiss, onPoiOpen, poiClicked, postFieldPlaceholders, postId, richTextAreaRef, topic, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
4
- export declare const AttachmentBar: ({ formError, group, isSubmitting, onImageUploadClick, onOpenReachTypeSelector, onPoiOpen, }: AttachmentBarProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Header: ({ isEditMode, isSubmitting, onContentTypeSelectorOpen, onDismiss, profile, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Content: ({ disablePremiumFeature, formError, group, isEditMode, onImageUploadClick, onOpenReachTypeSelector, onPoiDismiss, onPoiOpen, poiClicked, postFieldPlaceholders, postId, richTextAreaRef, topic, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const AttachmentBar: ({ formError, group, isEditMode, isSubmitting, onImageUploadClick, onOpenReachTypeSelector, onPoiOpen, }: AttachmentBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ import { ProfileResponse } from '../../../../../../../../api/src/lib/core_v2';
3
3
  import { RichTextAreaRef } from '../../../../../RichTextArea/RichTextArea.types';
4
4
  import { Group, Topic } from '../../../../ContentCreatorForm.types';
5
5
  export type HeaderProps = {
6
+ isEditMode: boolean;
6
7
  isSubmitting: boolean;
7
8
  onContentTypeSelectorOpen: () => void;
8
9
  onDismiss: () => void;
@@ -12,6 +13,7 @@ export type ContentProps = {
12
13
  disablePremiumFeature?: boolean;
13
14
  formError?: string | null;
14
15
  group: Group | null | undefined;
16
+ isEditMode: boolean;
15
17
  onImageUploadClick: () => void;
16
18
  onOpenReachTypeSelector: () => void;
17
19
  onPoiDismiss: () => void;
@@ -23,11 +25,12 @@ export type ContentProps = {
23
25
  };
24
26
  postId?: number | string;
25
27
  richTextAreaRef?: RefObject<RichTextAreaRef>;
26
- topic?: Topic;
28
+ topic?: Topic | null;
27
29
  };
28
30
  export type AttachmentBarProps = {
29
31
  formError?: string | null;
30
32
  group: Group | null | undefined;
33
+ isEditMode: boolean;
31
34
  isSubmitting?: boolean;
32
35
  onImageUploadClick: () => void;
33
36
  onOpenReachTypeSelector: () => void;
@@ -1,3 +1,3 @@
1
1
  import { EventFieldsProps } from './EventFields.types';
2
- declare const EventFields: ({ group, onOpenReachTypeSelector, topic }: EventFieldsProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const EventFields: ({ group, isEditMode, onOpenReachTypeSelector, topic, }: EventFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default EventFields;
@@ -1,6 +1,7 @@
1
1
  import { Group, Topic } from '../../../../ContentCreatorForm.types';
2
2
  export type EventFieldsProps = {
3
3
  group: Group | null | undefined;
4
+ isEditMode: boolean;
4
5
  onOpenReachTypeSelector: () => void;
5
- topic?: Topic;
6
+ topic?: Topic | null;
6
7
  };
@@ -4,4 +4,4 @@ export type FormCategoryFieldProps = UseControllerProps & Partial<CategoryModalF
4
4
  open: boolean;
5
5
  setOpen: CategoryModalFieldProps['setOpen'];
6
6
  };
7
- export default function FormCategory({ floatingLabel, isMarketplaceCategory, name, open, setOpen, value, }: FormCategoryFieldProps): import("react/jsx-runtime").JSX.Element;
7
+ export default function FormCategory({ floatingLabel, isMarketplaceCategory, name, open, setOpen, }: FormCategoryFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,8 @@ import { UseControllerProps } from 'react-hook-form';
2
2
  import { ContentFormData } from '../../../../../validationSchemas';
3
3
  import { LocationModalFieldProps } from '../ListModalField.types';
4
4
  export type FormLocationFieldProps = UseControllerProps<ContentFormData> & Partial<LocationModalFieldProps> & {
5
+ isEditMode: boolean;
5
6
  locationModalOpen: boolean;
6
7
  setLocationModalOpen: LocationModalFieldProps['setOpen'];
7
8
  };
8
- export default function FormLocation({ floatingLabel, locationModalOpen, name, setLocationModalOpen, value, }: FormLocationFieldProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function FormLocation({ floatingLabel, isEditMode, locationModalOpen, name, setLocationModalOpen, value, }: FormLocationFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -16,10 +16,11 @@ export type LocationModalFieldProps = {
16
16
  disabled?: boolean;
17
17
  errorMessage?: string;
18
18
  floatingLabel?: string;
19
+ isEditMode: boolean;
19
20
  onChange: (value: LocationValue) => void;
20
21
  open: boolean;
21
22
  setOpen: Dispatch<SetStateAction<boolean>>;
22
- value: LocationValue;
23
+ value: LocationValue | string;
23
24
  };
24
25
  export type DropdownButtonProps = {
25
26
  disabled?: boolean;
@@ -1,3 +1,3 @@
1
1
  import { LocationModalFieldProps } from './ListModalField.types';
2
- declare const LocationModalField: ({ disabled, errorMessage, floatingLabel, onChange, open, setOpen, value, }: LocationModalFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const LocationModalField: ({ disabled, errorMessage, floatingLabel, isEditMode, onChange, open, setOpen, value, }: LocationModalFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default LocationModalField;
@@ -1,4 +1,4 @@
1
1
  import { UseControllerProps } from 'react-hook-form';
2
2
  import { TextInputProps } from '../../../../../../../../ui/src/lib/Atoms/Inputs/TextInput/TextInput.types';
3
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;
4
+ export default function FormCurrencyInput({ colorScheme, disabled, hintText, id, label, name, size, ...props }: FormTextInputProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { MarketplaceFieldsProps } from './MarketplaceFields.types';
2
- declare const MarketplaceFields: ({ disablePremiumFeature, onOpenReachTypeSelector, postId, }: MarketplaceFieldsProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const MarketplaceFields: ({ disablePremiumFeature, isEditMode, onOpenReachTypeSelector, postId, }: MarketplaceFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MarketplaceFields;
@@ -1,5 +1,6 @@
1
1
  export type MarketplaceFieldsProps = {
2
2
  disablePremiumFeature?: boolean;
3
+ isEditMode: boolean;
3
4
  onOpenReachTypeSelector: () => void;
4
5
  postId?: number | string;
5
6
  };
@@ -13,7 +13,12 @@ declare const FormRichTextAreaInput: import('react').ForwardRefExoticComponent<U
13
13
  embeddables?: {
14
14
  role: "link" | "profile" | "mention";
15
15
  associated_gid: string;
16
+ title?: string | undefined;
17
+ description?: string | null | undefined;
18
+ cta_url?: string | undefined;
19
+ image_url?: string | null | undefined;
16
20
  indices?: number[] | null | undefined;
21
+ recommendations_count?: number | undefined;
17
22
  }[] | null | undefined;
18
23
  attachments?: {
19
24
  images?: {
@@ -34,7 +39,12 @@ declare const FormRichTextAreaInput: import('react').ForwardRefExoticComponent<U
34
39
  embeddables?: {
35
40
  role: "link" | "profile" | "mention";
36
41
  associated_gid: string;
42
+ title?: string | undefined;
43
+ description?: string | null | undefined;
44
+ cta_url?: string | undefined;
45
+ image_url?: string | null | undefined;
37
46
  indices?: number[] | null | undefined;
47
+ recommendations_count?: number | undefined;
38
48
  }[] | null | undefined;
39
49
  attachments?: {
40
50
  images?: {
@@ -55,7 +65,12 @@ declare const FormRichTextAreaInput: import('react').ForwardRefExoticComponent<U
55
65
  embeddables?: {
56
66
  role: "link" | "profile" | "mention";
57
67
  associated_gid: string;
68
+ title?: string | undefined;
69
+ description?: string | null | undefined;
70
+ cta_url?: string | undefined;
71
+ image_url?: string | null | undefined;
58
72
  indices?: number[] | null | undefined;
73
+ recommendations_count?: number | undefined;
59
74
  }[] | null | undefined;
60
75
  attachments?: {
61
76
  images?: {
@@ -76,7 +91,12 @@ declare const FormRichTextAreaInput: import('react').ForwardRefExoticComponent<U
76
91
  embeddables?: {
77
92
  role: "link" | "profile" | "mention";
78
93
  associated_gid: string;
94
+ title?: string | undefined;
95
+ description?: string | null | undefined;
96
+ cta_url?: string | undefined;
97
+ image_url?: string | null | undefined;
79
98
  indices?: number[] | null | undefined;
99
+ recommendations_count?: number | undefined;
80
100
  }[] | null | undefined;
81
101
  attachments?: {
82
102
  images?: {
@@ -112,7 +132,12 @@ declare const FormRichTextAreaInput: import('react').ForwardRefExoticComponent<U
112
132
  embeddables?: {
113
133
  role: "link" | "profile" | "mention";
114
134
  associated_gid: string;
135
+ title?: string | undefined;
136
+ description?: string | null | undefined;
137
+ cta_url?: string | undefined;
138
+ image_url?: string | null | undefined;
115
139
  indices?: number[] | null | undefined;
140
+ recommendations_count?: number | undefined;
116
141
  }[] | null | undefined;
117
142
  attachments?: {
118
143
  images?: {
@@ -1,3 +1,3 @@
1
1
  import { PostFieldsProps } from './PostFields.types';
2
- declare const PostFields: ({ formError, group, onImageUploadClick, onOpenReachTypeSelector, onPoiDismiss, onPoiOpen, poiClicked, postFieldPlaceholders, richTextAreaRef, topic, }: PostFieldsProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const PostFields: ({ formError, group, isEditMode, onImageUploadClick, onOpenReachTypeSelector, onPoiDismiss, onPoiOpen, poiClicked, postFieldPlaceholders, richTextAreaRef, topic, }: PostFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default PostFields;
@@ -4,6 +4,7 @@ import { Group, Topic } from '../../../../ContentCreatorForm.types';
4
4
  export type PostFieldsProps = {
5
5
  formError?: string | null;
6
6
  group: Group | null | undefined;
7
+ isEditMode: boolean;
7
8
  onImageUploadClick: () => void;
8
9
  onOpenReachTypeSelector: () => void;
9
10
  onPoiDismiss: () => void;
@@ -14,5 +15,5 @@ export type PostFieldsProps = {
14
15
  subjectField?: string;
15
16
  };
16
17
  richTextAreaRef?: RefObject<RichTextAreaRef>;
17
- topic?: Topic;
18
+ topic?: Topic | null;
18
19
  };
@@ -1,3 +1,3 @@
1
1
  import { ReachTypeFieldProps } from './ReachTypeFields.types';
2
- declare const ReachTypeField: ({ group, hoodName, onClose, open }: ReachTypeFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ReachTypeField: ({ group, hoodName, isEditMode, onClose, open, }: ReachTypeFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ReachTypeField;
@@ -7,6 +7,7 @@ export type OptionType = {
7
7
  export type ReachTypeFieldProps = {
8
8
  group: Group | null | undefined;
9
9
  hoodName?: string;
10
+ isEditMode?: boolean;
10
11
  onClose: () => void;
11
12
  open: boolean;
12
13
  };
@@ -0,0 +1,7 @@
1
+ type ErrorModalProps = {
2
+ onDismiss: () => void;
3
+ onReload: () => void;
4
+ open: boolean;
5
+ };
6
+ declare const ErrorModal: ({ onDismiss, onReload, open }: ErrorModalProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ErrorModal;
@@ -1,5 +1,23 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { OnFormSubmitType } from '../Forms/Form/Form.types';
3
- import { HoodGroupId, HoodMessage, MarketplaceFormData, Topic } from './ContentCreatorForm.types';
3
+ import { EditObject, HoodGroupId, HoodMessage, MarketplaceFormData, Topic } from './ContentCreatorForm.types';
4
+ import { ContentType } from './components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types';
4
5
  import { ContentFormData, ImageFile } from './validationSchemas';
5
- export declare const handleSubmit: (data: OnFormSubmitType<ContentFormData>, isEditMode: boolean, setFormError: Dispatch<SetStateAction<string | null>>, hoodGroupId: HoodGroupId, onSuccess?: (responseData: HoodMessage | undefined, premiumFeature?: MarketplaceFormData["premium_feature"]) => void, selectedImage?: ImageFile | null, topic?: Topic) => Promise<boolean | undefined>;
6
+ export declare const handleSubmit: (data: OnFormSubmitType<ContentFormData>, setFormError: Dispatch<SetStateAction<string | null>>, hoodGroupId: HoodGroupId, onSuccess?: (responseData: HoodMessage | undefined, premiumFeature?: MarketplaceFormData["premium_feature"]) => void, onEditSuccess?: (responseData: HoodMessage | undefined, premiumFeature?: MarketplaceFormData["premium_feature"]) => void, selectedImage?: ImageFile | null, editObject?: EditObject, topic?: Topic) => Promise<boolean | undefined>;
7
+ export declare const fetchEditData: (id?: number, type?: ContentType) => Promise<{
8
+ data: null;
9
+ error: null;
10
+ } | {
11
+ data: null;
12
+ error: Error;
13
+ } | {
14
+ data: {
15
+ subject: string;
16
+ body: string;
17
+ topic?: string | null;
18
+ reach: string;
19
+ images: import('../../../../api/src/lib/core').components["schemas"]["string_List"];
20
+ embeds: import('../../../../api/src/lib/core').components["schemas"]["Core_V3_EmbedDetails_List"];
21
+ } | undefined;
22
+ error: null;
23
+ }>;
@@ -1,11 +1,11 @@
1
1
  import { SelectedPremiumFeature } from '../../PremiumFeaturePanel/components/PremiumFeatureSelector/PremiumFeatureSelector.types';
2
- import { FailureError } from '../ContentCreatorForm.types';
2
+ import { EditPostFetchResponse, FailureError } from '../ContentCreatorForm.types';
3
3
  import { LocationValue } from '../components/ContentCreatorFieldWrapper/components/ListModalField/FormModalFields/FormModalsFields.types';
4
4
  import { BodyWithEmbeds } from '../validationSchemas/commonSchemas';
5
5
  export declare const transformBackendFieldError: (error: FailureError) => {
6
6
  failures: {
7
7
  field: string;
8
- 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";
8
+ 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" | "invalid_character" | "invalid_format" | "invalid_word" | "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" | "suspicious_characters" | "same_letter_repeated" | "non_letter_repeated" | "starts_or_ends_with_numbers" | "suspicious_words" | "emojis" | "blank_or_invalid" | "non_five_consecutive_digits" | "same_digit_repeated_five_times" | "same_first_and_lastname" | "single_letter_with_dot" | "zero_or_smaller" | "includes_nebenan" | "only_3_characters_without_vowels" | "capital_letter_or_word_with_dot";
9
9
  message: string;
10
10
  }[];
11
11
  };
@@ -15,6 +15,13 @@ export declare const formatLocation: (location: LocationValue) => string;
15
15
  export declare const removePoiFromContent: (content: BodyWithEmbeds) => {
16
16
  role: "link" | "profile" | "mention";
17
17
  associated_gid: string;
18
+ title?: string | undefined;
19
+ description?: string | null | undefined;
20
+ cta_url?: string | undefined;
21
+ image_url?: string | null | undefined;
18
22
  indices?: number[] | null | undefined;
23
+ recommendations_count?: number | undefined;
19
24
  }[];
20
25
  export declare const getSubmitButtonText: (submitText: string, submitPriceText: string, checkoutValue?: SelectedPremiumFeature) => string;
26
+ export declare const centsToEuros: (cents: number | null | undefined) => number | null;
27
+ export declare const updateEmbedIndices: (body: string, embeds: EditPostFetchResponse["embeds"]) => EditPostFetchResponse["embeds"];
@@ -8,9 +8,13 @@ export declare function injectImagesToContent(content: BodyWithEmbeds | undefine
8
8
  embeddables?: {
9
9
  role: "link" | "profile" | "mention";
10
10
  associated_gid: string;
11
+ title?: string | undefined;
12
+ description?: string | null | undefined;
13
+ cta_url?: string | undefined;
14
+ image_url?: string | null | undefined;
11
15
  indices?: number[] | null | undefined;
16
+ recommendations_count?: number | undefined;
12
17
  }[] | null | undefined;
13
18
  } | undefined;
14
19
  export declare const findEventImage: (images: ImageFile[] | null | undefined, selectedImage: ImageFile | null | undefined) => ImageFile | null | undefined;
15
20
  export declare const getImagesSignedIds: (images: ImageFile[] | null | undefined) => string[] | null;
16
- export declare const generateImageObject: (imageUrls: string[]) => never[] | undefined;
@@ -0,0 +1,115 @@
1
+ import { EditPostFetchResponse } from '../ContentCreatorForm.types';
2
+ import { ContentType } from '../components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types';
3
+ import { MarketplaceItems } from '../components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.types';
4
+ export declare const getEditInitialValues: (data?: EditPostFetchResponse | null, postContentType?: ContentType) => {
5
+ content?: undefined;
6
+ content_type?: undefined;
7
+ reach?: undefined;
8
+ subject?: undefined;
9
+ topic?: undefined;
10
+ category?: undefined;
11
+ ends_at_date?: undefined;
12
+ ends_at_time?: undefined;
13
+ images?: undefined;
14
+ location?: undefined;
15
+ starts_at_date?: undefined;
16
+ starts_at_time?: undefined;
17
+ marketplace_item_type?: undefined;
18
+ price_in_cents?: undefined;
19
+ } | {
20
+ content: {
21
+ attachments: {
22
+ images: string[];
23
+ };
24
+ body: string;
25
+ embeddables: {
26
+ gid: string;
27
+ associated_gid: string;
28
+ title: string;
29
+ description?: string | null;
30
+ cta_url: string;
31
+ image_url?: string | null;
32
+ recommendations_count: number;
33
+ indices?: import('../../../../../api/src/lib/core').components["schemas"]["integer_List"] | null;
34
+ role: "profile" | "mention" | "link";
35
+ }[];
36
+ };
37
+ content_type: "search" | "post" | "recommendation";
38
+ reach: string;
39
+ subject: string;
40
+ topic: boolean;
41
+ category?: undefined;
42
+ ends_at_date?: undefined;
43
+ ends_at_time?: undefined;
44
+ images?: undefined;
45
+ location?: undefined;
46
+ starts_at_date?: undefined;
47
+ starts_at_time?: undefined;
48
+ marketplace_item_type?: undefined;
49
+ price_in_cents?: undefined;
50
+ } | {
51
+ category: string;
52
+ content: {
53
+ attachments: {
54
+ images: never[];
55
+ };
56
+ body: string;
57
+ embeddables: {
58
+ gid: string;
59
+ associated_gid: string;
60
+ title: string;
61
+ description?: string | null;
62
+ cta_url: string;
63
+ image_url?: string | null;
64
+ recommendations_count: number;
65
+ indices?: import('../../../../../api/src/lib/core').components["schemas"]["integer_List"] | null;
66
+ role: "profile" | "mention" | "link";
67
+ }[];
68
+ };
69
+ content_type: string;
70
+ ends_at_date: Date | null;
71
+ ends_at_time: Date | null;
72
+ images: string[];
73
+ location: string | {
74
+ gid: string;
75
+ label: string;
76
+ };
77
+ reach: string;
78
+ starts_at_date: Date;
79
+ starts_at_time: Date;
80
+ subject: string;
81
+ topic: boolean;
82
+ marketplace_item_type?: undefined;
83
+ price_in_cents?: undefined;
84
+ } | {
85
+ category: string;
86
+ content: {
87
+ attachments: {
88
+ images: never[];
89
+ };
90
+ body: string;
91
+ embeddables: {
92
+ gid: string;
93
+ associated_gid: string;
94
+ title: string;
95
+ description?: string | null;
96
+ cta_url: string;
97
+ image_url?: string | null;
98
+ recommendations_count: number;
99
+ indices?: import('../../../../../api/src/lib/core').components["schemas"]["integer_List"] | null;
100
+ role: "profile" | "mention" | "link";
101
+ }[];
102
+ };
103
+ content_type: string;
104
+ images: string[];
105
+ marketplace_item_type: MarketplaceItems;
106
+ price_in_cents: string | null;
107
+ reach: string;
108
+ subject: string;
109
+ topic?: undefined;
110
+ ends_at_date?: undefined;
111
+ ends_at_time?: undefined;
112
+ location?: undefined;
113
+ starts_at_date?: undefined;
114
+ starts_at_time?: undefined;
115
+ };
@@ -7,13 +7,34 @@ export declare const generatePostPayload: (data: PostFormData, contentTopic?: To
7
7
  embeds: {
8
8
  role: "link" | "profile" | "mention";
9
9
  associated_gid: string;
10
+ title?: string | undefined;
11
+ description?: string | null | undefined;
12
+ cta_url?: string | undefined;
13
+ image_url?: string | null | undefined;
10
14
  indices?: number[] | null | undefined;
11
- }[] | null | undefined;
15
+ recommendations_count?: number | undefined;
16
+ }[];
12
17
  images: string[] | null;
13
18
  reach: "group" | "profile" | "public" | "hood" | "extended";
14
19
  subject: string;
15
20
  topic: string | null;
16
21
  };
22
+ export declare const generateEditPostPayload: (data: PostFormData, contentTopic?: Topic | null) => {
23
+ body: string;
24
+ embeds: {
25
+ role: "link" | "profile" | "mention";
26
+ associated_gid: string;
27
+ title?: string | undefined;
28
+ description?: string | null | undefined;
29
+ cta_url?: string | undefined;
30
+ image_url?: string | null | undefined;
31
+ indices?: number[] | null | undefined;
32
+ recommendations_count?: number | undefined;
33
+ }[];
34
+ images: string[];
35
+ subject: string;
36
+ topic: string | null;
37
+ };
17
38
  export declare const generateEventPayload: (data: EventFormData, selectedImage?: ImageFile | null, contentTopic?: Topic) => {
18
39
  body: string;
19
40
  category: string;
@@ -21,7 +42,12 @@ export declare const generateEventPayload: (data: EventFormData, selectedImage?:
21
42
  embeds: {
22
43
  role: "link" | "profile" | "mention";
23
44
  associated_gid: string;
45
+ title?: string | undefined;
46
+ description?: string | null | undefined;
47
+ cta_url?: string | undefined;
48
+ image_url?: string | null | undefined;
24
49
  indices?: number[] | null | undefined;
50
+ recommendations_count?: number | undefined;
25
51
  }[];
26
52
  ends_all_day: boolean;
27
53
  ends_at: string | null | undefined;
@@ -33,6 +59,28 @@ export declare const generateEventPayload: (data: EventFormData, selectedImage?:
33
59
  subject: string;
34
60
  topic: string | null;
35
61
  };
62
+ export declare const generateEditEventPayload: (data: EventFormData, contentTopic?: Topic | null) => {
63
+ body: string;
64
+ category: string;
65
+ embeds: {
66
+ role: "link" | "profile" | "mention";
67
+ associated_gid: string;
68
+ title?: string | undefined;
69
+ description?: string | null | undefined;
70
+ cta_url?: string | undefined;
71
+ image_url?: string | null | undefined;
72
+ indices?: number[] | null | undefined;
73
+ recommendations_count?: number | undefined;
74
+ }[];
75
+ ends_all_day: boolean;
76
+ ends_at: string | null | undefined;
77
+ images: string[];
78
+ location: string;
79
+ starts_all_day: boolean;
80
+ starts_at: string;
81
+ subject: string;
82
+ topic: string | null;
83
+ };
36
84
  export declare const generateMarketplacePayload: (data: MarketplaceFormData) => {
37
85
  body: string;
38
86
  category: string;
@@ -40,10 +88,32 @@ export declare const generateMarketplacePayload: (data: MarketplaceFormData) =>
40
88
  embeds: {
41
89
  role: "link" | "profile" | "mention";
42
90
  associated_gid: string;
91
+ title?: string | undefined;
92
+ description?: string | null | undefined;
93
+ cta_url?: string | undefined;
94
+ image_url?: string | null | undefined;
43
95
  indices?: number[] | null | undefined;
96
+ recommendations_count?: number | undefined;
44
97
  }[];
45
98
  images: string[] | null;
46
99
  price_in_cents: number | null;
47
100
  reach: "group" | "profile" | "public" | "hood" | "extended";
48
101
  subject: string;
49
102
  };
103
+ export declare const generateEditMarketplacePayload: (data: MarketplaceFormData) => {
104
+ body: string;
105
+ category: string;
106
+ embeds: {
107
+ role: "link" | "profile" | "mention";
108
+ associated_gid: string;
109
+ title?: string | undefined;
110
+ description?: string | null | undefined;
111
+ cta_url?: string | undefined;
112
+ image_url?: string | null | undefined;
113
+ indices?: number[] | null | undefined;
114
+ recommendations_count?: number | undefined;
115
+ }[];
116
+ images: string[];
117
+ price_in_cents: number | null;
118
+ subject: string;
119
+ };