@wise/dynamic-flow-client 2.9.1 → 2.9.3
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 +38 -40
- package/build/main.min.js +1 -1
- package/build/types/common/makeHttpClient/makeHttpClient.d.ts +1 -0
- package/build/types/legacy/common/utils/schema-utils.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.d.ts +3 -3
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.d.ts +1 -1
- package/build/types/legacy/layout/search/SearchResults.d.ts +4 -4
- package/build/types/legacy/layout/search/useSearch.d.ts +1 -1
- package/build/types/revamp/DynamicFlowCore.d.ts +7 -0
- package/build/types/revamp/DynamicFlowWise.d.ts +3 -0
- package/build/types/revamp/domain/components/AllOfComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ConstComponent.d.ts +9 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
- 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/ObjectComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +1 -1
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +1 -1
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +6 -5
- package/build/types/revamp/domain/mappers/schema/constSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -0
- package/build/types/revamp/domain/types.d.ts +6 -6
- package/build/types/revamp/renderers/types.d.ts +1 -0
- package/build/types/revamp/step/Step.d.ts +5 -4
- package/build/types/revamp/utils/component-utils.d.ts +2 -1
- package/build/types/revamp/utils/type-utils.d.ts +3 -3
- package/build/types/revamp/wise/renderers/UploadInputRenderer.d.ts +2 -1
- package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +2 -0
- package/build/types/test-utils/fetch-utils.d.ts +1 -0
- package/package.json +2 -2
- package/build/types/revamp/DynamicFlowRevamp.d.ts +0 -3
- package/build/types/revamp/domain/components/HiddenComponent.d.ts +0 -9
- package/build/types/revamp/domain/mappers/schema/hiddenSchemaToComponent.d.ts +0 -7
- /package/build/types/common/errorBoundary/{ErrorBoundary.messages.d.ts → error-boundary.messages.d.ts} +0 -0
package/build/main.js
CHANGED
|
@@ -1900,11 +1900,13 @@ var makeHttpClient = (baseUrl, additionalHeaders) => (
|
|
|
1900
1900
|
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
1901
1901
|
(input, init) => {
|
|
1902
1902
|
const resource = applyBaseUrl(input, baseUrl || "");
|
|
1903
|
-
|
|
1904
|
-
return fetch(resource, __spreadProps(__spreadValues({}, init != null ? init : {}), { headers: headers2 }));
|
|
1903
|
+
return fetch(resource, mergeRequestInit(init != null ? init : {}, { headers: additionalHeaders }));
|
|
1905
1904
|
}
|
|
1906
1905
|
);
|
|
1907
1906
|
var applyBaseUrl = (input, baseUrl) => typeof input === "string" && isRelativePath(input) ? baseUrl + input : input;
|
|
1907
|
+
var mergeRequestInit = (init, additionalInit) => __spreadProps(__spreadValues(__spreadValues({}, init), additionalInit), {
|
|
1908
|
+
headers: mergeHeaders(init == null ? void 0 : init.headers, additionalInit == null ? void 0 : additionalInit.headers)
|
|
1909
|
+
});
|
|
1908
1910
|
var mergeHeaders = (initHeaders, additionalHeaders) => {
|
|
1909
1911
|
if (!initHeaders && !additionalHeaders) {
|
|
1910
1912
|
return {};
|
|
@@ -3016,21 +3018,18 @@ var import_react_intl11 = require("react-intl");
|
|
|
3016
3018
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
3017
3019
|
var import_components9 = require("@transferwise/components");
|
|
3018
3020
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3019
|
-
|
|
3020
|
-
item,
|
|
3021
|
-
onClick
|
|
3022
|
-
}) => {
|
|
3021
|
+
function ItemSummaryOption({ item, onClick }) {
|
|
3023
3022
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3024
3023
|
import_components9.NavigationOption,
|
|
3025
3024
|
{
|
|
3026
|
-
onClick,
|
|
3027
3025
|
media: getNavigationOptionMedia(item),
|
|
3028
3026
|
title: item.title,
|
|
3029
3027
|
content: item.description,
|
|
3030
|
-
showMediaAtAllSizes: true
|
|
3028
|
+
showMediaAtAllSizes: true,
|
|
3029
|
+
onClick
|
|
3031
3030
|
}
|
|
3032
3031
|
);
|
|
3033
|
-
}
|
|
3032
|
+
}
|
|
3034
3033
|
|
|
3035
3034
|
// src/common/messages/repeatable.messages.ts
|
|
3036
3035
|
var import_react_intl9 = require("react-intl");
|
|
@@ -3182,19 +3181,19 @@ function getSchemaProperties(childSchema) {
|
|
|
3182
3181
|
}
|
|
3183
3182
|
|
|
3184
3183
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.ts
|
|
3185
|
-
var getItemSummaryFromSchema = (schema, model, defaults = {}) => {
|
|
3184
|
+
var getItemSummaryFromSchema = (schema, model, defaults = {}, summaryTextOverride) => {
|
|
3186
3185
|
const { defaultTitle = "", defaultDescription = "", defaultIcon, defaultImage } = defaults;
|
|
3187
3186
|
const title = getSummaryPropFromSchema({
|
|
3188
3187
|
schema,
|
|
3189
3188
|
model,
|
|
3190
3189
|
providesProp: "providesTitle",
|
|
3191
|
-
getValueFromSchema: getStringValueFromSchema
|
|
3190
|
+
getValueFromSchema: (schema2, model2) => summaryTextOverride != null ? summaryTextOverride : getStringValueFromSchema(schema2, model2)
|
|
3192
3191
|
});
|
|
3193
3192
|
const description = getSummaryPropFromSchema({
|
|
3194
3193
|
schema,
|
|
3195
3194
|
model,
|
|
3196
3195
|
providesProp: "providesDescription",
|
|
3197
|
-
getValueFromSchema: getStringValueFromSchema
|
|
3196
|
+
getValueFromSchema: (schema2, model2) => summaryTextOverride != null ? summaryTextOverride : getStringValueFromSchema(schema2, model2)
|
|
3198
3197
|
});
|
|
3199
3198
|
const icon = getSummaryPropFromSchema({
|
|
3200
3199
|
schema,
|
|
@@ -3224,10 +3223,10 @@ var getItemSummaryFromSchema = (schema, model, defaults = {}) => {
|
|
|
3224
3223
|
};
|
|
3225
3224
|
var getSummaryPropFromSchema = (props) => {
|
|
3226
3225
|
const { schema, model, providesProp, getValueFromSchema } = props;
|
|
3226
|
+
const type = getSchemaType(schema);
|
|
3227
3227
|
if (schemaSummaryProvides(schema.summary, providesProp)) {
|
|
3228
3228
|
return getValueFromSchema(schema, model);
|
|
3229
3229
|
}
|
|
3230
|
-
const type = getSchemaType(schema);
|
|
3231
3230
|
switch (type) {
|
|
3232
3231
|
case "object": {
|
|
3233
3232
|
return getObjectValueFromSchema(props);
|
|
@@ -3344,8 +3343,9 @@ function RepeatableSchema({ schema, model, errors, submitted, onChange }) {
|
|
|
3344
3343
|
var _a;
|
|
3345
3344
|
const updatedItem = action === "remove" ? null : getItemSummaryFromSchema(
|
|
3346
3345
|
schema.items,
|
|
3347
|
-
|
|
3348
|
-
schema.summary
|
|
3346
|
+
editableItem.model,
|
|
3347
|
+
schema.summary,
|
|
3348
|
+
summaryTextOverride
|
|
3349
3349
|
);
|
|
3350
3350
|
if (action !== "remove" && !isValidSchema((_a = updatedItem == null ? void 0 : updatedItem.value) != null ? _a : null, schema.items)) {
|
|
3351
3351
|
return;
|
|
@@ -3367,7 +3367,7 @@ function RepeatableSchema({ schema, model, errors, submitted, onChange }) {
|
|
|
3367
3367
|
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
3368
3368
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3369
3369
|
schema.title && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Header, { title: schema.title }),
|
|
3370
|
-
itemSummaries
|
|
3370
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3371
3371
|
ItemSummaryOption,
|
|
3372
3372
|
{
|
|
3373
3373
|
item: itemSummary,
|
|
@@ -5529,9 +5529,9 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
5529
5529
|
var import_components30 = require("@transferwise/components");
|
|
5530
5530
|
var import_react_intl19 = require("react-intl");
|
|
5531
5531
|
|
|
5532
|
-
// src/common/errorBoundary/
|
|
5532
|
+
// src/common/errorBoundary/error-boundary.messages.ts
|
|
5533
5533
|
var import_react_intl18 = require("react-intl");
|
|
5534
|
-
var
|
|
5534
|
+
var error_boundary_messages_default = (0, import_react_intl18.defineMessages)({
|
|
5535
5535
|
errorAlert: {
|
|
5536
5536
|
id: "dynamicFlows.ErrorBoundary.errorAlert",
|
|
5537
5537
|
defaultMessage: "Oops. Something went wrong...",
|
|
@@ -5546,29 +5546,27 @@ var ErrorBoundary_messages_default = (0, import_react_intl18.defineMessages)({
|
|
|
5546
5546
|
|
|
5547
5547
|
// src/legacy/layout/search/SearchResults.tsx
|
|
5548
5548
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5549
|
-
|
|
5549
|
+
function SearchResults({ results, emptyMessage, onSelect }) {
|
|
5550
5550
|
if (results.length === 0) {
|
|
5551
5551
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
5552
5552
|
}
|
|
5553
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components30.NavigationOptionsList, { children: results.map((result) =>
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
};
|
|
5568
|
-
var ErrorResult = ({ onRetrySearch }) => {
|
|
5553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components30.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5554
|
+
import_components30.NavigationOption,
|
|
5555
|
+
{
|
|
5556
|
+
title: result.title,
|
|
5557
|
+
content: result.description,
|
|
5558
|
+
media: getNavigationOptionMedia(result),
|
|
5559
|
+
showMediaCircle: false,
|
|
5560
|
+
showMediaAtAllSizes: true,
|
|
5561
|
+
onClick: () => onSelect(result)
|
|
5562
|
+
},
|
|
5563
|
+
JSON.stringify(result)
|
|
5564
|
+
)) });
|
|
5565
|
+
}
|
|
5566
|
+
function ErrorResult({ onRetrySearch }) {
|
|
5569
5567
|
const intl = (0, import_react_intl19.useIntl)();
|
|
5570
5568
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "m-t-2", children: [
|
|
5571
|
-
intl.formatMessage(
|
|
5569
|
+
intl.formatMessage(error_boundary_messages_default.errorAlert),
|
|
5572
5570
|
"\xA0",
|
|
5573
5571
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5574
5572
|
"a",
|
|
@@ -5578,11 +5576,11 @@ var ErrorResult = ({ onRetrySearch }) => {
|
|
|
5578
5576
|
e.preventDefault();
|
|
5579
5577
|
onRetrySearch();
|
|
5580
5578
|
},
|
|
5581
|
-
children: intl.formatMessage(
|
|
5579
|
+
children: intl.formatMessage(error_boundary_messages_default.retry)
|
|
5582
5580
|
}
|
|
5583
5581
|
)
|
|
5584
5582
|
] });
|
|
5585
|
-
}
|
|
5583
|
+
}
|
|
5586
5584
|
|
|
5587
5585
|
// src/legacy/layout/search/useSearch.tsx
|
|
5588
5586
|
var import_react27 = require("react");
|
|
@@ -7141,10 +7139,10 @@ function ErrorBoundaryAlert({ onDismiss }) {
|
|
|
7141
7139
|
import_components37.Alert,
|
|
7142
7140
|
{
|
|
7143
7141
|
action: {
|
|
7144
|
-
text: formatMessage(
|
|
7142
|
+
text: formatMessage(error_boundary_messages_default.retry),
|
|
7145
7143
|
href: window.location.href
|
|
7146
7144
|
},
|
|
7147
|
-
message: formatMessage(
|
|
7145
|
+
message: formatMessage(error_boundary_messages_default.errorAlert),
|
|
7148
7146
|
type: import_components37.Sentiment.NEGATIVE,
|
|
7149
7147
|
className: "m-b-3",
|
|
7150
7148
|
onDismiss
|