@wise/dynamic-flow-client 3.19.7 → 3.20.1
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 +146 -117
- package/build/main.min.js +1 -1
- package/build/main.mjs +146 -117
- package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -6
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -8
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +0 -8
- package/build/types/legacy/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +1 -4
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +0 -9
- package/build/types/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -5
- package/build/types/revamp/domain/mappers/layout/buttonLayoutToComponent.d.ts +4 -1
- package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +1 -0
- package/build/types/revamp/domain/mappers/schema/types.d.ts +2 -1
- package/build/types/revamp/domain/types.d.ts +2 -1
- package/build/types/revamp/types.d.ts +3 -2
- package/build/types/revamp/useDynamicFlowCore.d.ts +1 -0
- package/build/types/revamp/utils/openLinkInNewTab.d.ts +1 -0
- package/package.json +17 -18
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import type { Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
declare function ControlFeedback(props: ControlFeedbackProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace ControlFeedback {
|
|
4
|
-
var defaultProps: {
|
|
5
|
-
errors: string;
|
|
6
|
-
validations: never[];
|
|
7
|
-
validationMessages: {};
|
|
8
|
-
validationAsyncSuccessMessage: null;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
3
|
type ValidationMessages = {
|
|
12
4
|
minimum?: string;
|
|
13
5
|
maximum?: string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { ObjectModel, ObjectSchema as ObjectSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function ObjectSchema(props: ObjectSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace ObjectSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
hideTitle: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
4
|
export type ObjectSchemaProps = GenericSchemaProps & {
|
|
11
5
|
schema: ObjectSchemaType;
|
|
12
6
|
model: ObjectModel | null;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { OneOfSchema as OneOfSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function OneOfSchema(props: OneOfSchemaProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
declare namespace OneOfSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
4
|
export type OneOfSchemaProps = Omit<GenericSchemaProps, 'schema'> & {
|
|
11
5
|
schema: OneOfSchemaType;
|
|
12
6
|
required?: boolean;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { PersistAsyncSchema as PersistAsyncSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function PersistAsyncSchema(props: PersistAsyncSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace PersistAsyncSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
export type PersistAsyncSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model' | 'errors'> & {
|
|
10
5
|
schema: PersistAsyncSchemaType;
|
|
11
6
|
model: string | null;
|
|
@@ -5,11 +5,6 @@ export declare const getErrorFromResponse: (errorProperty: string, response: {
|
|
|
5
5
|
validation?: Record<string, unknown>;
|
|
6
6
|
}) => unknown;
|
|
7
7
|
declare function PersistAsyncBasicSchema(props: PersistAsyncBasicSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare namespace PersistAsyncBasicSchema {
|
|
9
|
-
var defaultProps: {
|
|
10
|
-
required: boolean;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
8
|
type PersistAsyncBasicSchemaProps = Omit<GenericSchemaProps, 'schema'> & {
|
|
14
9
|
schema: Schema & {
|
|
15
10
|
persistAsync: PersistAsync;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BlobSchema, PersistAsync, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../../genericSchema/GenericSchema';
|
|
3
3
|
declare function PersistAsyncBlobSchema(props: PersistAsyncBlobSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace PersistAsyncBlobSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
type PersistAsyncBlobSchemaProps = Omit<GenericSchemaProps, 'model'> & {
|
|
10
5
|
schema: Schema & {
|
|
11
6
|
persistAsync: PersistAsync & {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { PromotedOneOfControlProps } from './PromotedOneOfControl';
|
|
2
|
-
declare const PromotedOneOfCheckboxControl:
|
|
3
|
-
(props: PromotedOneOfControlProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
defaultProps: {};
|
|
5
|
-
};
|
|
2
|
+
declare const PromotedOneOfCheckboxControl: (props: PromotedOneOfControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
3
|
export default PromotedOneOfCheckboxControl;
|
|
@@ -4,15 +4,6 @@ import type { OnChangeProps } from '../JsonSchemaForm';
|
|
|
4
4
|
export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
|
|
5
5
|
export declare const getStringSchemaControlType: ({ format, control, displayFormat, }: StringSchema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
|
|
6
6
|
declare function SchemaFormControl(props: SchemaFormControlProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare namespace SchemaFormControl {
|
|
8
|
-
var defaultProps: {
|
|
9
|
-
value: null;
|
|
10
|
-
onFocus: null;
|
|
11
|
-
onBlur: null;
|
|
12
|
-
onSearchChange: null;
|
|
13
|
-
disabled: boolean;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
7
|
export type SchemaFormControlProps = {
|
|
17
8
|
id: string;
|
|
18
9
|
value: BasicModel | null;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BasicModel, ValidationAsyncSchema as ValidationAsyncSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function ValidationAsyncSchema(props: ValidationAsyncSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace ValidationAsyncSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
export type ValidationAsyncSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model' | 'errors'> & {
|
|
10
5
|
schema: ValidationAsyncSchemaType;
|
|
11
6
|
model: BasicModel | null;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { ButtonLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { Behavior } from '@wise/dynamic-flow-types/build/next/feature/Behavior';
|
|
2
3
|
import type { MapperProps } from '../schema/types';
|
|
3
|
-
export declare const buttonLayoutToComponent: (uid: string, button: ButtonLayout
|
|
4
|
+
export declare const buttonLayoutToComponent: (uid: string, button: ButtonLayout & {
|
|
5
|
+
behavior?: Behavior;
|
|
6
|
+
}, mapperProps: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
|
|
@@ -6,6 +6,7 @@ export declare const getMockMapperProps: (mapperProps?: Partial<MapperProps>) =>
|
|
|
6
6
|
step: Step;
|
|
7
7
|
getErrorMessageFunctions: import("../../types").GetErrorMessageFunctions | jest.Mock<any, any, any>;
|
|
8
8
|
httpClient: typeof fetch | jest.Mock<any, any, any>;
|
|
9
|
+
onLink: import("../../../types").OnLink | jest.Mock<any, any, any>;
|
|
9
10
|
onAction: import("../../../types").OnAction | jest.Mock<any, any, any>;
|
|
10
11
|
onRefresh: import("../../../types").OnRefresh | jest.Mock<any, any, any>;
|
|
11
12
|
onValueChange: import("../../../types").OnValueChange | jest.Mock<any, any, any>;
|
|
@@ -1,13 +1,14 @@
|
|
|
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, OnAction, OnRefresh, OnValueChange, UpdateComponent } from '../../types';
|
|
4
|
+
import type { LocalValue, OnAction, OnLink, OnRefresh, OnValueChange, UpdateComponent } from '../../types';
|
|
5
5
|
import type { GetErrorMessageFunctions, PersistAsyncConfig } from '../types';
|
|
6
6
|
export type MapperProps = {
|
|
7
7
|
stepLocalValue: LocalValue;
|
|
8
8
|
step: DFStep;
|
|
9
9
|
getErrorMessageFunctions: GetErrorMessageFunctions;
|
|
10
10
|
httpClient: HttpClient;
|
|
11
|
+
onLink: OnLink;
|
|
11
12
|
onAction: OnAction;
|
|
12
13
|
onRefresh: OnRefresh;
|
|
13
14
|
onValueChange: OnValueChange;
|
|
@@ -76,8 +76,9 @@ 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>;
|
|
80
79
|
export type OnRefresh = (schemaId: string | undefined, url?: string) => Promise<void> | void;
|
|
80
|
+
export type OnPoll = (url: string, errorAction: Action, signal: AbortSignal) => Promise<boolean>;
|
|
81
|
+
export type OnLink = (url: string) => boolean;
|
|
81
82
|
export type OnValueChange = () => void;
|
|
82
83
|
export type Align = 'start' | 'center' | 'end';
|
|
83
84
|
export type Bias = 'none' | 'start' | 'end';
|
|
@@ -11,8 +11,8 @@ export type DynamicFlowCorePropsWithInitialStep = DynamicFlowCorePropsBasic & {
|
|
|
11
11
|
initialStep: Step;
|
|
12
12
|
};
|
|
13
13
|
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
14
|
-
export type DynamicFlowWisePropsWithInitialAction = MakeOptional<DynamicFlowCorePropsWithInitialAction, 'renderers'>;
|
|
15
|
-
export type DynamicFlowWisePropsWithInitialStep = MakeOptional<DynamicFlowCorePropsWithInitialStep, 'renderers'>;
|
|
14
|
+
export type DynamicFlowWisePropsWithInitialAction = MakeOptional<DynamicFlowCorePropsWithInitialAction, 'renderers' | 'onLink'>;
|
|
15
|
+
export type DynamicFlowWisePropsWithInitialStep = MakeOptional<DynamicFlowCorePropsWithInitialStep, 'renderers' | 'onLink'>;
|
|
16
16
|
export type DynamicFlowWiseProps = DynamicFlowWisePropsWithInitialAction | DynamicFlowWisePropsWithInitialStep;
|
|
17
17
|
export type DynamicFragmentController = {
|
|
18
18
|
/**
|
|
@@ -45,6 +45,7 @@ type DynamicFlowCorePropsBasic = {
|
|
|
45
45
|
onError: (error: unknown, status?: number) => void;
|
|
46
46
|
onEvent?: AnalyticsEventHandler;
|
|
47
47
|
onLog?: LoggingEventHandler;
|
|
48
|
+
onLink: (url: string) => boolean;
|
|
48
49
|
};
|
|
49
50
|
export type HttpClient = typeof fetch;
|
|
50
51
|
type Feature = {
|
|
@@ -3,6 +3,7 @@ import type { OnValueChange } from './domain/types';
|
|
|
3
3
|
import type { DynamicFlowCoreProps } from './types';
|
|
4
4
|
type UseDynamicFlowCoreProps = Omit<DynamicFlowCoreProps, 'renderers'> & {
|
|
5
5
|
onValueChange?: OnValueChange;
|
|
6
|
+
onLink: (url: string) => boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare function useDynamicFlowCore(props: UseDynamicFlowCoreProps): {
|
|
8
9
|
stepComponentRef: import("react").MutableRefObject<StepDomainComponent | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const openLinkInNewTab: (url: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.1",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -36,32 +36,31 @@
|
|
|
36
36
|
"@cfaester/enzyme-adapter-react-18": "0.8.0",
|
|
37
37
|
"@chromatic-com/storybook": "1.9.0",
|
|
38
38
|
"@formatjs/cli": "^6.2.12",
|
|
39
|
-
"@storybook/addon-a11y": "^8.3.
|
|
40
|
-
"@storybook/addon-actions": "^8.3.
|
|
41
|
-
"@storybook/addon-essentials": "^8.3.
|
|
42
|
-
"@storybook/addon-interactions": "^8.3.
|
|
43
|
-
"@storybook/addon-links": "^8.3.
|
|
39
|
+
"@storybook/addon-a11y": "^8.3.2",
|
|
40
|
+
"@storybook/addon-actions": "^8.3.2",
|
|
41
|
+
"@storybook/addon-essentials": "^8.3.2",
|
|
42
|
+
"@storybook/addon-interactions": "^8.3.2",
|
|
43
|
+
"@storybook/addon-links": "^8.3.2",
|
|
44
44
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
|
|
45
|
-
"@storybook/manager-api": "^8.3.
|
|
46
|
-
"@storybook/react": "^8.3.
|
|
47
|
-
"@storybook/react-webpack5": "^8.3.
|
|
48
|
-
"@storybook/test": "^8.3.
|
|
49
|
-
"@storybook/types": "^8.3.
|
|
45
|
+
"@storybook/manager-api": "^8.3.2",
|
|
46
|
+
"@storybook/react": "^8.3.2",
|
|
47
|
+
"@storybook/react-webpack5": "^8.3.2",
|
|
48
|
+
"@storybook/test": "^8.3.2",
|
|
49
|
+
"@storybook/types": "^8.3.2",
|
|
50
50
|
"@testing-library/dom": "10.4.0",
|
|
51
51
|
"@testing-library/jest-dom": "6.5.0",
|
|
52
52
|
"@testing-library/react": "16.0.1",
|
|
53
|
-
"@testing-library/react-hooks": "8.0.1",
|
|
54
53
|
"@testing-library/user-event": "14.5.2",
|
|
55
54
|
"@transferwise/components": "46.70.3",
|
|
56
55
|
"@transferwise/formatting": "^2.13.0",
|
|
57
|
-
"@transferwise/icons": "3.13.
|
|
56
|
+
"@transferwise/icons": "3.13.1",
|
|
58
57
|
"@transferwise/neptune-css": "14.18.0",
|
|
59
58
|
"@types/enzyme": "^3.10.18",
|
|
60
59
|
"@types/jest": "29.5.13",
|
|
61
|
-
"@types/react": "18.3.
|
|
60
|
+
"@types/react": "18.3.8",
|
|
62
61
|
"@types/react-dom": "18.3.0",
|
|
63
62
|
"@types/react-intl": "3.0.0",
|
|
64
|
-
"@wise/art": "2.
|
|
63
|
+
"@wise/art": "2.15.0",
|
|
65
64
|
"@wise/components-theming": "^1.6.0",
|
|
66
65
|
"babel-jest": "29.7.0",
|
|
67
66
|
"enzyme": "^3.11.0",
|
|
@@ -77,8 +76,8 @@
|
|
|
77
76
|
"postcss-import": "^15.1.0",
|
|
78
77
|
"react": "18.3.1",
|
|
79
78
|
"react-dom": "18.3.1",
|
|
80
|
-
"react-intl": "6.
|
|
81
|
-
"storybook": "^8.3.
|
|
79
|
+
"react-intl": "6.7.0",
|
|
80
|
+
"storybook": "^8.3.2",
|
|
82
81
|
"stylelint": "16.9.0",
|
|
83
82
|
"stylelint-config-standard": "36.0.1",
|
|
84
83
|
"stylelint-no-unsupported-browser-features": "8.0.1",
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
"nanoid": "5.0.7",
|
|
105
104
|
"react-webcam": "^7.2.0",
|
|
106
105
|
"screenfull": "^5.2.0",
|
|
107
|
-
"@wise/dynamic-flow-types": "2.22.
|
|
106
|
+
"@wise/dynamic-flow-types": "2.22.4"
|
|
108
107
|
},
|
|
109
108
|
"scripts": {
|
|
110
109
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|