@wise/dynamic-flow-client 4.5.4 → 4.5.6

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 (37) hide show
  1. package/build/main.js +417 -579
  2. package/build/main.mjs +417 -579
  3. package/build/types/revamp/domain/components/AllOfComponent.d.ts +4 -5
  4. package/build/types/revamp/domain/components/ColumnsComponent.d.ts +1 -1
  5. package/build/types/revamp/domain/components/ConstComponent.d.ts +2 -3
  6. package/build/types/revamp/domain/components/ContainerComponent.d.ts +1 -2
  7. package/build/types/revamp/domain/components/DecisionComponent.d.ts +1 -1
  8. package/build/types/revamp/domain/components/FormComponent.d.ts +4 -4
  9. package/build/types/revamp/domain/components/HeadingComponent.d.ts +1 -1
  10. package/build/types/revamp/domain/components/InstructionsComponent.d.ts +1 -1
  11. package/build/types/revamp/domain/components/ListComponent.d.ts +1 -1
  12. package/build/types/revamp/domain/components/MarkdownComponent.d.ts +1 -1
  13. package/build/types/revamp/domain/components/ModalContentComponent.d.ts +1 -2
  14. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +5 -5
  15. package/build/types/revamp/domain/components/ObjectComponent.d.ts +4 -5
  16. package/build/types/revamp/domain/components/RepeatableComponent.d.ts +6 -7
  17. package/build/types/revamp/domain/components/ReviewComponent.d.ts +1 -1
  18. package/build/types/revamp/domain/components/RootDomainComponent.d.ts +5 -2
  19. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +5 -5
  20. package/build/types/revamp/domain/components/TupleComponent.d.ts +4 -5
  21. package/build/types/revamp/domain/components/step/ExternalConfirmationComponent.d.ts +1 -2
  22. package/build/types/revamp/domain/components/step/StepDomainComponent.d.ts +6 -3
  23. package/build/types/revamp/domain/features/summary/summary-utils.d.ts +2 -2
  24. package/build/types/revamp/domain/features/validation/validation-functions.d.ts +2 -2
  25. package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +2 -2
  26. package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +2 -2
  27. package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +2 -2
  28. package/build/types/revamp/domain/mappers/layout/modalLayoutToComponent.d.ts +2 -2
  29. package/build/types/revamp/domain/mappers/layout/modalToContent.d.ts +2 -2
  30. package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +2 -2
  31. package/build/types/revamp/domain/mappers/mapSchemaToComponent.d.ts +2 -2
  32. package/build/types/revamp/domain/mappers/mapStepSchemas.d.ts +2 -2
  33. package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +1 -1
  34. package/build/types/revamp/domain/types.d.ts +15 -18
  35. package/build/types/revamp/utils/analyse-step.d.ts +3 -0
  36. package/build/types/revamp/utils/component-utils.d.ts +4 -4
  37. package/package.json +4 -4
@@ -1,11 +1,10 @@
1
1
  import type { Model } from '@wise/dynamic-flow-types/build/next';
