@wise/dynamic-flow-client 4.5.3 → 4.5.4

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 (23) hide show
  1. package/build/main.js +2900 -2885
  2. package/build/main.mjs +2900 -2885
  3. package/build/types/revamp/domain/components/AllOfComponent.d.ts +3 -5
  4. package/build/types/revamp/domain/components/ConstComponent.d.ts +3 -3
  5. package/build/types/revamp/domain/components/FormComponent.d.ts +4 -4
  6. package/build/types/revamp/domain/components/ObjectComponent.d.ts +3 -5
  7. package/build/types/revamp/domain/components/RepeatableComponent.d.ts +3 -4
  8. package/build/types/revamp/domain/components/RootDomainComponent.d.ts +3 -2
  9. package/build/types/revamp/domain/components/TupleComponent.d.ts +3 -5
  10. package/build/types/revamp/domain/components/step/StepDomainComponent.d.ts +4 -3
  11. package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +2 -1
  12. package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +3 -2
  13. package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +3 -3
  14. package/build/types/revamp/domain/mappers/layout/modalLayoutToComponent.d.ts +2 -1
  15. package/build/types/revamp/domain/mappers/layout/modalToContent.d.ts +3 -2
  16. package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +2 -2
  17. package/build/types/revamp/domain/mappers/mapStepSchemas.d.ts +4 -0
  18. package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +1 -0
  19. package/build/types/revamp/domain/mappers/schema/types.d.ts +1 -0
  20. package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -0
  21. package/build/types/revamp/domain/types.d.ts +5 -1
  22. package/package.json +15 -15
  23. package/build/types/revamp/domain/mappers/mapUnreferencedSchemas.d.ts +0 -3
@@ -1,14 +1,12 @@
1
1
  import type { Model } from '@wise/dynamic-flow-types/build/next';
