@goodhood-web/nebenan-base 4.1.0-development.24 → 4.1.0-development.26

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 (36) hide show
  1. package/index.d.ts +4 -2
  2. package/index.js +85 -85
  3. package/index.mjs +70252 -69410
  4. package/lib/ContentCreator/ContentCreator.d.ts +3 -0
  5. package/lib/ContentCreator/ContentCreator.types.d.ts +18 -0
  6. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/ContentCreatorFieldsWrapper.d.ts +3 -0
  7. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.d.ts +4 -0
  8. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentFieldsSheet/ContentFieldsSheet.types.d.ts +34 -0
  9. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.d.ts +3 -0
  10. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ContentTypeField/ContentTypeField.types.d.ts +13 -0
  11. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/EventFields/EventField.d.ts +2 -0
  12. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/MarketplaceFields/MarketplaceFields.d.ts +2 -0
  13. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/PostFields/PostFields.d.ts +3 -0
  14. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/PostFields/PostFields.types.d.ts +6 -0
  15. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeField.d.ts +3 -0
  16. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/ReachTypeField/ReachTypeFields.type.d.ts +10 -0
  17. package/lib/ContentCreator/components/ContentCreatorFieldWrapper/components/index.d.ts +6 -0
  18. package/lib/ContentCreator/constants.d.ts +12 -0
  19. package/lib/ContentCreator/network.d.ts +4 -0
  20. package/lib/ContentCreator/utils.d.ts +14 -0
  21. package/lib/ContentCreator/validationSchemas/commonSchemas.d.ts +112 -0
  22. package/lib/ContentCreator/validationSchemas/dynamicValidationSchema.d.ts +628 -0
  23. package/lib/ContentCreator/validationSchemas/eventSchema.d.ts +127 -0
  24. package/lib/ContentCreator/validationSchemas/index.d.ts +7 -0
  25. package/lib/ContentCreator/validationSchemas/marketplaceSchema.d.ts +127 -0
  26. package/lib/ContentCreator/validationSchemas/postSchema.d.ts +127 -0
  27. package/lib/ContentCreator/validationSchemas/recommendationSchema.d.ts +127 -0
  28. package/lib/ContentCreator/validationSchemas/searchSchema.d.ts +127 -0
  29. package/lib/Forms/Fields/FormRichTextArea.d.ts +8 -0
  30. package/lib/MarketplaceImageCropper/MarketplaceImageCropper.d.ts +5 -0
  31. package/lib/MarketplaceImageCropper/MarketplaceImageCropper.types.d.ts +6 -0
  32. package/lib/MarketplaceImageCropper/components/ImageThumbnailGrid/ImageThumbnailGrid.d.ts +10 -0
  33. package/lib/RichTextArea/RichTextArea.d.ts +1 -1
  34. package/lib/RichTextArea/RichTextArea.types.d.ts +2 -1
  35. package/package.json +1 -1
  36. package/style.css +1 -1
