@wise/dynamic-flow-client 4.11.3 → 4.12.0-experimental-fae3d25
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 +119 -107
- package/build/main.mjs +119 -107
- package/build/types/revamp/domain/components/AllOfComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/DecisionComponent.d.ts +2 -4
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ListComponent.d.ts +2 -4
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/RepeatableComponent.d.ts +4 -7
- package/build/types/revamp/domain/components/ReviewComponent.d.ts +2 -4
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +4 -5
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/TupleComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/features/summary/summary-utils.d.ts +2 -7
- package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +14 -28
- package/build/types/revamp/domain/mappers/schema/persistAsyncSchemaToComponent.d.ts +14 -28
- package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -2
- package/build/types/revamp/domain/mappers/utils/media-utils.d.ts +9 -0
- package/build/types/revamp/domain/types.d.ts +30 -6
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -2
- package/build/types/revamp/renderers/mappers/utils/mapMediaToLegacyProps.d.ts +9 -0
- package/package.json +3 -3
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Icon } from '@wise/dynamic-flow-types/build/next';
|
|
2
1
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
-
import type { BaseSchemaComponent,
|
|
2
|
+
import type { BaseSchemaComponent, InlineAlert, LocalValue, LocalValueArray, Media, OnValueChange, RepeatableSummary, SchemaComponent, UpdateComponent } from '../types';
|
|
4
3
|
export type RepeatableComponent = BaseSchemaComponent<LocalValueArray> & {
|
|
5
4
|
type: 'repeatable';
|
|
6
5
|
kind: 'input';
|
|
@@ -24,14 +23,12 @@ export type RepeatableComponent = BaseSchemaComponent<LocalValueArray> & {
|
|
|
24
23
|
type Summary = {
|
|
25
24
|
defaultTitle?: string;
|
|
26
25
|
defaultDescription?: string;
|
|
27
|
-
|
|
28
|
-
defaultImage?: Image;
|
|
26
|
+
defaultMedia?: Media;
|
|
29
27
|
providesTitle?: boolean;
|
|
30
28
|
providesDescription?: boolean;
|
|
31
|
-
|
|
32
|
-
providesImage?: boolean;
|
|
29
|
+
providesMedia?: boolean;
|
|
33
30
|
};
|
|
34
|
-
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "uid" | "analyticsId" | "schemaId" | "id" | "addItemTitle" | "alert" | "components" | "control" | "description" | "editItemTitle" | "errors" | "hidden" | "
|
|
31
|
+
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "uid" | "analyticsId" | "schemaId" | "id" | "addItemTitle" | "alert" | "components" | "control" | "description" | "editItemTitle" | "errors" | "hidden" | "media" | "maxItems" | "minItems" | "title"> & {
|
|
35
32
|
checks: IsInvalidCheck<LocalValueArray | null>[];
|
|
36
33
|
summary?: Summary;
|
|
37
34
|
summariser: (value: LocalValueArray | null) => RepeatableSummary;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { AdditionalInfo, BaseLayoutComponent, CallToAction, Image, InlineAlert } from '../types';
|
|
1
|
+
import type { AdditionalInfo, BaseLayoutComponent, CallToAction, InlineAlert, Media } from '../types';
|
|
3
2
|
export type ReviewComponent = BaseLayoutComponent & {
|
|
4
3
|
type: 'review';
|
|
5
4
|
kind: 'layout';
|
|
@@ -17,7 +16,6 @@ export type ReviewField = {
|
|
|
17
16
|
inlineAlert?: InlineAlert;
|
|
18
17
|
additionalInfo?: AdditionalInfo;
|
|
19
18
|
callToAction?: CallToAction;
|
|
20
|
-
|
|
21
|
-
image?: Image;
|
|
19
|
+
media?: Media;
|
|
22
20
|
};
|
|
23
21
|
export declare const createReviewComponent: (reviewProps: Pick<ReviewComponent, "uid" | "analyticsId" | "callToAction" | "control" | "fields" | "margin" | "title">) => ReviewComponent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
3
3
|
import type { SchemaOnChange } from '../features/schema-on-change/getSchemaOnChange';
|
|
4
4
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
5
|
-
import type { BaseInputComponent,
|
|
5
|
+
import type { BaseInputComponent, LocalValue, Media, OnValueChange, RepeatableSummary, SchemaComponent, UpdateComponent } from '../types';
|
|
6
6
|
export type SelectInputComponent = BaseInputComponent<LocalValue | null> & {
|
|
7
7
|
type: 'select';
|
|
8
8
|
kind: 'input';
|
|
@@ -17,12 +17,11 @@ export type SelectInputComponent = BaseInputComponent<LocalValue | null> & {
|
|
|
17
17
|
export type SelectInputOption = {
|
|
18
18
|
title: string;
|
|
19
19
|
description?: string;
|
|
20
|
-
|
|
21
|
-
image?: Image;
|
|
20
|
+
media?: Media;
|
|
22
21
|
keywords: string[];
|
|
23
22
|
disabled: boolean;
|
|
24
23
|
};
|
|
25
|
-
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "
|
|
24
|
+
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "placeholder" | "required" | "title"> & {
|
|
26
25
|
initialModel: Model;
|
|
27
26
|
options: (SelectInputOption & {
|
|
28
27
|
component: SchemaComponent;
|
|
@@ -13,7 +13,7 @@ export type TextInputComponent = BaseInputComponent<string | null> & {
|
|
|
13
13
|
validationAsyncState: ValidationAsyncState;
|
|
14
14
|
onChange: (value: string | null) => void;
|
|
15
15
|
};
|
|
16
|
-
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autocapitalization" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "
|
|
16
|
+
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autocapitalization" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "maxLength" | "media" | "minLength" | "placeholder" | "required" | "suggestions" | "title" | "value" | "validationAsyncState"> & {
|
|
17
17
|
checks: IsInvalidCheck<string | null>[];
|
|
18
18
|
performValidationAsync: PerformValidationAsync | undefined;
|
|
19
19
|
schemaOnChange: SchemaOnChange | undefined;
|
|
@@ -6,6 +6,6 @@ export type TupleComponent = BaseSchemaComponent<LocalValueArray> & {
|
|
|
6
6
|
alert?: InlineAlert;
|
|
7
7
|
getChildren: () => SchemaComponent[];
|
|
8
8
|
};
|
|
9
|
-
export declare const createTupleComponent: (tupleProps: Pick<TupleComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "
|
|
9
|
+
export declare const createTupleComponent: (tupleProps: Pick<TupleComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "media" | "schemaId" | "title"> & {
|
|
10
10
|
summariser: (value: LocalValue | null) => RepeatableSummary;
|
|
11
11
|
}) => TupleComponent;
|
|
@@ -14,7 +14,7 @@ export type UploadInputComponent = BaseInputComponent<File | null> & {
|
|
|
14
14
|
base64Value: string | null;
|
|
15
15
|
onUpload: (value: File | null) => Promise<void>;
|
|
16
16
|
};
|
|
17
|
-
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "uid" | "id" | "accepts" | "analyticsId" | "alert" | "autoComplete" | "cameraConfig" | "control" | "errors" | "description" | "disabled" | "format" | "help" | "hidden" | "
|
|
17
|
+
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "uid" | "id" | "accepts" | "analyticsId" | "alert" | "autoComplete" | "cameraConfig" | "control" | "errors" | "description" | "disabled" | "format" | "help" | "hidden" | "maxSize" | "media" | "placeholder" | "required" | "source" | "title" | "value"> & {
|
|
18
18
|
checks: IsInvalidCheck<File | null>[];
|
|
19
19
|
schemaOnChange: SchemaOnChange | undefined;
|
|
20
20
|
onValueChange: OnValueChange;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Model, Schema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { SchemaComponent, LocalValue, RepeatableSummary } from '../../types';
|
|
3
3
|
/** A summariser that accepts a schema and returns a function that can form a summary based on a value. */
|
|
4
4
|
export declare const getSummariser: <S extends Schema>(schema: S) => (value: LocalValue | null) => RepeatableSummary;
|
|
5
5
|
export declare const getConstSummary: (schema: Schema, model: Model | null) => RepeatableSummary;
|
|
6
6
|
export declare const summariseFromChildren: (components: SchemaComponent[]) => RepeatableSummary;
|
|
7
|
-
export declare const mergeSummaries: (summaryA: RepeatableSummary, summaryB: RepeatableSummary) =>
|
|
8
|
-
title: string | undefined;
|
|
9
|
-
description: string | undefined;
|
|
10
|
-
icon: Icon | undefined;
|
|
11
|
-
image: import("../../types").Image | undefined;
|
|
12
|
-
};
|
|
7
|
+
export declare const mergeSummaries: (summaryA: RepeatableSummary, summaryB: RepeatableSummary) => RepeatableSummary;
|
package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts
CHANGED
|
@@ -9,8 +9,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
9
9
|
description?: string;
|
|
10
10
|
help?: string;
|
|
11
11
|
hidden: boolean;
|
|
12
|
-
|
|
13
|
-
image?: import("../../../types").Image;
|
|
12
|
+
media?: import("../../../types").Media;
|
|
14
13
|
title?: string;
|
|
15
14
|
getLocalValue: () => import("../../../types").LocalValue;
|
|
16
15
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -36,8 +35,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
36
35
|
description?: string;
|
|
37
36
|
help?: string;
|
|
38
37
|
hidden: boolean;
|
|
39
|
-
|
|
40
|
-
image?: import("../../../types").Image;
|
|
38
|
+
media?: import("../../../types").Media;
|
|
41
39
|
title?: string;
|
|
42
40
|
getLocalValue: () => import("../../../types").LocalValue;
|
|
43
41
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -59,8 +57,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
59
57
|
description?: string;
|
|
60
58
|
help?: string;
|
|
61
59
|
hidden: boolean;
|
|
62
|
-
|
|
63
|
-
image?: import("../../../types").Image;
|
|
60
|
+
media?: import("../../../types").Media;
|
|
64
61
|
title?: string;
|
|
65
62
|
getLocalValue: () => boolean;
|
|
66
63
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -93,8 +90,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
93
90
|
description?: string;
|
|
94
91
|
help?: string;
|
|
95
92
|
hidden: boolean;
|
|
96
|
-
|
|
97
|
-
image?: import("../../../types").Image;
|
|
93
|
+
media?: import("../../../types").Media;
|
|
98
94
|
title?: string;
|
|
99
95
|
getLocalValue: () => import("../../../types").LocalValue;
|
|
100
96
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -113,8 +109,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
113
109
|
description?: string;
|
|
114
110
|
help?: string;
|
|
115
111
|
hidden: boolean;
|
|
116
|
-
|
|
117
|
-
image?: import("../../../types").Image;
|
|
112
|
+
media?: import("../../../types").Media;
|
|
118
113
|
title?: string;
|
|
119
114
|
getLocalValue: () => string | null;
|
|
120
115
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -150,8 +145,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
150
145
|
description?: string;
|
|
151
146
|
help?: string;
|
|
152
147
|
hidden: boolean;
|
|
153
|
-
|
|
154
|
-
image?: import("../../../types").Image;
|
|
148
|
+
media?: import("../../../types").Media;
|
|
155
149
|
title?: string;
|
|
156
150
|
getLocalValue: () => number | null;
|
|
157
151
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -186,8 +180,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
186
180
|
description?: string;
|
|
187
181
|
help?: string;
|
|
188
182
|
hidden: boolean;
|
|
189
|
-
|
|
190
|
-
image?: import("../../../types").Image;
|
|
183
|
+
media?: import("../../../types").Media;
|
|
191
184
|
title?: string;
|
|
192
185
|
getLocalValue: () => import("../../../types").LocalValueArray | null;
|
|
193
186
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -227,8 +220,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
227
220
|
description?: string;
|
|
228
221
|
help?: string;
|
|
229
222
|
hidden: boolean;
|
|
230
|
-
|
|
231
|
-
image?: import("../../../types").Image;
|
|
223
|
+
media?: import("../../../types").Media;
|
|
232
224
|
title?: string;
|
|
233
225
|
getLocalValue: () => File[];
|
|
234
226
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -277,8 +269,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
277
269
|
description?: string;
|
|
278
270
|
help?: string;
|
|
279
271
|
hidden: boolean;
|
|
280
|
-
|
|
281
|
-
image?: import("../../../types").Image;
|
|
272
|
+
media?: import("../../../types").Media;
|
|
282
273
|
title?: string;
|
|
283
274
|
getLocalValue: () => number | null;
|
|
284
275
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -313,8 +304,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
313
304
|
description?: string;
|
|
314
305
|
help?: string;
|
|
315
306
|
hidden: boolean;
|
|
316
|
-
|
|
317
|
-
image?: import("../../../types").Image;
|
|
307
|
+
media?: import("../../../types").Media;
|
|
318
308
|
title?: string;
|
|
319
309
|
getLocalValue: () => import("../../../types").LocalValueObject;
|
|
320
310
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -336,8 +326,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
336
326
|
description?: string;
|
|
337
327
|
help?: string;
|
|
338
328
|
hidden: boolean;
|
|
339
|
-
|
|
340
|
-
image?: import("../../../types").Image;
|
|
329
|
+
media?: import("../../../types").Media;
|
|
341
330
|
title?: string;
|
|
342
331
|
getLocalValue: () => import("../../../types").LocalValueArray;
|
|
343
332
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -372,8 +361,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
372
361
|
description?: string;
|
|
373
362
|
help?: string;
|
|
374
363
|
hidden: boolean;
|
|
375
|
-
|
|
376
|
-
image?: import("../../../types").Image;
|
|
364
|
+
media?: import("../../../types").Media;
|
|
377
365
|
title?: string;
|
|
378
366
|
getLocalValue: () => string | null;
|
|
379
367
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -411,8 +399,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
411
399
|
description?: string;
|
|
412
400
|
help?: string;
|
|
413
401
|
hidden: boolean;
|
|
414
|
-
|
|
415
|
-
image?: import("../../../types").Image;
|
|
402
|
+
media?: import("../../../types").Media;
|
|
416
403
|
title?: string;
|
|
417
404
|
getLocalValue: () => import("../../../types").LocalValueArray;
|
|
418
405
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -434,8 +421,7 @@ export declare const oneOfSchemaToComponent: (schemaMapperProps: SchemaMapperPro
|
|
|
434
421
|
description?: string;
|
|
435
422
|
help?: string;
|
|
436
423
|
hidden: boolean;
|
|
437
|
-
|
|
438
|
-
image?: import("../../../types").Image;
|
|
424
|
+
media?: import("../../../types").Media;
|
|
439
425
|
title?: string;
|
|
440
426
|
getLocalValue: () => File | null;
|
|
441
427
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -10,8 +10,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
10
10
|
description?: string;
|
|
11
11
|
help?: string;
|
|
12
12
|
hidden: boolean;
|
|
13
|
-
|
|
14
|
-
image?: import("../../types").Image;
|
|
13
|
+
media?: import("../../types").Media;
|
|
15
14
|
title?: string;
|
|
16
15
|
getLocalValue: () => import("../../types").LocalValue;
|
|
17
16
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -33,8 +32,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
33
32
|
description?: string;
|
|
34
33
|
help?: string;
|
|
35
34
|
hidden: boolean;
|
|
36
|
-
|
|
37
|
-
image?: import("../../types").Image;
|
|
35
|
+
media?: import("../../types").Media;
|
|
38
36
|
title?: string;
|
|
39
37
|
getLocalValue: () => boolean;
|
|
40
38
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -67,8 +65,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
67
65
|
description?: string;
|
|
68
66
|
help?: string;
|
|
69
67
|
hidden: boolean;
|
|
70
|
-
|
|
71
|
-
image?: import("../../types").Image;
|
|
68
|
+
media?: import("../../types").Media;
|
|
72
69
|
title?: string;
|
|
73
70
|
getLocalValue: () => import("../../types").LocalValue;
|
|
74
71
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -87,8 +84,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
87
84
|
description?: string;
|
|
88
85
|
help?: string;
|
|
89
86
|
hidden: boolean;
|
|
90
|
-
|
|
91
|
-
image?: import("../../types").Image;
|
|
87
|
+
media?: import("../../types").Media;
|
|
92
88
|
title?: string;
|
|
93
89
|
getLocalValue: () => string | null;
|
|
94
90
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -124,8 +120,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
124
120
|
description?: string;
|
|
125
121
|
help?: string;
|
|
126
122
|
hidden: boolean;
|
|
127
|
-
|
|
128
|
-
image?: import("../../types").Image;
|
|
123
|
+
media?: import("../../types").Media;
|
|
129
124
|
title?: string;
|
|
130
125
|
getLocalValue: () => number | null;
|
|
131
126
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -160,8 +155,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
160
155
|
description?: string;
|
|
161
156
|
help?: string;
|
|
162
157
|
hidden: boolean;
|
|
163
|
-
|
|
164
|
-
image?: import("../../types").Image;
|
|
158
|
+
media?: import("../../types").Media;
|
|
165
159
|
title?: string;
|
|
166
160
|
getLocalValue: () => import("../../types").LocalValueArray | null;
|
|
167
161
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -201,8 +195,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
201
195
|
description?: string;
|
|
202
196
|
help?: string;
|
|
203
197
|
hidden: boolean;
|
|
204
|
-
|
|
205
|
-
image?: import("../../types").Image;
|
|
198
|
+
media?: import("../../types").Media;
|
|
206
199
|
title?: string;
|
|
207
200
|
getLocalValue: () => File[];
|
|
208
201
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -251,8 +244,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
251
244
|
description?: string;
|
|
252
245
|
help?: string;
|
|
253
246
|
hidden: boolean;
|
|
254
|
-
|
|
255
|
-
image?: import("../../types").Image;
|
|
247
|
+
media?: import("../../types").Media;
|
|
256
248
|
title?: string;
|
|
257
249
|
getLocalValue: () => number | null;
|
|
258
250
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -287,8 +279,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
287
279
|
description?: string;
|
|
288
280
|
help?: string;
|
|
289
281
|
hidden: boolean;
|
|
290
|
-
|
|
291
|
-
image?: import("../../types").Image;
|
|
282
|
+
media?: import("../../types").Media;
|
|
292
283
|
title?: string;
|
|
293
284
|
getLocalValue: () => import("../../types").LocalValueObject;
|
|
294
285
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -310,8 +301,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
310
301
|
description?: string;
|
|
311
302
|
help?: string;
|
|
312
303
|
hidden: boolean;
|
|
313
|
-
|
|
314
|
-
image?: import("../../types").Image;
|
|
304
|
+
media?: import("../../types").Media;
|
|
315
305
|
title?: string;
|
|
316
306
|
getLocalValue: () => import("../../types").LocalValueArray;
|
|
317
307
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -346,8 +336,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
346
336
|
description?: string;
|
|
347
337
|
help?: string;
|
|
348
338
|
hidden: boolean;
|
|
349
|
-
|
|
350
|
-
image?: import("../../types").Image;
|
|
339
|
+
media?: import("../../types").Media;
|
|
351
340
|
title?: string;
|
|
352
341
|
getLocalValue: () => import("../../types").LocalValue;
|
|
353
342
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -385,8 +374,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
385
374
|
description?: string;
|
|
386
375
|
help?: string;
|
|
387
376
|
hidden: boolean;
|
|
388
|
-
|
|
389
|
-
image?: import("../../types").Image;
|
|
377
|
+
media?: import("../../types").Media;
|
|
390
378
|
title?: string;
|
|
391
379
|
getLocalValue: () => string | null;
|
|
392
380
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -424,8 +412,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
424
412
|
description?: string;
|
|
425
413
|
help?: string;
|
|
426
414
|
hidden: boolean;
|
|
427
|
-
|
|
428
|
-
image?: import("../../types").Image;
|
|
415
|
+
media?: import("../../types").Media;
|
|
429
416
|
title?: string;
|
|
430
417
|
getLocalValue: () => import("../../types").LocalValueArray;
|
|
431
418
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -447,8 +434,7 @@ export declare const persistAsyncSchemaToComponent: (schemaMapperProps: SchemaMa
|
|
|
447
434
|
description?: string;
|
|
448
435
|
help?: string;
|
|
449
436
|
hidden: boolean;
|
|
450
|
-
|
|
451
|
-
image?: import("../../types").Image;
|
|
437
|
+
media?: import("../../types").Media;
|
|
452
438
|
title?: string;
|
|
453
439
|
getLocalValue: () => File | null;
|
|
454
440
|
getSubmittableValueSync: () => import("@wise/dynamic-flow-types/build/next").Model;
|
|
@@ -12,9 +12,8 @@ export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
|
|
|
12
12
|
disabled: boolean;
|
|
13
13
|
errors: string[] | undefined;
|
|
14
14
|
hidden: boolean;
|
|
15
|
-
icon: import("@wise/dynamic-flow-types/build/next").Icon | undefined;
|
|
16
|
-
image: import("../../../types").Image | undefined;
|
|
17
15
|
keywords: string[] | undefined;
|
|
16
|
+
media: import("../../../types").Media | undefined;
|
|
18
17
|
required: boolean;
|
|
19
18
|
title: string | undefined;
|
|
20
19
|
onPersistAsync: import("../../../types").OnPersistAsync | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Icon, Image, Media as SpecMedia } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { Media } from '../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
media?: SpecMedia;
|
|
5
|
+
icon?: Icon;
|
|
6
|
+
image?: Image;
|
|
7
|
+
};
|
|
8
|
+
export declare const getDomainLayerMedia: ({ icon, image, media }: Props) => Media | undefined;
|
|
9
|
+
export {};
|
|
@@ -91,6 +91,33 @@ export type Image = {
|
|
|
91
91
|
uri: string;
|
|
92
92
|
accessibilityDescription?: string;
|
|
93
93
|
};
|
|
94
|
+
export type Media = MediaAvatar | MediaImage | LegacyMedia;
|
|
95
|
+
type MediaAvatar = {
|
|
96
|
+
type: 'avatar';
|
|
97
|
+
content: AvatarContent[];
|
|
98
|
+
accessibilityDescription?: string;
|
|
99
|
+
};
|
|
100
|
+
type AvatarContent = AvatarTextContent | AvatarUriContent;
|
|
101
|
+
type AvatarTextContent = {
|
|
102
|
+
type: 'text';
|
|
103
|
+
text: string;
|
|
104
|
+
badgeUri?: string;
|
|
105
|
+
};
|
|
106
|
+
type AvatarUriContent = {
|
|
107
|
+
type: 'uri';
|
|
108
|
+
uri: string;
|
|
109
|
+
badgeUri?: string;
|
|
110
|
+
};
|
|
111
|
+
type MediaImage = {
|
|
112
|
+
type: 'image';
|
|
113
|
+
uri: string;
|
|
114
|
+
accessibilityDescription?: string;
|
|
115
|
+
};
|
|
116
|
+
type LegacyMedia = {
|
|
117
|
+
type: 'legacy';
|
|
118
|
+
icon?: Icon;
|
|
119
|
+
image?: Image;
|
|
120
|
+
};
|
|
94
121
|
export type PersistableComponent = {
|
|
95
122
|
onPersistAsync: () => void;
|
|
96
123
|
};
|
|
@@ -101,8 +128,7 @@ export type BaseSchemaComponent<LV extends LocalValue> = BaseComponent & {
|
|
|
101
128
|
description?: string;
|
|
102
129
|
help?: string;
|
|
103
130
|
hidden: boolean;
|
|
104
|
-
|
|
105
|
-
image?: Image;
|
|
131
|
+
media?: Media;
|
|
106
132
|
title?: string;
|
|
107
133
|
getLocalValue: () => LV;
|
|
108
134
|
/** Gets the (potentially incomplete) form model, synchronously. It will NOT wait for in-flight requests and will not include base64 encoded values. It can be used in places where accuracy is not required (such as matching algorithms) but on submission, you should always prefer getSubmittableValue */
|
|
@@ -142,15 +168,13 @@ export type Suggestions = {
|
|
|
142
168
|
export type SuggestionsValue = {
|
|
143
169
|
label: string;
|
|
144
170
|
value?: JsonElement;
|
|
145
|
-
|
|
146
|
-
image?: Image;
|
|
171
|
+
media?: Media;
|
|
147
172
|
tag?: string;
|
|
148
173
|
};
|
|
149
174
|
export type RepeatableSummary = {
|
|
150
175
|
title?: string;
|
|
151
176
|
description?: string;
|
|
152
|
-
|
|
153
|
-
image?: Image;
|
|
177
|
+
media?: Media;
|
|
154
178
|
};
|
|
155
179
|
export type PersistedState = {
|
|
156
180
|
id?: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ValidationResult } from '@wise/dynamic-flow-types/build/renderers';
|
|
2
2
|
import type { BaseInputComponent, LocalValue } from '../../../domain/types';
|
|
3
3
|
export declare const inputComponentToProps: <T extends string, V extends LocalValue>(component: BaseInputComponent<V>, type: T) => {
|
|
4
|
+
media?: import("@wise/dynamic-flow-types/build/renderers").Media;
|
|
5
|
+
icon?: import("@wise/dynamic-flow-types/build/renderers").Icon;
|
|
6
|
+
image?: import("@wise/dynamic-flow-types/build/renderers").Image;
|
|
4
7
|
uid: string;
|
|
5
8
|
analyticsId: string | undefined;
|
|
6
9
|
type: T;
|
|
@@ -9,9 +12,7 @@ export declare const inputComponentToProps: <T extends string, V extends LocalVa
|
|
|
9
12
|
disabled: boolean;
|
|
10
13
|
error: string | undefined;
|
|
11
14
|
help: string | undefined;
|
|
12
|
-
icon: import("@wise/dynamic-flow-types/build/renderers").Icon | undefined;
|
|
13
15
|
id: string;
|
|
14
|
-
image: import("../../../domain/types").Image | undefined;
|
|
15
16
|
placeholder: string | undefined;
|
|
16
17
|
required: boolean;
|
|
17
18
|
title: string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Media as DomainMedia } from '../../../domain/types';
|
|
2
|
+
import type { Icon, Image, Media as RendererMedia } from '@wise/dynamic-flow-types/build/renderers';
|
|
3
|
+
type MediaWithLegacyIconImage = {
|
|
4
|
+
media?: RendererMedia;
|
|
5
|
+
icon?: Icon;
|
|
6
|
+
image?: Image;
|
|
7
|
+
};
|
|
8
|
+
export declare const mapMediaToLegacyProps: (media: DomainMedia | undefined) => MediaWithLegacyIconImage;
|
|
9
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0-experimental-fae3d25",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@testing-library/jest-dom": "6.6.4",
|
|
47
47
|
"@testing-library/react": "16.3.0",
|
|
48
48
|
"@testing-library/user-event": "14.6.1",
|
|
49
|
-
"@transferwise/components": "
|
|
49
|
+
"@transferwise/components": "0.0.0-experimental-4ee52fa",
|
|
50
50
|
"@transferwise/formatting": "^2.13.4",
|
|
51
51
|
"@transferwise/icons": "3.22.3",
|
|
52
52
|
"@transferwise/neptune-css": "14.24.5",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"classnames": "2.5.1",
|
|
96
96
|
"react-webcam": "^7.2.0",
|
|
97
97
|
"screenfull": "^5.2.0",
|
|
98
|
-
"@wise/dynamic-flow-types": "3.
|
|
98
|
+
"@wise/dynamic-flow-types": "3.10.0-experimental-fae3d25"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|