@wise/dynamic-flow-client 4.8.0 → 4.8.2

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.
@@ -6,7 +6,7 @@
6
6
  "dynamicFlows.ArraySchema.minItemsError": "Voeg minimaal {minItems} toe.",
7
7
  "dynamicFlows.ArraySchema.removeItem": "Verwijderen",
8
8
  "dynamicFlows.CameraCapture.CameraConnectionIssue.action": "Opnieuw proberen",
9
- "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "Controleer of de camera verbonden is en probeer opnieuw.",
9
+ "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "Controleer of de camera verbonden is en probeer het opnieuw.",
10
10
  "dynamicFlows.CameraCapture.CameraConnectionIssue.title": "We hebben geen toegang tot je camera",
11
11
  "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "Je browser ondersteunt geen camera's. Probeer een andere browser of apparaat of download onze mobiele app.",
12
12
  "dynamicFlows.CameraCapture.CameraNotSupported.title": "Camera wordt niet ondersteund",
@@ -29,22 +29,22 @@
29
29
  "dynamicFlows.ControlFeedback.type": "Onjuist type",
30
30
  "dynamicFlows.DefaultErrorMessages.required": "Vul dit veld in.",
31
31
  "dynamicFlows.DynamicExternal.retryTitle": "Venster opnieuw openen",
32
- "dynamicFlows.DynamicParagraph.copied": "Naar klembord gekopiëerd",
32
+ "dynamicFlows.DynamicParagraph.copied": "Naar klembord gekopieerd",
33
33
  "dynamicFlows.DynamicParagraph.copy": "Kopiëren",
34
34
  "dynamicFlows.ErrorBoundary.errorAlert": "Er is iets misgegaan.",
35
35
  "dynamicFlows.ErrorBoundary.retry": "Opnieuw proberen",
36
36
  "dynamicFlows.ExternalConfirmation.cancel": "Annuleren",
37
37
  "dynamicFlows.ExternalConfirmation.description": "Bevestig dat je **{origin}** in een nieuw browsertabblad wilt openen.",
38
38
  "dynamicFlows.ExternalConfirmation.open": "In nieuw tabblad openen",
39
- "dynamicFlows.ExternalConfirmation.title": "Bevestig",
39
+ "dynamicFlows.ExternalConfirmation.title": "Bevestigen",
40
40
  "dynamicFlows.FileUploadSchema.maxFileSizeError": "Het bestand is te groot. Upload een kleiner bestand.",
41
41
  "dynamicFlows.FileUploadSchema.wrongFileTypeError": "De bestandsindeling wordt niet ondersteund. Upload een ander bestand.",
42
42
  "dynamicFlows.Help.ariaLabel": "Klik hier voor meer informatie.",
43
43
  "dynamicFlows.MultiSelect.summary": "{first} en nog {count}",
44
44
  "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Het bestand is te groot. Upload een kleiner bestand.",
45
45
  "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "Upload {maxItems} of minder bestanden.",
46
- "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Upload mimimaal {minItems} bestand(en).",
47
- "dynamicFlows.PersistAsyncSchema.genericError": "Er ging iets mis, probeer het a. u. b. opnieuw.",
46
+ "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Upload minimaal {minItems} bestand(en).",
47
+ "dynamicFlows.PersistAsyncSchema.genericError": "Er is iets misgegaan, probeer het opnieuw.",
48
48
  "dynamicFlows.ReadOnlySchema.no": "Nee",
49
49
  "dynamicFlows.ReadOnlySchema.yes": "Ja",
50
50
  "dynamicFlows.SearchLayout.loading": "Laden..."
package/build/main.js CHANGED
@@ -3288,7 +3288,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
3288
3288
  const isValid = this.validate();
3289
3289
  performOnChange == null ? void 0 : performOnChange.flush();
3290
3290
  if (isValid) {
3291
- onPersistAsync == null ? void 0 : onPersistAsync();
3291
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
3292
3292
  validateAsync == null ? void 0 : validateAsync.flush();
3293
3293
  }
3294
3294
  },
@@ -4713,7 +4713,7 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
4713
4713
  });
4714
4714
  schemaOnChange == null ? void 0 : schemaOnChange();
4715
4715
  onValueChange();
