@soma-vertical-web/multi-lib 0.0.70 → 0.0.72

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 (31) hide show
  1. package/cms/ContentTypes/LPCadastro/LPCadastroContent.d.ts +4 -0
  2. package/cms/Sections/PopupModal/Component.d.ts +4 -0
  3. package/cms/Sections/PopupModal/Composite/FormSection.d.ts +4 -0
  4. package/cms/Sections/PopupModal/Composite/Success.d.ts +4 -0
  5. package/cms/index.d.ts +1 -0
  6. package/cms/server.d.ts +1 -0
  7. package/constants.d.ts +4 -1
  8. package/data/api/DitoIngest/sendDitoEvent.d.ts +3 -0
  9. package/data/api/search/autoCompleteSuggestions/index.d.ts +1 -1
  10. package/data/helpers/utils/stringToSHA1.d.ts +1 -0
  11. package/index.js +16 -16
  12. package/index.mjs +5587 -5190
  13. package/index2.js +1 -1
  14. package/index2.mjs +456 -437
  15. package/layout/index.d.ts +12 -0
  16. package/layout/team-component/Form/Composite/Content.d.ts +4 -0
  17. package/layout/team-component/Form/Composite/FieldGroup.d.ts +7 -0
  18. package/layout/team-component/Form/Composite/FieldWrapper.d.ts +7 -0
  19. package/layout/team-component/Form/Composite/FormError.d.ts +4 -0
  20. package/layout/team-component/Form/Composite/Success.d.ts +4 -0
  21. package/layout/team-component/Form/Composite/index.d.ts +4 -0
  22. package/layout/team-component/Form/Form.d.ts +11 -0
  23. package/layout/team-component/Form/FormContext.d.ts +5 -0
  24. package/layout/team-component/Form/index.d.ts +1 -0
  25. package/layout/template/LPCadastro/index.d.ts +3 -0
  26. package/package.json +1 -1
  27. package/style.css +1 -1
  28. package/types/cms/Sections/PopupModal/index.d.ts +26 -0
  29. package/types/data/api/dito-ingest/index.d.ts +65 -0
  30. package/types/layout/team-components/Form/index.d.ts +21 -3
  31. package/types/layout/templates/LPCadastro/index.d.ts +32 -0
@@ -0,0 +1,65 @@
1
+ type DitoEventType = 'IDENTIFY' | 'TRACK';
2
+ interface DitoAddress {
3
+ city?: string;
4
+ state?: string;
5
+ country?: string;
6
+ postal_code?: string;
7
+ street?: string;
8
+ }
9
+ export interface DitoIdentifyBody {
10
+ user_id: string;
11
+ timestamp: string;
12
+ type: DitoEventType;
13
+ userToken?: string;
14
+ traits: {
15
+ id?: string;
16
+ birthday?: string;
17
+ created_at?: string;
18
+ gender?: string;
19
+ email?: string;
20
+ name?: string;
21
+ phone?: string;
22
+ timezone?: string;
23
+ address?: DitoAddress;
24
+ custom_data?: {
25
+ [key: string]: any;
26
+ };
27
+ };
28
+ }
29
+ export interface DitoTrackBody {
30
+ user_id: string;
31
+ action: string;
32
+ timestamp: string;
33
+ type: DitoEventType;
34
+ context?: {
35
+ os?: {
36
+ name?: string;
37
+ version?: string;
38
+ };
39
+ utm?: {
40
+ campaign?: string;
41
+ medium?: string;
42
+ source?: string;
43
+ };
44
+ browser?: {
45
+ name?: string;
46
+ version?: string;
47
+ };
48
+ platform?: {
49
+ name?: string;
50
+ type?: string;
51
+ };
52
+ referrer?: string;
53
+ user_agent?: string;
54
+ };
55
+ properties: {
56
+ custom_data?: {
57
+ [key: string]: any;
58
+ };
59
+ };
60
+ }
61
+ export type DitoAuthResponse = {
62
+ token: string;
63
+ refresh_token: string;
64
+ };
65
+ export {};
@@ -1,4 +1,6 @@
1
- import { FormEvent, PropsWithChildren } from 'react';
1
+ import { default as React, FormEvent, HTMLAttributes, PropsWithChildren } from 'react';
2
+ import { FormStatus } from '../Newsletter';
3
+ import { ICONSType } from '../../../constants';
2
4
 
3
5
  type SizeField = 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
4
6
  export type Fields = {
@@ -11,9 +13,13 @@ export interface IFormGroup {
11
13
  groupLabel: string;
12
14
  fields: Fields[];
13
15
  }
14
- export interface IFormProps extends PropsWithChildren {
15
- masterDataEntity: string;
16
+ export interface IFormProps extends HTMLAttributes<HTMLDivElement>, FormConstantsProps, PropsWithChildren {
17
+ masterDataEntity: string | undefined;
16
18
  groups: IFormGroup[];
19
+ postFn: (args: any) => Promise<any>;
20
+ actionName?: string;
21
+ originName?: string;
22
+ POPUP_SUBMITTED_STORAGE: string;
17
23
  }
18
24
  export interface IFormData {
19
25
  [key: string]: string;
@@ -23,5 +29,17 @@ export interface IFormContext {
23
29
  handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
24
30
  submitForm: (event: FormEvent) => void;
25
31
  formData: IFormData;
32
+ status: FormStatus;
33
+ fieldMessage?: string;
34
+ success: boolean;
35
+ setSuccess: React.Dispatch<React.SetStateAction<boolean>>;
36
+ }
37
+ export interface FormConstantsProps extends HTMLAttributes<HTMLDivElement> {
38
+ FORM_CONFIGS: {
39
+ successMessage: string;
40
+ errorMessage: string;
41
+ returnButton: string;
42
+ };
43
+ ICONS: ICONSType;
26
44
  }
27
45
  export {};
@@ -0,0 +1,32 @@
1
+ import { ICONSType } from '../../../constants';
2
+ import { GetContentTypeProps } from '../../../data/api/cms';
3
+
4
+ export interface LPCadastroContentProps {
5
+ requiredMessage: string;
6
+ buttonLabel: string;
7
+ bannerDesk: string;
8
+ bannerMobile: string;
9
+ altBanner: string;
10
+ }
11
+ export interface LPCadastroContenTypeProps {
12
+ sections: Array<any>;
13
+ content: {
14
+ ['conteúdo']: LPCadastroContentProps;
15
+ };
16
+ }
17
+ export interface LPCadastroProps {
18
+ content: LPCadastroContentProps;
19
+ postFn: (args: any) => Promise<any>;
20
+ sections: Array<any>;
21
+ FORM_CONFIGS: {
22
+ successMessage: string;
23
+ errorMessage: string;
24
+ returnButton: string;
25
+ };
26
+ ICONS: ICONSType;
27
+ POPUP_SUBMITTED_STORAGE: string;
28
+ }
29
+ export interface LPCadastroContentTypeProps extends Omit<GetContentTypeProps, 'contentType'> {
30
+ SectionZone: React.ComponentType<any>;
31
+ LPCadastro: React.ComponentType<any>;
32
+ }