@wise/dynamic-flow-client 3.2.2 → 3.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.
- package/build/i18n/tr.json +2 -2
- package/build/main.js +506 -555
- package/build/main.min.js +1 -1
- package/build/main.mjs +508 -557
- package/build/types/legacy/formControl/FormControl.d.ts +4 -1
- package/build/types/legacy/formControl/utils/getAutocompleteString.d.ts +4 -1
- package/build/types/revamp/domain/components/StepDomainComponent.d.ts +5 -6
- package/build/types/revamp/domain/components/utils/getComponentForLocalValueKey.d.ts +7 -0
- package/build/types/revamp/domain/features/{events/getAnalyticsEventDispatcher.d.ts → events.d.ts} +3 -7
- package/build/types/revamp/domain/mappers/schema/types.d.ts +2 -2
- package/build/types/revamp/{step/utils → renderers}/getRenderFunction.d.ts +2 -2
- package/build/types/revamp/{step/utils → renderers}/getSchemaErrorMessageFunction.d.ts +1 -1
- package/build/types/revamp/utils/useStableCallback.d.ts +6 -0
- package/package.json +14 -14
- package/build/types/revamp/domain/features/events/getLogggingEventDispatcher.d.ts +0 -4
- package/build/types/revamp/domain/features/events/index.d.ts +0 -2
- package/build/types/revamp/step/Step.d.ts +0 -25
|
@@ -45,7 +45,10 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
|
|
|
45
45
|
prevValue: string | number | boolean | Date | null;
|
|
46
46
|
value: string | number | boolean | Date | null;
|
|
47
47
|
} | null;
|
|
48
|
-
getAutocompleteValue: (
|
|
48
|
+
getAutocompleteValue: ({ prefix, suffix }?: {
|
|
49
|
+
prefix?: string | undefined;
|
|
50
|
+
suffix?: string | undefined;
|
|
51
|
+
}) => string;
|
|
49
52
|
handleOnChange: (value: string | number | boolean | null, metadata?: OnChangeProps['metadata']) => void;
|
|
50
53
|
handleInputOnChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
51
54
|
handleOnFocus: () => void;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { AutocompleteToken } from '@wise/dynamic-flow-types';
|
|
2
|
-
export declare const getAutocompleteString: (hints: AutocompleteToken[]
|
|
2
|
+
export declare const getAutocompleteString: (hints: AutocompleteToken[], { prefix, suffix }?: {
|
|
3
|
+
prefix?: string | undefined;
|
|
4
|
+
suffix?: string | undefined;
|
|
5
|
+
}) => string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type { BaseComponent, DomainComponent, LoadingState, LocalValue } from '../types';
|
|
1
|
+
import type { BaseComponent, DomainComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
|
|
2
2
|
export type StepDomainComponent = BaseComponent & {
|
|
3
3
|
type: 'step';
|
|
4
4
|
loadingState: LoadingState;
|
|
5
5
|
components: DomainComponent[];
|
|
6
|
+
setLoadingState: (loadingState: LoadingState) => void;
|
|
6
7
|
getChildren: () => DomainComponent[];
|
|
7
8
|
getLocalValue: () => LocalValue;
|
|
8
9
|
};
|
|
9
|
-
export declare const createStepComponent: (
|
|
10
|
-
|
|
11
|
-
loadingState: LoadingState;
|
|
12
|
-
components: DomainComponent[];
|
|
10
|
+
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "components" | "loadingState" | "uid"> & {
|
|
11
|
+
updateComponent: UpdateComponent;
|
|
13
12
|
}) => StepDomainComponent;
|
|
14
|
-
export declare const createEmptyStepComponent: () => StepDomainComponent;
|
|
13
|
+
export declare const createEmptyStepComponent: (updateComponent: UpdateComponent) => StepDomainComponent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DomainComponent } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a component that is a child (or grandchild, etc.) of the given component,
|
|
4
|
+
* which is "responsible" for the value of the given key,
|
|
5
|
+
* or null if there isn't any.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getComponentForLocalValueKey: (key: string, component: DomainComponent) => DomainComponent | null;
|
package/build/types/revamp/domain/features/{events/getAnalyticsEventDispatcher.d.ts → events.d.ts}
RENAMED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
1
|
export type AnalyticsEventHandler = (eventName: string, properties?: Record<string, unknown>) => void;
|
|
3
2
|
export type AnalyticsEventDispatcher = (eventName: EventName, properties?: Record<string, unknown>) => void;
|
|
4
|
-
export declare const getAnalyticsEventDispatcher: ({ flowId, stepId, analytics, onEvent, }: {
|
|
5
|
-
flowId: string;
|
|
6
|
-
stepId?: string | undefined;
|
|
7
|
-
analytics?: Step['analytics'];
|
|
8
|
-
onEvent?: AnalyticsEventHandler | undefined;
|
|
9
|
-
}) => AnalyticsEventDispatcher;
|
|
10
3
|
export type EventName = 'Flow Started' | 'Flow Succeeded' | 'Flow Failed' | 'Step Shown' | 'Action Triggered' | 'Action Succeeded' | 'Action Aborted' | 'Action Failed' | 'Refresh Triggered' | 'Refresh Succeeded' | 'Refresh Aborted' | 'Refresh Failed' | 'OneOf Selected' | 'PersistAsync Triggered' | 'PersistAsync Succeeded' | 'PersistAsync Failed' | 'ValidationAsync Triggered' | 'ValidationAsync Succeeded' | 'ValidationAsync Failed' | 'Search Started' | 'Search Result Selected';
|
|
4
|
+
export type LogLevel = 'info' | 'warning' | 'error';
|
|
5
|
+
export type LoggingEventHandler = (level: LogLevel, message: string, extra: Record<string, unknown>) => void;
|
|
6
|
+
export type LoggingEventDispatcher = (level: LogLevel, message: string, extra?: Record<string, unknown>) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Step as DFStep, Model, Schema, ValidationError } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { HttpClient } from '../../../types';
|
|
3
|
+
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../features/events';
|
|
2
4
|
import type { LocalValue, OnAction, OnRefresh, UpdateComponent } from '../../types';
|
|
3
5
|
import type { GetErrorMessageFunctions, PersistAsyncConfig } from '../types';
|
|
4
|
-
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../features/events';
|
|
5
|
-
import type { HttpClient } from '../../../types';
|
|
6
6
|
export type MapperProps = {
|
|
7
7
|
stepLocalValue: LocalValue;
|
|
8
8
|
step: DFStep;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { DomainComponent } from '
|
|
2
|
-
import type { Renderers } from '
|
|
1
|
+
import type { DomainComponent } from '../domain/types';
|
|
2
|
+
import type { Renderers } from '../types';
|
|
3
3
|
export declare const getRenderFunction: (renderers: Renderers) => (component: DomainComponent) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IntlFormatters } from 'react-intl';
|
|
2
|
-
import type { GetErrorMessageFunctions } from '
|
|
2
|
+
import type { GetErrorMessageFunctions } from '../domain/mappers/types';
|
|
3
3
|
export declare function getSchemaErrorMessageFunction(formatMessage: IntlFormatters['formatMessage'], locale: string): GetErrorMessageFunctions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"url": "git+https://github.com/transferwise/dynamic-flow.git"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@babel/core": "7.24.
|
|
23
|
-
"@babel/plugin-syntax-flow": "7.
|
|
22
|
+
"@babel/core": "7.24.3",
|
|
23
|
+
"@babel/plugin-syntax-flow": "7.24.1",
|
|
24
24
|
"@babel/plugin-transform-react-jsx": "7.23.4",
|
|
25
|
-
"@babel/preset-env": "7.24.
|
|
26
|
-
"@babel/preset-react": "7.
|
|
27
|
-
"@babel/preset-typescript": "7.
|
|
25
|
+
"@babel/preset-env": "7.24.3",
|
|
26
|
+
"@babel/preset-react": "7.24.1",
|
|
27
|
+
"@babel/preset-typescript": "7.24.1",
|
|
28
28
|
"@cfaester/enzyme-adapter-react-18": "0.7.1",
|
|
29
|
-
"@formatjs/cli": "^6.2.
|
|
29
|
+
"@formatjs/cli": "^6.2.8",
|
|
30
30
|
"@storybook/addon-a11y": "7.6.17",
|
|
31
31
|
"@storybook/addon-actions": "7.6.17",
|
|
32
32
|
"@storybook/addon-essentials": "7.6.17",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@storybook/testing-library": "0.2.2",
|
|
38
38
|
"@testing-library/dom": "9.3.4",
|
|
39
39
|
"@testing-library/jest-dom": "6.4.2",
|
|
40
|
-
"@testing-library/react": "14.2.
|
|
40
|
+
"@testing-library/react": "14.2.2",
|
|
41
41
|
"@testing-library/react-hooks": "8.0.1",
|
|
42
42
|
"@testing-library/user-event": "14.5.2",
|
|
43
|
-
"@transferwise/components": "46.
|
|
43
|
+
"@transferwise/components": "46.20.1",
|
|
44
44
|
"@transferwise/formatting": "^2.13.0",
|
|
45
45
|
"@transferwise/icons": "3.13.0",
|
|
46
46
|
"@transferwise/neptune-css": "14.9.5",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
54
54
|
"@wise/art": "2.9.2",
|
|
55
55
|
"@wise/components-theming": "^0.8.4",
|
|
56
|
-
"@wise/forms": "0.3.
|
|
56
|
+
"@wise/forms": "0.3.3",
|
|
57
57
|
"babel-jest": "29.7.0",
|
|
58
58
|
"currency-flags": "4.0.7",
|
|
59
59
|
"enzyme": "^3.11.0",
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
"jest-watch-typeahead": "^2.2.2",
|
|
65
65
|
"nanoid": "5.0.6",
|
|
66
66
|
"npm-run-all2": "5.0.2",
|
|
67
|
-
"postcss": "^8.4.
|
|
67
|
+
"postcss": "^8.4.38",
|
|
68
68
|
"postcss-cli": "^10.1.0",
|
|
69
69
|
"postcss-import": "^15.1.0",
|
|
70
70
|
"react": "18.2.0",
|
|
71
71
|
"react-dom": "18.2.0",
|
|
72
|
-
"react-intl": "6.6.
|
|
72
|
+
"react-intl": "6.6.3",
|
|
73
73
|
"storybook": "7.6.17",
|
|
74
|
-
"stylelint": "16.
|
|
74
|
+
"stylelint": "16.3.0",
|
|
75
75
|
"stylelint-config-standard": "36.0.0",
|
|
76
76
|
"stylelint-no-unsupported-browser-features": "5.0.4",
|
|
77
77
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
78
78
|
"typescript": "4.9.5",
|
|
79
|
-
"webpack": "5.
|
|
79
|
+
"webpack": "5.91.0",
|
|
80
80
|
"@wise/dynamic-flow-fixtures": "0.0.1"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type LogLevel = 'info' | 'warning' | 'error';
|
|
2
|
-
export type LoggingEventHandler = (level: LogLevel, message: string, extra: Record<string, unknown>) => void;
|
|
3
|
-
export type LoggingEventDispatcher = (level: LogLevel, message: string, extra?: Record<string, unknown>) => void;
|
|
4
|
-
export declare const getLoggingEventDispatcher: (onLog?: LoggingEventHandler) => LoggingEventDispatcher;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Action, Step as DFStep, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { DomainComponent, LoadingState, LocalValue } from '../domain/types';
|
|
3
|
-
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../domain/features/events';
|
|
4
|
-
import type { GetErrorMessageFunctions } from '../domain/mappers/types';
|
|
5
|
-
import type { HttpClient } from '../types';
|
|
6
|
-
type StepProps = {
|
|
7
|
-
localValue: LocalValue;
|
|
8
|
-
step: DFStep;
|
|
9
|
-
displayStepTitle?: boolean;
|
|
10
|
-
loadingState: LoadingState;
|
|
11
|
-
getErrorMessageFunctions: GetErrorMessageFunctions;
|
|
12
|
-
render: (component: DomainComponent) => JSX.Element;
|
|
13
|
-
httpClient: HttpClient;
|
|
14
|
-
trackEvent: AnalyticsEventDispatcher;
|
|
15
|
-
logEvent: LoggingEventDispatcher;
|
|
16
|
-
triggerSubmission: (action: Action, model: Model, localValue: LocalValue) => Promise<void>;
|
|
17
|
-
triggerRefresh: (props: {
|
|
18
|
-
refreshUrl: string;
|
|
19
|
-
model: Model;
|
|
20
|
-
localValue: LocalValue;
|
|
21
|
-
schemaId: string | undefined;
|
|
22
|
-
}) => Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
declare function Step({ localValue: initialLocalValue, step, displayStepTitle, loadingState, getErrorMessageFunctions, render, httpClient, trackEvent, logEvent, triggerSubmission, triggerRefresh, }: StepProps): JSX.Element;
|
|
25
|
-
export default Step;
|