4716
- onPersistAsync == null ? void 0 : onPersistAsync();
4716
+ await (onPersistAsync == null ? void 0 : onPersistAsync());
4717
4717
  },
4718
4718
  async getSubmittableValue() {
4719
4719
  const file = this.getLocalValue();
@@ -4812,7 +4812,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
4812
4812
  draft.value = updatedValue;
4813
4813
  });
4814
4814
  schemaOnChange == null ? void 0 : schemaOnChange();
4815
- onPersistAsync == null ? void 0 : onPersistAsync();
4815
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
4816
4816
  validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
4817
4817
  });
4818
4818
  onValueChange();
@@ -4939,7 +4939,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
4939
4939
  const isValid = this.validate();
4940
4940
  performOnChange == null ? void 0 : performOnChange.flush();
4941
4941
  if (isValid) {
4942
- onPersistAsync == null ? void 0 : onPersistAsync();
4942
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
4943
4943
  validateAsync == null ? void 0 : validateAsync.flush();
4944
4944
  }
4945
4945
  },
@@ -5367,7 +5367,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
5367
5367
  }
5368
5368
  onValueChange();
5369
5369
  if (getValidationErrors(updatedValue).length === 0) {
5370
- onPersistAsync == null ? void 0 : onPersistAsync();
5370
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
5371
5371
  }
5372
5372
  },
5373
5373
  async getSubmittableValue() {
@@ -5509,7 +5509,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
5509
5509
  const isValid = this.validate();
5510
5510
  performOnChange == null ? void 0 : performOnChange.flush();
5511
5511
  if (isValid) {
5512
- onPersistAsync == null ? void 0 : onPersistAsync();
5512
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
5513
5513
  validateAsync == null ? void 0 : validateAsync.flush();
5514
5514
  }
5515
5515
  },
@@ -5736,10 +5736,9 @@ var persistAsyncSchemaToComponent = (schemaMapperProps, mapperProps) => {
5736
5736
  const { uid, schema, model, localValue } = schemaMapperProps;
5737
5737
  const { persistAsync } = schema;
5738
5738
  const performPersistAsync = getPerformPersistAsyncFn(schema, persistAsync, mapperProps);
5739
- const onPersistAsync = () => {
5740
- void paComponent.persist().catch(() => {
5741
- });
5742
- };
5739
+ const onPersistAsync = async () => paComponent.persist().catch(() => {
5740
+ }).then(() => {
5741
+ });
5743
5742
  const childComponent = mapSchemaToComponent(
5744
5743
  __spreadProps(__spreadValues({}, schemaMapperProps), { uid: `${uid}-persist`, schema: persistAsync.schema, onPersistAsync }),
5745
5744
  mapperProps
package/build/main.mjs CHANGED
@@ -3245,7 +3245,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
3245
3245
  const isValid = this.validate();
3246
3246
  performOnChange == null ? void 0 : performOnChange.flush();
3247
3247
  if (isValid) {
3248
- onPersistAsync == null ? void 0 : onPersistAsync();
3248
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
3249
3249
  validateAsync == null ? void 0 : validateAsync.flush();
3250
3250
  }
3251
3251
  },
@@ -4670,7 +4670,7 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
4670
4670
  });
4671
4671
  schemaOnChange == null ? void 0 : schemaOnChange();
4672
4672
  onValueChange();
4673
- onPersistAsync == null ? void 0 : onPersistAsync();
4673
+ await (onPersistAsync == null ? void 0 : onPersistAsync());
4674
4674
  },
4675
4675
  async getSubmittableValue() {
4676
4676
  const file = this.getLocalValue();
@@ -4769,7 +4769,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
4769
4769
  draft.value = updatedValue;
4770
4770
  });
4771
4771
  schemaOnChange == null ? void 0 : schemaOnChange();
4772
- onPersistAsync == null ? void 0 : onPersistAsync();
4772
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
4773
4773
  validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
4774
4774
  });
4775
4775
  onValueChange();
@@ -4896,7 +4896,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
4896
4896
  const isValid = this.validate();
4897
4897
  performOnChange == null ? void 0 : performOnChange.flush();
4898
4898
  if (isValid) {
4899
- onPersistAsync == null ? void 0 : onPersistAsync();
4899
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
4900
4900
  validateAsync == null ? void 0 : validateAsync.flush();
4901
4901
  }
