@wise/dynamic-flow-client 2.8.5 → 2.8.7
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 +57 -44
- package/build/main.min.js +1 -1
- package/build/types/legacy/jsonSchemaForm/help/Help.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +1 -1
- package/build/types/legacy/layout/paragraph/DynamicParagraph.d.ts +2 -2
- package/build/types/revamp/domain/components/AlertComponent.d.ts +1 -7
- package/build/types/revamp/domain/components/BoxComponent.d.ts +4 -11
- package/build/types/revamp/domain/components/ButtonComponent.d.ts +4 -13
- package/build/types/revamp/domain/components/ColumnsComponent.d.ts +3 -13
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +10 -0
- package/build/types/revamp/domain/components/FormComponent.d.ts +7 -0
- package/build/types/revamp/domain/components/HeadingComponent.d.ts +2 -8
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ParagraphComponent.d.ts +2 -10
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +9 -0
- package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +1 -2
- package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/buttonLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +1 -2
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -2
- package/build/types/revamp/domain/mappers/schema/{objectSchemaToComponent.d.ts → objectSchemaToComponent/objectSchemaToComponent.d.ts} +2 -2
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.d.ts +5 -0
- package/build/types/revamp/domain/types.d.ts +7 -3
- package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/boxComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/dateInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/formComponentToProps.d.ts +4 -0
- package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/uploadInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/types.d.ts +30 -8
- package/build/types/revamp/wise/renderers/DateInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/FormRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/UploadInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +10 -0
- package/build/types/revamp/wise/renderers/components/VariableDateInput.d.ts +9 -0
- package/build/types/revamp/wise/renderers/components/VariableTextInput.d.ts +10 -0
- package/build/types/revamp/wise/renderers/hooks/useSnackBarIfAvailable.d.ts +10 -0
- package/build/types/revamp/wise/renderers/utils/input-utils.d.ts +1 -0
- package/build/types/revamp/wise/renderers/utils/value-utils.d.ts +3 -0
- package/build/types/revamp/wise/renderers/validators/type-validators.d.ts +9 -0
- package/package.json +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent.d.ts +0 -5
- package/build/types/revamp/wise/renderers/utils/Label.d.ts +0 -5
- /package/build/types/common/{helpMessages → messages}/help.messages.d.ts +0 -0
- /package/build/types/{legacy/layout/paragraph/DynamicParagraph.messages.d.ts → common/messages/paragraph.messages.d.ts} +0 -0
- /package/build/types/common/{validationMessages → messages}/validation.messages.d.ts +0 -0
package/build/main.js
CHANGED
|
@@ -2541,19 +2541,23 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
2541
2541
|
var import_components4 = require("@transferwise/components");
|
|
2542
2542
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2543
2543
|
function DynamicDecision({ component, onAction }) {
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2544
|
+
const { loading } = useDynamicFlow();
|
|
2545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getMargin(component.margin), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_components4.NavigationOptionsList, { children: component.options.map((option) => {
|
|
2546
|
+
var _a;
|
|
2547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2548
|
+
import_components4.NavigationOption,
|
|
2549
|
+
{
|
|
2550
|
+
title: option.title,
|
|
2551
|
+
content: option.description,
|
|
2552
|
+
disabled: (_a = option.disabled) != null ? _a : loading,
|
|
2553
|
+
media: getNavigationOptionMedia(option),
|
|
2554
|
+
showMediaCircle: false,
|
|
2555
|
+
showMediaAtAllSizes: true,
|
|
2556
|
+
onClick: () => onAction(option.action)
|
|
2557
|
+
},
|
|
2558
|
+
JSON.stringify(option)
|
|
2559
|
+
);
|
|
2560
|
+
}) }) });
|
|
2557
2561
|
}
|
|
2558
2562
|
var DynamicDecision_default = DynamicDecision;
|
|
2559
2563
|
|
|
@@ -2666,7 +2670,7 @@ var import_components7 = require("@transferwise/components");
|
|
|
2666
2670
|
var import_formatting = require("@transferwise/formatting");
|
|
2667
2671
|
var import_react_intl5 = require("react-intl");
|
|
2668
2672
|
|
|
2669
|
-
// src/common/
|
|
2673
|
+
// src/common/messages/validation.messages.ts
|
|
2670
2674
|
var import_react_intl4 = require("react-intl");
|
|
2671
2675
|
var validation_messages_default = (0, import_react_intl4.defineMessages)({
|
|
2672
2676
|
type: {
|
|
@@ -3520,7 +3524,7 @@ var import_react17 = require("react");
|
|
|
3520
3524
|
var import_components11 = require("@transferwise/components");
|
|
3521
3525
|
var import_react_intl13 = require("react-intl");
|
|
3522
3526
|
|
|
3523
|
-
// src/common/
|
|
3527
|
+
// src/common/messages/help.messages.ts
|
|
3524
3528
|
var import_react_intl12 = require("react-intl");
|
|
3525
3529
|
var help_messages_default = (0, import_react_intl12.defineMessages)({
|
|
3526
3530
|
helpAria: {
|
|
@@ -3532,7 +3536,7 @@ var help_messages_default = (0, import_react_intl12.defineMessages)({
|
|
|
3532
3536
|
|
|
3533
3537
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
3534
3538
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3535
|
-
|
|
3539
|
+
function Help(props) {
|
|
3536
3540
|
const intl = (0, import_react_intl13.useIntl)();
|
|
3537
3541
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3538
3542
|
import_components11.Info,
|
|
@@ -3544,7 +3548,7 @@ var Help = (props) => {
|
|
|
3544
3548
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
3545
3549
|
}
|
|
3546
3550
|
);
|
|
3547
|
-
}
|
|
3551
|
+
}
|
|
3548
3552
|
var Help_default = Help;
|
|
3549
3553
|
|
|
3550
3554
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
@@ -4157,20 +4161,16 @@ var mapConstSchemaToOption = (schema, controlType) => {
|
|
|
4157
4161
|
return mapConstSchemaToRadioOption(schema);
|
|
4158
4162
|
}
|
|
4159
4163
|
};
|
|
4160
|
-
var mapConstSchemaToRadioOption = (schema) => {
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
label: schema.title,
|
|
4171
|
-
value: schema.const
|
|
4172
|
-
}, getOptionDescription(schema.title, schema.description)), getIconPropertyForSelectOption(schema.icon)), mapImage(schema.image)), getDisabled(schema.disabled)), mapKeywordsToSearchStrings(schema.keywords));
|
|
4173
|
-
};
|
|
4164
|
+
var mapConstSchemaToRadioOption = (schema) => __spreadValues(__spreadValues(__spreadValues({
|
|
4165
|
+
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
4166
|
+
label: schema.title,
|
|
4167
|
+
value: schema.const
|
|
4168
|
+
}, getRadioOptionDescription(schema.title, schema.description)), getAvatarPropertyForRadioOption(schema)), getDisabled(schema.disabled));
|
|
4169
|
+
var mapConstSchemaToSelectOption = (schema) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
4170
|
+
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
4171
|
+
label: schema.title,
|
|
4172
|
+
value: schema.const
|
|
4173
|
+
}, getOptionDescription(schema.title, schema.description)), getIconPropertyForSelectOption(schema.icon)), mapImage(schema.image)), getDisabled(schema.disabled)), mapKeywordsToSearchStrings(schema.keywords));
|
|
4174
4174
|
var mapKeywordsToSearchStrings = (searchStrings) => isArray(searchStrings) ? { searchStrings } : {};
|
|
4175
4175
|
var mapImage = (image) => {
|
|
4176
4176
|
if (image == null ? void 0 : image.url) {
|
|
@@ -4218,6 +4218,12 @@ var getOptionDescription = (title, description) => {
|
|
|
4218
4218
|
}
|
|
4219
4219
|
return void 0;
|
|
4220
4220
|
};
|
|
4221
|
+
var getRadioOptionDescription = (title, description) => {
|
|
4222
|
+
if (title && description) {
|
|
4223
|
+
return { note: description };
|
|
4224
|
+
}
|
|
4225
|
+
return void 0;
|
|
4226
|
+
};
|
|
4221
4227
|
var getDisabled = (disabled) => {
|
|
4222
4228
|
if (!isUndefined(disabled) && !isNull(disabled)) {
|
|
4223
4229
|
return { disabled };
|
|
@@ -5350,9 +5356,9 @@ var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
|
5350
5356
|
var import_components26 = require("@transferwise/components");
|
|
5351
5357
|
var import_react_intl17 = require("react-intl");
|
|
5352
5358
|
|
|
5353
|
-
// src/
|
|
5359
|
+
// src/common/messages/paragraph.messages.ts
|
|
5354
5360
|
var import_react_intl16 = require("react-intl");
|
|
5355
|
-
var
|
|
5361
|
+
var paragraph_messages_default = (0, import_react_intl16.defineMessages)({
|
|
5356
5362
|
copy: {
|
|
5357
5363
|
id: "dynamicFlows.DynamicParagraph.copy",
|
|
5358
5364
|
defaultMessage: "Copy",
|
|
@@ -5377,21 +5383,28 @@ function noop2() {
|
|
|
5377
5383
|
|
|
5378
5384
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
5379
5385
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
"
|
|
5385
|
-
|
|
5386
|
-
|
|
5386
|
+
function DynamicParagraph({ component }) {
|
|
5387
|
+
return component.control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BasicDynamicParagraph, { component });
|
|
5388
|
+
}
|
|
5389
|
+
function BasicDynamicParagraph({ component }) {
|
|
5390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: getTextAlignmentAndMargin(component), children: [
|
|
5391
|
+
" ",
|
|
5392
|
+
component.text,
|
|
5393
|
+
" "
|
|
5394
|
+
] });
|
|
5395
|
+
}
|
|
5396
|
+
function CopyableDynamicParagraph({ component }) {
|
|
5387
5397
|
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
5388
5398
|
const createSnackbar = useSnackBarIfAvailable();
|
|
5389
5399
|
const { text } = component;
|
|
5390
5400
|
const copy = () => {
|
|
5391
5401
|
var _a;
|
|
5392
|
-
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(
|
|
5402
|
+
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(noop3);
|
|
5393
5403
|
};
|
|
5394
|
-
const classNames8 = getTextAlignmentAndMargin({
|
|
5404
|
+
const classNames8 = `${getTextAlignmentAndMargin({
|
|
5405
|
+
align: component.align,
|
|
5406
|
+
margin: "sm"
|
|
5407
|
+
})} form-control`;
|
|
5395
5408
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: getTextAlignmentAndMargin(component), children: [
|
|
5396
5409
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5397
5410
|
"input",
|
|
@@ -5403,9 +5416,9 @@ var CopyableDynamicParagraph = ({ component }) => {
|
|
|
5403
5416
|
style: { textOverflow: "ellipsis" }
|
|
5404
5417
|
}
|
|
5405
5418
|
),
|
|
5406
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components26.Button, { block: true, onClick: copy, children: formatMessage(
|
|
5419
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components26.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5407
5420
|
] });
|
|
5408
|
-
}
|
|
5421
|
+
}
|
|
5409
5422
|
function noop3() {
|
|
5410
5423
|
}
|
|
5411
5424
|
var DynamicParagraph_default = DynamicParagraph;
|