@wise/dynamic-flow-client 2.9.2 → 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 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
- const headers2 = mergeHeaders(init == null ? void 0 : init.headers, additionalHeaders);
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
- var ItemSummaryOption = ({
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
- summaryTextOverride != null ? summaryTextOverride : editableItem.model,
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 && itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3370
+ itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3371
3371
  ItemSummaryOption,
3372
3372
  {
3373
3373
  item: itemSummary,