@wise/dynamic-flow-client 2.8.7 → 2.8.9

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,4 +1,4 @@
1
- import { ButtonLayout, Size } from '@wise/dynamic-flow-types';
1
+ import type { ButtonLayout, Size } from '@wise/dynamic-flow-types';
2
2
  export declare const getButtonPriority: (component: ButtonLayout) => "primary" | "secondary" | "tertiary";
3
3
  export declare const getButtonType: (component: ButtonLayout) => "positive" | "negative" | "accent";
4
4
  export declare const getButtonSize: (size: Size | undefined) => "sm" | "md" | "lg";
@@ -0,0 +1,11 @@
1
+ import type { Model } from '@wise/dynamic-flow-types/build/next';
2
+ import type { BaseComponent } from '../types';
3
+ export type HiddenComponent = BaseComponent<Model> & {
4
+ type: 'hidden';
5
+ };
6
+ type HiddenProps = {
7
+ uid: string;
8
+ value: Model;
9
+ };
10
+ export declare const createHiddenComponent: ({ uid, value }: HiddenProps) => HiddenComponent;
11
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { ButtonLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
- export declare const buttonLayoutToComponent: (uid: string, { action, context, control, disabled, margin, pinOrder, size, title, }: ButtonLayout, { onAction }: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
3
+ export declare const buttonLayoutToComponent: (uid: string, { action, context, control, disabled, margin, pinOrder, size, title }: ButtonLayout, { onAction }: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
@@ -0,0 +1,5 @@
1
+ import type { SchemaMapperProps } from './types';
2
+ import type { ConstSchema } from '@wise/dynamic-flow-types/build/next';
3
+ export declare const constSchemaToComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
4
+ schema: ConstSchema;
5
+ }) => import("../../components/HiddenComponent").HiddenComponent;
@@ -1,5 +1,7 @@
1
- import type { Context as DFContext, Align as DFAlign } from '@wise/dynamic-flow-types/build/next';
1
+ import type { Context as DFContext, Align as DFAlign, Action } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { Align, Bias, Context } from '../../types';
3
3
  export declare const mapLegacyContext: (context: DFContext) => Context;
4
4
  export declare const mapLegacyBias: (bias: 'left' | 'right' | 'none') => Bias;
5
5
  export declare const mapLegacyAlign: (align: DFAlign) => Align;
6
+ export declare const mapLegacyActionTypeToContext: (type: Action['type']) => Context;
7
+ export declare const mapLegacyActionTypeToControl: (type: Action['type']) => 'primary' | 'secondary' | 'tertiary';
@@ -1,4 +1,5 @@
1
1
  import type { Action, Margin, Model } from '@wise/dynamic-flow-types/build/next';
2
+ import type { HiddenComponent } from './components/HiddenComponent';
2
3
  import type { AlertComponent } from './components/AlertComponent';
3
4
  import type { BoxComponent } from './components/BoxComponent';
4
5
  import type { ButtonComponent } from './components/ButtonComponent';
@@ -13,7 +14,7 @@ import type { DateInputComponent } from './components/DateInputComponent';
13
14
  import type { UploadInputComponent } from './components/UploadInputComponent';
14
15
  import type { ContainerComponent } from './components/ContainerComponent';
15
16
  import type { FormComponent } from './components/FormComponent';
16
- export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DateInputComponent | FormComponent | HeadingComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | TextInputComponent | UploadInputComponent;
17
+ export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DateInputComponent | FormComponent | HeadingComponent | HiddenComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | TextInputComponent | UploadInputComponent;
17
18
  export type HasChildren = BoxComponent | ColumnsComponent | ContainerComponent | FormComponent | ObjectComponent;
18
19
  export type BaseComponent<M extends Model> = {
19
20
  type: string;
@@ -0,0 +1,2 @@
1
+ import type { HiddenRendererProps } from '../types';
2
+ export declare const hiddenComponentToProps: () => HiddenRendererProps;
@@ -113,4 +113,7 @@ export interface ButtonRendererProps extends RendererProps {
113
113
  title: string;
114
114
  onClick: () => void;
115
115
  }
116
+ export interface HiddenRendererProps extends RendererProps {
117
+ type: 'hidden';
118
+ }
116
119
  export {};
@@ -1,4 +1,4 @@
1
- import type { AllOfSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
1
+ import type { AllOfSchema, ConstSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { HasChildren, StepComponent } from '../domain/types';
3
3
  import type { ColumnsComponent } from '../domain/components/ColumnsComponent';
4
4
  export declare const hasChildren: (component: StepComponent) => component is HasChildren;
@@ -10,3 +10,4 @@ export declare const isObjectSchema: (schema: Schema) => schema is ObjectSchema;
10
10
  export declare const isStringSchema: (schema: Schema) => schema is StringSchema;
11
11
  export declare const isNumberSchema: (schema: Schema) => schema is NumberSchema;
12
12
  export declare const isIntegerSchema: (schema: Schema) => schema is IntegerSchema;
13
+ export declare const isConstSchema: (schema: Schema) => schema is ConstSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "2.8.7",
3
+ "version": "2.8.9",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -18,58 +18,58 @@
18
18
  "url": "git+https://github.com/transferwise/dynamic-flow.git"
19
19
  },
20
20
  "devDependencies": {
21
- "@babel/core": "7.23.3",
21
+ "@babel/core": "7.23.7",
22
22
  "@babel/plugin-syntax-flow": "7.23.3",
23
23
  "@babel/plugin-transform-react-jsx": "7.23.4",
24
- "@babel/preset-env": "7.23.3",
24
+ "@babel/preset-env": "7.23.8",
25
25
  "@babel/preset-react": "7.23.3",
26
26
  "@babel/preset-typescript": "7.23.3",
27
27
  "@cfaester/enzyme-adapter-react-18": "0.7.1",
28
28
  "@formatjs/cli": "^6.2.4",
29
- "@storybook/addon-a11y": "7.5.3",
30
- "@storybook/addon-actions": "7.5.3",
31
- "@storybook/addon-essentials": "7.5.3",
32
- "@storybook/addon-interactions": "7.5.3",
33
- "@storybook/addon-links": "7.5.3",
34
- "@storybook/react": "7.5.3",
35
- "@storybook/react-webpack5": "7.5.3",
29
+ "@storybook/addon-a11y": "7.6.8",
30
+ "@storybook/addon-actions": "7.6.8",
31
+ "@storybook/addon-essentials": "7.6.8",
32
+ "@storybook/addon-interactions": "7.6.8",
33
+ "@storybook/addon-links": "7.6.8",
34
+ "@storybook/react": "7.6.8",
35
+ "@storybook/react-webpack5": "7.6.8",
36
36
  "@storybook/testing-library": "0.2.2",
37
- "@testing-library/dom": "9.3.3",
38
- "@testing-library/jest-dom": "6.1.4",
37
+ "@testing-library/dom": "9.3.4",
38
+ "@testing-library/jest-dom": "6.2.0",
39
39
  "@testing-library/react": "14.1.2",
40
40
  "@testing-library/react-hooks": "8.0.1",
41
- "@testing-library/user-event": "14.5.1",
41
+ "@testing-library/user-event": "14.5.2",
42
42
  "@transferwise/components": "45.21.3",
43
43
  "@transferwise/formatting": "^2.10.0",
44
- "@transferwise/icons": "3.12.0",
44
+ "@transferwise/icons": "3.13.0",
45
45
  "@transferwise/neptune-css": "14.7.0",
46
46
  "@transferwise/neptune-tokens": "8.7.0",
47
- "@types/enzyme": "^3.10.16",
48
- "@types/jest": "29.5.10",
47
+ "@types/enzyme": "^3.10.18",
48
+ "@types/jest": "29.5.11",
49
49
  "@types/react": "18",
50
50
  "@types/react-dom": "18",
51
51
  "@types/react-intl": "3.0.0",
52
52
  "@types/testing-library__jest-dom": "5.14.9",
53
- "@wise/art": "2.8.4",
53
+ "@wise/art": "2.8.5",
54
54
  "@wise/components-theming": "^0.8.4",
55
- "@wise/forms": "0.2.3",
55
+ "@wise/forms": "0.3.0",
56
56
  "babel-jest": "29.7.0",
57
57
  "currency-flags": "4.0.7",
58
58
  "enzyme": "^3.11.0",
59
- "esbuild": "0.19.5",
59
+ "esbuild": "0.19.11",
60
60
  "immer": "10.0.3",
61
61
  "jest": "29.7.0",
62
62
  "jest-environment-jsdom": "29.7.0",
63
63
  "jest-fetch-mock": "^3.0.3",
64
64
  "jest-watch-typeahead": "^2.2.2",
65
65
  "npm-run-all": "4.1.5",
66
- "postcss": "^8.4.31",
66
+ "postcss": "^8.4.33",
67
67
  "postcss-cli": "^10.1.0",
68
68
  "postcss-import": "^15.1.0",
69
69
  "react": "18.2.0",
70
70
  "react-dom": "18.2.0",
71
71
  "react-intl": "6.5.5",
72
- "storybook": "7.5.3",
72
+ "storybook": "7.6.8",
73
73
  "stylelint": "14.16.1",
74
74
  "stylelint-config-standard": "25.0.0",
75
75
  "stylelint-no-unsupported-browser-features": "5.0.4",
@@ -88,10 +88,10 @@
88
88
  "react-intl": "^6"
89
89
  },
90
90
  "dependencies": {
91
- "classnames": "2.3.2",
91
+ "classnames": "2.5.1",
92
92
  "react-webcam": "^7.2.0",
93
93
  "screenfull": "^5.2.0",
94
- "@wise/dynamic-flow-types": "2.4.1"
94
+ "@wise/dynamic-flow-types": "2.5.0"
95
95
  },
96
96
  "scripts": {
97
97
  "dev": "storybook dev -p 3003",