@habit.analytics/habit-claims-journey-components 2.2.0 → 2.3.1
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/form-configurator/FlowValidationPanel.d.ts +1 -0
- package/dist/components/runner/FormRunnerWidget.d.ts +20 -2
- package/dist/i18n/locales/en.d.ts +13 -0
- package/dist/index.cjs +87 -67
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6829 -6434
- package/dist/lib/flow-validation.d.ts +8 -0
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FlowValidationPanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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.
|
|
@@ -173,6 +173,17 @@ declare const en: {
|
|
|
173
173
|
readonly fc_tab_fields: "Fields";
|
|
174
174
|
readonly fc_tab_init: "Init";
|
|
175
175
|
readonly fc_tab_json: "JSON";
|
|
176
|
+
readonly fc_flow_validation_title: "Flow Validation";
|
|
177
|
+
readonly fc_flow_validation_validate: "Validate Flow";
|
|
178
|
+
readonly fc_flow_validation_no_issues: "No flow issues found";
|
|
179
|
+
readonly fc_flow_validation_good: "Flow looks good!";
|
|
180
|
+
readonly fc_flow_validation_no_issues_step: "No issues";
|
|
181
|
+
readonly fc_flow_validation_broken_reference: "Broken Reference";
|
|
182
|
+
readonly fc_flow_validation_unreachable_step: "Unreachable Step";
|
|
183
|
+
readonly fc_flow_validation_dead_end: "Dead End";
|
|
184
|
+
readonly fc_flow_validation_cycle: "Navigation Cycle";
|
|
185
|
+
readonly fc_flow_validation_no_fallback_rule: "No Fallback Rule";
|
|
186
|
+
readonly fc_flow_validation_general: "General";
|
|
176
187
|
readonly fc_form_steps: "Form Steps";
|
|
177
188
|
readonly fc_add_step: "Add Step";
|
|
178
189
|
readonly fc_step_untitled: "(untitled)";
|
|
@@ -223,6 +234,8 @@ declare const en: {
|
|
|
223
234
|
readonly fc_nav_field_requires_value: "Field \"{{label}}\" requires a value.";
|
|
224
235
|
readonly fc_summary_panel: "Summary Panel";
|
|
225
236
|
readonly fc_summary_title_label: "Summary Title";
|
|
237
|
+
readonly fc_summary_show_sidebar: "Show live summary";
|
|
238
|
+
readonly fc_summary_show_sidebar_hint: "Display the summary sidebar while the user moves through the journey.";
|
|
226
239
|
readonly fc_summary_sections: "Sections";
|
|
227
240
|
readonly fc_summary_add_section: "Add Section";
|
|
228
241
|
readonly fc_summary_section_title_placeholder: "Section title";
|