@hievilmath/browser-formidavim 1.4.40 → 1.5.0

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.
@@ -1,16 +1,17 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { Flow, FlowForm } from '../../../../../axios/formidavim/src/index.ts';
2
+ import { eventData } from '../types/data';
3
3
  export declare const DataRenderer: FC<PropsWithChildren<{
4
4
  dataFetcher?: (type?: 'pipeline' | 'flow') => Promise<any>;
5
5
  configFetcher?: () => Promise<any>;
6
- onSubmit?: (formData: any, flow: Partial<Flow>) => Promise<any>;
7
6
  isPreview?: boolean;
8
7
  flowName?: string;
9
8
  version?: string | undefined;
10
9
  formidavimHost?: string;
11
- onNextStep?: (flow: Flow, currentForm: FlowForm) => any;
12
- onPrevStep?: (flow: Flow, currentForm: FlowForm) => any;
13
- onFlowInit?: (flow: Flow) => any;
10
+ onNextStep?: (data: eventData) => any;
11
+ onPrevStep?: (data: eventData) => any;
12
+ onFormInit?: (data: eventData) => any;
13
+ onFlowInit?: (data: eventData) => any;
14
+ onSubmit?: (data: eventData, shouldRedirect?: boolean) => Promise<any>;
14
15
  onFormidavimFallback?: () => void;
15
16
  onConfigFetchError?: (error: any) => any;
16
17
  shouldRedirect?: boolean;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { Flow, FlowForm, FormComponent } from '../../../../../axios/formidavim/src/index.ts';
3
+ import { eventData } from '../types/data';
3
4
  export interface EvaluatedFormComponent extends FormComponent {
4
5
  isVisible: boolean;
5
6
  shouldRender: boolean;
@@ -17,9 +18,10 @@ export declare const FlowRenderer: FC<{
17
18
  flow: Partial<Flow>;
18
19
  isPreview: boolean;
19
20
  $bgColor?: string;
20
- onSubmit: (formData: any, flow: Partial<Flow>, shouldRedirect: boolean) => Promise<any>;
21
- onNextStep?: (flow: any, currentForm: any) => any;
22
- onPrevStep?: (flow: any, currentForm: any) => any;
21
+ onSubmit: (data: eventData, shouldRedirect: boolean) => Promise<any>;
22
+ onNextStep?: (data: eventData) => any;
23
+ onPrevStep?: (data: eventData) => any;
24
+ onFormInit?: (data: eventData) => any;
23
25
  shouldRedirect?: boolean;
24
26
  formidavimHost?: string;
25
27
  }>;
@@ -1,18 +1,20 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { Flow, FlowForm, PipelineDto, PipelineFlowDto } from '../../../../../axios/formidavim/src/index.ts';
2
+ import { PipelineDto } from '../../../../../axios/formidavim/src/index.ts';
3
+ import { eventData } from '../types/data';
3
4
  export declare const PipelineProcessor: FC<PropsWithChildren<{
4
5
  dataFetcher?: (type?: 'pipeline' | 'flow') => Promise<any>;
5
6
  pipelineFetcher?: () => Promise<any>;
6
7
  configFetcher?: () => Promise<any>;
7
- onSubmit?: (formData: any, flow: Partial<Flow>) => Promise<((config?: PipelineDto) => void) | void>;
8
8
  isPreview?: boolean;
9
9
  flowName: string;
10
10
  version?: string | undefined;
11
11
  formidavimHost?: string;
12
- onNextStep?: (flow: Flow, currentForm: FlowForm) => any;
13
- onPrevStep?: (flow: Flow, currentForm: FlowForm) => any;
14
- onFlowInit?: (flow: Flow, pipeline?: PipelineDto) => any;
15
- onPipelineInit?: (pipelineFlows: PipelineFlowDto[]) => any;
12
+ onNextStep?: (data: eventData) => any;
13
+ onPrevStep?: (data: eventData) => any;
14
+ onFlowInit?: (data: eventData) => any;
15
+ onFormInit?: (data: eventData) => any;
16
+ onPipelineInit?: (data: eventData) => any;
17
+ onSubmit?: (data: eventData) => Promise<((config?: PipelineDto) => void) | void>;
16
18
  onNoFlowsAvailable?: () => void;
17
19
  onFormidavimFallback?: () => void;
18
20
  onConfigFetchError?: (error: any) => any;
@@ -1,13 +1,15 @@
1
1
  import { PatientProfileDto, Flow } from '../../../../../axios/formidavim/src/index.ts';
2
2
  import { FC } from 'react';
3
+ import { eventData } from '../types/data';
3
4
  export declare const Renderer: FC<{
4
5
  data: PatientProfileDto | null;
5
6
  config: Partial<Flow>;
6
7
  isPreview: boolean;
7
- onSubmit: (formData: any, flow: Partial<Flow>, shouldRedirect: boolean) => Promise<any>;
8
- onNextStep?: (flow: any, currentForm: any) => any;
9
- onPrevStep?: (flow: any, currentForm: any) => any;
10
- onFlowInit?: (flow: Flow) => any;
8
+ onSubmit: (data: eventData, shouldRedirect: boolean) => Promise<any>;
9
+ onNextStep?: (data: eventData) => any;
10
+ onPrevStep?: (data: eventData) => any;
11
+ onFlowInit?: (data: eventData) => any;
12
+ onFormInit?: (data: eventData) => any;
11
13
  shouldRedirect?: boolean;
12
14
  formidavimHost?: string;
13
15
  }>;
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ import { FormComponent } from '../../../../../../axios/formidavim/src/index.ts';
3
+ /**
4
+ * GA Client ID Component
5
+ *
6
+ * Automatically extracts Google Analytics client ID from the _ga cookie
7
+ * and stores it in the flow data for submission to WordPress user meta.
8
+ *
9
+ * Behavior: On render, reads GA client ID from the GA cookie
10
+ * Output: Exposes a value new_user_ga_cookie to the flow submission payload
11
+ * Placement: Should be placed in the first flow of all new user/registration pipelines
12
+ */
13
+ export declare const GAClientId: FC<{
14
+ formComponent: Partial<FormComponent>;
15
+ formidavimHost?: string;
16
+ }>;
@@ -0,0 +1,8 @@
1
+ import { Flow, FlowForm, PipelineDto } from '../../../../../axios/formidavim/src/index.ts';
2
+ export interface eventData {
3
+ pipeline?: PipelineDto;
4
+ flow?: Partial<Flow>;
5
+ flowData?: any;
6
+ form?: FlowForm;
7
+ formData?: any;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hievilmath/browser-formidavim",
3
- "version": "1.4.40",
3
+ "version": "1.5.0",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "typings": "./index.d.ts",