@wise/dynamic-flow-client 2.3.0 → 2.3.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 +2 -2
- package/build/types/revamp/domain/{AlertComponent.d.ts → components/AlertComponent.d.ts} +1 -3
- package/build/types/revamp/domain/{HeadingComponent.d.ts → components/HeadingComponent.d.ts} +1 -3
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +9 -0
- package/build/types/revamp/domain/{ParagraphComponent.d.ts → components/ParagraphComponent.d.ts} +2 -4
- package/build/types/revamp/domain/{Step.d.ts → components/Step.d.ts} +1 -1
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +27 -0
- package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +2 -0
- package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +3 -0
- package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +2 -0
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +2 -0
- package/build/types/revamp/domain/mappers/mapSchemaToComponents.d.ts +4 -0
- package/build/types/revamp/domain/mappers/mapStepToComponents.d.ts +4 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent.d.ts +3 -0
- package/build/types/revamp/domain/mappers/schema/types.d.ts +4 -0
- package/build/types/revamp/domain/types.d.ts +16 -5
- package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/textInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/types.d.ts +18 -2
- package/build/types/revamp/renderers/utils/mapping-utils.d.ts +3 -0
- package/build/types/revamp/{renderers/neptune → wise/renderers}/AlertRenderer.d.ts +1 -1
- package/build/types/revamp/{renderers/neptune → wise/renderers}/HeadingRenderer.d.ts +1 -1
- package/build/types/revamp/{renderers/neptune → wise/renderers}/ParagraphRenderer.d.ts +1 -1
- package/build/types/revamp/wise/renderers/TextInputRenderer.d.ts +3 -0
- package/build/types/revamp/{renderers/neptune → wise/renderers}/utils/layout-utils.d.ts +1 -1
- package/package.json +3 -2
- package/build/types/revamp/mappers/componentToProps/alertComponentToProps.d.ts +0 -3
- package/build/types/revamp/mappers/componentToProps/headingComponentToProps.d.ts +0 -3
- package/build/types/revamp/mappers/componentToProps/paragraphComponentToProps.d.ts +0 -3
- package/build/types/revamp/mappers/specToDomain/alertLayoutToDomain.d.ts +0 -2
- package/build/types/revamp/mappers/specToDomain/headingLayoutToDomain.d.ts +0 -2
- package/build/types/revamp/mappers/specToDomain/mapStepToDomain.d.ts +0 -4
- package/build/types/revamp/mappers/specToDomain/paragraphLayoutToDomain.d.ts +0 -2
- package/build/types/revamp/renderers/utils/renderComponent.d.ts +0 -7
package/build/main.js
CHANGED
|
@@ -99,9 +99,9 @@ var require_classnames = __commonJS({
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
// ../../node_modules/.pnpm/react-webcam@7.1.
|
|
102
|
+
// ../../node_modules/.pnpm/react-webcam@7.1.1_react-dom@18.2.0_react@18.2.0/node_modules/react-webcam/dist/react-webcam.js
|
|
103
103
|
var require_react_webcam = __commonJS({
|
|
104
|
-
"../../node_modules/.pnpm/react-webcam@7.1.
|
|
104
|
+
"../../node_modules/.pnpm/react-webcam@7.1.1_react-dom@18.2.0_react@18.2.0/node_modules/react-webcam/dist/react-webcam.js"(exports, module2) {
|
|
105
105
|
"use strict";
|
|
106
106
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
107
107
|
if (typeof exports === "object" && typeof module2 === "object")
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Context, Margin } from '@wise/dynamic-flow-types';
|
|
2
|
-
import { LayoutComponent } from '
|
|
2
|
+
import { LayoutComponent } from '../types';
|
|
3
3
|
export type AlertComponent = LayoutComponent & {
|
|
4
4
|
type: 'alert';
|
|
5
5
|
markdown: string;
|
|
6
6
|
context: Context;
|
|
7
|
-
margin: Margin;
|
|
8
7
|
};
|
|
9
8
|
export declare const createAlertComponent: (alertProps: {
|
|
10
|
-
uid: string;
|
|
11
9
|
markdown: string;
|
|
12
10
|
context: Context;
|
|
13
11
|
margin: Margin;
|
package/build/types/revamp/domain/{HeadingComponent.d.ts → components/HeadingComponent.d.ts}
RENAMED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Align, Margin, Size } from '@wise/dynamic-flow-types';
|
|
2
|
-
import { LayoutComponent } from '
|
|
2
|
+
import { LayoutComponent } from '../types';
|
|
3
3
|
export type HeadingComponent = LayoutComponent & {
|
|
4
4
|
type: 'heading';
|
|
5
5
|
text: string;
|
|
6
6
|
align: Align;
|
|
7
|
-
margin: Margin;
|
|
8
7
|
size: Size;
|
|
9
8
|
};
|
|
10
9
|
export declare const createHeadingComponent: (headingProps: {
|
|
11
|
-
uid: string;
|
|
12
10
|
text: string;
|
|
13
11
|
align: Align;
|
|
14
12
|
margin: Margin;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SchemaMapperProps } from '../mappers/schema/types';
|
|
2
|
+
import { StepComponent } from '../types';
|
|
3
|
+
export type ObjectComponent = {
|
|
4
|
+
type: 'object';
|
|
5
|
+
uid?: string;
|
|
6
|
+
propertyName?: string;
|
|
7
|
+
childComponents: StepComponent[];
|
|
8
|
+
};
|
|
9
|
+
export declare const createObjectComponent: (components: StepComponent[], mapperProps: SchemaMapperProps) => ObjectComponent;
|
package/build/types/revamp/domain/{ParagraphComponent.d.ts → components/ParagraphComponent.d.ts}
RENAMED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Align, Margin } from '@wise/dynamic-flow-types';
|
|
2
|
-
import { LayoutComponent } from '
|
|
2
|
+
import { LayoutComponent } from '../types';
|
|
3
3
|
export type ParagraphComponent = LayoutComponent & {
|
|
4
4
|
type: 'paragraph';
|
|
5
5
|
text: string;
|
|
6
6
|
control?: 'copyable' | string;
|
|
7
|
-
margin: Margin;
|
|
8
7
|
align: Align;
|
|
9
8
|
};
|
|
10
9
|
export declare const createParagraphComponent: (paragraphProps: {
|
|
11
|
-
uid: string;
|
|
12
10
|
text: string;
|
|
13
|
-
control?:
|
|
11
|
+
control?: string | undefined;
|
|
14
12
|
margin: Margin;
|
|
15
13
|
align: Align;
|
|
16
14
|
}) => ParagraphComponent;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StringSchema } from '@wise/dynamic-flow-types';
|
|
2
|
+
import { InputComponent } from '../types';
|
|
3
|
+
type TextInputFormat = 'text' | 'date';
|
|
4
|
+
type TextInputControl = 'password' | 'textarea' | 'email' | 'numeric' | 'phone-number' | 'date-lookup' | string;
|
|
5
|
+
export type TextInputComponent = InputComponent & {
|
|
6
|
+
type: 'text';
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
control?: TextInputControl;
|
|
11
|
+
format: TextInputFormat;
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
onChange: (value: string | undefined) => void;
|
|
14
|
+
getValue: () => string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare const createTextInputComponent: (textInputProps: {
|
|
17
|
+
uid: string;
|
|
18
|
+
id: string;
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
placeholder?: string | undefined;
|
|
22
|
+
control: StringSchema['control'];
|
|
23
|
+
format: StringSchema['format'];
|
|
24
|
+
value?: string | undefined;
|
|
25
|
+
propertyName: string;
|
|
26
|
+
}) => TextInputComponent;
|
|
27
|
+
export {};
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Margin } from '@wise/dynamic-flow-types';
|
|
2
|
+
import { AlertComponent } from './components/AlertComponent';
|
|
3
|
+
import { HeadingComponent } from './components/HeadingComponent';
|
|
4
|
+
import { ObjectComponent } from './components/ObjectComponent';
|
|
5
|
+
import { ParagraphComponent } from './components/ParagraphComponent';
|
|
6
|
+
import { TextInputComponent } from './components/TextInputComponent';
|
|
7
|
+
export type StepComponent = AlertComponent | HeadingComponent | ParagraphComponent | ObjectComponent | TextInputComponent;
|
|
8
|
+
export type BaseComponent = {
|
|
6
9
|
type: string;
|
|
10
|
+
keyProp: string;
|
|
11
|
+
};
|
|
12
|
+
export type LayoutComponent = BaseComponent & {
|
|
13
|
+
margin: Margin;
|
|
14
|
+
};
|
|
15
|
+
export type InputComponent = BaseComponent & {
|
|
7
16
|
uid: string;
|
|
17
|
+
id: string;
|
|
18
|
+
propertyName: string;
|
|
8
19
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TextInputComponent } from '../../domain/components/TextInputComponent';
|
|
2
|
+
import { TextInputRendererProps } from '../types';
|
|
3
|
+
export declare const textComponentToProps: ({ keyProp, format, id, title, description, placeholder, value, onChange, }: TextInputComponent) => TextInputRendererProps;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Context as DFContext, Margin as DFMargin, Size as DFSize } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export type Renderer<P extends RendererProps> = {
|
|
4
4
|
canRender: (props: RendererProps) => boolean;
|
|
5
5
|
render: (props: P) => ReactNode;
|
|
6
6
|
};
|
|
7
|
+
export type Align = 'start' | 'center' | 'end';
|
|
8
|
+
export type Margin = DFMargin;
|
|
9
|
+
export type Context = DFContext;
|
|
10
|
+
export type Size = DFSize;
|
|
7
11
|
export interface RendererProps {
|
|
8
12
|
type: string;
|
|
9
|
-
|
|
13
|
+
keyProp: string;
|
|
10
14
|
}
|
|
11
15
|
export interface AlertRendererProps extends RendererProps {
|
|
12
16
|
type: 'alert';
|
|
@@ -29,3 +33,15 @@ export interface ParagraphRendererProps extends RendererProps {
|
|
|
29
33
|
margin: Margin;
|
|
30
34
|
align: Align;
|
|
31
35
|
}
|
|
36
|
+
export interface TextInputRendererProps extends RendererProps {
|
|
37
|
+
type: 'input-text';
|
|
38
|
+
control?: 'password' | 'textarea' | 'email' | 'numeric' | 'phone-number' | 'date-lookup' | string;
|
|
39
|
+
format: 'text' | 'date';
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
label?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
value?: string;
|
|
46
|
+
onChange: (value: string | undefined) => void;
|
|
47
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Align, Size } from '
|
|
1
|
+
import { Align, Size } from '../../../renderers/types';
|
|
2
2
|
declare const getTopMargin: (size: Size) => "" | "m-t-0" | "m-t-1" | "m-t-2" | "m-t-3" | "m-t-5";
|
|
3
3
|
declare const getTextAlignmentAndTopMargin: (component: {
|
|
4
4
|
align: Align;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
53
53
|
"@wise/art": "2.8.4",
|
|
54
54
|
"@wise/components-theming": "^0.8.4",
|
|
55
|
+
"@wise/forms": "0.2.2",
|
|
55
56
|
"babel-jest": "29.7.0",
|
|
56
57
|
"currency-flags": "4.0.7",
|
|
57
58
|
"enzyme": "^3.11.0",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"@wise/dynamic-flow-fixtures": "0.0.1"
|
|
81
82
|
},
|
|
82
83
|
"peerDependencies": {
|
|
83
|
-
"@transferwise/components": "
|
|
84
|
+
"@transferwise/components": "43 || 44 || 45",
|
|
84
85
|
"@transferwise/formatting": "^2",
|
|
85
86
|
"@transferwise/icons": "^3",
|
|
86
87
|
"@transferwise/neptune-css": "^14",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { StepComponent } from '../../domain/types';
|
|
3
|
-
import { Renderer, RendererProps } from '../types';
|
|
4
|
-
export declare const renderComponent: ({ component, renderers, }: {
|
|
5
|
-
component: StepComponent;
|
|
6
|
-
renderers: Renderer<RendererProps>[];
|
|
7
|
-
}) => ReactNode | ReactNode[];
|