2
- import type { BaseSchemaComponent, ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, RepeatableSummary } from '../types';
3
- export type AllOfComponent = ComponentWithTitle & BaseSchemaComponent & {
2
+ import type { BaseSchemaComponent, InlineAlert, SchemaComponent, LocalValue, RepeatableSummary } from '../types';
3
+ export type AllOfComponent = BaseSchemaComponent<LocalValue> & {
4
4
  type: 'all-of';
5
- components: DomainComponent[];
5
+ components: SchemaComponent[];
6
6
  alert?: InlineAlert;
7
- getChildren: () => DomainComponent[];
8
- getLocalValue: () => LocalValue;
7
+ getChildren: () => SchemaComponent[];
9
8
  };
10
9
  export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "title"> & {
11
10
  summariser: (value: Model | null) => RepeatableSummary;
@@ -1,4 +1,4 @@
1
- import type { Bias, BaseLayoutComponent, DomainComponent } from '../types';
1
+ import type { BaseLayoutComponent, Bias, DomainComponent } from '../types';
2
2
  export type ColumnsComponent = BaseLayoutComponent & {
3
3
  type: 'columns';
4
4
  bias: Bias;
@@ -1,8 +1,7 @@
1
1
  import type { Model } from '@wise/dynamic-flow-types/build/next';
2
- import type { BaseComponent, BaseSchemaComponent, LocalValue, RepeatableSummary } from '../types';
3
- export type ConstComponent = BaseComponent & BaseSchemaComponent & {
2
+ import type { BaseSchemaComponent, LocalValue, RepeatableSummary } from '../types';
3
+ export type ConstComponent = BaseSchemaComponent<LocalValue> & {
4
4
  type: 'const';
5
- getLocalValue: () => LocalValue;
6
5
  };
7
6
  export declare const createConstComponent: (hiddenProps: Pick<ConstComponent, "uid" | "schemaId" | "analyticsId"> & {
8
7
  value: Model;
@@ -1,9 +1,8 @@
1
- import type { BaseComponent, LocalValue, DomainComponent } from '../types';
1
+ import type { BaseComponent, DomainComponent } from '../types';
2
2
  export type ContainerComponent = BaseComponent & {
3
3
  type: 'container';
4
4
  components: DomainComponent[];
5
5
  getChildren: () => DomainComponent[];
6
- getLocalValue: () => LocalValue;
7
6
  };
8
7
  export declare const createContainerComponent: (containerProps: {
9
8
  uid: string;
@@ -1,5 +1,5 @@
1
1
  import type { Icon } from '@wise/dynamic-flow-types/build/next';
2
- import type { Image, InlineAlert, BaseLayoutComponent, SupportingValues } from '../types';
2
+ import type { BaseLayoutComponent, Image, InlineAlert, SupportingValues } from '../types';
3
3
  export type DecisionComponent = BaseLayoutComponent & {
4
4
  type: 'decision';
5
5
  options: DecisionOption[];
@@ -1,7 +1,7 @@
1
- import type { BaseLayoutComponent, InputComponent } from '../types';
1
+ import type { BaseLayoutComponent, SchemaComponent } from '../types';
2
2
  export type FormComponent = BaseLayoutComponent & {
3
3
  type: 'form';
4
- inputComponent: InputComponent;
5
- getChildren: () => InputComponent[];
4
+ schemaComponent: SchemaComponent;
5
+ getChildren: () => SchemaComponent[];
6
6
  };
7
- export declare const createFormComponent: (formProps: Pick<FormComponent, "uid" | "inputComponent" | "control" | "margin">) => FormComponent;
7
+ export declare const createFormComponent: (formProps: Pick<FormComponent, "uid" | "schemaComponent" | "control" | "margin">) => FormComponent;
@@ -1,5 +1,5 @@
1
1
  import type { Size } from '@wise/dynamic-flow-types/build/next';
2
- import type { BaseLayoutComponent, Align } from '../types';
2
+ import type { Align, BaseLayoutComponent } from '../types';
3
3
  export type HeadingComponent = BaseLayoutComponent & {
4
4
  type: 'heading';
5
5
  text: string;
@@ -1,4 +1,4 @@
1
- import type { Context, BaseLayoutComponent } from '../types';
1
+ import type { BaseLayoutComponent, Context } from '../types';
2
2
  export type InstructionsComponent = BaseLayoutComponent & {
3
3
  type: 'instructions';
4
4
  items: InstructionItem[];
@@ -1,5 +1,5 @@
1
1
  import { Icon } from '@wise/dynamic-flow-types/build/next';
2
- import { AdditionalInfo, CallToAction, Image, InlineAlert, BaseLayoutComponent, SupportingValues } from '../types';
2
+ import { AdditionalInfo, BaseLayoutComponent, CallToAction, Image, InlineAlert, SupportingValues } from '../types';
3
3
  export type ListComponent = BaseLayoutComponent & {
4
4
  type: 'list';
5
5
  items: ListItem[];
@@ -1,4 +1,4 @@
1
- import type { BaseLayoutComponent, Align } from '../types';
1
+ import type { Align, BaseLayoutComponent } from '../types';
2
2
  export type MarkdownComponent = BaseLayoutComponent & {
3
3
  type: 'markdown';
4
4
  align: Align;
@@ -1,11 +1,10 @@
1
- import type { DomainComponent, BaseComponent, LocalValue, UpdateComponent } from '../types';
1
+ import type { BaseComponent, DomainComponent, UpdateComponent } from '../types';
2
2
  export type ModalContentComponent = BaseComponent & {
3
3
  type: 'modal-content';
4
4
  components: DomainComponent[];
5
5
  open: boolean;
6
6
  title?: string;
7
7
  getChildren: () => DomainComponent[];
8
- getLocalValue: () => LocalValue;
9
8
  close: () => void;
10
9
  };
11
10
  export declare const createModalContentComponent: (modalProps: Pick<ModalContentComponent, "uid" | "components" | "title">, updateComponent: UpdateComponent) => ModalContentComponent;
@@ -1,25 +1,25 @@
1
1
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
3
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
4
- import type { DomainComponent, BaseInputComponent, LocalValue, LocalValueArray, OnValueChange, UpdateComponent, ValidationAsyncState } from '../types';
4
+ import type { BaseInputComponent, LocalValue, LocalValueArray, OnValueChange, SchemaComponent, UpdateComponent, ValidationAsyncState } from '../types';
5
5
  import type { SelectInputOption } from './SelectInputComponent';
6
6
  export type MultiSelectComponent = BaseInputComponent<LocalValueArray | null> & {
7
7
  type: 'multi-select';
8
- children: DomainComponent[];
8
+ children: SchemaComponent[];
9
9
  maxItems?: number;
10
10
  minItems?: number;
11
11
  options: SelectInputOption[];
12
12
  validationAsyncState: ValidationAsyncState;
13
13
  selectedIndices: number[];
14
- getChildren: () => DomainComponent[];
15
- getSelectedChildren: () => DomainComponent[] | null;
14
+ getChildren: () => SchemaComponent[];
15
+ getSelectedChildren: () => SchemaComponent[] | null;
16
16
  onSelect: (indices: number[]) => void;
17
17
  };
18
18
  export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "alert" | "control" | "description" | "disabled" | "errors" | "hidden" | "icon" | "image" | "maxItems" | "minItems" | "required" | "title" | "validationAsyncState"> & {
19
19
  checks: IsInvalidCheck<LocalValueArray | null>[];
20
20
  initialValue: LocalValue;
21
21
  options: (SelectInputOption & {
22
- component: DomainComponent;
22
+ component: SchemaComponent;
23
23
  })[];
24
24
  performValidationAsync: PerformValidationAsync | undefined;
25
25
  performRefresh: PerformRefresh | undefined;
@@ -1,10 +1,9 @@
1
- import type { BaseSchemaComponent, ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, LocalValueObject, RepeatableSummary } from '../types';
2
- export type ObjectComponent = ComponentWithTitle & BaseSchemaComponent & {
1
+ import type { BaseSchemaComponent, InlineAlert, SchemaComponent, LocalValue, LocalValueObject, RepeatableSummary } from '../types';
2
+ export type ObjectComponent = BaseSchemaComponent<LocalValueObject> & {
3
3
  type: 'object';
4
- componentMap: Record<string, DomainComponent>;
4
+ componentMap: Record<string, SchemaComponent>;
5
5
  alert?: InlineAlert;
6
- getChildren: () => DomainComponent[];
7
- getLocalValue: () => LocalValueObject;
6
+ getChildren: () => SchemaComponent[];
8
7
  };
9
8
  export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "componentMap" | "help" | "hidden" | "icon" | "image" | "title"> & {
10
9
  displayOrder: string[];
@@ -1,21 +1,20 @@
1
1
  import { Icon } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
- import type { BaseSchemaComponent, ComponentWithTitle, DomainComponent, Image, InlineAlert, LocalValue, LocalValueArray, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
4
- export type RepeatableComponent = ComponentWithTitle & BaseSchemaComponent & {
3
+ import type { BaseSchemaComponent, Image, InlineAlert, SchemaComponent, LocalValue, LocalValueArray, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
4
+ export type RepeatableComponent = BaseSchemaComponent<LocalValueArray> & {
5
5
  type: 'repeatable';
6
6
  id?: string;
7
- components: DomainComponent[];
7
+ components: SchemaComponent[];
8
8
  addItemTitle: string;
9
9
  alert?: InlineAlert;
10
- editableComponent: DomainComponent | null;
10
+ editableComponent: SchemaComponent | null;
11
11
  editableIndex: number | null;
12
12
  editItemTitle: string;
13
13
  errors: string[] | undefined;
14
14
  maxItems?: number;
15
15
  minItems?: number;
16
16
  summaryDefaults: RepeatableSummary;
17
- getChildren: () => DomainComponent[];
18
- getLocalValue: () => LocalValueArray;
17
+ getChildren: () => SchemaComponent[];
19
18
  onAdd: () => void;
20
19
  onEdit: (itemIndex: number) => void;
21
20
  onRemove: () => void;
@@ -36,6 +35,6 @@ export declare const createRepeatableComponent: (repeatableProps: Pick<Repeatabl
36
35
  summary?: Summary;
37
36
  summariser: (value: LocalValueArray | null) => RepeatableSummary;
38
37
  onValueChange: OnValueChange;
39
- createEditableComponent: (value: LocalValue) => DomainComponent;
38
+ createEditableComponent: (value: LocalValue) => SchemaComponent;
40
39
  }, updateComponent: UpdateComponent) => RepeatableComponent;
41
40
  export {};
@@ -1,5 +1,5 @@
1
1
  import { Icon } from '@wise/dynamic-flow-types/build/next';
2
- import type { AdditionalInfo, CallToAction, Image, InlineAlert, BaseLayoutComponent } from '../types';
2
+ import type { AdditionalInfo, BaseLayoutComponent, CallToAction, Image, InlineAlert } from '../types';
3
3
  export type ReviewComponent = BaseLayoutComponent & {
4
4
  type: 'review';
5
5
  fields: ReviewField[];
@@ -1,5 +1,6 @@
1
+ import { Model } from '@wise/dynamic-flow-types';
1
2
  import { AnalyticsEventDispatcher } from '../features/events';
2
- import { BaseComponent, DomainComponent, InputComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
3
+ import { BaseComponent, DomainComponent, SchemaComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
3
4
  import { ModalContentComponent } from './ModalContentComponent';
4
5
  import { StepDomainComponent } from './step/StepDomainComponent';
5
6
  export type RootDomainComponent = BaseComponent & {
@@ -11,7 +12,9 @@ export type RootDomainComponent = BaseComponent & {
11
12
  getChildren: () => DomainComponent[];
12
13
  getLocalValue: () => LocalValue;
13
14
  getLoadingState: () => LoadingState;
14
- getInputComponents: () => InputComponent[];
15
+ getSchemaComponents: () => SchemaComponent[];
16
+ getSubmittableValue: () => Promise<Model>;
17
+ validate: () => boolean;
15
18
  getTrackEvent: () => AnalyticsEventDispatcher<string> | null;
16
19
  setLoadingState: (loadingState: LoadingState) => void;
17
20
  hasStep: () => boolean;
@@ -2,16 +2,16 @@ import type { Icon, Model } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { AnalyticsEventDispatcher } from '../features/events';
3
3
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
4
4
  import type { IsInvalidCheck } from '../features/validation/value-checks';
5
- import type { DomainComponent, Image, BaseInputComponent, LocalValue, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
5
+ import type { BaseInputComponent, Image, SchemaComponent, LocalValue, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
6
6
  export type SelectInputComponent = BaseInputComponent<LocalValue | null> & {
7
7
  type: 'select';
8
8
  selectedIndex: number | null;
9
9
  options: SelectInputOption[];
10
- children: DomainComponent[];
10
+ children: SchemaComponent[];
11
11
  validationAsyncState?: undefined;
12
12
  onSelect: (index: number | null) => void;
13
- getChildren: () => DomainComponent[];
14
- getSelectedChild: () => DomainComponent | null;
13
+ getChildren: () => SchemaComponent[];
14
+ getSelectedChild: () => SchemaComponent | null;
15
15
  };
16
16
  export type SelectInputOption = {
17
17
  title: string;
@@ -24,7 +24,7 @@ export type SelectInputOption = {
24
24
  export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "icon" | "image" | "placeholder" | "required" | "title"> & {
25
25
  initialModel: Model;
26
26
  options: (SelectInputOption & {
27
- component: DomainComponent;
27
+ component: SchemaComponent;
28
28
  })[];
29
29
  checks: IsInvalidCheck<LocalValue>[];
30
30
  performRefresh?: PerformRefresh | undefined;
@@ -1,10 +1,9 @@
1
- import { BaseSchemaComponent, ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, LocalValueArray, RepeatableSummary } from '../types';
2
- export type TupleComponent = ComponentWithTitle & BaseSchemaComponent & {
1
+ import { BaseSchemaComponent, InlineAlert, SchemaComponent, LocalValue, LocalValueArray, RepeatableSummary } from '../types';
2
+ export type TupleComponent = BaseSchemaComponent<LocalValueArray> & {
3
3
  type: 'tuple';
4
- components: DomainComponent[];
4
+ components: SchemaComponent[];
5
5
  alert?: InlineAlert;
6
- getChildren: () => DomainComponent[];
7
- getLocalValue: () => LocalValueArray;
6
+ getChildren: () => SchemaComponent[];
8
7
  };
9
8
  export declare const createTupleComponent: (tupleProps: Pick<TupleComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "schemaId" | "title"> & {
10
9
  summariser: (value: LocalValue | null) => RepeatableSummary;
@@ -1,4 +1,4 @@
1
- import { BaseComponent, LocalValue, UpdateComponent } from '../../types';
1
+ import { BaseComponent, UpdateComponent } from '../../types';
2
2
  export type ExternalConfirmationComponent = BaseComponent & {
3
3
  type: 'external-confirmation';
4
4
  uid: string;
@@ -7,6 +7,5 @@ export type ExternalConfirmationComponent = BaseComponent & {
7
7
  onSuccess: () => void;
8
8
  onFailure: () => void;
9
9
  onCancel: () => void;
10
- getLocalValue: () => LocalValue;
11
10
  };
12
11
  export declare const createExternalConfirmation: (uid: string, url: string, updateComponent: UpdateComponent) => ExternalConfirmationComponent;
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, DomainComponent, InputComponent, LayoutComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '../../types';
1
+ import type { BaseComponent, DomainComponent, SchemaComponent, LayoutComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '../../types';
2
+ import { Model } from '@wise/dynamic-flow-types';
2
3
  import type { Step } from '@wise/dynamic-flow-types/build/next';
3
4
  import type { AnalyticsEventDispatcher } from '../../features/events';
4
5
  import type { StepPolling } from '../../features/polling/getStepPolling';
@@ -9,7 +10,7 @@ export type StepDomainComponent = BaseComponent & {
9
10
  type: 'step';
10
11
  back?: BackNavigation;
11
12
  layoutComponents: LayoutComponent[];
12
- inputComponents: InputComponent[];
13
+ schemaComponents: SchemaComponent[];
13
14
  control?: string;
14
15
  description?: string;
15
16
  error?: string;
@@ -24,6 +25,8 @@ export type StepDomainComponent = BaseComponent & {
24
25
  getChildren: () => DomainComponent[];
25
26
  getModals: () => ModalContentComponent[];
26
27
  getLocalValue: () => LocalValue;
28
+ getSubmittableValue: () => Promise<Model>;
29
+ validate: () => boolean;
27
30
  setLoadingState: (loadingState: LoadingState) => void;
28
31
  onBehavior: OnBehavior;
29
32
  stop: () => void;
@@ -33,7 +36,7 @@ type BackNavigation = {
33
36
  title?: string;
34
37
  onClick: () => void;
35
38
  };
36
- export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "layoutComponents" | "inputComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
39
+ export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "layoutComponents" | "schemaComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
37
40
  stepPolling?: StepPolling;
38
41
  stepRefreshAfter?: StepRefreshAfter;
39
42
  updateComponent: UpdateComponent;
@@ -1,9 +1,9 @@
1
1
  import type { Icon, Model, Schema } from '@wise/dynamic-flow-types/build/next';
2
- import type { LocalValue, RepeatableSummary, DomainComponent } from '../../types';
2
+ import type { SchemaComponent, LocalValue, RepeatableSummary } from '../../types';
3
3
  /** A summariser that accepts a schema and returns a function that can form a summary based on a value. */
4
4
  export declare const getSummariser: <S extends Schema>(schema: S) => (value: LocalValue | null) => RepeatableSummary;
5
5
  export declare const getConstSummary: (schema: Schema, model: Model | null) => RepeatableSummary;
6
- export declare const summariseFromChildren: (components: DomainComponent[]) => RepeatableSummary;
6
+ export declare const summariseFromChildren: (components: SchemaComponent[]) => RepeatableSummary;
7
7
  export declare const mergeSummaries: (summaryA: RepeatableSummary, summaryB: RepeatableSummary) => {
8
8
  title: string | undefined;
9
9
  description: string | undefined;
@@ -1,6 +1,6 @@
1
- import type { LocalValue, DomainComponent } from '../../types';
1
+ import type { LocalValue, SchemaComponent } from '../../types';
2
2
  import type { IsInvalidCheck } from './value-checks';
3
- export declare const validateComponents: (components: DomainComponent[]) => boolean;
3
+ export declare const validateComponents: (components: SchemaComponent[]) => boolean;
4
4
  /**
5
5
  * Returns a function that takes a local value and returns an array of validation errors
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { BoxLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import { type BoxComponent } from '../../components/BoxComponent';
3
- import type { InputComponent } from '../../types';
3
+ import type { SchemaComponent } from '../../types';
4
4
  import type { MapperProps } from '../schema/types';
5
- export declare const boxLayoutToComponent: (uid: string, { border, components, control, margin, width }: BoxLayout, mapperProps: MapperProps, inputComponents: InputComponent[]) => BoxComponent;
5
+ export declare const boxLayoutToComponent: (uid: string, { border, components, control, margin, width }: BoxLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => BoxComponent;
@@ -1,5 +1,5 @@
1
1
  import type { ColumnsLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import { type ColumnsComponent } from '../../components/ColumnsComponent';
3
- import type { InputComponent } from '../../types';
3
+ import type { SchemaComponent } from '../../types';
4
4
  import type { MapperProps } from '../schema/types';
5
- export declare const columnsLayoutToComponent: (uid: string, { control, left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps, inputComponents: InputComponent[]) => ColumnsComponent;
5
+ export declare const columnsLayoutToComponent: (uid: string, { control, left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => ColumnsComponent;
@@ -1,4 +1,4 @@
1
1
  import type { FormLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import { FormComponent } from '../../components/FormComponent';
3
- import type { InputComponent } from '../../types';
4
- export declare const formLayoutToComponent: (uid: string, { schemaId, schema: schemaRef, control, margin }: FormLayout, inputComponents: InputComponent[]) => FormComponent;
3
+ import type { SchemaComponent } from '../../types';
4
+ export declare const formLayoutToComponent: (uid: string, { schemaId, schema: schemaRef, control, margin }: FormLayout, schemaComponents: SchemaComponent[]) => FormComponent;
@@ -1,4 +1,4 @@
1
1
  import type { ModalLayout } from '@wise/dynamic-flow-types/build/next';
2
- import type { InputComponent } from '../../types';
2
+ import type { SchemaComponent } from '../../types';
3
3
  import type { MapperProps } from '../schema/types';
4
- export declare const modalLayoutToComponent: (uid: string, { content, control, margin, trigger }: ModalLayout, mapperProps: MapperProps, inputComponents: InputComponent[]) => import("../../components/ModalComponent").ModalComponent;
4
+ export declare const modalLayoutToComponent: (uid: string, { content, control, margin, trigger }: ModalLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => import("../../components/ModalComponent").ModalComponent;
@@ -1,5 +1,5 @@
1
1
  import { ModalBehavior } from '@wise/dynamic-flow-types/build/next';
2
2
  import { ModalContentComponent } from '../../components/ModalContentComponent';
3
- import type { InputComponent } from '../../types';
3
+ import type { SchemaComponent } from '../../types';
4
4
  import type { MapperProps } from '../schema/types';
5
- export declare const modalToContent: (uid: string, { content, title }: ModalBehavior, mapperProps: MapperProps, inputComponents: InputComponent[]) => ModalContentComponent;
5
+ export declare const modalToContent: (uid: string, { content, title }: ModalBehavior, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => ModalContentComponent;
@@ -1,4 +1,4 @@
1
1
  import type { Layout } from '@wise/dynamic-flow-types/build/next';
2
- import type { InputComponent, LayoutComponent } from '../types';
2
+ import type { LayoutComponent, SchemaComponent } from '../types';
3
3
  import type { MapperProps } from './schema/types';
4
- export declare const mapLayoutToComponent: (uid: string, layout: Layout, mapperProps: MapperProps, inputComponents: InputComponent[]) => LayoutComponent;
4
+ export declare const mapLayoutToComponent: (uid: string, layout: Layout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => LayoutComponent;
@@ -1,3 +1,3 @@
1
- import type { InputComponent } from '../types';
1
+ import type { SchemaComponent } from '../types';
2
2
  import type { MapperProps, SchemaMapperProps } from './schema/types';
3
- export declare const mapSchemaToComponent: (schemaMapperProps: SchemaMapperProps, mapperProps: MapperProps) => InputComponent;
3
+ export declare const mapSchemaToComponent: (schemaMapperProps: SchemaMapperProps, mapperProps: MapperProps) => SchemaComponent;
@@ -1,4 +1,4 @@
1
1
  import { Step } from '@wise/dynamic-flow-types/build/next';
2
- import { InputComponent, LocalValue } from '../types';
2
+ import { LocalValue, SchemaComponent } from '../types';
3
3
  import { MapperProps } from './schema/types';
4
- export declare const mapStepSchemas: (uid: string, step: Step, stepLocalValue: LocalValue, mapperProps: MapperProps, referencedSchemaIds: string[]) => InputComponent[];
4
+ export declare const mapStepSchemas: (uid: string, step: Step, stepLocalValue: LocalValue, mapperProps: MapperProps, referencedSchemaIds: string[]) => SchemaComponent[];
@@ -2,4 +2,4 @@ import type { OneOfSchema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps, SchemaMapperProps } from '../types';
3
3
  export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
4
4
  schema: OneOfSchema;
5
- }, mapperProps: MapperProps) => import("../../../types").InputComponent;
5
+ }, mapperProps: MapperProps) => import("../../../types").SchemaComponent;
@@ -36,9 +36,9 @@ import type { StepDomainComponent } from './components/step/StepDomainComponent'
36
36
  import type { TextInputComponent } from './components/TextInputComponent';
37
37
  import type { TupleComponent } from './components/TupleComponent';
38
38
  import type { UploadInputComponent } from './components/UploadInputComponent';
39
- export type DomainComponent = InputComponent | LayoutComponent;
40
- export type InputComponent = AllOfComponent | BooleanInputComponent | ConstComponent | DateInputComponent | IntegerInputComponent | MultiSelectComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | RepeatableComponent | SelectInputComponent | TextInputComponent | TupleComponent | UploadInputComponent;
41
- export type LayoutComponent = RootDomainComponent | StepDomainComponent | AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DecisionComponent | DividerComponent | ExternalConfirmationComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | ListComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | ModalContentComponent | ParagraphComponent | ReviewComponent | SearchComponent | StatusListComponent;
39
+ export type DomainComponent = SchemaComponent | LayoutComponent | RootDomainComponent | StepDomainComponent;
40
+ export type SchemaComponent = AllOfComponent | BooleanInputComponent | ConstComponent | DateInputComponent | IntegerInputComponent | MultiSelectComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | RepeatableComponent | SelectInputComponent | TextInputComponent | TupleComponent | UploadInputComponent;
41
+ export type LayoutComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DecisionComponent | DividerComponent | ExternalConfirmationComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | ListComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | ModalContentComponent | ParagraphComponent | ReviewComponent | SearchComponent | StatusListComponent;
42
42
  export type LocalValue = LocalValuePrimitive | LocalValueObject | LocalValueArray;
43
43
  export type LocalValuePrimitive = string | number | boolean | File | null;
44
44
  export interface LocalValueObject extends Record<string, LocalValuePrimitive | LocalValueObject | LocalValueArray> {
@@ -64,23 +64,18 @@ export type BaseComponent = {
64
64
  type: string;
65
65
  uid: string;
66
66
  analyticsId?: string;
67
- /** Gets the form model value. Will wait for in-flight requests to finish (e.g. persist async) and return the most up to date value. */
68
- getSubmittableValue: () => Promise<Model>;
69
- /** Gets the (potentially incomplete) form model, synchronously. It will NOT wait for in-flight requests and will not include base64 encoded values. It can be used in places where accuracy is not required (such as matching algorithms) but on submission, you should always prefer getSubmittableValue */
70
- getSubmittableValueSync: () => Model;
71
- getSummary: () => RepeatableSummary;
72
- validate: () => boolean;
73
67
  };
74
68
  export type BaseLayoutComponent = BaseComponent & {
75
69
  control?: string;
76
70
  margin: Margin;
77
- getLocalValue: () => LocalValue;
78
71
  };
79
72
  export type Image = {
80
73
  uri: string;
81
74
  accessibilityDescription?: string;
82
75
  };
83
- export type ComponentWithTitle = BaseComponent & {
76
+ export type BaseSchemaComponent<LV extends LocalValue> = BaseComponent & {
77
+ schemaId?: string;
78
+ isSchemaReferencedInStep?: boolean;
84
79
  control?: string;
85
80
  description?: string;
86
81
  help?: string;
@@ -88,12 +83,15 @@ export type ComponentWithTitle = BaseComponent & {
88
83
  icon?: Icon;
89
84
  image?: Image;
90
85
  title?: string;
86
+ getLocalValue: () => LV;
87
+ /** Gets the (potentially incomplete) form model, synchronously. It will NOT wait for in-flight requests and will not include base64 encoded values. It can be used in places where accuracy is not required (such as matching algorithms) but on submission, you should always prefer getSubmittableValue */
88
+ getSubmittableValueSync: () => Model;
89
+ getSummary: () => RepeatableSummary;
90
+ /** Gets the form model value. Will wait for in-flight requests to finish (e.g. persist async) and return the most up to date value. */
91
+ getSubmittableValue: () => Promise<Model>;
92
+ validate: () => boolean;
91
93
  };
92
- export type BaseSchemaComponent = {
93
- schemaId?: string;
94
- isSchemaReferencedInStep?: boolean;
95
- };
96
- export type BaseInputComponent<V extends LocalValue> = BaseSchemaComponent & ComponentWithTitle & {
94
+ export type BaseInputComponent<LV extends LocalValue> = BaseSchemaComponent<LV> & {
97
95
  id: string;
98
96
  autoComplete: string;
99
97
  disabled: boolean;
@@ -101,11 +99,10 @@ export type BaseInputComponent<V extends LocalValue> = BaseSchemaComponent & Com
101
99
  placeholder?: string;
102
100
  required: boolean;
103
101
  validationAsyncState?: ValidationAsyncState;
104
- value: V;
102
+ value: LV;
105
103
  alert?: InlineAlert;
106
104
  onBlur: () => void;
107
105
  onFocus: () => void;
108
- getLocalValue: () => V;
109
106
  };
110
107
  export type UpdateComponent = () => void;
111
108
  export type OnBehavior = (behavior: Behavior) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { Step } from '@wise/dynamic-flow-types/build/next';
2
+ import { LoggingEventDispatcher } from '../domain/features/events';
3
+ export declare const analyseStep: (step: Step, logEvent: LoggingEventDispatcher) => void;
@@ -1,7 +1,7 @@
1
1
  import type { Model } from '@wise/dynamic-flow-types/build/next';
2
- import type { LocalValue, DomainComponent } from '../domain/types';
3
- export declare const getSubmittableData: (components: DomainComponent[]) => Promise<Model>;
4
- export declare const getSubmittableDataSync: (components: DomainComponent[]) => Model;
5
- export declare const getLocalValues: (components: DomainComponent[]) => LocalValue;
2
+ import type { SchemaComponent, LocalValue } from '../domain/types';
3
+ export declare const getSubmittableData: (components: SchemaComponent[]) => Promise<Model>;
4
+ export declare const getSubmittableDataSync: (components: SchemaComponent[]) => Model;
5
+ export declare const getLocalValues: (components: SchemaComponent[]) => LocalValue;
6
6
  export declare const mergeLocalValues: (valueA: LocalValue, valueB: LocalValue) => LocalValue;
7
7
  export declare const mergeModels: (valueA: Model, valueB: Model) => Model;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "4.5.4",
3
+ "version": "4.5.6",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -85,8 +85,8 @@
85
85
  "tsx": "4.19.4",
86
86
  "typescript": "5.8.3",
87
87
  "webpack": "5.99.8",
88
- "@wise/dynamic-flow-renderers": "0.0.0",
89
- "@wise/dynamic-flow-fixtures": "0.0.1"
88
+ "@wise/dynamic-flow-fixtures": "0.0.1",
89
+ "@wise/dynamic-flow-renderers": "0.0.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/components": "^46.92.0",
@@ -102,7 +102,7 @@
102
102
  "classnames": "2.5.1",
103
103
  "react-webcam": "^7.2.0",
104
104
  "screenfull": "^5.2.0",
105
- "@wise/dynamic-flow-types": "3.3.2"
105
+ "@wise/dynamic-flow-types": "3.3.4"
106
106
  },
107
107
  "scripts": {
108
108
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",