@wise/dynamic-flow-client 3.18.0 → 3.19.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/main.js +197 -156
- package/build/main.min.js +1 -1
- package/build/main.mjs +197 -156
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/utils/isPartialModelMatch.d.ts +2 -0
- package/build/types/revamp/domain/features/polling/getStepPolling.d.ts +3 -4
- package/build/types/revamp/domain/mappers/mapStepToComponent.d.ts +3 -2
- package/build/types/revamp/domain/types.d.ts +1 -0
- package/build/types/revamp/flow/executePoll.d.ts +21 -0
- package/build/types/revamp/flow/getResponseType.d.ts +1 -0
- package/package.json +8 -8
- package/build/types/revamp/domain/components/utils/getComponentForLocalValueKey.d.ts +0 -7
- package/build/types/revamp/domain/components/utils/isPartialLocalValueMatch.d.ts +0 -2
|
@@ -5,11 +5,13 @@ import type { PerformValidationAsync } from '../features/validationAsync/getPerf
|
|
|
5
5
|
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
|
|
6
6
|
export type NumberInputComponent = InputComponent<number | null> & {
|
|
7
7
|
type: 'number';
|
|
8
|
+
maximum?: number;
|
|
9
|
+
minimum?: number;
|
|
8
10
|
persistedState: PersistedState;
|
|
9
11
|
validationState: ValidationState;
|
|
10
12
|
onChange: (value: number | null) => void;
|
|
11
13
|
};
|
|
12
|
-
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
|
|
14
|
+
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "minimum" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
|
|
13
15
|
checks: IsInvalidCheck<number | null>[];
|
|
14
16
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
15
17
|
performRefresh: PerformRefresh | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Icon, Image } from '@wise/dynamic-flow-types/build/next';
|
|
1
|
+
import type { Icon, Image, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { InputComponent, LocalValue, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange } from '../types';
|
|
3
3
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
4
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
@@ -21,7 +21,7 @@ export type SelectInputOption = {
|
|
|
21
21
|
disabled: boolean;
|
|
22
22
|
};
|
|
23
23
|
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "placeholder" | "required" | "title"> & {
|
|
24
|
-
|
|
24
|
+
initialModel: Model;
|
|
25
25
|
options: (SelectInputOption & {
|
|
26
26
|
component: DomainComponent;
|
|
27
27
|
})[];
|
|
@@ -6,11 +6,13 @@ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary,
|
|
|
6
6
|
export type TextInputComponent = InputComponent<string | null> & {
|
|
7
7
|
type: 'text';
|
|
8
8
|
displayFormat?: string;
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
minLength?: number;
|
|
9
11
|
persistedState: PersistedState;
|
|
10
12
|
validationState: ValidationState;
|
|
11
13
|
onChange: (value: string | null) => void;
|
|
12
14
|
};
|
|
13
|
-
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
|
|
15
|
+
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "maxLength" | "minLength" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
|
|
14
16
|
checks: IsInvalidCheck<string | null>[];
|
|
15
17
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
16
18
|
performValidationAsync: PerformValidationAsync | undefined;
|
|
@@ -10,6 +10,8 @@ export type RepeatableComponent = ComponentWithTitle & {
|
|
|
10
10
|
editableIndex: number | null;
|
|
11
11
|
editItemTitle: string;
|
|
12
12
|
errors: string[];
|
|
13
|
+
maxItems?: number;
|
|
14
|
+
minItems?: number;
|
|
13
15
|
summaryDefaults: RepeatableSummary;
|
|
14
16
|
getChildren: () => DomainComponent[];
|
|
15
17
|
getLocalValue: () => LocalValueArray;
|
|
@@ -18,7 +20,7 @@ export type RepeatableComponent = ComponentWithTitle & {
|
|
|
18
20
|
onRemove: () => void;
|
|
19
21
|
onSave: () => boolean;
|
|
20
22
|
};
|
|
21
|
-
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "uid" | "id" | "addItemTitle" | "components" | "control" | "description" | "editItemTitle" | "errors" | "hidden" | "title"> & {
|
|
23
|
+
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "uid" | "id" | "addItemTitle" | "components" | "control" | "description" | "editItemTitle" | "errors" | "hidden" | "maxItems" | "minItems" | "title"> & {
|
|
22
24
|
analyticsId?: string;
|
|
23
25
|
checks: IsInvalidCheck<LocalValueArray | null>[];
|
|
24
26
|
summary?: SummarySummariser;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Polling } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnAction } from '../../types';
|
|
2
|
+
import type { OnAction, OnPoll } from '../../types';
|
|
4
3
|
export type StepPollingProps = {
|
|
5
|
-
httpClient: HttpClient;
|
|
6
4
|
pollingConfig: Polling;
|
|
7
5
|
onAction: OnAction;
|
|
6
|
+
onPoll: OnPoll;
|
|
8
7
|
};
|
|
9
8
|
export type StepPolling = {
|
|
10
9
|
stop: () => void;
|
|
11
10
|
};
|
|
12
|
-
export declare const getStepPolling: ({
|
|
11
|
+
export declare const getStepPolling: ({ pollingConfig, onAction, onPoll, }: StepPollingProps) => StepPolling;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
2
|
-
import type { LoadingState } from '../types';
|
|
2
|
+
import type { LoadingState, OnPoll } from '../types';
|
|
3
3
|
import type { MapperProps } from './schema/types';
|
|
4
4
|
export type StepMapperProps = Omit<MapperProps, 'trackEvent'> & {
|
|
5
5
|
displayStepTitle: boolean;
|
|
6
6
|
loadingState: LoadingState;
|
|
7
7
|
trackEvent: AnalyticsEventDispatcher<string>;
|
|
8
|
+
onPoll: OnPoll;
|
|
8
9
|
};
|
|
9
|
-
export declare const mapStepToComponent: ({ loadingState, displayStepTitle, trackEvent, ...restProps }: StepMapperProps) => import("../components/StepDomainComponent").StepDomainComponent;
|
|
10
|
+
export declare const mapStepToComponent: ({ loadingState, displayStepTitle, trackEvent, onPoll, ...restProps }: StepMapperProps) => import("../components/StepDomainComponent").StepDomainComponent;
|
|
@@ -76,6 +76,7 @@ export type InputComponent<V extends LocalValue> = ComponentWithTitle & {
|
|
|
76
76
|
};
|
|
77
77
|
export type UpdateComponent = (id: string, update: (component: DomainComponent) => void) => void;
|
|
78
78
|
export type OnAction = (action: Action) => Promise<void>;
|
|
79
|
+
export type OnPoll = (url: string, errorAction: Action, signal: AbortSignal) => Promise<boolean>;
|
|
79
80
|
export type OnRefresh = (schemaId: string | undefined, url?: string) => Promise<void> | void;
|
|
80
81
|
export type OnValueChange = () => void;
|
|
81
82
|
export type Align = 'start' | 'center' | 'end';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action, Model, Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
type Command = {
|
|
3
|
+
type: 'complete';
|
|
4
|
+
result: Model;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'replace-step';
|
|
7
|
+
step: Step;
|
|
8
|
+
etag: string | null;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'continue';
|
|
11
|
+
} | {
|
|
12
|
+
type: 'action';
|
|
13
|
+
action: Action;
|
|
14
|
+
};
|
|
15
|
+
export declare const executePoll: (props: {
|
|
16
|
+
httpClient: typeof fetch;
|
|
17
|
+
url: string;
|
|
18
|
+
errorAction: Action;
|
|
19
|
+
signal: AbortSignal;
|
|
20
|
+
}) => Promise<Command>;
|
|
21
|
+
export {};
|
|
@@ -7,4 +7,5 @@ export type ResponseType = (typeof responseTypes)[number];
|
|
|
7
7
|
* Ideally it should just be a matter of checking the "X-Df-Response-Type" response header.
|
|
8
8
|
*/
|
|
9
9
|
export declare const getResponseType: (response: Response) => Promise<ResponseType>;
|
|
10
|
+
export declare const getResponseTypeFromHeader: (response: Response) => ResponseType | undefined;
|
|
10
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@babel/preset-react": "7.24.7",
|
|
35
35
|
"@babel/preset-typescript": "7.24.7",
|
|
36
36
|
"@cfaester/enzyme-adapter-react-18": "0.8.0",
|
|
37
|
-
"@chromatic-com/storybook": "1.
|
|
37
|
+
"@chromatic-com/storybook": "1.8.0",
|
|
38
38
|
"@formatjs/cli": "^6.2.12",
|
|
39
39
|
"@storybook/addon-a11y": "^8.2.9",
|
|
40
40
|
"@storybook/addon-actions": "^8.2.9",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@storybook/types": "^8.2.9",
|
|
50
50
|
"@testing-library/dom": "10.4.0",
|
|
51
51
|
"@testing-library/jest-dom": "6.5.0",
|
|
52
|
-
"@testing-library/react": "16.0.
|
|
52
|
+
"@testing-library/react": "16.0.1",
|
|
53
53
|
"@testing-library/react-hooks": "8.0.1",
|
|
54
54
|
"@testing-library/user-event": "14.5.2",
|
|
55
55
|
"@transferwise/components": "46.70.2",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@transferwise/neptune-css": "14.18.0",
|
|
59
59
|
"@types/enzyme": "^3.10.18",
|
|
60
60
|
"@types/jest": "29.5.12",
|
|
61
|
-
"@types/react": "18.3.
|
|
61
|
+
"@types/react": "18.3.5",
|
|
62
62
|
"@types/react-dom": "18.3.0",
|
|
63
63
|
"@types/react-intl": "3.0.0",
|
|
64
64
|
"@wise/art": "2.14.0",
|
|
@@ -72,18 +72,18 @@
|
|
|
72
72
|
"jest-watch-typeahead": "^2.2.2",
|
|
73
73
|
"nanoid": "5.0.7",
|
|
74
74
|
"npm-run-all2": "6.2.2",
|
|
75
|
-
"postcss": "^8.4.
|
|
75
|
+
"postcss": "^8.4.44",
|
|
76
76
|
"postcss-cli": "^11.0.0",
|
|
77
77
|
"postcss-import": "^15.1.0",
|
|
78
78
|
"react": "18.3.1",
|
|
79
79
|
"react-dom": "18.3.1",
|
|
80
80
|
"react-intl": "6.6.8",
|
|
81
81
|
"storybook": "8.2.9",
|
|
82
|
-
"stylelint": "16.
|
|
82
|
+
"stylelint": "16.9.0",
|
|
83
83
|
"stylelint-config-standard": "36.0.1",
|
|
84
84
|
"stylelint-no-unsupported-browser-features": "8.0.1",
|
|
85
85
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
86
|
-
"tsx": "4.
|
|
86
|
+
"tsx": "4.19.0",
|
|
87
87
|
"typescript": "5.5.4",
|
|
88
88
|
"webpack": "5.94.0",
|
|
89
89
|
"@wise/dynamic-flow-fixtures": "0.0.1",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"nanoid": "5.0.7",
|
|
105
105
|
"react-webcam": "^7.2.0",
|
|
106
106
|
"screenfull": "^5.2.0",
|
|
107
|
-
"@wise/dynamic-flow-types": "2.
|
|
107
|
+
"@wise/dynamic-flow-types": "2.22.0"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|