@@ -0,0 +1,3 @@
1
+ import { ContentCreatorProps } from './ContentCreator.types';
2
+ declare const ContentCreator: ({ imageUrl, post, postId, userId }: ContentCreatorProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ContentCreator;
@@ -0,0 +1,18 @@
1
+ import { components } from '../../../../api/src/lib/core';
2
+ export type PostItem = components['schemas']['Core_V3_Input_HoodMessage'];
3
+ export type FailureError = {
4
+ failures: components['schemas']['Core_V3_Failure_List'];
5
+ };
6
+ export type ContentCreatorProps = {
7
+ imageUrl?: string;
8
+ post?: PostItem;
9
+ postId?: number;
10
+ userId?: number;
11
+ };
12
+ export type ContentCreatorFormProps = Pick<ContentCreatorProps, 'imageUrl' | 'userId'> & {
13
+ formError?: string | null;
14
+ isEditMode?: boolean;
15
+ isFormSheetOpen: boolean;
16
+ onFormSheetClose: () => void;
17
+ onFormSheetOpen: () => void;
18
+ };
@@ -0,0 +1,3 @@
1
+ import { ContentCreatorFormProps } from '../../ContentCreator.types';
2
+ declare const ContentCreatorFieldsWrapper: ({ formError, imageUrl, isEditMode, isFormSheetOpen, onFormSheetClose, onFormSheetOpen, userId, }: ContentCreatorFormProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ContentCreatorFieldsWrapper;
@@ -0,0 +1,4 @@
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: ({ imageUploadClicked, onImageUploadDismiss, onPoiDismiss, poiClicked, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const Footer: ({ formError, onImageUploadOpen, onPoiOpen, setReachTypeSelectorOpen, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export type HeaderProps = {
3
+ imageUrl?: string;
4
+ onContentTypeSelectorOpen: () => void;
5
+ onDismiss: () => void;
6
+ userId?: number;
7
+ };
8
+ export type ContentProps = {
9
+ imageUploadClicked: boolean;
10
+ onImageUploadDismiss: () => void;
11
+ onPoiDismiss: () => void;
12
+ poiClicked: boolean;
13
+ };
14
+ export type FooterProps = {
15
+ formError?: string | null;
16
+ onImageUploadOpen: () => void;
17
+ onPoiOpen: () => void;
18
+ setReachTypeSelectorOpen: Dispatch<SetStateAction<boolean>>;
19
+ };
20
+ export type Lang = {
21
+ contentTypes: {
22
+ event: string;
23
+ marketplace: string;
24
+ post: string;
25
+ recommendation: string;
26
+ search: string;
27
+ };
28
+ reachTypes: {
29
+ extended: string;
30
+ hood: string;
31
+ public: string;
32
+ };
33
+ submitButton: string;
34
+ };
@@ -0,0 +1,3 @@
1
+ import { ContentTypeSheetProps } from './ContentTypeField.types';
2
+ declare const ContentTypeField: ({ onClose, onFormSheetOpen, open }: ContentTypeSheetProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ContentTypeField;
@@ -0,0 +1,13 @@
1
+ import { Icon32 } from '../../../../../../../../ui/src/lib/Base/Icon/Icon.types';
2
+ export type ContentTypeSheetProps = {
3
+ onClose: () => void;
4
+ onFormSheetOpen: () => void;
5
+ open: boolean;
6
+ };
7
+ export type OptionType = {
8
+ description: string;
9
+ headline: string;
10
+ icon: Icon32;
11
+ value: string;
12
+ };
13
+ export type ContentType = 'post' | 'search' | 'recommendation' | 'event' | 'marketplace';
@@ -0,0 +1,2 @@
1
+ declare const EventFields: () => import("react/jsx-runtime").JSX.Element;
2
+ export default EventFields;
@@ -0,0 +1,2 @@
1
+ declare const MarketplaceFields: () => import("react/jsx-runtime").JSX.Element;
2
+ export default MarketplaceFields;
@@ -0,0 +1,3 @@
1
+ import { PostFieldsProps } from './PostFields.types';
2
+ declare const PostFields: ({ imageUploadClicked, onImageUploadDismiss, onPoiDismiss, poiClicked, }: PostFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default PostFields;
@@ -0,0 +1,6 @@
1
+ export type PostFieldsProps = {
2
+ imageUploadClicked: boolean;
3
+ onImageUploadDismiss: () => void;
4
+ onPoiDismiss: () => void;
5
+ poiClicked: boolean;
6
+ };
@@ -0,0 +1,3 @@
1
+ import { ReachTypeFieldProps } from './ReachTypeFields.type';
2
+ declare const ReachTypeField: ({ onClose, open }: ReachTypeFieldProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ReachTypeField;
@@ -0,0 +1,10 @@
1
+ export type OptionType = {
2
+ label: string;
3
+ secondaryText: string;
4
+ value: ReachType;
5
+ };
6
+ export type ReachTypeFieldProps = {
7
+ onClose: () => void;
8
+ open: boolean;
9
+ };
10
+ export type ReachType = 'hood' | 'extended' | 'public';
@@ -0,0 +1,6 @@
1
+ export { default as ContentTypeField } from './ContentTypeField/ContentTypeField';
2
+ export { default as PostFields } from './PostFields/PostFields';
3
+ export { default as EventFields } from './EventFields/EventField';
4
+ export { default as MarketplaceFields } from './MarketplaceFields/MarketplaceFields';
5
+ export { Header, Content, Footer } from './ContentFieldsSheet/ContentFieldsSheet';
6
+ export { default as ReachTypeField } from './ReachTypeField/ReachTypeField';
@@ -0,0 +1,12 @@
1
+ export declare const DEFAULT_FORM_VALUES: {
2
+ content: {
3
+ attachments: {
4
+ images: never[];
5
+ };
6
+ body: string;
7
+ embeddables: never[];
8
+ };
9
+ content_type: string;
10
+ reach: string;
11
+ subject: string;
12
+ };
@@ -0,0 +1,4 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { OnFormSubmitType } from '../Forms/Form/Form.types';
3
+ 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>;
@@ -0,0 +1,14 @@
1
+ import { DefaultValues } from 'react-hook-form';
2
+ import { FailureError, PostItem } from './ContentCreator.types';
3
+ import { ContentFormData } from './validationSchemas';
4
+ import { ImageFile } from './validationSchemas/commonSchemas';
5
+ export declare const transformBackendFieldError: (error: FailureError) => {
6
+ failures: {
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";
9
+ message: string;
10
+ }[];
11
+ };
12
+ export declare const getImagesSignedIds: (images: ImageFile[] | null | undefined) => string[] | null;
13
+ export declare const generateImageObject: (imageUrls: string[]) => never[] | undefined;
14
+ export declare function getInitialValues(post: PostItem): DefaultValues<ContentFormData>;
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+ export declare const embedSchema: z.ZodObject<{
3
+ gid: z.ZodString;
4
+ indices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
5
+ role: z.ZodEnum<["mention", "link", "profile"]>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ role: "link" | "profile" | "mention";
8
+ gid: string;
9
+ indices?: number[] | null | undefined;
10
+ }, {
11
+ role: "link" | "profile" | "mention";
12
+ gid: string;
13
+ indices?: number[] | null | undefined;
14
+ }>;
15
+ declare const imageFileSchema: z.ZodObject<{
16
+ croppedImg: z.ZodType<File, z.ZodTypeDef, File>;
17
+ id: z.ZodString;
18
+ originalImg: z.ZodType<File, z.ZodTypeDef, File>;
19
+ signedId: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ id: string;
22
+ croppedImg: File;
23
+ originalImg: File;
24
+ signedId?: string | undefined;
25
+ }, {
26
+ id: string;
27
+ croppedImg: File;
28
+ originalImg: File;
29
+ signedId?: string | undefined;
30
+ }>;
31
+ export declare const reachSchema: z.ZodEnum<["profile", "hood", "extended", "public"]>;
32
+ export type ImageFile = z.infer<typeof imageFileSchema>;
33
+ export declare const subjectSchema: z.ZodString;
34
+ export declare const bodyWithEmbedsSchema: z.ZodObject<{
35
+ attachments: z.ZodOptional<z.ZodObject<{
36
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
37
+ croppedImg: z.ZodType<File, z.ZodTypeDef, File>;
38
+ id: z.ZodString;
39
+ originalImg: z.ZodType<File, z.ZodTypeDef, File>;
40
+ signedId: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ id: string;
43
+ croppedImg: File;
44
+ originalImg: File;
45
+ signedId?: string | undefined;
46
+ }, {
47
+ id: string;
48
+ croppedImg: File;
49
+ originalImg: File;
50
+ signedId?: string | undefined;
51
+ }>, "many">>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ images?: {
54
+ id: string;
55
+ croppedImg: File;
56
+ originalImg: File;
57
+ signedId?: string | undefined;
58
+ }[] | undefined;
59
+ }, {
60
+ images?: {
61
+ id: string;
62
+ croppedImg: File;
63
+ originalImg: File;
64
+ signedId?: string | undefined;
65
+ }[] | undefined;
66
+ }>>;
67
+ body: z.ZodString;
68
+ embeddables: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
69
+ gid: z.ZodString;
70
+ indices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
71
+ role: z.ZodEnum<["mention", "link", "profile"]>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ role: "link" | "profile" | "mention";
74
+ gid: string;
75
+ indices?: number[] | null | undefined;
76
+ }, {
77
+ role: "link" | "profile" | "mention";
78
+ gid: string;
79
+ indices?: number[] | null | undefined;
80
+ }>, "many">>>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ body: string;
83
+ embeddables?: {
84
+ role: "link" | "profile" | "mention";
85
+ gid: string;
86
+ indices?: number[] | null | undefined;
87
+ }[] | null | undefined;
88
+ attachments?: {
89
+ images?: {
90
+ id: string;
91
+ croppedImg: File;
92
+ originalImg: File;
93
+ signedId?: string | undefined;
94
+ }[] | undefined;
95
+ } | undefined;
96
+ }, {
97
+ body: string;
98
+ embeddables?: {
99
+ role: "link" | "profile" | "mention";
100
+ gid: string;
101
+ indices?: number[] | null | undefined;
102
+ }[] | null | undefined;
103
+ attachments?: {
104
+ images?: {
105
+ id: string;
106
+ croppedImg: File;
107
+ originalImg: File;
108
+ signedId?: string | undefined;
109
+ }[] | undefined;
110
+ } | undefined;
111
+ }>;
112
+ export {};