@wise/dynamic-flow-client-internal 3.34.1 → 4.0.0-exp-zod-301f0be
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 +50 -51
- package/build/main.min.js +1 -1
- package/build/main.mjs +50 -51
- package/build/types/index.d.ts +1 -1
- package/package.json +5 -5
package/build/main.mjs
CHANGED
|
@@ -1025,16 +1025,16 @@ var mapStatusToSentiment = (validation) => {
|
|
|
1025
1025
|
};
|
|
1026
1026
|
var FieldInput_default = FieldInput;
|
|
1027
1027
|
|
|
1028
|
-
// ../renderers/src/
|
|
1028
|
+
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1029
1029
|
import { Checkbox } from "@transferwise/components";
|
|
1030
1030
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1031
|
-
var
|
|
1032
|
-
canRenderType: "input-
|
|
1031
|
+
var CheckboxInputRenderer = {
|
|
1032
|
+
canRenderType: "input-checkbox",
|
|
1033
1033
|
render: (props) => {
|
|
1034
1034
|
const _a = props, {
|
|
1035
1035
|
id,
|
|
1036
1036
|
control,
|
|
1037
|
-
|
|
1037
|
+
title = "",
|
|
1038
1038
|
description,
|
|
1039
1039
|
help,
|
|
1040
1040
|
type,
|
|
@@ -1043,18 +1043,18 @@ var BooleanInputRenderer = {
|
|
|
1043
1043
|
} = _a, rest = __objRest(_a, [
|
|
1044
1044
|
"id",
|
|
1045
1045
|
"control",
|
|
1046
|
-
"
|
|
1046
|
+
"title",
|
|
1047
1047
|
"description",
|
|
1048
1048
|
"help",
|
|
1049
1049
|
"type",
|
|
1050
1050
|
"validationState",
|
|
1051
1051
|
"value"
|
|
1052
1052
|
]);
|
|
1053
|
-
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
1053
|
+
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
1054
1054
|
return /* @__PURE__ */ jsx6(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx6(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
1055
1055
|
}
|
|
1056
1056
|
};
|
|
1057
|
-
var
|
|
1057
|
+
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1058
1058
|
|
|
1059
1059
|
// ../renderers/src/BoxRenderer.tsx
|
|
1060
1060
|
var import_classnames = __toESM(require_classnames());
|
|
@@ -1275,19 +1275,19 @@ var DateInputRenderer = {
|
|
|
1275
1275
|
const _a = props, {
|
|
1276
1276
|
id,
|
|
1277
1277
|
control,
|
|
1278
|
-
label,
|
|
1279
1278
|
description,
|
|
1280
1279
|
type,
|
|
1281
1280
|
help,
|
|
1281
|
+
title,
|
|
1282
1282
|
validationState,
|
|
1283
1283
|
value: initialValue
|
|
1284
1284
|
} = _a, rest = __objRest(_a, [
|
|
1285
1285
|
"id",
|
|
1286
1286
|
"control",
|
|
1287
|
-
"label",
|
|
1288
1287
|
"description",
|
|
1289
1288
|
"type",
|
|
1290
1289
|
"help",
|
|
1290
|
+
"title",
|
|
1291
1291
|
"validationState",
|
|
1292
1292
|
"value"
|
|
1293
1293
|
]);
|
|
@@ -1297,7 +1297,7 @@ var DateInputRenderer = {
|
|
|
1297
1297
|
FieldInput_default,
|
|
1298
1298
|
{
|
|
1299
1299
|
id,
|
|
1300
|
-
label,
|
|
1300
|
+
label: title,
|
|
1301
1301
|
description,
|
|
1302
1302
|
validation: validationState,
|
|
1303
1303
|
help,
|
|
@@ -1430,10 +1430,9 @@ var FormRenderer_default = FormRenderer;
|
|
|
1430
1430
|
import { Header as Header2 } from "@transferwise/components";
|
|
1431
1431
|
import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1432
1432
|
var FormSectionRenderer = {
|
|
1433
|
-
canRenderType: "
|
|
1433
|
+
canRenderType: "section",
|
|
1434
1434
|
render: ({ title, description, children }) => /* @__PURE__ */ jsxs5("fieldset", { children: [
|
|
1435
|
-
title &&
|
|
1436
|
-
/* @__PURE__ */ jsx20(
|
|
1435
|
+
title && /* @__PURE__ */ jsx20(
|
|
1437
1436
|
Header2,
|
|
1438
1437
|
{
|
|
1439
1438
|
as: "h2",
|
|
@@ -1642,7 +1641,7 @@ var IntegerInputRenderer = {
|
|
|
1642
1641
|
render: (props) => {
|
|
1643
1642
|
const _a = props, {
|
|
1644
1643
|
id,
|
|
1645
|
-
|
|
1644
|
+
title,
|
|
1646
1645
|
description,
|
|
1647
1646
|
help,
|
|
1648
1647
|
icon,
|
|
@@ -1653,7 +1652,7 @@ var IntegerInputRenderer = {
|
|
|
1653
1652
|
onChange
|
|
1654
1653
|
} = _a, rest = __objRest(_a, [
|
|
1655
1654
|
"id",
|
|
1656
|
-
"
|
|
1655
|
+
"title",
|
|
1657
1656
|
"description",
|
|
1658
1657
|
"help",
|
|
1659
1658
|
"icon",
|
|
@@ -1667,7 +1666,7 @@ var IntegerInputRenderer = {
|
|
|
1667
1666
|
FieldInput_default,
|
|
1668
1667
|
{
|
|
1669
1668
|
id,
|
|
1670
|
-
label,
|
|
1669
|
+
label: title,
|
|
1671
1670
|
description,
|
|
1672
1671
|
validation: validationState,
|
|
1673
1672
|
help,
|
|
@@ -1793,11 +1792,11 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1793
1792
|
autoComplete,
|
|
1794
1793
|
description,
|
|
1795
1794
|
disabled,
|
|
1796
|
-
label,
|
|
1797
1795
|
help,
|
|
1798
1796
|
options,
|
|
1799
1797
|
placeholder,
|
|
1800
1798
|
selectedIndices,
|
|
1799
|
+
title,
|
|
1801
1800
|
validationState,
|
|
1802
1801
|
onSelect
|
|
1803
1802
|
} = props;
|
|
@@ -1834,7 +1833,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1834
1833
|
FieldInput_default,
|
|
1835
1834
|
{
|
|
1836
1835
|
id,
|
|
1837
|
-
label,
|
|
1836
|
+
label: title,
|
|
1838
1837
|
help,
|
|
1839
1838
|
description,
|
|
1840
1839
|
validation: validationState,
|
|
@@ -1930,9 +1929,6 @@ var getFileType = (base64Url) => {
|
|
|
1930
1929
|
return void 0;
|
|
1931
1930
|
};
|
|
1932
1931
|
|
|
1933
|
-
// ../renderers/src/utils/getRandomId.ts
|
|
1934
|
-
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1935
|
-
|
|
1936
1932
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1937
1933
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1938
1934
|
var MultiUploadInputRenderer = {
|
|
@@ -1942,30 +1938,28 @@ var MultiUploadInputRenderer = {
|
|
|
1942
1938
|
id,
|
|
1943
1939
|
accepts,
|
|
1944
1940
|
help,
|
|
1945
|
-
|
|
1941
|
+
title,
|
|
1946
1942
|
description,
|
|
1947
1943
|
disabled,
|
|
1948
1944
|
maxSize,
|
|
1949
1945
|
maxItems,
|
|
1950
1946
|
uploadLabel,
|
|
1951
1947
|
validationState,
|
|
1952
|
-
|
|
1953
|
-
|
|
1948
|
+
value,
|
|
1949
|
+
onInsertFile,
|
|
1950
|
+
onRemoveFile
|
|
1954
1951
|
} = props;
|
|
1955
1952
|
const onUploadFile = async (formData) => {
|
|
1956
1953
|
const file = formData.get("file");
|
|
1957
|
-
|
|
1958
|
-
return onUpload(file, fileId).then(() => ({
|
|
1959
|
-
id: fileId
|
|
1960
|
-
}));
|
|
1954
|
+
return onInsertFile(value.length, file).then((newId) => ({ id: newId }));
|
|
1961
1955
|
};
|
|
1962
|
-
const onDeleteFile = async (fileId) =>
|
|
1956
|
+
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1963
1957
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1964
1958
|
return /* @__PURE__ */ jsx32(
|
|
1965
1959
|
UploadFieldInput_default,
|
|
1966
1960
|
{
|
|
1967
1961
|
id,
|
|
1968
|
-
label,
|
|
1962
|
+
label: title,
|
|
1969
1963
|
description,
|
|
1970
1964
|
validation: validationState,
|
|
1971
1965
|
help,
|
|
@@ -1999,7 +1993,7 @@ var NumberInputRenderer = {
|
|
|
1999
1993
|
render: (props) => {
|
|
2000
1994
|
const _a = props, {
|
|
2001
1995
|
id,
|
|
2002
|
-
|
|
1996
|
+
title,
|
|
2003
1997
|
description,
|
|
2004
1998
|
help,
|
|
2005
1999
|
icon,
|
|
@@ -2010,7 +2004,7 @@ var NumberInputRenderer = {
|
|
|
2010
2004
|
onChange
|
|
2011
2005
|
} = _a, rest = __objRest(_a, [
|
|
2012
2006
|
"id",
|
|
2013
|
-
"
|
|
2007
|
+
"title",
|
|
2014
2008
|
"description",
|
|
2015
2009
|
"help",
|
|
2016
2010
|
"icon",
|
|
@@ -2024,7 +2018,7 @@ var NumberInputRenderer = {
|
|
|
2024
2018
|
FieldInput_default,
|
|
2025
2019
|
{
|
|
2026
2020
|
id,
|
|
2027
|
-
label,
|
|
2021
|
+
label: title,
|
|
2028
2022
|
description,
|
|
2029
2023
|
validation: validationState,
|
|
2030
2024
|
help,
|
|
@@ -2493,7 +2487,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2493
2487
|
description,
|
|
2494
2488
|
disabled,
|
|
2495
2489
|
help,
|
|
2496
|
-
|
|
2490
|
+
title,
|
|
2497
2491
|
options,
|
|
2498
2492
|
selectedIndex,
|
|
2499
2493
|
validationState,
|
|
@@ -2504,7 +2498,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2504
2498
|
FieldInput_default,
|
|
2505
2499
|
{
|
|
2506
2500
|
id,
|
|
2507
|
-
label,
|
|
2501
|
+
label: title,
|
|
2508
2502
|
help,
|
|
2509
2503
|
description,
|
|
2510
2504
|
validation: validationState,
|
|
@@ -2541,7 +2535,7 @@ function TabInputRendererComponent(props) {
|
|
|
2541
2535
|
description,
|
|
2542
2536
|
disabled,
|
|
2543
2537
|
help,
|
|
2544
|
-
|
|
2538
|
+
title,
|
|
2545
2539
|
options,
|
|
2546
2540
|
selectedIndex,
|
|
2547
2541
|
validationState,
|
|
@@ -2557,7 +2551,7 @@ function TabInputRendererComponent(props) {
|
|
|
2557
2551
|
FieldInput_default,
|
|
2558
2552
|
{
|
|
2559
2553
|
id,
|
|
2560
|
-
label,
|
|
2554
|
+
label: title,
|
|
2561
2555
|
help,
|
|
2562
2556
|
description,
|
|
2563
2557
|
validation: validationState,
|
|
@@ -2594,7 +2588,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2594
2588
|
description,
|
|
2595
2589
|
disabled,
|
|
2596
2590
|
help,
|
|
2597
|
-
|
|
2591
|
+
title,
|
|
2598
2592
|
options,
|
|
2599
2593
|
placeholder,
|
|
2600
2594
|
required,
|
|
@@ -2635,7 +2629,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2635
2629
|
FieldInput_default,
|
|
2636
2630
|
{
|
|
2637
2631
|
id,
|
|
2638
|
-
label,
|
|
2632
|
+
label: title,
|
|
2639
2633
|
help,
|
|
2640
2634
|
description,
|
|
2641
2635
|
validation: validationState,
|
|
@@ -2669,7 +2663,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2669
2663
|
children,
|
|
2670
2664
|
description,
|
|
2671
2665
|
help,
|
|
2672
|
-
|
|
2666
|
+
title,
|
|
2673
2667
|
options,
|
|
2674
2668
|
selectedIndex,
|
|
2675
2669
|
validationState,
|
|
@@ -2685,7 +2679,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2685
2679
|
FieldInput_default,
|
|
2686
2680
|
{
|
|
2687
2681
|
id,
|
|
2688
|
-
label,
|
|
2682
|
+
label: title,
|
|
2689
2683
|
help,
|
|
2690
2684
|
description,
|
|
2691
2685
|
validation: validationState,
|
|
@@ -2864,7 +2858,7 @@ var TextInputRenderer = {
|
|
|
2864
2858
|
const _a = props, {
|
|
2865
2859
|
id,
|
|
2866
2860
|
control,
|
|
2867
|
-
|
|
2861
|
+
title,
|
|
2868
2862
|
description,
|
|
2869
2863
|
help,
|
|
2870
2864
|
error,
|
|
@@ -2879,7 +2873,7 @@ var TextInputRenderer = {
|
|
|
2879
2873
|
} = _a, rest = __objRest(_a, [
|
|
2880
2874
|
"id",
|
|
2881
2875
|
"control",
|
|
2882
|
-
"
|
|
2876
|
+
"title",
|
|
2883
2877
|
"description",
|
|
2884
2878
|
"help",
|
|
2885
2879
|
"error",
|
|
@@ -2906,7 +2900,7 @@ var TextInputRenderer = {
|
|
|
2906
2900
|
FieldInput_default,
|
|
2907
2901
|
{
|
|
2908
2902
|
id,
|
|
2909
|
-
label,
|
|
2903
|
+
label: title,
|
|
2910
2904
|
description,
|
|
2911
2905
|
validation: validationState,
|
|
2912
2906
|
help,
|
|
@@ -2919,11 +2913,16 @@ var TextInputRenderer_default = TextInputRenderer;
|
|
|
2919
2913
|
|
|
2920
2914
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2921
2915
|
import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
2916
|
+
|
|
2917
|
+
// ../renderers/src/utils/getRandomId.ts
|
|
2918
|
+
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
2919
|
+
|
|
2920
|
+
// ../renderers/src/UploadInputRenderer.tsx
|
|
2922
2921
|
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2923
2922
|
var UploadInputRenderer = {
|
|
2924
2923
|
canRenderType: "input-upload",
|
|
2925
2924
|
render: (props) => {
|
|
2926
|
-
const { id, accepts,
|
|
2925
|
+
const { id, accepts, title, description, disabled, maxSize, validationState, onUpload } = props;
|
|
2927
2926
|
const onUploadFile = async (formData) => {
|
|
2928
2927
|
const file = formData.get("file");
|
|
2929
2928
|
return onUpload(file).then(() => ({
|
|
@@ -2950,7 +2949,7 @@ var UploadInputRenderer = {
|
|
|
2950
2949
|
disabled,
|
|
2951
2950
|
fileTypes: getAcceptsString(accepts),
|
|
2952
2951
|
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
2953
|
-
uploadButtonTitle:
|
|
2952
|
+
uploadButtonTitle: title,
|
|
2954
2953
|
onDeleteFile,
|
|
2955
2954
|
onUploadFile
|
|
2956
2955
|
}
|
|
@@ -2968,7 +2967,7 @@ var LargeUploadRenderer = {
|
|
|
2968
2967
|
id,
|
|
2969
2968
|
accepts,
|
|
2970
2969
|
control,
|
|
2971
|
-
|
|
2970
|
+
title,
|
|
2972
2971
|
description,
|
|
2973
2972
|
disabled,
|
|
2974
2973
|
help,
|
|
@@ -2980,7 +2979,7 @@ var LargeUploadRenderer = {
|
|
|
2980
2979
|
"id",
|
|
2981
2980
|
"accepts",
|
|
2982
2981
|
"control",
|
|
2983
|
-
"
|
|
2982
|
+
"title",
|
|
2984
2983
|
"description",
|
|
2985
2984
|
"disabled",
|
|
2986
2985
|
"help",
|
|
@@ -3003,7 +3002,7 @@ var LargeUploadRenderer = {
|
|
|
3003
3002
|
FieldInput_default,
|
|
3004
3003
|
{
|
|
3005
3004
|
id,
|
|
3006
|
-
label,
|
|
3005
|
+
label: title,
|
|
3007
3006
|
description,
|
|
3008
3007
|
validation: validationState,
|
|
3009
3008
|
help,
|
|
@@ -3237,7 +3236,7 @@ import { jsx as jsx53, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
|
3237
3236
|
var ListRenderer = {
|
|
3238
3237
|
canRenderType: "list",
|
|
3239
3238
|
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ jsxs22("div", { className: getMargin(margin), children: [
|
|
3240
|
-
|
|
3239
|
+
title && /* @__PURE__ */ jsx53(Header7, { as: "h2", title, action: getListAction(callToAction) }),
|
|
3241
3240
|
items.map((props) => /* @__PURE__ */ jsx53(DesignSystemListItem, __spreadValues({}, props), props.title))
|
|
3242
3241
|
] })
|
|
3243
3242
|
};
|
|
@@ -3299,7 +3298,7 @@ var ListRenderer_default = ListRenderer;
|
|
|
3299
3298
|
// ../renderers/src/getWiseRenderers.ts
|
|
3300
3299
|
var getWiseRenderers = () => [
|
|
3301
3300
|
AlertRenderer_default,
|
|
3302
|
-
|
|
3301
|
+
CheckboxInputRenderer_default,
|
|
3303
3302
|
BoxRenderer_default,
|
|
3304
3303
|
ButtonRenderer_default,
|
|
3305
3304
|
ColumnsRenderer_default,
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { makeHttpClient as makeCustomFetch } from '@wise/dynamic-flow-client';
|
|
2
2
|
export type { DynamicFlowProps, DynamicFragmentController, Step, InitialAction, } from '@wise/dynamic-flow-client';
|
|
3
|
-
export type { Renderer, Renderers, AlertRendererProps,
|
|
3
|
+
export type { Renderer, Renderers, AlertRendererProps, CheckboxInputRendererProps, BoxRendererProps, ButtonRendererProps, ColumnsRendererProps, DateInputRendererProps, DecisionRendererProps, DividerRendererProps, FormRendererProps, SectionRendererProps, HeadingRendererProps, HiddenRendererProps, ImageRendererProps, InstructionsRendererProps, IntegerInputRendererProps, LoadingIndicatorRendererProps, MarkdownRendererProps, ModalRendererProps, MultiSelectInputRendererProps, MultiUploadInputRendererProps, NumberInputRendererProps, ParagraphRendererProps, RepeatableRendererProps, ReviewRendererProps, SearchRendererProps, SelectInputRendererProps, StatusListRendererProps, StepRendererProps, TextInputRendererProps, UploadInputRendererProps, } from '@wise/dynamic-flow-types/build/renderers';
|
|
4
4
|
export { JsonSchemaForm, isValidSchema } from '@wise/dynamic-flow-client';
|
|
5
5
|
export { default as translations } from './i18n';
|
|
6
6
|
export type { DynamicFlowLegacyProps as WiseDynamicFlowProps, DynamicFlowLegacyProps, DynamicFlowRevampProps, } from './dynamicFlow/DynamicFlow';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client-internal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-exp-zod-301f0be",
|
|
4
4
|
"description": "Dynamic Flow web client for Wise",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@testing-library/jest-dom": "6.6.3",
|
|
52
52
|
"@testing-library/react": "16.2.0",
|
|
53
53
|
"@testing-library/user-event": "14.6.1",
|
|
54
|
-
"@transferwise/components": "46.87.
|
|
54
|
+
"@transferwise/components": "46.87.0",
|
|
55
55
|
"@transferwise/formatting": "^2.13.0",
|
|
56
56
|
"@transferwise/icons": "3.18.0",
|
|
57
57
|
"@transferwise/neptune-css": "14.20.1",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"webpack": "5.97.1",
|
|
85
85
|
"@wise/dynamic-flow-fixtures": "0.0.1",
|
|
86
86
|
"@wise/dynamic-flow-renderers": "0.0.0",
|
|
87
|
-
"@wise/dynamic-flow-types": "
|
|
87
|
+
"@wise/dynamic-flow-types": "3.0.0-exp-zod-301f0be"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"@transferwise/components": "^46.31",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"classnames": "2.5.1",
|
|
101
|
-
"@wise/dynamic-flow-types": "
|
|
102
|
-
"@wise/dynamic-flow-client": "
|
|
101
|
+
"@wise/dynamic-flow-types": "3.0.0-exp-zod-301f0be",
|
|
102
|
+
"@wise/dynamic-flow-client": "4.0.0-exp-zod-301f0be"
|
|
103
103
|
},
|
|
104
104
|
"scripts": {
|
|
105
105
|
"dev": "pnpm build:visual-tests && storybook dev -p 3005",
|