@wise/dynamic-flow-types 3.0.0-experimental-8a78888 → 3.0.0-experimental-ffcedb9
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 +404 -397
- package/build/main.min.js +1 -1
- package/build/main.mjs +404 -397
- package/build/next/index.d.ts +1 -0
- package/build/next/layout/DecisionLayoutOption.d.ts +5 -0
- package/build/next/layout/InstructionsLayoutItem.d.ts +5 -0
- package/build/next/layout/ListLayoutItem.d.ts +6 -1
- package/build/next/layout/ReviewLayoutField.d.ts +5 -0
- package/build/next/layout/StatusListLayoutItem.d.ts +5 -0
- package/build/next/schema/StringSchema.d.ts +5 -0
- package/build/next/step/Step.d.ts +4 -0
- package/build/renderers/AlertRendererProps.d.ts +5 -1
- package/build/renderers/BaseInputRendererProps.d.ts +2 -5
- package/build/renderers/BoxRendererProps.d.ts +6 -2
- package/build/renderers/ButtonRendererProps.d.ts +3 -1
- package/build/renderers/CheckboxInputRendererProps.d.ts +3 -0
- package/build/renderers/ColumnsRendererProps.d.ts +7 -1
- package/build/renderers/CoreContainerRendererProps.d.ts +6 -1
- package/build/renderers/DateInputRendererProps.d.ts +3 -0
- package/build/renderers/DecisionRendererProps.d.ts +7 -2
- package/build/renderers/DividerRendererProps.d.ts +5 -1
- package/build/renderers/FormRendererProps.d.ts +6 -1
- package/build/renderers/HeadingRendererProps.d.ts +3 -1
- package/build/renderers/HiddenRendererProps.d.ts +4 -0
- package/build/renderers/Image.d.ts +3 -2
- package/build/renderers/ImageRendererProps.d.ts +6 -2
- package/build/renderers/InstructionsRendererProps.d.ts +6 -1
- package/build/renderers/IntegerInputRendererProps.d.ts +3 -0
- package/build/renderers/ListRendererProps.d.ts +6 -1
- package/build/renderers/LoadingIndicatorRendererProps.d.ts +5 -1
- package/build/renderers/MarkdownRendererProps.d.ts +5 -1
- package/build/renderers/ModalRendererProps.d.ts +7 -2
- package/build/renderers/MultiSelectInputRendererProps.d.ts +3 -1
- package/build/renderers/MultiUploadInputRendererProps.d.ts +7 -2
- package/build/renderers/NumberInputRendererProps.d.ts +3 -0
- package/build/renderers/ParagraphRendererProps.d.ts +3 -1
- package/build/renderers/RendererProps.d.ts +16 -2
- package/build/renderers/RepeatableRendererProps.d.ts +8 -6
- package/build/renderers/ReviewRendererProps.d.ts +6 -1
- package/build/renderers/SearchRendererProps.d.ts +5 -1
- package/build/renderers/SectionRendererProps.d.ts +6 -1
- package/build/renderers/SelectInputRendererProps.d.ts +6 -1
- package/build/renderers/StatusListRendererProps.d.ts +6 -1
- package/build/renderers/StepRendererProps.d.ts +17 -4
- package/build/renderers/TextInputRendererProps.d.ts +3 -0
- package/build/renderers/UploadInputRendererProps.d.ts +7 -0
- package/build/renderers/constants.d.ts +1 -0
- package/build/renderers/index.d.ts +1 -1
- package/build/zod/schemas.d.ts +2840 -2800
- package/build/zod/schemas.ts +440 -433
- package/package.json +2 -2
package/build/next/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type { Polling } from './feature/Polling';
|
|
|
7
7
|
export type { PollingOnError } from './feature/PollingOnError';
|
|
8
8
|
export type { ValidateAsync } from './feature/ValidateAsync';
|
|
9
9
|
export type { Align } from './misc/Align';
|
|
10
|
+
export type { AutocapitalizationType } from './misc/AutocapitalizationType';
|
|
10
11
|
export type { Context } from './misc/Context';
|
|
11
12
|
export type { Size } from './misc/Size';
|
|
12
13
|
export type { Size as Margin } from './misc/Size';
|
|
@@ -29,4 +29,9 @@ export type DecisionLayoutOption = {
|
|
|
29
29
|
* An image to represent the option.
|
|
30
30
|
*/
|
|
31
31
|
image?: ImageLayout;
|
|
32
|
+
/**
|
|
33
|
+
* An optional identifier to be used in custom renderers.
|
|
34
|
+
* @experimental This feature may be changed in the future without notice.
|
|
35
|
+
*/
|
|
36
|
+
tag?: string;
|
|
32
37
|
};
|
|
@@ -11,4 +11,9 @@ export type InstructionsLayoutItem = {
|
|
|
11
11
|
* The semantics of the instruction.
|
|
12
12
|
*/
|
|
13
13
|
context: Context;
|
|
14
|
+
/**
|
|
15
|
+
* An optional identifier to be used in custom renderers.
|
|
16
|
+
* @experimental This feature may be changed in the future without notice.
|
|
17
|
+
*/
|
|
18
|
+
tag?: string;
|
|
14
19
|
};
|
|
@@ -26,7 +26,7 @@ export type ListLayoutItem = {
|
|
|
26
26
|
/**
|
|
27
27
|
* A user-facing title.
|
|
28
28
|
*/
|
|
29
|
-
title
|
|
29
|
+
title?: string;
|
|
30
30
|
/**
|
|
31
31
|
* A user-facing subtitle.
|
|
32
32
|
*/
|
|
@@ -39,4 +39,9 @@ export type ListLayoutItem = {
|
|
|
39
39
|
* A user-facing subvalue.
|
|
40
40
|
*/
|
|
41
41
|
subvalue?: string;
|
|
42
|
+
/**
|
|
43
|
+
* An optional identifier to be used in custom renderers.
|
|
44
|
+
* @experimental This feature may be changed in the future without notice.
|
|
45
|
+
*/
|
|
46
|
+
tag?: string;
|
|
42
47
|
};
|
|
@@ -22,4 +22,9 @@ export type ReviewLayoutField = {
|
|
|
22
22
|
* Provide additional help information to the user.
|
|
23
23
|
*/
|
|
24
24
|
help?: Help;
|
|
25
|
+
/**
|
|
26
|
+
* An optional identifier to be used in custom renderers.
|
|
27
|
+
* @experimental This feature may be changed in the future without notice.
|
|
28
|
+
*/
|
|
29
|
+
tag?: string;
|
|
25
30
|
};
|
|
@@ -26,4 +26,9 @@ export type StatusListLayoutItem = {
|
|
|
26
26
|
* @experimental This feature may be changed in the future without notice.
|
|
27
27
|
*/
|
|
28
28
|
callToAction?: ItemCallToAction;
|
|
29
|
+
/**
|
|
30
|
+
* An optional identifier to be used in custom renderers.
|
|
31
|
+
* @experimental This feature may be changed in the future without notice.
|
|
32
|
+
*/
|
|
33
|
+
tag?: string;
|
|
29
34
|
};
|
|
@@ -82,6 +82,11 @@ export type StringSchema = {
|
|
|
82
82
|
*/
|
|
83
83
|
autocapitalization?: AutocapitalizationType;
|
|
84
84
|
/**
|
|
85
|
+
* Whether the device should automatically correct the user's input. It defaults to false.
|
|
86
|
+
* @experimental This feature may be changed in the future without notice.
|
|
87
|
+
*/
|
|
88
|
+
autocorrect?: boolean;
|
|
89
|
+
/**
|
|
85
90
|
* A unique id which can be used to refer to the schema.
|
|
86
91
|
*/
|
|
87
92
|
$id?: string;
|
|
@@ -90,4 +90,8 @@ export type Step = {
|
|
|
90
90
|
* The URL to use to fetch an updated step when the value of a schema marked refreshStepOnChange is updated.
|
|
91
91
|
*/
|
|
92
92
|
refreshUrl?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Specify a particular control to instruct how the step should be rendered. If the control is unknown, it will be ignored.
|
|
95
|
+
*/
|
|
96
|
+
control?: string;
|
|
93
97
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Context, Margin } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type AlertRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'alert';
|
|
4
8
|
control?: string;
|
|
5
9
|
context: Context;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Icon } from './Icon';
|
|
2
2
|
import { Image } from './Image';
|
|
3
|
-
|
|
3
|
+
import { BaseRendererProps } from './RendererProps';
|
|
4
|
+
export interface BaseInputRendererProps extends BaseRendererProps {
|
|
4
5
|
id: string;
|
|
5
6
|
control?: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
disabled: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated please use the `validationState` property instead
|
|
10
|
-
*/
|
|
11
|
-
error?: string;
|
|
12
9
|
help?: string;
|
|
13
10
|
placeholder?: string;
|
|
14
11
|
required: boolean;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Margin, Size } from './constants';
|
|
3
|
-
|
|
3
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
6
|
+
*/
|
|
7
|
+
export type BoxRendererProps = BaseRendererProps & {
|
|
4
8
|
type: 'box';
|
|
5
9
|
control?: string;
|
|
6
|
-
border: boolean;
|
|
7
10
|
children: ReactNode;
|
|
11
|
+
childrenProps: RendererProps[];
|
|
8
12
|
margin: Margin;
|
|
9
13
|
width: Size;
|
|
10
14
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Context, Margin, Size } from './constants';
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
2
3
|
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
3
5
|
* Known values for "control" are: 'primary' | 'secondary' | 'tertiary'.
|
|
4
6
|
*/
|
|
5
|
-
export type ButtonRendererProps = {
|
|
7
|
+
export type ButtonRendererProps = BaseRendererProps & {
|
|
6
8
|
type: 'button';
|
|
7
9
|
control?: string;
|
|
8
10
|
context: Context;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseInputRendererProps } from './BaseInputRendererProps';
|
|
2
|
+
/**
|
|
3
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
4
|
+
*/
|
|
2
5
|
export interface CheckboxInputRendererProps extends BaseInputRendererProps {
|
|
3
6
|
type: 'input-checkbox';
|
|
4
7
|
value: boolean;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Margin } from './constants';
|
|
3
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
3
4
|
export type Bias = 'none' | 'start' | 'end';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
7
|
+
*/
|
|
8
|
+
export type ColumnsRendererProps = BaseRendererProps & {
|
|
5
9
|
type: 'columns';
|
|
6
10
|
control?: string;
|
|
7
11
|
bias: Bias;
|
|
8
12
|
margin: Margin;
|
|
9
13
|
startChildren: ReactNode;
|
|
14
|
+
startChildrenProps: RendererProps[];
|
|
10
15
|
endChildren: ReactNode;
|
|
16
|
+
endChildrenProps: RendererProps[];
|
|
11
17
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export interface CoreContainerRendererProps extends BaseRendererProps {
|
|
3
7
|
type: 'container';
|
|
4
8
|
children: ReactNode;
|
|
9
|
+
childrenProps: RendererProps[];
|
|
5
10
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseInputRendererProps } from './BaseInputRendererProps';
|
|
2
|
+
/**
|
|
3
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
4
|
+
*/
|
|
2
5
|
export type DateInputRendererProps = BaseInputRendererProps & {
|
|
3
6
|
type: 'input-date';
|
|
4
7
|
autoComplete: string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Icon } from './Icon';
|
|
2
2
|
import { Image } from './Image';
|
|
3
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
4
|
import { Margin } from './constants';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
7
|
+
*/
|
|
8
|
+
export type DecisionRendererProps = BaseRendererProps & {
|
|
5
9
|
type: 'decision';
|
|
6
10
|
control?: string;
|
|
7
11
|
options: DecisionOption[];
|
|
@@ -10,10 +14,11 @@ export type DecisionRendererProps = {
|
|
|
10
14
|
};
|
|
11
15
|
export type DecisionOption = {
|
|
12
16
|
description?: string;
|
|
13
|
-
disabled
|
|
17
|
+
disabled: boolean;
|
|
14
18
|
href?: string;
|
|
15
19
|
icon?: Icon;
|
|
16
20
|
image?: Image;
|
|
17
21
|
title: string;
|
|
22
|
+
tag?: string;
|
|
18
23
|
onClick: () => void;
|
|
19
24
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Margin } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type DividerRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'divider';
|
|
4
8
|
control?: string;
|
|
5
9
|
margin: Margin;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Margin } from './constants';
|
|
3
|
-
|
|
3
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
6
|
+
*/
|
|
7
|
+
export type FormRendererProps = BaseRendererProps & {
|
|
4
8
|
type: 'form';
|
|
5
9
|
control?: string;
|
|
6
10
|
children: ReactNode;
|
|
11
|
+
childrenProps: RendererProps[];
|
|
7
12
|
margin: Margin;
|
|
8
13
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Align, Margin, Size } from './constants';
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
2
3
|
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
3
5
|
* Known values for "control" are: 'display'.
|
|
4
6
|
*/
|
|
5
|
-
export type HeadingRendererProps = {
|
|
7
|
+
export type HeadingRendererProps = BaseRendererProps & {
|
|
6
8
|
type: 'heading';
|
|
7
9
|
control?: string;
|
|
8
10
|
align: Align;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Margin, Size } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type ImageRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'image';
|
|
4
8
|
control?: string;
|
|
5
9
|
accessibilityDescription?: string;
|
|
@@ -7,7 +11,7 @@ export type ImageRendererProps = {
|
|
|
7
11
|
margin: Margin;
|
|
8
12
|
/**
|
|
9
13
|
* The `uri` property, if present should take precedence.
|
|
10
|
-
|
|
14
|
+
*/
|
|
11
15
|
url: string;
|
|
12
16
|
uri?: string;
|
|
13
17
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Context, Margin } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type InstructionsRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'instructions';
|
|
4
8
|
control?: string;
|
|
5
9
|
items: InstructionItem[];
|
|
@@ -9,4 +13,5 @@ export type InstructionsRendererProps = {
|
|
|
9
13
|
export type InstructionItem = {
|
|
10
14
|
context: Context;
|
|
11
15
|
text: string;
|
|
16
|
+
tag?: string;
|
|
12
17
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseInputRendererProps } from './BaseInputRendererProps';
|
|
2
|
+
/**
|
|
3
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
4
|
+
*/
|
|
2
5
|
export type IntegerInputRendererProps = BaseInputRendererProps & {
|
|
3
6
|
type: 'input-integer';
|
|
4
7
|
autoComplete: string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Icon } from "./Icon";
|
|
2
2
|
import { Image } from "./Image";
|
|
3
|
+
import { BaseRendererProps } from "./RendererProps";
|
|
3
4
|
import { Margin } from "./constants";
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
7
|
+
*/
|
|
8
|
+
export type ListRendererProps = BaseRendererProps & {
|
|
5
9
|
type: 'list';
|
|
6
10
|
callToAction?: ListCallToAction;
|
|
7
11
|
control?: string;
|
|
@@ -16,6 +20,7 @@ export type ListItem = {
|
|
|
16
20
|
subtitle?: string;
|
|
17
21
|
value?: string;
|
|
18
22
|
subvalue?: string;
|
|
23
|
+
tag?: string;
|
|
19
24
|
};
|
|
20
25
|
export type ListCallToAction = ListCallToActionLink | ListCallToActionAction;
|
|
21
26
|
export type ListCallToActionLink = {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Margin, Size } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type LoadingIndicatorRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'loading-indicator';
|
|
4
8
|
control?: string;
|
|
5
9
|
margin: Margin;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Align, Margin } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type MarkdownRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'markdown';
|
|
4
8
|
control?: string;
|
|
5
9
|
align: Align;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Margin } from './constants';
|
|
3
|
-
|
|
3
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
6
|
+
*/
|
|
7
|
+
export type ModalRendererProps = BaseRendererProps & {
|
|
4
8
|
type: 'modal';
|
|
5
9
|
control?: string;
|
|
6
10
|
content: {
|
|
7
|
-
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
childrenProps: RendererProps[];
|
|
8
13
|
title?: string;
|
|
9
14
|
};
|
|
10
15
|
margin: Margin;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BaseInputRendererProps } from './BaseInputRendererProps';
|
|
2
2
|
import { SelectInputRendererOption } from './SelectInputRendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
3
6
|
export type MultiSelectInputRendererProps = Omit<BaseInputRendererProps, 'required'> & {
|
|
4
7
|
type: 'input-multi-select';
|
|
5
8
|
autoComplete: string;
|
|
6
|
-
label?: string;
|
|
7
9
|
description?: string;
|
|
8
10
|
/** @experimental */
|
|
9
11
|
maxItems?: number;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonElement } from '../next';
|
|
2
|
+
import { UploadSource } from '../next/feature/UploadSource';
|
|
2
3
|
import { BaseInputRendererProps, ValidationResult } from './BaseInputRendererProps';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
6
|
+
*/
|
|
3
7
|
export type MultiUploadInputRendererProps = BaseInputRendererProps & {
|
|
4
8
|
type: 'input-upload-multi';
|
|
5
|
-
cameraConfig?:
|
|
9
|
+
cameraConfig?: JsonElement;
|
|
6
10
|
maxSize?: number;
|
|
7
11
|
minItems?: number;
|
|
8
12
|
maxItems?: number;
|
|
9
13
|
accepts?: string[];
|
|
14
|
+
source?: UploadSource;
|
|
10
15
|
uploadLabel?: string;
|
|
11
16
|
value: FileWithId[];
|
|
12
17
|
onInsertFile: (index: number, file: File) => Promise<string>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseInputRendererProps } from './BaseInputRendererProps';
|
|
2
|
+
/**
|
|
3
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
4
|
+
*/
|
|
2
5
|
export type NumberInputRendererProps = BaseInputRendererProps & {
|
|
3
6
|
type: 'input-number';
|
|
4
7
|
value: number | null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Align, Margin } from './constants';
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
2
3
|
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
3
5
|
* Known values for "control" are: 'copyable'.
|
|
4
6
|
*/
|
|
5
|
-
export type ParagraphRendererProps = {
|
|
7
|
+
export type ParagraphRendererProps = BaseRendererProps & {
|
|
6
8
|
type: 'paragraph';
|
|
7
9
|
control?: string;
|
|
8
10
|
align: Align;
|
|
@@ -27,13 +27,27 @@ import { ReviewRendererProps } from './ReviewRendererProps';
|
|
|
27
27
|
import { SearchRendererProps } from './SearchRendererProps';
|
|
28
28
|
import { SelectInputRendererProps } from './SelectInputRendererProps';
|
|
29
29
|
import { StatusListRendererProps } from './StatusListRendererProps';
|
|
30
|
-
import { StepRendererProps } from './StepRendererProps';
|
|
30
|
+
import { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from './StepRendererProps';
|
|
31
31
|
import { TextInputRendererProps } from './TextInputRendererProps';
|
|
32
32
|
import { UploadInputRendererProps } from './UploadInputRendererProps';
|
|
33
|
+
/**
|
|
34
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
35
|
+
*/
|
|
33
36
|
export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | RepeatableRendererProps | ReviewRendererProps | SearchRendererProps | SectionRendererProps | SelectInputRendererProps | StatusListRendererProps | StepRendererProps | TextInputRendererProps | UploadInputRendererProps;
|
|
34
37
|
export type Renderer<P extends RendererProps> = {
|
|
35
38
|
canRenderType: P['type'];
|
|
36
39
|
canRender?: (props: P) => boolean;
|
|
37
|
-
render: (props: P) => JSX.Element;
|
|
40
|
+
render: (props: P) => JSX.Element | null;
|
|
38
41
|
};
|
|
42
|
+
export type RendererContext = {
|
|
43
|
+
render: RenderFunction;
|
|
44
|
+
};
|
|
45
|
+
export type RenderFunction = (props: RendererProps | null) => JSX.Element | null;
|
|
39
46
|
export type Renderers = readonly (Renderer<StepRendererProps> | Renderer<CoreContainerRendererProps> | Renderer<AlertRendererProps> | Renderer<BoxRendererProps> | Renderer<ColumnsRendererProps> | Renderer<DecisionRendererProps> | Renderer<DividerRendererProps> | Renderer<FormRendererProps> | Renderer<HeadingRendererProps> | Renderer<InstructionsRendererProps> | Renderer<ListRendererProps> | Renderer<LoadingIndicatorRendererProps> | Renderer<MarkdownRendererProps> | Renderer<ImageRendererProps> | Renderer<ModalRendererProps> | Renderer<ParagraphRendererProps> | Renderer<ReviewRendererProps> | Renderer<SearchRendererProps> | Renderer<StatusListRendererProps> | Renderer<CheckboxInputRendererProps> | Renderer<ButtonRendererProps> | Renderer<DateInputRendererProps> | Renderer<HiddenRendererProps> | Renderer<IntegerInputRendererProps> | Renderer<NumberInputRendererProps> | Renderer<RepeatableRendererProps> | Renderer<SectionRendererProps> | Renderer<SelectInputRendererProps> | Renderer<MultiSelectInputRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
|
|
47
|
+
export type BaseRendererProps = {
|
|
48
|
+
uid: string;
|
|
49
|
+
render: RenderFunction;
|
|
50
|
+
httpClient: typeof fetch;
|
|
51
|
+
trackEvent: AnalyticsEventDispatcher;
|
|
52
|
+
stepLoadingState: LoadingState;
|
|
53
|
+
};
|
|
@@ -2,18 +2,20 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { Icon } from './Icon';
|
|
3
3
|
import { Image } from './Image';
|
|
4
4
|
import { ValidationResult } from './BaseInputRendererProps';
|
|
5
|
-
|
|
5
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
6
|
+
/**
|
|
7
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
8
|
+
*/
|
|
9
|
+
export type RepeatableRendererProps = BaseRendererProps & {
|
|
6
10
|
type: 'repeatable';
|
|
7
11
|
control?: string;
|
|
8
12
|
addItemTitle: string;
|
|
9
13
|
description?: string;
|
|
10
|
-
children: ReactNode
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
childrenProps: RendererProps[];
|
|
11
16
|
editableItem: ReactNode;
|
|
17
|
+
editableItemProps: RendererProps | null;
|
|
12
18
|
editItemTitle: string;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated please use the `validationState` property instead
|
|
15
|
-
*/
|
|
16
|
-
error?: string;
|
|
17
19
|
/** @experimental */
|
|
18
20
|
validationState: ValidationResult | undefined;
|
|
19
21
|
items: RepeatableItemRendererProps[];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Margin } from './constants';
|
|
2
|
-
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
5
|
+
*/
|
|
6
|
+
export type ReviewRendererProps = BaseRendererProps & {
|
|
3
7
|
type: 'review';
|
|
4
8
|
control?: string;
|
|
5
9
|
fields: ReviewField[];
|
|
@@ -12,6 +16,7 @@ export type ReviewField = {
|
|
|
12
16
|
label: string;
|
|
13
17
|
value: string;
|
|
14
18
|
rawValue?: string;
|
|
19
|
+
tag?: string;
|
|
15
20
|
};
|
|
16
21
|
export type ReviewCallToAction = {
|
|
17
22
|
accessibilityDescription?: string;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ImageLayout, SearchResult as SearchResultSpec } from '../next';
|
|
2
2
|
import { Margin } from './constants';
|
|
3
|
-
|
|
3
|
+
import { BaseRendererProps } from './RendererProps';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
6
|
+
*/
|
|
7
|
+
export type SearchRendererProps = BaseRendererProps & {
|
|
4
8
|
type: 'search';
|
|
5
9
|
control?: string;
|
|
6
10
|
id: string;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Icon } from './Icon';
|
|
3
3
|
import { Image } from './Image';
|
|
4
|
-
|
|
4
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
5
|
+
/**
|
|
6
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
7
|
+
*/
|
|
8
|
+
export type SectionRendererProps = BaseRendererProps & {
|
|
5
9
|
type: 'section';
|
|
6
10
|
control?: string;
|
|
7
11
|
title?: string;
|
|
8
12
|
description?: string;
|
|
9
13
|
help?: string;
|
|
10
14
|
children: ReactNode;
|
|
15
|
+
childrenProps: RendererProps[];
|
|
11
16
|
icon?: Icon;
|
|
12
17
|
image?: Image;
|
|
13
18
|
};
|
|
@@ -2,10 +2,15 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { BaseInputRendererProps } from './BaseInputRendererProps';
|
|
3
3
|
import { Icon } from './Icon';
|
|
4
4
|
import { Image } from './Image';
|
|
5
|
+
import { RendererProps } from './RendererProps';
|
|
6
|
+
/**
|
|
7
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
8
|
+
*/
|
|
5
9
|
export type SelectInputRendererProps = BaseInputRendererProps & {
|
|
6
10
|
type: 'input-select';
|
|
7
11
|
autoComplete: string;
|
|
8
12
|
children: ReactNode;
|
|
13
|
+
childrenProps: RendererProps | null;
|
|
9
14
|
options: SelectInputRendererOption[];
|
|
10
15
|
selectedIndex: number | null;
|
|
11
16
|
onSelect: (index: number | null) => void;
|
|
@@ -15,6 +20,6 @@ export type SelectInputRendererOption = {
|
|
|
15
20
|
disabled: boolean;
|
|
16
21
|
icon?: Icon;
|
|
17
22
|
image?: Image;
|
|
18
|
-
keywords
|
|
23
|
+
keywords: string[];
|
|
19
24
|
title: string;
|
|
20
25
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Icon } from './Icon';
|
|
2
|
+
import { BaseRendererProps } from './RendererProps';
|
|
2
3
|
import { Margin } from './constants';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @experimental Expect RendererProps to change as we align them across platform
|
|
6
|
+
*/
|
|
7
|
+
export type StatusListRendererProps = BaseRendererProps & {
|
|
4
8
|
type: 'status-list';
|
|
5
9
|
control?: string;
|
|
6
10
|
items: StatusListItem[];
|
|
@@ -13,6 +17,7 @@ export type StatusListItem = {
|
|
|
13
17
|
status?: 'done' | 'not-done' | 'pending';
|
|
14
18
|
title: string;
|
|
15
19
|
callToAction?: StatusListItemCallToAction;
|
|
20
|
+
tag?: string;
|
|
16
21
|
};
|
|
17
22
|
export type StatusListItemCallToAction = {
|
|
18
23
|
accessibilityDescription?: string;
|