@wise/dynamic-flow-client 4.13.0 → 4.14.1-experimental-048a281
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.css +7 -9
- package/build/main.js +46 -9
- package/build/main.mjs +46 -9
- package/build/types/revamp/domain/components/step/StepDomainComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/step/ToolbarComponent.d.ts +21 -0
- package/build/types/revamp/domain/mappers/mapToolbarToComponent.d.ts +4 -0
- package/package.json +14 -14
package/build/main.css
CHANGED
|
@@ -346,15 +346,13 @@ button.df-back-btn {
|
|
|
346
346
|
width: 300px;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
.df-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
.df-back-btn:active .tw-avatar__content {
|
|
357
|
-
background-color: var(--color-background-neutral-active);
|
|
349
|
+
.df-toolbar {
|
|
350
|
+
display: flex;
|
|
351
|
+
gap: 0.25em;
|
|
352
|
+
overflow-x: auto;
|
|
353
|
+
padding: 0.5em;
|
|
354
|
+
padding-right: 0;
|
|
355
|
+
margin-left: auto;
|
|
358
356
|
}
|
|
359
357
|
.splash-screen {
|
|
360
358
|
display: flex;
|
package/build/main.js
CHANGED
|
@@ -1297,6 +1297,15 @@ var isStringSchema = (schema) => "type" in schema && schema.type === "string";
|
|
|
1297
1297
|
var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.format === "base64url";
|
|
1298
1298
|
var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
|
|
1299
1299
|
|
|
1300
|
+
// src/revamp/renderers/mappers/utils/pick.ts
|
|
1301
|
+
function pick(obj, ...keys) {
|
|
1302
|
+
const result = {};
|
|
1303
|
+
keys.forEach((key) => {
|
|
1304
|
+
result[key] = obj[key];
|
|
1305
|
+
});
|
|
1306
|
+
return result;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1300
1309
|
// src/revamp/renderers/stepComponentToProps.ts
|
|
1301
1310
|
var stepComponentToProps = (component, rendererMapperProps) => {
|
|
1302
1311
|
const {
|
|
@@ -1320,6 +1329,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1320
1329
|
back,
|
|
1321
1330
|
control,
|
|
1322
1331
|
description,
|
|
1332
|
+
toolbar: getToolbarProps(component.toolbar, rendererMapperProps),
|
|
1323
1333
|
error,
|
|
1324
1334
|
loadingState,
|
|
1325
1335
|
step,
|
|
@@ -1331,15 +1341,17 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1331
1341
|
}
|
|
1332
1342
|
}, rendererMapperProps);
|
|
1333
1343
|
};
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1344
|
+
var getToolbarProps = (toolbar, rendererMapperProps) => {
|
|
1345
|
+
if (!toolbar) {
|
|
1346
|
+
return void 0;
|
|
1347
|
+
}
|
|
1348
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(toolbar, "uid", "control", "type")), {
|
|
1349
|
+
type: "toolbar",
|
|
1350
|
+
items: toolbar.items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
1351
|
+
disabled: item.disabled || rendererMapperProps.stepLoadingState !== "idle"
|
|
1352
|
+
}))
|
|
1353
|
+
}), rendererMapperProps);
|
|
1354
|
+
};
|
|
1343
1355
|
|
|
1344
1356
|
// src/revamp/renderers/mappers/alertComponentToProps.ts
|
|
1345
1357
|
var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
@@ -6130,6 +6142,29 @@ var mapStepSchemas = (uid, step, stepLocalValue, mapperProps, referencedSchemaId
|
|
|
6130
6142
|
});
|
|
6131
6143
|
};
|
|
6132
6144
|
|
|
6145
|
+
// src/revamp/domain/mappers/mapToolbarToComponent.ts
|
|
6146
|
+
var mapToolbarToComponent = (uid, toolbar, mapperProps) => {
|
|
6147
|
+
if (!toolbar) {
|
|
6148
|
+
return void 0;
|
|
6149
|
+
}
|
|
6150
|
+
const { onBehavior } = mapperProps;
|
|
6151
|
+
return __spreadProps(__spreadValues({}, toolbar), {
|
|
6152
|
+
type: "toolbar",
|
|
6153
|
+
uid: `${uid}.toolbar`,
|
|
6154
|
+
items: toolbar.items.map((item) => {
|
|
6155
|
+
const context = item.context ? mapLegacyContext(item.context) : void 0;
|
|
6156
|
+
const behavior = getDomainLayerBehavior({ behavior: item.behavior }, []);
|
|
6157
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
6158
|
+
context: context ? mapLegacyContext(context) : void 0,
|
|
6159
|
+
disabled: !!item.disabled,
|
|
6160
|
+
onClick: () => {
|
|
6161
|
+
void onBehavior(behavior);
|
|
6162
|
+
}
|
|
6163
|
+
});
|
|
6164
|
+
})
|
|
6165
|
+
});
|
|
6166
|
+
};
|
|
6167
|
+
|
|
6133
6168
|
// src/revamp/domain/mappers/mapStepToComponent.ts
|
|
6134
6169
|
var mapStepToComponent = (_a) => {
|
|
6135
6170
|
var _b = _a, {
|
|
@@ -6192,9 +6227,11 @@ var mapStepToComponent = (_a) => {
|
|
|
6192
6227
|
const layoutComponents = layout.map(
|
|
6193
6228
|
(layoutComponent, index) => mapLayoutToComponent(`${uid}.layout-${index}`, layoutComponent, mapperProps, schemaComponents)
|
|
6194
6229
|
);
|
|
6230
|
+
const toolbar = mapToolbarToComponent(uid, step.toolbar, mapperProps);
|
|
6195
6231
|
const stepComponent = createStepComponent({
|
|
6196
6232
|
uid,
|
|
6197
6233
|
back,
|
|
6234
|
+
toolbar,
|
|
6198
6235
|
layoutComponents,
|
|
6199
6236
|
schemaComponents,
|
|
6200
6237
|
control,
|
package/build/main.mjs
CHANGED
|
@@ -1254,6 +1254,15 @@ var isStringSchema = (schema) => "type" in schema && schema.type === "string";
|
|
|
1254
1254
|
var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.format === "base64url";
|
|
1255
1255
|
var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
|
|
1256
1256
|
|
|
1257
|
+
// src/revamp/renderers/mappers/utils/pick.ts
|
|
1258
|
+
function pick(obj, ...keys) {
|
|
1259
|
+
const result = {};
|
|
1260
|
+
keys.forEach((key) => {
|
|
1261
|
+
result[key] = obj[key];
|
|
1262
|
+
});
|
|
1263
|
+
return result;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1257
1266
|
// src/revamp/renderers/stepComponentToProps.ts
|
|
1258
1267
|
var stepComponentToProps = (component, rendererMapperProps) => {
|
|
1259
1268
|
const {
|
|
@@ -1277,6 +1286,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1277
1286
|
back,
|
|
1278
1287
|
control,
|
|
1279
1288
|
description,
|
|
1289
|
+
toolbar: getToolbarProps(component.toolbar, rendererMapperProps),
|
|
1280
1290
|
error,
|
|
1281
1291
|
loadingState,
|
|
1282
1292
|
step,
|
|
@@ -1288,15 +1298,17 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1288
1298
|
}
|
|
1289
1299
|
}, rendererMapperProps);
|
|
1290
1300
|
};
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
}
|
|
1301
|
+
var getToolbarProps = (toolbar, rendererMapperProps) => {
|
|
1302
|
+
if (!toolbar) {
|
|
1303
|
+
return void 0;
|
|
1304
|
+
}
|
|
1305
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(toolbar, "uid", "control", "type")), {
|
|
1306
|
+
type: "toolbar",
|
|
1307
|
+
items: toolbar.items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
1308
|
+
disabled: item.disabled || rendererMapperProps.stepLoadingState !== "idle"
|
|
1309
|
+
}))
|
|
1310
|
+
}), rendererMapperProps);
|
|
1311
|
+
};
|
|
1300
1312
|
|
|
1301
1313
|
// src/revamp/renderers/mappers/alertComponentToProps.ts
|
|
1302
1314
|
var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
@@ -6087,6 +6099,29 @@ var mapStepSchemas = (uid, step, stepLocalValue, mapperProps, referencedSchemaId
|
|
|
6087
6099
|
});
|
|
6088
6100
|
};
|
|
6089
6101
|
|
|
6102
|
+
// src/revamp/domain/mappers/mapToolbarToComponent.ts
|
|
6103
|
+
var mapToolbarToComponent = (uid, toolbar, mapperProps) => {
|
|
6104
|
+
if (!toolbar) {
|
|
6105
|
+
return void 0;
|
|
6106
|
+
}
|
|
6107
|
+
const { onBehavior } = mapperProps;
|
|
6108
|
+
return __spreadProps(__spreadValues({}, toolbar), {
|
|
6109
|
+
type: "toolbar",
|
|
6110
|
+
uid: `${uid}.toolbar`,
|
|
6111
|
+
items: toolbar.items.map((item) => {
|
|
6112
|
+
const context = item.context ? mapLegacyContext(item.context) : void 0;
|
|
6113
|
+
const behavior = getDomainLayerBehavior({ behavior: item.behavior }, []);
|
|
6114
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
6115
|
+
context: context ? mapLegacyContext(context) : void 0,
|
|
6116
|
+
disabled: !!item.disabled,
|
|
6117
|
+
onClick: () => {
|
|
6118
|
+
void onBehavior(behavior);
|
|
6119
|
+
}
|
|
6120
|
+
});
|
|
6121
|
+
})
|
|
6122
|
+
});
|
|
6123
|
+
};
|
|
6124
|
+
|
|
6090
6125
|
// src/revamp/domain/mappers/mapStepToComponent.ts
|
|
6091
6126
|
var mapStepToComponent = (_a) => {
|
|
6092
6127
|
var _b = _a, {
|
|
@@ -6149,9 +6184,11 @@ var mapStepToComponent = (_a) => {
|
|
|
6149
6184
|
const layoutComponents = layout.map(
|
|
6150
6185
|
(layoutComponent, index) => mapLayoutToComponent(`${uid}.layout-${index}`, layoutComponent, mapperProps, schemaComponents)
|
|
6151
6186
|
);
|
|
6187
|
+
const toolbar = mapToolbarToComponent(uid, step.toolbar, mapperProps);
|
|
6152
6188
|
const stepComponent = createStepComponent({
|
|
6153
6189
|
uid,
|
|
6154
6190
|
back,
|
|
6191
|
+
toolbar,
|
|
6155
6192
|
layoutComponents,
|
|
6156
6193
|
schemaComponents,
|
|
6157
6194
|
control,
|
|
@@ -6,10 +6,12 @@ import type { StepPolling } from '../../features/polling/getStepPolling';
|
|
|
6
6
|
import { StepRefreshAfter } from '../../features/refreshAfter/getStepRefreshAfter';
|
|
7
7
|
import { ModalComponent } from '../ModalComponent';
|
|
8
8
|
import { ExternalConfirmationComponent } from './ExternalConfirmationComponent';
|
|
9
|
+
import { ToolbarComponent } from './ToolbarComponent';
|
|
9
10
|
export type StepDomainComponent = BaseComponent & {
|
|
10
11
|
type: 'step';
|
|
11
12
|
kind: 'step';
|
|
12
13
|
back?: BackNavigation;
|
|
14
|
+
toolbar?: ToolbarComponent;
|
|
13
15
|
layoutComponents: LayoutComponent[];
|
|
14
16
|
schemaComponents: SchemaComponent[];
|
|
15
17
|
control?: string;
|
|
@@ -38,7 +40,7 @@ type BackNavigation = {
|
|
|
38
40
|
title?: string;
|
|
39
41
|
onClick: () => void;
|
|
40
42
|
};
|
|
41
|
-
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "layoutComponents" | "schemaComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
|
|
43
|
+
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "toolbar" | "layoutComponents" | "schemaComponents" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
|
|
42
44
|
stepPolling?: StepPolling;
|
|
43
45
|
stepRefreshAfter?: StepRefreshAfter;
|
|
44
46
|
updateComponent: UpdateComponent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Media } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import { Context } from '../../types';
|
|
3
|
+
export type ToolbarComponent = {
|
|
4
|
+
type: 'toolbar';
|
|
5
|
+
uid: string;
|
|
6
|
+
control?: string;
|
|
7
|
+
items: ToolbarItem[];
|
|
8
|
+
};
|
|
9
|
+
type ToolbarItem = ToolbarButton;
|
|
10
|
+
type ToolbarButton = {
|
|
11
|
+
type: 'toolbar-button';
|
|
12
|
+
title: string;
|
|
13
|
+
accessibilityDescription?: string;
|
|
14
|
+
media?: Media;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
control?: string;
|
|
17
|
+
context?: Context;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
analyticsId?: string;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import { ToolbarComponent } from '../components/step/ToolbarComponent';
|
|
3
|
+
import type { MapperProps } from './schema/types';
|
|
4
|
+
export declare const mapToolbarToComponent: (uid: string, toolbar: Step["toolbar"], mapperProps: MapperProps) => ToolbarComponent | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.1-experimental-048a281",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"@babel/preset-typescript": "7.27.1",
|
|
39
39
|
"@chromatic-com/storybook": "4.1.0",
|
|
40
40
|
"@formatjs/cli": "^6.7.2",
|
|
41
|
-
"@storybook/addon-a11y": "^9.1.
|
|
42
|
-
"@storybook/addon-docs": "^9.1.
|
|
43
|
-
"@storybook/addon-links": "^9.1.
|
|
44
|
-
"@storybook/react-vite": "9.1.
|
|
41
|
+
"@storybook/addon-a11y": "^9.1.2",
|
|
42
|
+
"@storybook/addon-docs": "^9.1.2",
|
|
43
|
+
"@storybook/addon-links": "^9.1.2",
|
|
44
|
+
"@storybook/react-vite": "9.1.2",
|
|
45
45
|
"@testing-library/dom": "10.4.1",
|
|
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": "46.
|
|
49
|
+
"@transferwise/components": "46.104.0",
|
|
50
50
|
"@transferwise/formatting": "^2.13.4",
|
|
51
51
|
"@transferwise/icons": "3.22.3",
|
|
52
52
|
"@transferwise/neptune-css": "14.24.5",
|
|
53
53
|
"@types/jest": "30.0.0",
|
|
54
|
-
"@types/node": "22.17.
|
|
54
|
+
"@types/node": "22.17.1",
|
|
55
55
|
"@types/react": "18.3.23",
|
|
56
56
|
"@types/react-dom": "18.3.7",
|
|
57
57
|
"@types/react-intl": "3.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@wise/components-theming": "^1.6.4",
|
|
60
60
|
"babel-jest": "30.0.5",
|
|
61
61
|
"esbuild": "0.25.8",
|
|
62
|
-
"eslint-plugin-storybook": "9.1.
|
|
62
|
+
"eslint-plugin-storybook": "9.1.2",
|
|
63
63
|
"jest": "30.0.5",
|
|
64
64
|
"jest-environment-jsdom": "30.0.5",
|
|
65
65
|
"jest-fetch-mock": "^3.0.3",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"react": "18.3.1",
|
|
72
72
|
"react-dom": "18.3.1",
|
|
73
73
|
"react-intl": "6.8.9",
|
|
74
|
-
"storybook": "^9.1.
|
|
75
|
-
"stylelint": "16.23.
|
|
74
|
+
"storybook": "^9.1.2",
|
|
75
|
+
"stylelint": "16.23.1",
|
|
76
76
|
"stylelint-config-standard": "36.0.1",
|
|
77
77
|
"stylelint-no-unsupported-browser-features": "8.0.4",
|
|
78
78
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
79
|
-
"tsx": "4.20.
|
|
79
|
+
"tsx": "4.20.4",
|
|
80
80
|
"typescript": "5.9.2",
|
|
81
|
-
"@wise/dynamic-flow-
|
|
82
|
-
"@wise/dynamic-flow-
|
|
81
|
+
"@wise/dynamic-flow-renderers": "0.0.0",
|
|
82
|
+
"@wise/dynamic-flow-fixtures": "0.0.1"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@transferwise/components": "^46.92.0",
|
|
@@ -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.12.0-experimental-048a281"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|