@habit.analytics/habit-claims-journey-components 2.2.0 → 2.3.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.
- package/README.md +1 -0
- package/dist/components/runner/FormRunnerWidget.d.ts +20 -2
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/index.cjs +26 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3891 -3831
- package/dist/schemas/form-config.schema.json.d.ts +1 -0
- package/dist/types/journey.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JourneySpec, UploadResult } from '../../types/journey';
|
|
1
|
+
import { JourneySpec, FormStep, UploadResult } from '../../types/journey';
|
|
2
2
|
export type StepApiRequest = {
|
|
3
3
|
step_id: string;
|
|
4
4
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -12,10 +12,28 @@ export type InitApiRequest = {
|
|
|
12
12
|
url: string;
|
|
13
13
|
headers?: Record<string, string>;
|
|
14
14
|
};
|
|
15
|
+
export interface FormRunnerSaveContext {
|
|
16
|
+
reason: 'step_change' | 'manual' | 'progress';
|
|
17
|
+
currentStep: FormStep;
|
|
18
|
+
currentStepIndex: number;
|
|
19
|
+
nextStepId?: string;
|
|
20
|
+
stage?: 'welcome' | 'form' | 'summary';
|
|
21
|
+
}
|
|
15
22
|
export interface FormRunnerWidgetProps {
|
|
16
23
|
journey: JourneySpec;
|
|
17
24
|
onSubmit?: (answers: Record<string, unknown>) => void;
|
|
18
|
-
onSave?: (partialAnswers: Record<string, unknown
|
|
25
|
+
onSave?: (partialAnswers: Record<string, unknown>, context?: FormRunnerSaveContext) => void | Promise<void>;
|
|
26
|
+
onProgressChange?: (partialAnswers: Record<string, unknown>, context: FormRunnerSaveContext) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Automatically calls `onSave` when the user advances from one step to another.
|
|
29
|
+
* Defaults to `true`; set to `false` to keep saving only under host control.
|
|
30
|
+
*/
|
|
31
|
+
autoSaveOnStepChange?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to show the live summary panel while the user fills the form.
|
|
34
|
+
* Defaults to `true`. The final summary screen remains available.
|
|
35
|
+
*/
|
|
36
|
+
showSummaryPanel?: boolean;
|
|
19
37
|
onFileSelect?: (file: File, questionKey: string) => Promise<string | UploadResult | void> | void;
|
|
20
38
|
/**
|
|
21
39
|
* Optional handler to delegate per-step API calls to the host app.
|
|
@@ -223,6 +223,8 @@ declare const en: {
|
|
|
223
223
|
readonly fc_nav_field_requires_value: "Field \"{{label}}\" requires a value.";
|
|
224
224
|
readonly fc_summary_panel: "Summary Panel";
|
|
225
225
|
readonly fc_summary_title_label: "Summary Title";
|
|
226
|
+
readonly fc_summary_show_sidebar: "Show live summary";
|
|
227
|
+
readonly fc_summary_show_sidebar_hint: "Display the summary sidebar while the user moves through the journey.";
|
|
226
228
|
readonly fc_summary_sections: "Sections";
|
|
227
229
|
readonly fc_summary_add_section: "Add Section";
|
|
228
230
|
readonly fc_summary_section_title_placeholder: "Section title";
|