@wise/dynamic-flow-client 5.1.1 → 5.1.3

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.
@@ -2,4 +2,4 @@ import type { BoxLayout } from '@wise/dynamic-flow-types/spec';
2
2
  import { type BoxComponent } from '../../components/BoxComponent';
3
3
  import type { SchemaComponent } from '../../types';
4
4
  import type { MapperProps } from '../schema/types';
5
- export declare const boxLayoutToComponent: (uid: string, { border, components, control, margin, width, analyticsId, tags, }: BoxLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => BoxComponent;
5
+ export declare const boxLayoutToComponent: (uid: string, { border, components, control, margin, width, analyticsId, tags }: BoxLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => BoxComponent;
@@ -1,12 +1,13 @@
1
1
  import type { AnalyticsEventDispatcher } from '../features/events';
2
2
  import type { LoadingState, OnPoll } from '../types';
3
3
  import type { MapperProps } from './schema/types';
4
+ import { FeatureFlags } from './utils/FeatureFlags';
4
5
  export type StepMapperProps = Omit<MapperProps, 'trackEvent' | 'registerSubmissionBehavior'> & {
5
6
  uid: string;
6
7
  etag: string | null;
7
8
  loadingState: LoadingState;
8
9
  trackEvent: AnalyticsEventDispatcher<string>;
9
- features: Record<string, unknown>;
10
+ features: FeatureFlags;
10
11
  onPoll: OnPoll;
11
12
  };
12
13
  export declare const mapStepToComponent: ({ uid: rootUid, loadingState, features, trackEvent, onPoll, onBehavior, ...restProps }: StepMapperProps) => import("../components/step/StepDomainComponent").StepDomainComponent;
@@ -0,0 +1,7 @@
1
+ type FeatureName = 'pinnedButtons' | 'nativeBack' | 'hideStepTitle';
2
+ export declare class FeatureFlags {
3
+ #private;
4
+ constructor(features: Record<string, unknown>);
5
+ isEnabled(featureName: FeatureName): boolean;
6
+ }
7
+ export {};
@@ -2,8 +2,10 @@ import type { RendererProps, RenderFunction } from '@wise/dynamic-flow-types/ren
2
2
  import type { AnalyticsEventDispatcher } from '../../domain/features/events';
3
3
  import type { DomainComponent, LoadingState } from '../../domain/types';
4
4
  import type { HttpClient } from '../../types';
5
+ import { FeatureFlags } from '../../domain/mappers/utils/FeatureFlags';
5
6
  export type RendererMapperProps = {
6
7
  stepLoadingState: LoadingState;
8
+ features: FeatureFlags;
7
9
  render: RenderFunction;
8
10
  httpClient: HttpClient;
9
11
  trackEvent: AnalyticsEventDispatcher<string>;
@@ -2,6 +2,7 @@ import { ConstComponent } from '../../domain/components/ConstComponent';
2
2
  import { RendererMapperProps } from './componentToRendererProps';
3
3
  export declare const constComponentToProps: (component: ConstComponent, rendererMapperProps: RendererMapperProps) => {
4
4
  stepLoadingState: import("../../domain/types").LoadingState;
5
+ features: import("../../domain/mappers/utils/FeatureFlags").FeatureFlags;
5
6
  render: import("@wise/dynamic-flow-types/renderers").RenderFunction;
6
7
  httpClient: import("../../types").HttpClient;
7
8
  trackEvent: import("../../domain/features/events").AnalyticsEventDispatcher<string>;
@@ -1,7 +1,9 @@
1
1
  import { RootDomainComponent } from './domain/components/RootDomainComponent';
2
+ import { FeatureFlags } from './domain/mappers/utils/FeatureFlags';
2
3
  import type { OnValueChange, ScrollToTop } from './domain/types';
3
4
  import type { DynamicFlowCoreProps } from './types';
4
- type UseDynamicFlowCoreProps = Omit<DynamicFlowCoreProps, 'renderers'> & {
5
+ type UseDynamicFlowCoreProps = Omit<DynamicFlowCoreProps, 'renderers' | 'features'> & {
6
+ features: FeatureFlags;
5
7
  onValueChange?: OnValueChange;
6
8
  scrollToTop?: ScrollToTop;
7
9
  onLink: (url: string) => boolean;
@@ -0,0 +1,2 @@
1
+ import { ScrollToTop } from '../domain/types';
2
+ export declare const getScrollToTop: (normalisedFlowId: string, className: string) => ScrollToTop;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -32,29 +32,29 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@chromatic-com/storybook": "4.1.3",
35
- "@formatjs/cli": "^6.7.4",
36
- "@storybook/addon-a11y": "^10.1.8",
37
- "@storybook/addon-docs": "^10.1.8",
38
- "@storybook/addon-links": "^10.1.8",
39
- "@storybook/react-vite": "10.1.8",
35
+ "@formatjs/cli": "^6.9.0",
36
+ "@storybook/addon-a11y": "^10.1.11",
37
+ "@storybook/addon-docs": "^10.1.11",
38
+ "@storybook/addon-links": "^10.1.11",
39
+ "@storybook/react-vite": "10.1.11",
40
40
  "@testing-library/dom": "10.4.1",
41
41
  "@testing-library/jest-dom": "6.9.1",
42
- "@testing-library/react": "16.3.0",
42
+ "@testing-library/react": "16.3.1",
43
43
  "@testing-library/user-event": "14.6.1",
44
- "@transferwise/components": "^46.116.1",
44
+ "@transferwise/components": "^46.118.0",
45
45
  "@transferwise/formatting": "^2.13.4",
46
- "@transferwise/icons": "4.0.0",
46
+ "@transferwise/icons": "4.0.1",
47
47
  "@transferwise/navigation-ui": "4.41.0",
48
- "@transferwise/neptune-css": "14.25.2",
49
- "@types/node": "22.19.2",
48
+ "@transferwise/neptune-css": "14.26.0",
49
+ "@types/node": "22.19.3",
50
50
  "@types/react": "18.3.27",
51
51
  "@types/react-dom": "18.3.7",
52
52
  "@types/react-intl": "3.0.0",
53
53
  "@vitejs/plugin-react": "5.1.2",
54
- "@wise/art": "2.24.7",
54
+ "@wise/art": "2.25.0",
55
55
  "@wise/components-theming": "^1.9.1",
56
56
  "esbuild": "0.27.0",
57
- "eslint-plugin-storybook": "10.1.8",
57
+ "eslint-plugin-storybook": "10.1.11",
58
58
  "framer-motion": "^12.23.26",
59
59
  "npm-run-all2": "8.0.4",
60
60
  "postcss": "^8.5.6",
@@ -63,14 +63,14 @@
63
63
  "react": "18.3.1",
64
64
  "react-dom": "18.3.1",
65
65
  "react-intl": "6.8.9",
66
- "storybook": "^10.1.8",
66
+ "storybook": "^10.1.11",
67
67
  "stylelint": "16.26.1",
68
68
  "stylelint-config-standard": "36.0.1",
69
69
  "stylelint-no-unsupported-browser-features": "8.0.5",
70
- "stylelint-value-no-unknown-custom-properties": "6.0.1",
70
+ "stylelint-value-no-unknown-custom-properties": "6.1.0",
71
71
  "tsx": "4.21.0",
72
72
  "typescript": "5.9.3",
73
- "vitest": "4.0.15",
73
+ "vitest": "4.0.16",
74
74
  "vitest-fetch-mock": "0.4.5",
75
75
  "@wise/dynamic-flow-renderers": "0.0.0",
76
76
  "@wise/dynamic-flow-fixtures": "0.0.1"
@@ -86,7 +86,7 @@
86
86
  "react-intl": "^6"
87
87
  },
88
88
  "dependencies": {
89
- "@wise/dynamic-flow-types": "4.1.1"
89
+ "@wise/dynamic-flow-types": "4.2.0"
90
90
  },
91
91
  "scripts": {
92
92
  "dev": "EXCLUDE_VISUAL_TESTS=true pnpm storybook dev -p 3003",
@@ -1,3 +0,0 @@
1
- type Feature = 'pinnedButtons' | 'nativeBack';
2
- export declare const isFeatureEnabled: (features: Record<string, unknown>, featureName: Feature) => boolean;
3
- export {};