4902
4902
  },
@@ -5324,7 +5324,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
5324
5324
  }
5325
5325
  onValueChange();
5326
5326
  if (getValidationErrors(updatedValue).length === 0) {
5327
- onPersistAsync == null ? void 0 : onPersistAsync();
5327
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
5328
5328
  }
5329
5329
  },
5330
5330
  async getSubmittableValue() {
@@ -5466,7 +5466,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
5466
5466
  const isValid = this.validate();
5467
5467
  performOnChange == null ? void 0 : performOnChange.flush();
5468
5468
  if (isValid) {
5469
- onPersistAsync == null ? void 0 : onPersistAsync();
5469
+ void (onPersistAsync == null ? void 0 : onPersistAsync());
5470
5470
  validateAsync == null ? void 0 : validateAsync.flush();
5471
5471
  }
5472
5472
  },
@@ -5693,10 +5693,9 @@ var persistAsyncSchemaToComponent = (schemaMapperProps, mapperProps) => {
5693
5693
  const { uid, schema, model, localValue } = schemaMapperProps;
5694
5694
  const { persistAsync } = schema;
5695
5695
  const performPersistAsync = getPerformPersistAsyncFn(schema, persistAsync, mapperProps);
5696
- const onPersistAsync = () => {
5697
- void paComponent.persist().catch(() => {
5698
- });
5699
- };
5696
+ const onPersistAsync = async () => paComponent.persist().catch(() => {
5697
+ }).then(() => {
5698
+ });
5700
5699
  const childComponent = mapSchemaToComponent(
5701
5700
  __spreadProps(__spreadValues({}, schemaMapperProps), { uid: `${uid}-persist`, schema: persistAsync.schema, onPersistAsync }),
5702
5701
  mapperProps
@@ -27,7 +27,7 @@ export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperPr
27
27
  required: boolean;
28
28
  validationErrors: import("@wise/dynamic-flow-types/build/next").ValidationError;
29
29
  persistAsyncConfig?: import("../../types").PersistAsyncConfig | undefined;
30
- onPersistAsync?: (() => void) | undefined;
30
+ onPersistAsync?: import("../../../types").OnPersistAsync | undefined;
31
31
  };
32
32
  export declare const getMockRendererMapperProps: () => RendererMapperProps;
33
33
  export declare const mockUpdateFunction: <C extends DomainComponent>(draftComponent: C) => jest.Mock<any, any, any>;
@@ -1,7 +1,7 @@
1
1
  import type { Step as DFStep, Model, Schema, ValidationError } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { HttpClient } from '../../../types';
3
3
  import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../features/events';
4
- import type { LocalValue, OnBehavior, OnValueChange, UpdateComponent } from '../../types';
4
+ import type { LocalValue, OnBehavior, OnPersistAsync, OnValueChange, UpdateComponent } from '../../types';
5
5
  import type { GetErrorMessageFunctions, PersistAsyncConfig } from '../types';
6
6
  export type MapperProps = {
7
7
  stepLocalValue: LocalValue;
@@ -23,5 +23,5 @@ export type SchemaMapperProps = {
23
23
  required?: boolean;
24
24
  validationErrors?: ValidationError;
25
25
  persistAsyncConfig?: PersistAsyncConfig;
26
- onPersistAsync?: () => void;
26
+ onPersistAsync?: OnPersistAsync;
27
27
  };
@@ -17,6 +17,6 @@ export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
17
17
  keywords: string[] | undefined;
18
18
  required: boolean;
19
19
  title: string | undefined;
20
- onPersistAsync: (() => void) | undefined;
20
+ onPersistAsync: import("../../../types").OnPersistAsync | undefined;
21
21
  summariser: (value: import("../../../types").LocalValue | null) => import("../../../types").RepeatableSummary;
22
22
  };
@@ -122,7 +122,7 @@ export type OnAction = (action: Action) => Promise<void>;
122
122
  export type OnPoll = (url: string, errorBehavior: Behavior, signal: AbortSignal) => Promise<boolean>;
123
123
  export type OnLink = (url: string) => boolean;
124
124
  export type OnValueChange = () => void;
125
- export type OnPersistAsync = () => void;
125
+ export type OnPersistAsync = () => Promise<void>;
126
126
  export type Align = 'start' | 'center' | 'end';
127
127
  export type Autocapitalization = 'none' | 'sentences' | 'words' | 'characters';
128
128
  export type Bias = 'none' | 'start' | 'end';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "4.8.0",
3
+ "version": "4.8.2",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -36,22 +36,22 @@
36
36
  "@babel/preset-env": "7.27.2",
37
37
  "@babel/preset-react": "7.27.1",
38
38
  "@babel/preset-typescript": "7.27.1",
39
- "@chromatic-com/storybook": "4.0.0",
39
+ "@chromatic-com/storybook": "4.0.1",
40
40
  "@formatjs/cli": "^6.7.2",
41
- "@storybook/addon-a11y": "^9.0.10",
42
- "@storybook/addon-docs": "^9.0.10",
43
- "@storybook/addon-links": "^9.0.10",
44
- "@storybook/react-vite": "9.0.10",
41
+ "@storybook/addon-a11y": "^9.0.12",
42
+ "@storybook/addon-docs": "^9.0.12",
43
+ "@storybook/addon-links": "^9.0.12",
44
+ "@storybook/react-vite": "9.0.12",
45
45
  "@testing-library/dom": "10.4.0",
46
46
  "@testing-library/jest-dom": "6.6.3",
47
47
  "@testing-library/react": "16.3.0",
48
48
  "@testing-library/user-event": "14.6.1",
49
49
  "@transferwise/components": "46.98.1",
50
50
  "@transferwise/formatting": "^2.13.1",
51
- "@transferwise/icons": "3.22.0",
51
+ "@transferwise/icons": "3.22.2",
52
52
  "@transferwise/neptune-css": "14.24.4",
53
53
  "@types/jest": "29.5.14",
54
- "@types/node": "22.15.31",
54
+ "@types/node": "22.15.32",
55
55
  "@types/react": "18.3.23",
56
56
  "@types/react-dom": "18.3.7",
57
57
  "@types/react-intl": "3.0.0",
@@ -59,27 +59,27 @@
59
59
  "@wise/components-theming": "^1.6.3",
60
60
  "babel-jest": "30.0.2",
61
61
  "esbuild": "0.25.5",
62
- "eslint-plugin-storybook": "9.0.10",
62
+ "eslint-plugin-storybook": "9.0.12",
63
63
  "jest": "30.0.2",
64
64
  "jest-environment-jsdom": "30.0.2",
65
65
  "jest-fetch-mock": "^3.0.3",
66
66
  "jest-watch-typeahead": "^3.0.1",
67
67
  "npm-run-all2": "7.0.2",
68
- "postcss": "^8.5.5",
68
+ "postcss": "^8.5.6",
69
69
  "postcss-cli": "^11.0.1",
70
- "postcss-import": "^16.1.0",
70
+ "postcss-import": "^16.1.1",
71
71
  "react": "18.3.1",
72
72
  "react-dom": "18.3.1",
73
73
  "react-intl": "6.8.9",
74
- "storybook": "^9.0.10",
75
- "stylelint": "16.20.0",
74
+ "storybook": "^9.0.12",
75
+ "stylelint": "16.21.0",
76
76
  "stylelint-config-standard": "36.0.1",
77
77
  "stylelint-no-unsupported-browser-features": "8.0.4",
78
78
  "stylelint-value-no-unknown-custom-properties": "6.0.1",
79
79
  "tsx": "4.20.3",
80
80
  "typescript": "5.8.3",
81
- "@wise/dynamic-flow-fixtures": "0.0.1",
82
- "@wise/dynamic-flow-renderers": "0.0.0"
81
+ "@wise/dynamic-flow-renderers": "0.0.0",
82
+ "@wise/dynamic-flow-fixtures": "0.0.1"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@transferwise/components": "^46.92.0",
@@ -95,7 +95,7 @@
95
95
  "classnames": "2.5.1",
96
96
  "react-webcam": "^7.2.0",
97
97
  "screenfull": "^5.2.0",
98
- "@wise/dynamic-flow-types": "3.6.0"
98
+ "@wise/dynamic-flow-types": "3.6.1"
99
99
  },
100
100
  "scripts": {
101
101
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",