2
- import type { ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, RepeatableSummary } from '../types';
3
- export type AllOfComponent = ComponentWithTitle & {
2
+ import type { BaseSchemaComponent, ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, RepeatableSummary } from '../types';
3
+ export type AllOfComponent = ComponentWithTitle & BaseSchemaComponent & {
4
4
  type: 'all-of';
5
5
  components: DomainComponent[];
6
6
  alert?: InlineAlert;
7
7
  getChildren: () => DomainComponent[];
8
8
  getLocalValue: () => LocalValue;
9
9
  };
10
- export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "title"> & {
11
- uid: string;
12
- analyticsId?: string;
10
+ export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "title"> & {
13
11
  summariser: (value: Model | null) => RepeatableSummary;
14
12
  }) => AllOfComponent;
@@ -1,10 +1,10 @@
1
1
  import type { Model } from '@wise/dynamic-flow-types/build/next';
2
- import type { BaseComponent, LocalValue, RepeatableSummary } from '../types';
3
- export type ConstComponent = BaseComponent & {
2
+ import type { BaseComponent, BaseSchemaComponent, LocalValue, RepeatableSummary } from '../types';
3
+ export type ConstComponent = BaseComponent & BaseSchemaComponent & {
4
4
  type: 'const';
5
5
  getLocalValue: () => LocalValue;
6
6
  };
7
- export declare const createConstComponent: (hiddenProps: Pick<ConstComponent, "analyticsId" | "uid"> & {
7
+ export declare const createConstComponent: (hiddenProps: Pick<ConstComponent, "uid" | "schemaId" | "analyticsId"> & {
8
8
  value: Model;
9
9
  summary: RepeatableSummary;
10
10
  }) => ConstComponent;
@@ -1,7 +1,7 @@
1
- import type { BaseLayoutComponent, DomainComponent } from '../types';
1
+ import type { BaseLayoutComponent, InputComponent } from '../types';
2
2
  export type FormComponent = BaseLayoutComponent & {
3
3
  type: 'form';
4
- components: DomainComponent[];
5
- getChildren: () => DomainComponent[];
4
+ inputComponent: InputComponent;
5
+ getChildren: () => InputComponent[];
6
6
  };
7
- export declare const createFormComponent: (formProps: Pick<FormComponent, "uid" | "components" | "control" | "margin">) => FormComponent;
7
+ export declare const createFormComponent: (formProps: Pick<FormComponent, "uid" | "inputComponent" | "control" | "margin">) => FormComponent;
@@ -1,14 +1,12 @@
1
- import type { ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, LocalValueObject, RepeatableSummary } from '../types';
2
- export type ObjectComponent = ComponentWithTitle & {
1
+ import type { BaseSchemaComponent, ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, LocalValueObject, RepeatableSummary } from '../types';
2
+ export type ObjectComponent = ComponentWithTitle & BaseSchemaComponent & {
3
3
  type: 'object';
4
4
  componentMap: Record<string, DomainComponent>;
5
5
  alert?: InlineAlert;
6
6
  getChildren: () => DomainComponent[];
7
7
  getLocalValue: () => LocalValueObject;
8
8
  };
9
- export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "alert" | "control" | "description" | "componentMap" | "help" | "hidden" | "icon" | "image" | "title"> & {
10
- uid: string;
11
- analyticsId?: string;
9
+ export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "componentMap" | "help" | "hidden" | "icon" | "image" | "title"> & {
12
10
  displayOrder: string[];
13
11
  summariser: (value: LocalValue | null) => RepeatableSummary;
14
12
  }) => ObjectComponent;
@@ -1,7 +1,7 @@
1
1
  import { Icon } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
- import type { ComponentWithTitle, DomainComponent, Image, InlineAlert, LocalValue, LocalValueArray, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
4
- export type RepeatableComponent = ComponentWithTitle & {
3
+ import type { BaseSchemaComponent, ComponentWithTitle, DomainComponent, Image, InlineAlert, LocalValue, LocalValueArray, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
4
+ export type RepeatableComponent = ComponentWithTitle & BaseSchemaComponent & {
5
5
  type: 'repeatable';
6
6
  id?: string;
7
7
  components: DomainComponent[];
@@ -31,8 +31,7 @@ type Summary = {
31
31
  providesIcon?: boolean;
32
32
  providesImage?: boolean;
33
33
  };
34
- export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "uid" | "id" | "addItemTitle" | "alert" | "components" | "control" | "description" | "editItemTitle" | "errors" | "hidden" | "icon" | "image" | "maxItems" | "minItems" | "title"> & {
35
- analyticsId?: string;
34
+ export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "uid" | "schemaId" | "id" | "analyticsId" | "addItemTitle" | "alert" | "components" | "control" | "description" | "editItemTitle" | "errors" | "hidden" | "icon" | "image" | "maxItems" | "minItems" | "title"> & {
36
35
  checks: IsInvalidCheck<LocalValueArray | null>[];
37
36
  summary?: Summary;
38
37
  summariser: (value: LocalValueArray | null) => RepeatableSummary;
@@ -1,7 +1,7 @@
1
1
  import { AnalyticsEventDispatcher } from '../features/events';
2
- import { BaseComponent, DomainComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
3
- import { StepDomainComponent } from './step/StepDomainComponent';
2
+ import { BaseComponent, DomainComponent, InputComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
4
3
  import { ModalContentComponent } from './ModalContentComponent';
4
+ import { StepDomainComponent } from './step/StepDomainComponent';
5
5
  export type RootDomainComponent = BaseComponent & {
6
6
  type: 'root';
7
7
  stepComponent: StepDomainComponent | null;
@@ -11,6 +11,7 @@ export type RootDomainComponent = BaseComponent & {
11
11
  getChildren: () => DomainComponent[];
12
12
  getLocalValue: () => LocalValue;
13
13
  getLoadingState: () => LoadingState;
14
+ getInputComponents: () => InputComponent[];
14
15
  getTrackEvent: () => AnalyticsEventDispatcher<string> | null;
15
16
  setLoadingState: (loadingState: LoadingState) => void;
16
17
  hasStep: () => boolean;
@@ -1,13 +1,11 @@
1
- import { ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, LocalValueArray, RepeatableSummary } from '../types';
2
- export type TupleComponent = ComponentWithTitle & {
1
+ import { BaseSchemaComponent, ComponentWithTitle, DomainComponent, InlineAlert, LocalValue, LocalValueArray, RepeatableSummary } from '../types';
2
+ export type TupleComponent = ComponentWithTitle & BaseSchemaComponent & {
3
3
  type: 'tuple';
4
4
  components: DomainComponent[];
5
5
  alert?: InlineAlert;
6
6
  getChildren: () => DomainComponent[];
7
7
  getLocalValue: () => LocalValueArray;
8
8
  };
9
- export declare const createTupleComponent: (tupleProps: Pick<TupleComponent, "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "title"> & {
10
- uid: string;
11
- analyticsId?: string;
9
+ export declare const createTupleComponent: (tupleProps: Pick<TupleComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "schemaId" | "title"> & {
12
10
  summariser: (value: LocalValue | null) => RepeatableSummary;
13
11
  }) => TupleComponent;
@@ -1,4 +1,4 @@
1
- import type { BaseComponent, DomainComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '../../types';
1
+ import type { BaseComponent, DomainComponent, InputComponent, LayoutComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '../../types';
2
2
  import type { Step } from '@wise/dynamic-flow-types/build/next';
3
3
  import type { AnalyticsEventDispatcher } from '../../features/events';
4
4
  import type { StepPolling } from '../../features/polling/getStepPolling';
@@ -8,7 +8,8 @@ import { ExternalConfirmationComponent } from './ExternalConfirmationComponent';
8
8
  export type StepDomainComponent = BaseComponent & {
9
9
  type: 'step';
10
10
  back?: BackNavigation;
11
- components: DomainComponent[];
11
+ layoutComponents: LayoutComponent[];
12
+ inputComponents: InputComponent[];
12
13
  control?: string;
13
14
  description?: string;
14
15
  error?: string;
@@ -32,7 +33,7 @@ type BackNavigation = {
32
33
  title?: string;
33
34
  onClick: () => void;
34
35
  };
35
- export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "components" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
36
+ export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "layoutComponents" | "inputComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
36
37
  stepPolling?: StepPolling;
37
38
  stepRefreshAfter?: StepRefreshAfter;
38
39
  updateComponent: UpdateComponent;
@@ -1,4 +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
4
  import type { MapperProps } from '../schema/types';
4
- export declare const boxLayoutToComponent: (uid: string, { border, components, control, margin, width }: BoxLayout, mapperProps: MapperProps) => BoxComponent;
5
+ export declare const boxLayoutToComponent: (uid: string, { border, components, control, margin, width }: BoxLayout, mapperProps: MapperProps, inputComponents: InputComponent[]) => BoxComponent;
@@ -1,4 +1,5 @@
1
1
  import type { ColumnsLayout } from '@wise/dynamic-flow-types/build/next';
2
- import type { MapperProps } from '../schema/types';
3
2
  import { type ColumnsComponent } from '../../components/ColumnsComponent';
4
- export declare const columnsLayoutToComponent: (uid: string, { control, left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps) => ColumnsComponent;
3
+ import type { InputComponent } from '../../types';
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;
@@ -1,4 +1,4 @@
1
1
  import type { FormLayout } from '@wise/dynamic-flow-types/build/next';
2
- import type { DomainComponent } from '../../types';
3
- import type { MapperProps } from '../schema/types';
4
- export declare const formLayoutToComponent: (uid: string, { schemaId, schema: schemaRef, control, margin }: FormLayout, mapperProps: MapperProps) => DomainComponent;
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;
@@ -1,3 +1,4 @@
1
1
  import type { ModalLayout } from '@wise/dynamic-flow-types/build/next';
2
+ import type { InputComponent } from '../../types';
2
3
  import type { MapperProps } from '../schema/types';
3
- export declare const modalLayoutToComponent: (uid: string, { content, control, margin, trigger }: ModalLayout, mapperProps: MapperProps) => import("../../components/ModalComponent").ModalComponent;
4
+ export declare const modalLayoutToComponent: (uid: string, { content, control, margin, trigger }: ModalLayout, mapperProps: MapperProps, inputComponents: InputComponent[]) => import("../../components/ModalComponent").ModalComponent;
@@ -1,4 +1,5 @@
1
1
  import { ModalBehavior } from '@wise/dynamic-flow-types/build/next';
2
- import { MapperProps } from '../schema/types';
3
2
  import { ModalContentComponent } from '../../components/ModalContentComponent';
4
- export declare const modalToContent: (uid: string, { content, title }: ModalBehavior, mapperProps: MapperProps) => ModalContentComponent;
3
+ import type { InputComponent } from '../../types';
4
+ import type { MapperProps } from '../schema/types';
5
+ export declare const modalToContent: (uid: string, { content, title }: ModalBehavior, mapperProps: MapperProps, inputComponents: InputComponent[]) => ModalContentComponent;
@@ -1,4 +1,4 @@
1
1
  import type { Layout } from '@wise/dynamic-flow-types/build/next';
2
- import type { DomainComponent } from '../types';
2
+ import type { InputComponent, LayoutComponent } from '../types';
3
3
  import type { MapperProps } from './schema/types';
4
- export declare const mapLayoutToComponent: (uid: string, layout: Layout, mapperProps: MapperProps) => DomainComponent;
4
+ export declare const mapLayoutToComponent: (uid: string, layout: Layout, mapperProps: MapperProps, inputComponents: InputComponent[]) => LayoutComponent;
@@ -0,0 +1,4 @@
1
+ import { Step } from '@wise/dynamic-flow-types/build/next';
2
+ import { InputComponent, LocalValue } from '../types';
3
+ import { MapperProps } from './schema/types';
4
+ export declare const mapStepSchemas: (uid: string, step: Step, stepLocalValue: LocalValue, mapperProps: MapperProps, referencedSchemaIds: string[]) => InputComponent[];
@@ -22,6 +22,7 @@ export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperPr
22
22
  schema: S;
23
23
  }) => {
24
24
  uid: string;
25
+ schemaId?: string | undefined;
25
26
  schema: (Schema | undefined) & S;
26
27
  model: import("@wise/dynamic-flow-types/build/next").Model;
27
28
  localValue: import("../../../types").LocalValue;
@@ -17,6 +17,7 @@ export type MapperProps = {
17
17
  };
18
18
  export type SchemaMapperProps = {
19
19
  uid: string;
20
+ schemaId?: string;
20
21
  schema: Schema;
21
22
  model: Model;
22
23
  localValue: LocalValue;
@@ -5,6 +5,7 @@ export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
5
5
  help?: string | undefined;
6
6
  uid: string;
7
7
  id: string;
8
+ schemaId: string | undefined;
8
9
  analyticsId: string;
9
10
  control: string | undefined;
10
11
  description: string | undefined;
@@ -89,7 +89,11 @@ export type ComponentWithTitle = BaseComponent & {
89
89
  image?: Image;
90
90
  title?: string;
91
91
  };
92
- export type BaseInputComponent<V extends LocalValue> = ComponentWithTitle & {
92
+ export type BaseSchemaComponent = {
93
+ schemaId?: string;
94
+ isSchemaReferencedInStep?: boolean;
95
+ };
96
+ export type BaseInputComponent<V extends LocalValue> = BaseSchemaComponent & ComponentWithTitle & {
93
97
  id: string;
94
98
  autoComplete: string;
95
99
  disabled: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "4.5.3",
3
+ "version": "4.5.4",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -38,17 +38,17 @@
38
38
  "@babel/preset-typescript": "7.27.1",
39
39
  "@chromatic-com/storybook": "3.2.6",
40
40
  "@formatjs/cli": "^6.7.1",
41
- "@storybook/addon-a11y": "^8.6.12",
42
- "@storybook/addon-actions": "^8.6.12",
43
- "@storybook/addon-essentials": "^8.6.12",
44
- "@storybook/addon-interactions": "^8.6.12",
45
- "@storybook/addon-links": "^8.6.12",
41
+ "@storybook/addon-a11y": "^8.6.14",
42
+ "@storybook/addon-actions": "^8.6.14",
43
+ "@storybook/addon-essentials": "^8.6.14",
44
+ "@storybook/addon-interactions": "^8.6.14",
45
+ "@storybook/addon-links": "^8.6.14",
46
46
  "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
47
- "@storybook/manager-api": "^8.6.12",
48
- "@storybook/react": "^8.6.12",
49
- "@storybook/react-webpack5": "^8.6.12",
50
- "@storybook/test": "^8.6.12",
51
- "@storybook/types": "^8.6.12",
47
+ "@storybook/manager-api": "^8.6.14",
48
+ "@storybook/react": "^8.6.14",
49
+ "@storybook/react-webpack5": "^8.6.14",
50
+ "@storybook/test": "^8.6.14",
51
+ "@storybook/types": "^8.6.14",
52
52
  "@testing-library/dom": "10.4.0",
53
53
  "@testing-library/jest-dom": "6.6.3",
54
54
  "@testing-library/react": "16.3.0",
@@ -57,7 +57,7 @@
57
57
  "@transferwise/formatting": "^2.13.1",
58
58
  "@transferwise/icons": "3.21.0",
59
59
  "@transferwise/neptune-css": "14.24.4",
60
- "@types/node": "22.15.18",
60
+ "@types/node": "22.15.19",
61
61
  "@types/jest": "29.5.14",
62
62
  "@types/react": "18.3.21",
63
63
  "@types/react-dom": "18.3.7",
@@ -77,7 +77,7 @@
77
77
  "react": "18.3.1",
78
78
  "react-dom": "18.3.1",
79
79
  "react-intl": "6.8.9",
80
- "storybook": "^8.6.12",
80
+ "storybook": "^8.6.14",
81
81
  "stylelint": "16.19.1",
82
82
  "stylelint-config-standard": "36.0.1",
83
83
  "stylelint-no-unsupported-browser-features": "8.0.4",
@@ -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-fixtures": "0.0.1",
89
- "@wise/dynamic-flow-renderers": "0.0.0"
88
+ "@wise/dynamic-flow-renderers": "0.0.0",
89
+ "@wise/dynamic-flow-fixtures": "0.0.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/components": "^46.92.0",
@@ -1,3 +0,0 @@
1
- import type { DomainComponent } from '../types';
2
- import type { MapperProps } from './schema/types';
3
- export declare const mapUnreferencedSchemas: (mapperProps: MapperProps) => DomainComponent[];