@wise/dynamic-flow-client 5.5.1 → 5.6.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 +776 -759
- package/build/main.mjs +776 -759
- package/build/types/controller/FlowController.d.ts +1 -0
- package/build/types/controller/executeRequest.d.ts +1 -1
- package/build/types/controller/executeSubmission.d.ts +1 -1
- package/build/types/domain/components/RootDomainComponent.d.ts +1 -1
- package/build/types/domain/components/SubflowDomainComponent.d.ts +1 -1
- package/build/types/domain/components/step/StepDomainComponent.d.ts +4 -2
- package/build/types/domain/features/prefetch/getStepPrefetch.d.ts +12 -0
- package/build/types/domain/{prefetching → features/prefetch}/request-cache.d.ts +1 -1
- package/build/types/domain/mappers/mapStepToComponent.d.ts +1 -1
- package/build/types/domain/mappers/utils/layout-utils.d.ts +6 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -14,5 +14,6 @@ export type FlowControllerProps = Omit<DynamicFlowCoreProps, 'renderers' | 'feat
|
|
|
14
14
|
};
|
|
15
15
|
export declare const createFlowController: (props: FlowControllerProps) => {
|
|
16
16
|
rootComponent: import("../domain/components/RootDomainComponent").RootDomainComponent;
|
|
17
|
+
start: () => void;
|
|
17
18
|
cancel: () => void;
|
|
18
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ErrorResponseBody, Model, Request, Step } from '@wise/dynamic-flow-types/spec';
|
|
2
2
|
import { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../domain/features/events';
|
|
3
|
-
import { RequestCache } from '../domain/
|
|
3
|
+
import { RequestCache } from '../domain/features/prefetch/request-cache';
|
|
4
4
|
import { Behavior } from '../domain/types';
|
|
5
5
|
export type Command = {
|
|
6
6
|
type: 'complete';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Action, Model, Request } from '@wise/dynamic-flow-types/spec';
|
|
2
2
|
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../domain/features/events';
|
|
3
|
-
import { RequestCache } from '../domain/
|
|
3
|
+
import { RequestCache } from '../domain/features/prefetch/request-cache';
|
|
4
4
|
import { HttpClient } from '../types';
|
|
5
5
|
import { Command } from './executeRequest';
|
|
6
6
|
export declare const executeSubmission: (props: {
|
|
@@ -4,7 +4,7 @@ import { BaseComponent, DomainComponent, LoadingState, LocalValue, SchemaCompone
|
|
|
4
4
|
import { ModalComponent } from './ModalComponent';
|
|
5
5
|
import { StepDomainComponent } from './step/StepDomainComponent';
|
|
6
6
|
import { SubflowDomainComponent } from './SubflowDomainComponent';
|
|
7
|
-
import { RequestCache } from '../
|
|
7
|
+
import { RequestCache } from '../features/prefetch/request-cache';
|
|
8
8
|
export type BackConfig = {
|
|
9
9
|
isNativeBackEnabled: boolean;
|
|
10
10
|
isFlowCancellable: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JsonElement, Request } from '@wise/dynamic-flow-types/spec';
|
|
2
2
|
import { AnalyticsEventDispatcher } from '../features/events';
|
|
3
|
-
import { RequestCache } from '../
|
|
3
|
+
import { RequestCache } from '../features/prefetch/request-cache';
|
|
4
4
|
import { BaseComponent, OnComponentUpdate, Presentation } from '../types';
|
|
5
5
|
export type SubflowDomainComponent = BaseComponent & {
|
|
6
6
|
kind: 'layout';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { BaseComponent, DomainComponent, LayoutComponent, LoadingState, LocalValue, OnBehavior, SchemaComponent, OnComponentUpdate } from '../../types';
|
|
2
2
|
import type { NavigationStackBehavior, Step } from '@wise/dynamic-flow-types/spec';
|
|
3
3
|
import { Model } from '@wise/dynamic-flow-types/spec';
|
|
4
|
-
import { RequestCache } from '../../
|
|
4
|
+
import { RequestCache } from '../../features/prefetch/request-cache';
|
|
5
5
|
import type { AnalyticsEventDispatcher } from '../../features/events';
|
|
6
6
|
import type { StepPolling } from '../../features/polling/getStepPolling';
|
|
7
7
|
import { StepRefreshAfter } from '../../features/refreshAfter/getStepRefreshAfter';
|
|
8
8
|
import { ModalComponent } from '../ModalComponent';
|
|
9
9
|
import { ExternalConfirmationComponent } from './ExternalConfirmationComponent';
|
|
10
10
|
import { ToolbarComponent } from './ToolbarComponent';
|
|
11
|
+
import { StepPrefetch } from '../../features/prefetch/getStepPrefetch';
|
|
11
12
|
export type StepDomainComponent = BaseComponent & {
|
|
12
13
|
type: 'step';
|
|
13
14
|
kind: 'step';
|
|
@@ -47,8 +48,9 @@ export type BackNavigation = {
|
|
|
47
48
|
title?: string;
|
|
48
49
|
onClick: () => void;
|
|
49
50
|
};
|
|
50
|
-
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "toolbar" | "layoutComponents" | "schemaComponents" | "footerComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "stackBehavior" | "etag" | "step" | "title" | "tags" | "
|
|
51
|
+
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "toolbar" | "layoutComponents" | "schemaComponents" | "footerComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "stackBehavior" | "etag" | "step" | "title" | "tags" | "trackEvent" | "onBehavior"> & {
|
|
51
52
|
stepPolling?: StepPolling;
|
|
52
53
|
stepRefreshAfter?: StepRefreshAfter;
|
|
54
|
+
stepPrefetch: StepPrefetch;
|
|
53
55
|
onComponentUpdate: OnComponentUpdate;
|
|
54
56
|
}) => StepDomainComponent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JsonElement } from '@wise/dynamic-flow-types/spec';
|
|
2
|
+
import type { HttpClient } from '../../../types';
|
|
3
|
+
import type { Behavior } from '../../types';
|
|
4
|
+
import { RequestCache } from './request-cache';
|
|
5
|
+
export type StepPrefetch = {
|
|
6
|
+
requestCache: RequestCache;
|
|
7
|
+
start: (model: JsonElement) => void;
|
|
8
|
+
stop: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const getStepPrefetch: (httpClient: HttpClient, flowRequestCache: RequestCache, submissionBehaviors: (Behavior & {
|
|
11
|
+
type: "action" | "subflow";
|
|
12
|
+
})[]) => StepPrefetch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpClient } from '
|
|
1
|
+
import { HttpClient } from '../../../types';
|
|
2
2
|
export type RequestCache = {
|
|
3
3
|
get: (requestParams: Parameters<HttpClient>) => Promise<Response | null> | undefined;
|
|
4
4
|
set: (requestParams: Parameters<HttpClient>, responsePromise: Promise<Response | null>) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
2
|
-
import { RequestCache } from '../
|
|
2
|
+
import { RequestCache } from '../features/prefetch/request-cache';
|
|
3
3
|
import type { LoadingState, OnPoll } from '../types';
|
|
4
4
|
import type { MapperProps } from './schema/types';
|
|
5
5
|
import { FeatureFlags } from './utils/FeatureFlags';
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { Layout } from '@wise/dynamic-flow-types/spec';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes the margin of the last layout component in the container by removing its margin if it is not explicitly set.
|
|
4
|
+
* @param container The array of layout components.
|
|
5
|
+
* @returns The array of layout components with the last component's margin normalized if needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const normaliseMarginInLastComponent: (container: Layout[]) => Layout[];
|
package/build/types/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export { findRendererPropsByType } from './renderers/utils';
|
|
|
5
5
|
export { useDynamicFlow } from './useDynamicFlow';
|
|
6
6
|
export { useDynamicFlowModal } from './useDynamicFlowModal';
|
|
7
7
|
export { DynamicFlowCore as DynamicFlow } from './DynamicFlowCore';
|
|
8
|
-
export { makeRequestCache } from './domain/
|
|
8
|
+
export { makeRequestCache } from './domain/features/prefetch/request-cache';
|
|
9
9
|
export type { EventName } from './domain/features/events';
|
|
10
10
|
export { eventNames } from './domain/features/eventNames';
|
package/build/types/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Renderers } from '@wise/dynamic-flow-types/renderers';
|
|
2
2
|
import type { Model, Step } from '@wise/dynamic-flow-types/spec';
|
|
3
3
|
import type { AnalyticsEventHandler, LoggingEventHandler } from './domain/features/events';
|
|
4
|
-
import { RequestCache, RequestCacheEntries } from './domain/
|
|
4
|
+
import { RequestCache, RequestCacheEntries } from './domain/features/prefetch/request-cache';
|
|
5
5
|
export type DynamicFlowCoreProps = {
|
|
6
6
|
flowId: string;
|
|
7
7
|
initialAction?: InitialAction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.1",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"typescript": "5.9.3",
|
|
73
73
|
"vitest": "4.0.18",
|
|
74
74
|
"vitest-fetch-mock": "0.4.5",
|
|
75
|
-
"@wise/dynamic-flow-
|
|
76
|
-
"@wise/dynamic-flow-
|
|
75
|
+
"@wise/dynamic-flow-renderers": "0.0.0",
|
|
76
|
+
"@wise/dynamic-flow-fixtures": "0.0.1"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@transferwise/components": "^46.104.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"react-intl": "^6 || ^7"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@wise/dynamic-flow-types": "4.
|
|
89
|
+
"@wise/dynamic-flow-types": "4.7.0"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"dev": "EXCLUDE_VISUAL_TESTS=true pnpm storybook dev -p 3003",
|