@wise/dynamic-flow-client 5.6.0 → 5.6.2

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.
@@ -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/prefetching/request-cache';
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/prefetching/request-cache';
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 '../prefetching/request-cache';
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 '../prefetching/request-cache';
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 '../../prefetching/request-cache';
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" | "requestCache" | "trackEvent" | "onBehavior"> & {
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 '../../types';
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;
@@ -7,3 +7,4 @@ export type RequestCacheEntries = readonly [Parameters<HttpClient>, Promise<Resp
7
7
  export declare const makeRequestCacheWithParent: (parent: RequestCache | undefined) => RequestCache;
8
8
  export declare const makeRequestCache: (initialValues?: RequestCacheEntries) => RequestCache;
9
9
  export declare const normaliseRequestCache: (cache: RequestCache | RequestCacheEntries | undefined) => RequestCache;
10
+ export declare const makeRequestCacheKey: (requestParams: Parameters<HttpClient>) => string;
@@ -1,5 +1,5 @@
1
1
  import type { AnalyticsEventDispatcher } from '../features/events';
2
- import { RequestCache } from '../prefetching/request-cache';
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';
@@ -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/prefetching/request-cache';
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';
@@ -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/prefetching/request-cache';
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.6.0",
3
+ "version": "5.6.2",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -33,10 +33,10 @@
33
33
  "devDependencies": {
34
34
  "@chromatic-com/storybook": "4.1.3",
35
35
  "@formatjs/cli": "^6.12.0",
36
- "@storybook/addon-a11y": "^10.2.0",
37
- "@storybook/addon-docs": "^10.2.0",
38
- "@storybook/addon-links": "^10.2.0",
39
- "@storybook/react-vite": "10.2.0",
36
+ "@storybook/addon-a11y": "^10.2.3",
37
+ "@storybook/addon-docs": "^10.2.3",
38
+ "@storybook/addon-links": "^10.2.3",
39
+ "@storybook/react-vite": "10.2.3",
40
40
  "@testing-library/dom": "10.4.1",
41
41
  "@testing-library/jest-dom": "6.9.1",
42
42
  "@testing-library/react": "16.3.2",
@@ -44,7 +44,7 @@
44
44
  "@transferwise/components": "^46.122.1",
45
45
  "@transferwise/formatting": "^2.13.4",
46
46
  "@transferwise/icons": "4.0.2",
47
- "@transferwise/navigation-ui": "4.41.0",
47
+ "@transferwise/navigation-ui": "4.42.0",
48
48
  "@transferwise/neptune-css": "14.26.1",
49
49
  "@types/node": "22.19.7",
50
50
  "@types/react": "18.3.27",
@@ -54,8 +54,8 @@
54
54
  "@wise/art": "2.26.0",
55
55
  "@wise/components-theming": "^1.10.0",
56
56
  "esbuild": "0.27.0",
57
- "eslint-plugin-storybook": "10.2.0",
58
- "framer-motion": "^12.29.0",
57
+ "eslint-plugin-storybook": "10.2.3",
58
+ "framer-motion": "^12.29.2",
59
59
  "npm-run-all2": "8.0.4",
60
60
  "postcss": "^8.5.6",
61
61
  "postcss-cli": "^11.0.1",
@@ -63,7 +63,7 @@
63
63
  "react": "18.3.1",
64
64
  "react-dom": "18.3.1",
65
65
  "react-intl": "6.8.9",
66
- "storybook": "^10.2.0",
66
+ "storybook": "^10.2.3",
67
67
  "stylelint": "16.26.1",
68
68
  "stylelint-config-standard": "36.0.1",
69
69
  "stylelint-no-unsupported-browser-features": "8.0.5",