@wise/dynamic-flow-client 4.3.13 → 4.3.14
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 +281 -289
- package/build/main.mjs +281 -289
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/RepeatableComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/RootDomainComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/utils/WithUpdate.d.ts +4 -0
- package/build/types/revamp/domain/components/utils/component-utils.d.ts +2 -6
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +7 -6
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +2 -2
- package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +5 -5
- package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +1 -1
- package/build/types/revamp/domain/types.d.ts +1 -1
- package/package.json +5 -5
- package/build/types/revamp/utils/findComponent.d.ts +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
2
|
-
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
-
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, Suggestions, UpdateComponent, ValidationAsyncState } from '../types';
|
|
4
2
|
import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
3
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
5
4
|
import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
|
|
5
|
+
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, Suggestions, UpdateComponent, ValidationAsyncState } from '../types';
|
|
6
6
|
export type DateInputComponent = InputComponent<string | null> & {
|
|
7
7
|
type: 'date';
|
|
8
8
|
minimumDate?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
|
|
2
|
-
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
1
|
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
4
2
|
import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
3
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
5
4
|
import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
|
|
5
|
+
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
|
|
6
6
|
export type IntegerInputComponent = InputComponent<number | null> & {
|
|
7
7
|
type: 'integer';
|
|
8
8
|
maximum?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
3
|
import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
|
|
4
|
-
import type { InputComponent, LocalValue,
|
|
4
|
+
import type { DomainComponent, InputComponent, LocalValue, LocalValueArray, OnValueChange, UpdateComponent, ValidationAsyncState } from '../types';
|
|
5
5
|
import type { SelectInputOption } from './SelectInputComponent';
|
|
6
6
|
export type MultiSelectComponent = InputComponent<LocalValueArray | null> & {
|
|
7
7
|
type: 'multi-select';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { JsonElement } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
1
3
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
4
|
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, UploadSource } from '../types';
|
|
3
|
-
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
4
|
-
import { JsonElement } from '@wise/dynamic-flow-types/build/next';
|
|
5
5
|
export type MultiUploadInputComponent = InputComponent<File[]> & {
|
|
6
6
|
type: 'multi-upload';
|
|
7
7
|
accepts?: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentWithTitle, LocalValue, LocalValueArray, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange, Image } from '../types';
|
|
2
|
-
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
1
|
import { Icon } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
+
import type { ComponentWithTitle, DomainComponent, Image, LocalValue, LocalValueArray, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
|
|
4
4
|
export type RepeatableComponent = ComponentWithTitle & {
|
|
5
5
|
type: 'repeatable';
|
|
6
6
|
id?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnalyticsEventDispatcher } from '../features/events';
|
|
2
|
-
import { BaseComponent, DomainComponent, LoadingState, LocalValue } from '../types';
|
|
2
|
+
import { BaseComponent, DomainComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
|
|
3
3
|
import { StepDomainComponent } from './StepDomainComponent';
|
|
4
4
|
export type RootDomainComponent = BaseComponent & {
|
|
5
5
|
type: 'root';
|
|
@@ -11,5 +11,6 @@ export type RootDomainComponent = BaseComponent & {
|
|
|
11
11
|
setLoadingState: (loadingState: LoadingState) => void;
|
|
12
12
|
hasStep: () => boolean;
|
|
13
13
|
stop: () => void;
|
|
14
|
+
setStep: (stepComponent: StepDomainComponent) => void;
|
|
14
15
|
};
|
|
15
|
-
export declare const createRootDomainComponent: () => RootDomainComponent;
|
|
16
|
+
export declare const createRootDomainComponent: (updateComponent: UpdateComponent) => RootDomainComponent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Icon, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { InputComponent, LocalValue, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange, Image } from '../types';
|
|
3
|
-
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
2
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
5
3
|
import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
4
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
5
|
+
import type { DomainComponent, Image, InputComponent, LocalValue, OnValueChange, RepeatableSummary, UpdateComponent } from '../types';
|
|
6
6
|
export type SelectInputComponent = InputComponent<LocalValue | null> & {
|
|
7
7
|
type: 'select';
|
|
8
8
|
selectedIndex: number | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, UploadSource } from '../types';
|
|
1
|
+
import { JsonElement } from '@wise/dynamic-flow-types/build/next';
|
|
3
2
|
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
4
3
|
import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
5
|
-
import {
|
|
4
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
5
|
+
import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, UploadSource } from '../types';
|
|
6
6
|
export type UploadInputComponent = InputComponent<File | null> & {
|
|
7
7
|
type: 'upload';
|
|
8
8
|
format: 'blob' | 'base64';
|
|
@@ -2,11 +2,7 @@ import type { DomainComponent, UpdateComponent } from '../../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to update a component.
|
|
4
4
|
*
|
|
5
|
-
* `updateComponent` is generic, meaning we have to specify the type of the draft whenever we use it. This function takes
|
|
6
|
-
* the component uid and type, and returns a typed function that will update the component without the need to type assert.
|
|
7
|
-
*
|
|
8
|
-
* @param uid uid of the component
|
|
9
5
|
* @param updateComponent the updateComponent function that will update the component with the given uid
|
|
10
|
-
* @returns a function that accepts a function that will update the component
|
|
6
|
+
* @returns a function that accepts a component and returns a function that takes a function that will update the component and call `updateComponent` to notify that there has been a change.
|
|
11
7
|
*/
|
|
12
|
-
export declare const getInputUpdateFunction: <C extends DomainComponent>(
|
|
8
|
+
export declare const getInputUpdateFunction: <C extends DomainComponent>(updateComponent: UpdateComponent) => (component: C, updateFn: (component: C) => void) => void;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type { getInputUpdateFunction } from '../../components/utils/component-utils';
|
|
2
|
-
import type { PerformPersistAsync } from './getPerformPersistAsync';
|
|
3
1
|
import type { BooleanInputComponent } from '../../components/BooleanInputComponent';
|
|
4
2
|
import type { DateInputComponent } from '../../components/DateInputComponent';
|
|
5
3
|
import type { IntegerInputComponent } from '../../components/IntegerInputComponent';
|
|
4
|
+
import type { MultiUploadInputComponent } from '../../components/MultiUploadInputComponent';
|
|
6
5
|
import type { NumberInputComponent } from '../../components/NumberInputComponent';
|
|
7
6
|
import type { TextInputComponent } from '../../components/TextInputComponent';
|
|
8
7
|
import type { UploadInputComponent } from '../../components/UploadInputComponent';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
8
|
+
import type { LocalValue } from '../../types';
|
|
9
|
+
import type { PerformPersistAsync } from './getPerformPersistAsync';
|
|
11
10
|
type Persistable = BooleanInputComponent | DateInputComponent | IntegerInputComponent | NumberInputComponent | TextInputComponent | UploadInputComponent;
|
|
11
|
+
type Update<C extends Persistable> = (component: C, updateFn: (component: C) => void) => void;
|
|
12
12
|
/**
|
|
13
13
|
* Creates an onPersistAsync handler for a component.
|
|
14
14
|
*/
|
|
15
|
-
export declare const getComponentPersistAsync: (update:
|
|
15
|
+
export declare const getComponentPersistAsync: <C extends Persistable>(update: Update<C>, performPersistAsync: PerformPersistAsync) => (component: C, currentValue: LocalValue) => Promise<import("@wise/dynamic-flow-types/build/next").JsonElement>;
|
|
16
|
+
type UpdateMultiUploadInputComponent = (component: MultiUploadInputComponent, updateFn: (component: MultiUploadInputComponent) => void) => void;
|
|
16
17
|
/**
|
|
17
18
|
* Creates an onPersistAsync handler for a component.
|
|
18
19
|
*/
|
|
19
|
-
export declare const getComponentMultiPersistAsync: (update:
|
|
20
|
+
export declare const getComponentMultiPersistAsync: (update: UpdateMultiUploadInputComponent, performPersistAsync: PerformPersistAsync) => (component: MultiUploadInputComponent, index: number, value: LocalValue) => Promise<string | number | boolean | import("@wise/dynamic-flow-types/build/next").JsonObject | import("@wise/dynamic-flow-types/build/next").JsonArray | null>;
|
|
20
21
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { JsonElement } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { PersistAsyncConfig } from '../../mappers/types';
|
|
3
2
|
import type { HttpClient } from '../../../types';
|
|
4
|
-
import type {
|
|
3
|
+
import type { PersistAsyncConfig } from '../../mappers/types';
|
|
5
4
|
import type { LocalValue } from '../../types';
|
|
5
|
+
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../events';
|
|
6
6
|
export type PerformPersistAsync = (props: PersistAsyncProps) => Promise<JsonElement>;
|
|
7
7
|
type PersistAsyncProps = {
|
|
8
8
|
value: LocalValue;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { getInputUpdateFunction } from '../../components/utils/component-utils';
|
|
2
|
-
import type { PerformValidationAsync } from './getPerformValidationAsync';
|
|
3
1
|
import type { BooleanInputComponent } from '../../components/BooleanInputComponent';
|
|
4
2
|
import type { DateInputComponent } from '../../components/DateInputComponent';
|
|
5
3
|
import type { IntegerInputComponent } from '../../components/IntegerInputComponent';
|
|
6
4
|
import type { MultiSelectComponent } from '../../components/MultiSelectInputComponent';
|
|
7
5
|
import type { NumberInputComponent } from '../../components/NumberInputComponent';
|
|
8
6
|
import type { TextInputComponent } from '../../components/TextInputComponent';
|
|
9
|
-
import type { LocalValue
|
|
7
|
+
import type { LocalValue } from '../../types';
|
|
8
|
+
import type { PerformValidationAsync } from './getPerformValidationAsync';
|
|
10
9
|
type Validatable = BooleanInputComponent | DateInputComponent | IntegerInputComponent | MultiSelectComponent | NumberInputComponent | TextInputComponent;
|
|
10
|
+
type Update<C extends Validatable> = (component: C, updateFn: (component: C) => void) => void;
|
|
11
11
|
/**
|
|
12
12
|
* Creates an onValidateAsync handler for a component.
|
|
13
13
|
*/
|
|
14
|
-
export declare const getComponentValidationAsync: (update:
|
|
15
|
-
export declare const getDebouncedComponentValidationAsync: (update:
|
|
14
|
+
export declare const getComponentValidationAsync: <C extends Validatable>(update: Update<C>, performValidationAsync: PerformValidationAsync) => (component: C, currentValue: LocalValue) => Promise<string | null | undefined>;
|
|
15
|
+
export declare const getDebouncedComponentValidationAsync: <C extends Validatable>(update: Update<C>, performValidationAsync: PerformValidationAsync) => import("../../components/utils/debounce").DebouncedFunc<(component: C, currentValue: LocalValue) => Promise<string | null | undefined>>;
|
|
16
16
|
export {};
|
|
@@ -31,4 +31,4 @@ export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperPr
|
|
|
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>;
|
|
34
|
-
export declare const getUpdateFunctionMock: <C extends DomainComponent>(getComponent: () => C) => jest.Mock<void, [
|
|
34
|
+
export declare const getUpdateFunctionMock: <C extends DomainComponent>(getComponent: () => C) => jest.Mock<void, [], any>;
|
|
@@ -88,7 +88,7 @@ export type InputComponent<V extends LocalValue> = ComponentWithTitle & {
|
|
|
88
88
|
onFocus: () => void;
|
|
89
89
|
getLocalValue: () => V;
|
|
90
90
|
};
|
|
91
|
-
export type UpdateComponent = (
|
|
91
|
+
export type UpdateComponent = () => void;
|
|
92
92
|
export type OnBehavior = (behavior: Behavior) => Promise<void>;
|
|
93
93
|
export type OnAction = (action: Action) => Promise<void>;
|
|
94
94
|
export type OnRefresh = (schemaId: string | undefined, url?: string) => Promise<void> | void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.14",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/preset-react": "7.26.3",
|
|
38
38
|
"@babel/preset-typescript": "7.27.0",
|
|
39
39
|
"@chromatic-com/storybook": "3.2.6",
|
|
40
|
-
"@formatjs/cli": "^6.6.
|
|
40
|
+
"@formatjs/cli": "^6.6.4",
|
|
41
41
|
"@storybook/addon-a11y": "^8.6.12",
|
|
42
42
|
"@storybook/addon-actions": "^8.6.12",
|
|
43
43
|
"@storybook/addon-essentials": "^8.6.12",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
85
85
|
"tsx": "4.19.3",
|
|
86
86
|
"typescript": "5.8.3",
|
|
87
|
-
"webpack": "5.99.
|
|
88
|
-
"@wise/dynamic-flow-
|
|
89
|
-
"@wise/dynamic-flow-
|
|
87
|
+
"webpack": "5.99.6",
|
|
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",
|