@wise/dynamic-flow-client 5.2.0 → 5.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.
@@ -1,5 +1,5 @@
1
1
  import type { Renderers } from '@wise/dynamic-flow-types/renderers';
2
- import type { JsonElement, Model, Step } from '@wise/dynamic-flow-types/spec';
2
+ import type { Model, Step } from '@wise/dynamic-flow-types/spec';
3
3
  import type { AnalyticsEventHandler, LoggingEventHandler } from './domain/features/events';
4
4
  export type DynamicFlowCoreProps = {
5
5
  flowId: string;
@@ -16,16 +16,6 @@ export type DynamicFlowCoreProps = {
16
16
  onLog?: LoggingEventHandler;
17
17
  onLink: (url: string) => boolean;
18
18
  };
19
- export type DynamicFormController = {
20
- /**
21
- * Returns the current value of the form, even if it doesn't pass validation.
22
- */
23
- getValue: () => Promise<JsonElement>;
24
- /**
25
- * triggers validation in every UI component and returns whether or not the current value is valid.
26
- */
27
- validate: () => boolean;
28
- };
29
19
  export type InitialAction = {
30
20
  id?: string;
31
21
  url: string;
@@ -0,0 +1,12 @@
1
+ import type { DynamicFlowCoreProps } from './types';
2
+ /**
3
+ * @experimental This hook may be changed or removed in the future without notice.
4
+ */
5
+ export declare function useDynamicFlow(props: DynamicFlowCoreProps): {
6
+ controller: {
7
+ getSubmittableValue: () => Promise<import("@wise/dynamic-flow-types/spec").JsonElement>;
8
+ validate: () => boolean;
9
+ cancel: () => void;
10
+ };
11
+ view: import("react/jsx-runtime").JSX.Element;
12
+ };
@@ -8,7 +8,8 @@ type UseDynamicFlowCoreProps = Omit<DynamicFlowCoreProps, 'renderers' | 'feature
8
8
  scrollToTop?: ScrollToTop;
9
9
  onLink: (url: string) => boolean;
10
10
  };
11
- export declare function useDynamicFlowCore(props: UseDynamicFlowCoreProps): {
11
+ export declare function useDynamicFlowController(props: UseDynamicFlowCoreProps): {
12
12
  rootComponent: RootDomainComponent;
13
+ cancel: () => void;
13
14
  };
14
15
  export {};
@@ -1,2 +1,2 @@
1
- import { ScrollToTop } from '../domain/types';
1
+ import type { ScrollToTop } from '../domain/types';
2
2
  export declare const getScrollToTop: (normalisedFlowId: string, className: string) => ScrollToTop;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@chromatic-com/storybook": "4.1.3",
35
- "@formatjs/cli": "^6.9.0",
35
+ "@formatjs/cli": "^6.11.0",
36
36
  "@storybook/addon-a11y": "^10.1.11",
37
37
  "@storybook/addon-docs": "^10.1.11",
38
38
  "@storybook/addon-links": "^10.1.11",
@@ -41,21 +41,21 @@
41
41
  "@testing-library/jest-dom": "6.9.1",
42
42
  "@testing-library/react": "16.3.1",
43
43
  "@testing-library/user-event": "14.6.1",
44
- "@transferwise/components": "^46.118.0",
44
+ "@transferwise/components": "^46.121.1",
45
45
  "@transferwise/formatting": "^2.13.4",
46
- "@transferwise/icons": "4.0.1",
46
+ "@transferwise/icons": "4.0.2",
47
47
  "@transferwise/navigation-ui": "4.41.0",
48
- "@transferwise/neptune-css": "14.26.0",
49
- "@types/node": "22.19.3",
48
+ "@transferwise/neptune-css": "14.26.1",
49
+ "@types/node": "22.19.7",
50
50
  "@types/react": "18.3.27",
51
51
  "@types/react-dom": "18.3.7",
52
52
  "@types/react-intl": "3.0.0",
53
53
  "@vitejs/plugin-react": "5.1.2",
54
- "@wise/art": "2.25.0",
55
- "@wise/components-theming": "^1.9.1",
54
+ "@wise/art": "2.26.0",
55
+ "@wise/components-theming": "^1.10.0",
56
56
  "esbuild": "0.27.0",
57
57
  "eslint-plugin-storybook": "10.1.11",
58
- "framer-motion": "^12.23.26",
58
+ "framer-motion": "^12.26.2",
59
59
  "npm-run-all2": "8.0.4",
60
60
  "postcss": "^8.5.6",
61
61
  "postcss-cli": "^11.0.1",
@@ -70,7 +70,7 @@
70
70
  "stylelint-value-no-unknown-custom-properties": "6.1.0",
71
71
  "tsx": "4.21.0",
72
72
  "typescript": "5.9.3",
73
- "vitest": "4.0.16",
73
+ "vitest": "4.0.17",
74
74
  "vitest-fetch-mock": "0.4.5",
75
75
  "@wise/dynamic-flow-fixtures": "0.0.1",
76
76
  "@wise/dynamic-flow-renderers": "0.0.0"
@@ -86,7 +86,7 @@
86
86
  "react-intl": "^6"
87
87
  },
88
88
  "dependencies": {
89
- "@wise/dynamic-flow-types": "4.3.0"
89
+ "@wise/dynamic-flow-types": "4.4.0"
90
90
  },
91
91
  "scripts": {
92
92
  "dev": "EXCLUDE_VISUAL_TESTS=true pnpm storybook dev -p 3003",
@@ -1,11 +0,0 @@
1
- import type { DynamicFlowCoreProps, DynamicFormController } from './types';
2
- import type { OnValueChange } from './domain/types';
3
- /**
4
- * DynamicFormCore is like DynamicFlowCore, but it also accepts a ForwardedRef.
5
- * This ref conforms to the DynamicFormController type, containing two functions: `getValue` and `validate`.
6
- * @experimental This component may be changed in the future without notice.
7
- */
8
- export declare const DynamicFormCore: import("react").ForwardRefExoticComponent<Omit<DynamicFlowCoreProps, "onCompletion"> & {
9
- onValueChange?: OnValueChange;
10
- onCompletion?: DynamicFlowCoreProps["onCompletion"];
11
- } & import("react").RefAttributes<DynamicFormController>>;