@wise/dynamic-flow-client 4.11.3 → 4.12.0-experimental-5de9758

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.
Files changed (27) hide show
  1. package/build/main.js +119 -107
  2. package/build/main.mjs +119 -107
  3. package/build/types/revamp/domain/components/AllOfComponent.d.ts +1 -1
  4. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
  5. package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
  6. package/build/types/revamp/domain/components/DecisionComponent.d.ts +2 -4
  7. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
  8. package/build/types/revamp/domain/components/ListComponent.d.ts +2 -4
  9. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +1 -1
  10. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
  11. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
  12. package/build/types/revamp/domain/components/ObjectComponent.d.ts +1 -1
  13. package/build/types/revamp/domain/components/RepeatableComponent.d.ts +4 -7
  14. package/build/types/revamp/domain/components/ReviewComponent.d.ts +2 -4
  15. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +4 -5
  16. package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -1
  17. package/build/types/revamp/domain/components/TupleComponent.d.ts +1 -1
  18. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
  19. package/build/types/revamp/domain/features/summary/summary-utils.d.ts +2 -7
  20. package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +14 -28
  21. package/build/types/revamp/domain/mappers/schema/persistAsyncSchemaToComponent.d.ts +14 -28
  22. package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -2
  23. package/build/types/revamp/domain/mappers/utils/media-utils.d.ts +9 -0
  24. package/build/types/revamp/domain/types.d.ts +30 -6
  25. package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -2
  26. package/build/types/revamp/renderers/mappers/utils/mapMediaToLegacyProps.d.ts +9 -0
  27. package/package.json +3 -3
package/build/main.mjs CHANGED
@@ -1311,24 +1311,24 @@ var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(_
1311
1311
  "markdown"
1312
1312
  )), rendererMapperProps);
1313
1313
 
1314
+ // src/revamp/renderers/mappers/utils/mapMediaToLegacyProps.ts
1315
+ var mapMediaToLegacyProps = (media) => {
1316
+ const { icon, image } = (media == null ? void 0 : media.type) === "legacy" ? media : {};
1317
+ return {
1318
+ icon,
1319
+ image,
1320
+ media
1321
+ };
1322
+ };
1323
+
1314
1324
  // src/revamp/renderers/mappers/allOfComponentToProps.ts
1315
1325
  var allOfComponentToProps = (component, rendererMapperProps) => {
1316
1326
  const childrenProps = component.components.map(
1317
1327
  (c) => componentToRendererProps(c, rendererMapperProps)
1318
1328
  );
1319
- return __spreadProps(__spreadValues(__spreadValues({
1329
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
1320
1330
  type: "form-section"
1321
- }, pick(
1322
- component,
1323
- "uid",
1324
- "analyticsId",
1325
- "control",
1326
- "description",
1327
- "help",
1328
- "icon",
1329
- "image",
1330
- "title"
1331
- )), rendererMapperProps), {
1331
+ }, pick(component, "uid", "analyticsId", "control", "description", "help", "media", "title")), mapMediaToLegacyProps(component.media)), rendererMapperProps), {
1332
1332
  children: childrenProps.map(rendererMapperProps.render),
1333
1333
  childrenProps
1334
1334
  });
@@ -1356,9 +1356,8 @@ var inputComponentToProps = (component, type) => {
1356
1356
  disabled,
1357
1357
  errors,
1358
1358
  help,
1359
- icon,
1360
1359
  id,
1361
- image,
1360
+ media,
1362
1361
  placeholder,
1363
1362
  required,
1364
1363
  title,
@@ -1367,7 +1366,7 @@ var inputComponentToProps = (component, type) => {
1367
1366
  onFocus
1368
1367
  } = component;
1369
1368
  const { messages } = validationAsyncState != null ? validationAsyncState : {};
1370
- return {
1369
+ return __spreadValues({
1371
1370
  uid,
1372
1371
  analyticsId,
1373
1372
  type,
@@ -1376,9 +1375,7 @@ var inputComponentToProps = (component, type) => {
1376
1375
  disabled,
1377
1376
  error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
1378
1377
  help,
1379
- icon,
1380
1378
  id,
1381
- image,
1382
1379
  placeholder,
1383
1380
  required,
1384
1381
  title,
@@ -1386,7 +1383,7 @@ var inputComponentToProps = (component, type) => {
1386
1383
  value: component.getLocalValue(),
1387
1384
  onBlur: onBlur.bind(component),
1388
1385
  onFocus: onFocus.bind(component)
1389
- };
1386
+ }, mapMediaToLegacyProps(media));
1390
1387
  };
1391
1388
  var getValidationState = (errors, validationAsyncState) => {
1392
1389
  if (validationAsyncState) {
@@ -1489,15 +1486,17 @@ var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProp
1489
1486
  autoComplete: component.autoComplete,
1490
1487
  minimumDate: component.minimumDate,
1491
1488
  maximumDate: component.maximumDate,
1492
- suggestions: component.suggestions,
1489
+ suggestions: component.suggestions ? {
1490
+ values: component.suggestions.values.map((suggestion) => __spreadValues(__spreadValues({}, suggestion), mapMediaToLegacyProps(suggestion.media)))
1491
+ } : void 0,
1493
1492
  onChange: component.onChange.bind(component)
1494
1493
  });
1495
1494
 
1496
1495
  // src/revamp/renderers/mappers/decisionComponentToProps.ts
1497
1496
  var decisionComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title")), rendererMapperProps), {
1498
1497
  options: component.options.map((_a) => {
1499
- var _b = _a, { disabled } = _b, rest = __objRest(_b, ["disabled"]);
1500
- return __spreadProps(__spreadValues({}, rest), {
1498
+ var _b = _a, { disabled, media } = _b, rest = __objRest(_b, ["disabled", "media"]);
1499
+ return __spreadProps(__spreadValues(__spreadValues({}, rest), mapMediaToLegacyProps(media)), {
1501
1500
  disabled: disabled || rendererMapperProps.stepLoadingState !== "idle"
1502
1501
  });
1503
1502
  })
@@ -1566,12 +1565,12 @@ var listComponentToProps = (component, rendererMapperProps) => __spreadProps(__s
1566
1565
  });
1567
1566
  var mapItem = (item) => {
1568
1567
  var _a, _b;
1569
- return __spreadProps(__spreadValues({}, item), {
1568
+ return __spreadValues(__spreadProps(__spreadValues({}, item), {
1570
1569
  // populate deprecated fields
1571
1570
  subtitle: item.description,
1572
1571
  value: (_a = item.supportingValues) == null ? void 0 : _a.value,
1573
1572
  subvalue: (_b = item.supportingValues) == null ? void 0 : _b.subvalue
1574
- });
1573
+ }), mapMediaToLegacyProps(item.media));
1575
1574
  };
1576
1575
 
1577
1576
  // src/revamp/renderers/mappers/loadingIndicatorComponentToProps.ts
@@ -1658,19 +1657,9 @@ var numberInputComponentToProps = (component, rendererMapperProps) => __spreadPr
1658
1657
  // src/revamp/renderers/mappers/objectComponentToProps.ts
1659
1658
  var objectComponentToProps = (component, rendererMapperProps) => {
1660
1659
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
1661
- return __spreadProps(__spreadValues(__spreadValues({
1660
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
1662
1661
  type: "form-section"
1663
- }, pick(
1664
- component,
1665
- "uid",
1666
- "analyticsId",
1667
- "control",
1668
- "description",
1669
- "help",
1670
- "icon",
1671
- "image",
1672
- "title"
1673
- )), rendererMapperProps), {
1662
+ }, pick(component, "uid", "analyticsId", "control", "description", "help", "media", "title")), mapMediaToLegacyProps(component.media)), rendererMapperProps), {
1674
1663
  children: childrenProps.map(rendererMapperProps.render),
1675
1664
  childrenProps
1676
1665
  });
@@ -1702,9 +1691,8 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
1702
1691
  editableComponent,
1703
1692
  editItemTitle,
1704
1693
  errors,
1705
- icon,
1706
- image,
1707
1694
  maxItems,
1695
+ media,
1708
1696
  minItems,
1709
1697
  summaryDefaults,
1710
1698
  title = "",
@@ -1716,18 +1704,23 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
1716
1704
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
1717
1705
  const editableItemProps = editableComponent ? componentToRendererProps(editableComponent, rendererMapperProps) : null;
1718
1706
  const getSummary = (componentSummary) => {
1719
- var _a, _b, _c, _d;
1707
+ var _a, _b, _c;
1708
+ const { icon: componentIcon, image: componentImage } = mapMediaToLegacyProps(
1709
+ componentSummary.media
1710
+ );
1711
+ const { icon: defaultIcon, image: defaultImage } = mapMediaToLegacyProps(summaryDefaults.media);
1720
1712
  return {
1721
1713
  title: (_a = componentSummary.title) != null ? _a : summaryDefaults.title,
1722
1714
  description: (_b = componentSummary.description) != null ? _b : summaryDefaults.description,
1723
- icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
1724
- image: (_d = componentSummary.image) != null ? _d : summaryDefaults.image
1715
+ icon: componentIcon != null ? componentIcon : defaultIcon,
1716
+ image: componentImage != null ? componentImage : defaultImage,
1717
+ media: (_c = componentSummary.media) != null ? _c : summaryDefaults.media
1725
1718
  };
1726
1719
  };
1727
1720
  const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
1728
1721
  id: `${childComponent.uid}-summary`
1729
1722
  }));
1730
- return __spreadValues({
1723
+ return __spreadValues(__spreadValues({
1731
1724
  uid,
1732
1725
  analyticsId,
1733
1726
  type: "repeatable",
@@ -1739,8 +1732,6 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
1739
1732
  editableItem: rendererMapperProps.render(editableItemProps),
1740
1733
  editableItemProps,
1741
1734
  editItemTitle,
1742
- icon,
1743
- image,
1744
1735
  items: itemProps,
1745
1736
  maxItems,
1746
1737
  minItems,
@@ -1750,14 +1741,21 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
1750
1741
  onEdit: onEdit.bind(component),
1751
1742
  onSave: onSave.bind(component),
1752
1743
  onRemove: onRemove.bind(component)
1753
- }, rendererMapperProps);
1744
+ }, mapMediaToLegacyProps(media)), rendererMapperProps);
1754
1745
  };
1755
1746
 
1756
1747
  // src/revamp/renderers/mappers/reviewComponentToProps.ts
1757
1748
  var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "callToAction", "control", "margin", "title")), {
1758
1749
  fields: component.fields.map(mapField)
1759
1750
  }), rendererMapperProps);
1760
- var mapField = (field) => __spreadValues({}, field);
1751
+ var mapField = (_a) => {
1752
+ var _b = _a, {
1753
+ media
1754
+ } = _b, rest = __objRest(_b, [
1755
+ "media"
1756
+ ]);
1757
+ return __spreadValues(__spreadValues({}, rest), mapMediaToLegacyProps(media));
1758
+ };
1761
1759
 
1762
1760
  // src/revamp/renderers/mappers/rootComponentToProps.ts
1763
1761
  var rootComponentToProps = (rootComponent, rendererMapperProps) => {
@@ -1779,6 +1777,21 @@ var mapSpecImage = (image) => {
1779
1777
  } : void 0;
1780
1778
  };
1781
1779
 
1780
+ // src/revamp/domain/mappers/utils/media-utils.ts
1781
+ var getDomainLayerMedia = ({ icon, image, media }) => {
1782
+ if (media) {
1783
+ return media;
1784
+ }
1785
+ if (icon || image) {
1786
+ return {
1787
+ type: "legacy",
1788
+ icon,
1789
+ image: mapSpecImage(image)
1790
+ };
1791
+ }
1792
+ return void 0;
1793
+ };
1794
+
1782
1795
  // src/revamp/renderers/mappers/searchComponentToProps.ts
1783
1796
  var searchComponentToProps = (component, rendererMapperProps) => {
1784
1797
  const { uid, control, emptyMessage, error, isLoading, margin, query, results, title } = component;
@@ -1829,6 +1842,7 @@ var getSearchState = ({
1829
1842
  return __spreadProps(__spreadValues({}, result), {
1830
1843
  id: result.type === "action" ? (_a = result.value.id) != null ? _a : result.value.$id : void 0,
1831
1844
  image: mapSpecImage(result.image),
1845
+ media: getDomainLayerMedia(result),
1832
1846
  onClick: () => onSelect(result)
1833
1847
  });
1834
1848
  });
@@ -1888,26 +1902,18 @@ var textInputComponentToProps = (component, rendererMapperProps) => __spreadProp
1888
1902
  displayFormat: component.displayFormat,
1889
1903
  maxLength: component.maxLength,
1890
1904
  minLength: component.minLength,
1891
- suggestions: component.suggestions,
1905
+ suggestions: component.suggestions ? {
1906
+ values: component.suggestions.values.map((suggestion) => __spreadValues(__spreadValues({}, suggestion), mapMediaToLegacyProps(suggestion.media)))
1907
+ } : void 0,
1892
1908
  onChange: component.onChange.bind(component)
1893
1909
  });
1894
1910
 
1895
1911
  // src/revamp/renderers/mappers/tupleComponentToProps.ts
1896
1912
  var tupleComponentToProps = (component, rendererMapperProps) => {
1897
1913
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
1898
- return __spreadProps(__spreadValues(__spreadValues({
1914
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
1899
1915
  type: "form-section"
1900
- }, pick(
1901
- component,
1902
- "uid",
1903
- "analyticsId",
1904
- "control",
1905
- "description",
1906
- "help",
1907
- "icon",
1908
- "image",
1909
- "title"
1910
- )), rendererMapperProps), {
1916
+ }, pick(component, "uid", "analyticsId", "control", "description", "help", "media", "title")), mapMediaToLegacyProps(component.media)), rendererMapperProps), {
1911
1917
  children: childrenProps.map(rendererMapperProps.render),
1912
1918
  childrenProps
1913
1919
  });
@@ -2455,9 +2461,9 @@ var mapAdditionalInfo = (info, onBehavior) => {
2455
2461
  return {
2456
2462
  text: info.text,
2457
2463
  accessibilityDescription: info.accessibilityDescription,
2458
- onClick: () => {
2464
+ onClick: behavior.type !== "none" ? () => {
2459
2465
  void onBehavior(behavior);
2460
- }
2466
+ } : void 0
2461
2467
  };
2462
2468
  }
2463
2469
  return void 0;
@@ -2490,7 +2496,7 @@ var mapOption = (option, onBehavior, stepActions = []) => {
2490
2496
  return __spreadProps(__spreadValues({}, option), {
2491
2497
  disabled: (_a = option.disabled) != null ? _a : false,
2492
2498
  href: behavior.type === "link" ? behavior.url : void 0,
2493
- image: mapSpecImage(option.image),
2499
+ media: getDomainLayerMedia(option),
2494
2500
  inlineAlert: mapInlineAlert(option.inlineAlert),
2495
2501
  onClick: () => {
2496
2502
  void onBehavior(behavior);
@@ -2506,11 +2512,7 @@ var createStatusListComponent = (statusListProps) => __spreadValues({
2506
2512
 
2507
2513
  // src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
2508
2514
  var isDeprecatedListLayout = (layout) => {
2509
- const usesCallToAction = layout.callToAction != null;
2510
- const usesNewProperties = layout.items.some(
2511
- (item) => item.additionalInfo != null || item.inlineAlert != null || item.supportingValues != null || item.subtitle != null || item.value != null || item.subvalue != null
2512
- );
2513
- return !usesCallToAction && !usesNewProperties;
2515
+ return layout.items.some((item) => item.status);
2514
2516
  };
2515
2517
  var deprecatedListLayoutToComponent = (uid, { analyticsId, control, items, margin = "md", title }) => createStatusListComponent({
2516
2518
  uid,
@@ -2684,10 +2686,10 @@ var listLayoutToComponent = (uid, { analyticsId, callToAction, control, items, m
2684
2686
  };
2685
2687
  var mapItem2 = (item, mapperProps) => {
2686
2688
  var _b;
2687
- const _a = item, { value, subvalue, subtitle } = _a, rest = __objRest(_a, ["value", "subvalue", "subtitle"]);
2689
+ const _a = item, { value, subvalue, subtitle, icon, image, media } = _a, rest = __objRest(_a, ["value", "subvalue", "subtitle", "icon", "image", "media"]);
2688
2690
  return __spreadProps(__spreadValues({}, rest), {
2689
2691
  description: (_b = item.description) != null ? _b : subtitle,
2690
- image: mapSpecImage(item.image),
2692
+ media: getDomainLayerMedia({ icon, image, media }),
2691
2693
  supportingValues: mapSupportingValues(item),
2692
2694
  additionalInfo: mapAdditionalInfo(item.additionalInfo, mapperProps.onBehavior),
2693
2695
  inlineAlert: mapInlineAlert(item.inlineAlert)
@@ -2824,7 +2826,7 @@ var getOrientationControl = ({
2824
2826
  var mapReviewField = (field, { onBehavior, step }) => {
2825
2827
  var _a, _b;
2826
2828
  return __spreadProps(__spreadValues({}, field), {
2827
- image: mapSpecImage(field.image),
2829
+ media: getDomainLayerMedia(field),
2828
2830
  help: (_a = field.help) == null ? void 0 : _a.markdown,
2829
2831
  inlineAlert: mapInlineAlert(field.inlineAlert),
2830
2832
  additionalInfo: mapAdditionalInfo(field.additionalInfo, onBehavior),
@@ -3928,32 +3930,42 @@ var getSummariser = (schema) => (value) => {
3928
3930
  return summaryIfProvides(summary, { value: stringValueOrNull, icon, image });
3929
3931
  };
3930
3932
  var getConstSummary = (schema, model) => {
3931
- const { summary, icon, image } = schema;
3933
+ const { summary, icon, image, media } = schema;
3932
3934
  const value = isString(model) ? model : null;
3933
- return summaryIfProvides(summary, { value, icon, image });
3935
+ return summaryIfProvides(summary, { value, icon, image, media });
3934
3936
  };
3935
3937
  var summariseFromChildren = (components) => components.reduce(
3936
3938
  (acc, component) => mergeSummaries(acc, component.getSummary()),
3937
3939
  {}
3938
3940
  );
3939
3941
  var mergeSummaries = (summaryA, summaryB) => {
3940
- var _a, _b, _c, _d;
3942
+ var _a, _b, _c;
3941
3943
  return {
3942
3944
  title: (_a = summaryA.title) != null ? _a : summaryB.title,
3943
3945
  description: (_b = summaryA.description) != null ? _b : summaryB.description,
3944
- icon: (_c = summaryA.icon) != null ? _c : summaryB.icon,
3945
- image: (_d = summaryA.image) != null ? _d : summaryB.image
3946
+ media: (_c = summaryA.media) != null ? _c : summaryB.media
3946
3947
  };
3947
3948
  };
3948
- var summaryIfProvides = (summary, { value, icon, image }) => {
3949
+ var summaryIfProvides = (summary, {
3950
+ value = null,
3951
+ icon,
3952
+ image,
3953
+ media
3954
+ }) => {
3955
+ var _a;
3949
3956
  if (!summary) {
3950
3957
  return {};
3951
3958
  }
3959
+ const providesMedia = (_a = summary.providesMedia) != null ? _a : Boolean(summary.providesIcon) || Boolean(summary.providesImage);
3960
+ const providedMedia = getDomainLayerMedia({
3961
+ icon: summary.providesIcon ? icon : void 0,
3962
+ image: summary.providesImage ? image : void 0,
3963
+ media
3964
+ });
3952
3965
  return {
3953
3966
  title: summary.providesTitle && value || void 0,
3954
3967
  description: summary.providesDescription && value || void 0,
3955
- icon: summary.providesIcon && icon || void 0,
3956
- image: summary.providesImage && mapSpecImage(image != null ? image : void 0) || void 0
3968
+ media: providesMedia ? providedMedia : void 0
3957
3969
  };
3958
3970
  };
3959
3971
 
@@ -3961,7 +3973,7 @@ var summaryIfProvides = (summary, { value, icon, image }) => {
3961
3973
  var mapCommonSchemaProps = (schemaMapperProps) => {
3962
3974
  var _a;
3963
3975
  const { uid, schemaId, schema, required, validationErrors, onPersistAsync } = schemaMapperProps;
3964
- const { $id, analyticsId, control, description, icon, image, keywords, title, hidden } = schema;
3976
+ const { $id, analyticsId, control, description, icon, image, keywords, media, title, hidden } = schema;
3965
3977
  return __spreadValues(__spreadValues(__spreadValues({
3966
3978
  uid,
3967
3979
  id: $id != null ? $id : uid,
@@ -3972,9 +3984,8 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
3972
3984
  disabled: schemaHasDisabled(schema) ? schema.disabled : false,
3973
3985
  errors: isString(validationErrors) ? [validationErrors] : void 0,
3974
3986
  hidden: Boolean(hidden),
3975
- icon,
3976
- image: mapSpecImage(image),
3977
3987
  keywords,
3988
+ media: getDomainLayerMedia({ icon, image, media }),
3978
3989
  required: Boolean(required),
3979
3990
  title,
3980
3991
  onPersistAsync,
@@ -4030,8 +4041,7 @@ var createAllOfComponent = (allOfProps) => {
4030
4041
  description,
4031
4042
  help,
4032
4043
  hidden,
4033
- icon,
4034
- image,
4044
+ media,
4035
4045
  title
4036
4046
  } = allOfProps;
4037
4047
  return {
@@ -4046,8 +4056,7 @@ var createAllOfComponent = (allOfProps) => {
4046
4056
  description,
4047
4057
  help,
4048
4058
  hidden,
4049
- icon,
4050
- image,
4059
+ media,
4051
4060
  title,
4052
4061
  getChildren() {
4053
4062
  return this.components;
@@ -4129,8 +4138,7 @@ var createRepeatableComponent = (repeatableProps, updateComponent) => {
4129
4138
  summaryDefaults: {
4130
4139
  title: summary == null ? void 0 : summary.defaultTitle,
4131
4140
  description: summary == null ? void 0 : summary.defaultDescription,
4132
- icon: summary == null ? void 0 : summary.defaultIcon,
4133
- image: summary == null ? void 0 : summary.defaultImage
4141
+ media: summary == null ? void 0 : summary.defaultMedia
4134
4142
  }
4135
4143
  }, componentProps), {
4136
4144
  _update(updateFn) {
@@ -4265,7 +4273,11 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
4265
4273
  maxItems,
4266
4274
  minItems,
4267
4275
  summary: __spreadProps(__spreadValues({}, summary), {
4268
- defaultImage: mapSpecImage(summary == null ? void 0 : summary.defaultImage)
4276
+ defaultMedia: getDomainLayerMedia({
4277
+ icon: summary == null ? void 0 : summary.defaultIcon,
4278
+ image: summary == null ? void 0 : summary.defaultImage,
4279
+ media: summary == null ? void 0 : summary.defaultMedia
4280
+ })
4269
4281
  }),
4270
4282
  createEditableComponent,
4271
4283
  onValueChange
@@ -4712,12 +4724,11 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
4712
4724
  } = schemaMapperProps;
4713
4725
  const initialModel = model != null ? model : null;
4714
4726
  const options = schema.items.oneOf.map((childSchema, index) => {
4715
- const { title: title2 = "", description, image, icon, keywords = [] } = childSchema;
4727
+ const { title: title2 = "", description, image, icon, media, keywords = [] } = childSchema;
4716
4728
  return {
4717
4729
  title: title2,
4718
4730
  description,
4719
- image: mapSpecImage(image),
4720
- icon,
4731
+ media: getDomainLayerMedia({ icon, image, media }),
4721
4732
  keywords,
4722
4733
  disabled: "disabled" in childSchema ? Boolean(childSchema.disabled) : false,
4723
4734
  component: mapSchemaToComponent(
@@ -4776,8 +4787,7 @@ var createTupleComponent = (tupleProps) => {
4776
4787
  description,
4777
4788
  help,
4778
4789
  hidden,
4779
- icon,
4780
- image,
4790
+ media,
4781
4791
  summariser,
4782
4792
  title
4783
4793
  } = tupleProps;
@@ -4793,8 +4803,7 @@ var createTupleComponent = (tupleProps) => {
4793
4803
  description,
4794
4804
  help,
4795
4805
  hidden,
4796
- icon,
4797
- image,
4806
+ media,
4798
4807
  title,
4799
4808
  getChildren() {
4800
4809
  return this.components;
@@ -5261,8 +5270,7 @@ var createObjectComponent = (objectProps) => {
5261
5270
  displayOrder,
5262
5271
  help,
5263
5272
  hidden,
5264
- icon,
5265
- image,
5273
+ media,
5266
5274
  summariser,
5267
5275
  title
5268
5276
  } = objectProps;
@@ -5278,8 +5286,7 @@ var createObjectComponent = (objectProps) => {
5278
5286
  description,
5279
5287
  help,
5280
5288
  hidden,
5281
- icon,
5282
- image,
5289
+ media,
5283
5290
  title,
5284
5291
  getChildren() {
5285
5292
  return displayOrder.map((propName) => this.componentMap[propName]);
@@ -5500,12 +5507,11 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
5500
5507
  );
5501
5508
  }
5502
5509
  const options = schema.oneOf.map((childSchema, index) => {
5503
- const { title = "", description, image, icon, keywords = [] } = childSchema;
5510
+ const { title = "", description, image, icon, media, keywords = [] } = childSchema;
5504
5511
  return {
5505
5512
  title,
5506
5513
  description,
5507
- image: mapSpecImage(image),
5508
- icon,
5514
+ media: getDomainLayerMedia({ icon, image, media }),
5509
5515
  keywords,
5510
5516
  disabled: "disabled" in childSchema ? Boolean(childSchema.disabled) : false,
5511
5517
  component: mapSchemaToComponent(
@@ -5658,9 +5664,12 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
5658
5664
  minimumDate,
5659
5665
  maximumDate,
5660
5666
  suggestions: suggestions ? {
5661
- values: suggestions.values.map((suggestion) => __spreadProps(__spreadValues({}, suggestion), {
5662
- image: mapSpecImage(suggestion.image)
5663
- }))
5667
+ values: suggestions.values.map((_a) => {
5668
+ var _b = _a, { icon, image, media } = _b, rest = __objRest(_b, ["icon", "image", "media"]);
5669
+ return __spreadProps(__spreadValues({}, rest), {
5670
+ media: getDomainLayerMedia({ icon, image, media })
5671
+ });
5672
+ })
5664
5673
  } : void 0,
5665
5674
  value,
5666
5675
  validationAsyncState,
@@ -5832,9 +5841,12 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
5832
5841
  maxLength,
5833
5842
  minLength,
5834
5843
  suggestions: suggestions ? {
5835
- values: suggestions.values.map((suggestion) => __spreadProps(__spreadValues({}, suggestion), {
5836
- image: mapSpecImage(suggestion.image)
5837
- }))
5844
+ values: suggestions.values.map((_a) => {
5845
+ var _b = _a, { icon, image, media } = _b, rest = __objRest(_b, ["icon", "image", "media"]);
5846
+ return __spreadProps(__spreadValues({}, rest), {
5847
+ media: getDomainLayerMedia({ icon, image, media })
5848
+ });
5849
+ })
5838
5850
  } : void 0,
5839
5851
  value,
5840
5852
  validationAsyncState,
@@ -7,6 +7,6 @@ export type AllOfComponent = BaseSchemaComponent<LocalValue> & {
7
7
  alert?: InlineAlert;
8
8
  getChildren: () => SchemaComponent[];
9
9
  };
10
- export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "icon" | "image" | "title"> & {
10
+ export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "components" | "help" | "hidden" | "media" | "title"> & {
11
11
  summariser: (value: Model | null) => RepeatableSummary;
12
12
  }) => AllOfComponent;
@@ -7,7 +7,7 @@ export type BooleanInputComponent = BaseInputComponent<boolean> & {
7
7
  validationAsyncState: ValidationAsyncState;
8
8
  onChange: (value: boolean) => void;
9
9
  };
10
- export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "uid" | "id" | "analyticsId" | "alert" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "icon" | "image" | "required" | "title" | "value" | "validationAsyncState"> & {
10
+ export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "uid" | "id" | "analyticsId" | "alert" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "media" | "required" | "title" | "value" | "validationAsyncState"> & {
11
11
  schemaOnChange: SchemaOnChange | undefined;
12
12
  performValidationAsync: PerformValidationAsync | undefined;
13
13
  summariser: (value: boolean) => RepeatableSummary;
@@ -11,7 +11,7 @@ export type DateInputComponent = BaseInputComponent<string | null> & {
11
11
  validationAsyncState: ValidationAsyncState;
12
12
  onChange: (value: string | null) => void;
13
13
  };
14
- export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "icon" | "image" | "minimumDate" | "maximumDate" | "placeholder" | "required" | "suggestions" | "title" | "value" | "validationAsyncState"> & {
14
+ export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "media" | "minimumDate" | "maximumDate" | "placeholder" | "required" | "suggestions" | "title" | "value" | "validationAsyncState"> & {
15
15
  checks: IsInvalidCheck<string | null>[];
16
16
  schemaOnChange: SchemaOnChange | undefined;
17
17
  performValidationAsync: PerformValidationAsync | undefined;
@@ -1,5 +1,4 @@
1
- import type { Icon } from '@wise/dynamic-flow-types/build/next';
2
- import type { BaseLayoutComponent, Image, InlineAlert, SupportingValues } from '../types';
1
+ import type { BaseLayoutComponent, InlineAlert, Media, SupportingValues } from '../types';
3
2
  export type DecisionComponent = BaseLayoutComponent & {
4
3
  type: 'decision';
5
4
  kind: 'layout';
@@ -10,8 +9,7 @@ export type DecisionOption = {
10
9
  description?: string;
11
10
  disabled: boolean;
12
11
  href?: string;
13
- icon?: Icon;
14
- image?: Image;
12
+ media?: Media;
15
13
  title: string;
16
14
  tag?: string;
17
15
  additionalText?: string;
@@ -10,7 +10,7 @@ export type IntegerInputComponent = BaseInputComponent<number | null> & {
10
10
  validationAsyncState: ValidationAsyncState;
11
11
  onChange: (value: number | null) => void;
12
12
  };
13
- export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "alert" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "icon" | "image" | "maximum" | "minimum" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
13
+ export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "alert" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "media" | "minimum" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
14
14
  checks: IsInvalidCheck<number | null>[];
15
15
  schemaOnChange: SchemaOnChange | undefined;
16
16
  performValidationAsync: PerformValidationAsync | undefined;
@@ -1,5 +1,4 @@
1
- import { Icon } from '@wise/dynamic-flow-types/build/next';
2
- import { AdditionalInfo, BaseLayoutComponent, CallToAction, Image, InlineAlert, SupportingValues } from '../types';
1
+ import { AdditionalInfo, BaseLayoutComponent, CallToAction, InlineAlert, Media, SupportingValues } from '../types';
3
2
  export type ListComponent = BaseLayoutComponent & {
4
3
  type: 'list';
5
4
  kind: 'layout';
@@ -8,8 +7,7 @@ export type ListComponent = BaseLayoutComponent & {
8
7
  callToAction?: CallToAction;
9
8
  };
10
9
  export type ListItem = {
11
- icon?: Icon;
12
- image?: Image;
10
+ media?: Media;
13
11
  title?: string;
14
12
  description?: string;
15
13
  tag?: string;
@@ -16,7 +16,7 @@ export type MultiSelectComponent = BaseInputComponent<LocalValueArray | null> &
16
16
  getSelectedChildren: () => SchemaComponent[] | null;
17
17
  onSelect: (indices: number[]) => void;
18
18
  };
19
- export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "alert" | "control" | "description" | "disabled" | "errors" | "hidden" | "icon" | "image" | "maxItems" | "minItems" | "required" | "title" | "validationAsyncState"> & {
19
+ export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "alert" | "control" | "description" | "disabled" | "errors" | "hidden" | "maxItems" | "media" | "minItems" | "required" | "title" | "validationAsyncState"> & {
20
20
  checks: IsInvalidCheck<LocalValueArray | null>[];
21
21
  initialValue: LocalValue;
22
22
  options: (SelectInputOption & {
@@ -24,7 +24,7 @@ export type MultiUploadInputComponent = BaseInputComponent<File[]> & {
24
24
  onRemoveFile: (index: number) => Promise<void>;
25
25
  onInsertFile: (index: number, file: File) => Promise<string>;
26
26
  };
27
- export declare const createMultiUploadInputComponent: (uploadInputProps: Pick<MultiUploadInputComponent, "uid" | "id" | "accepts" | "analyticsId" | "alert" | "autoComplete" | "cameraConfig" | "control" | "errors" | "description" | "disabled" | "format" | "help" | "hidden" | "icon" | "image" | "maxSize" | "minItems" | "maxItems" | "persistedState" | "placeholder" | "required" | "source" | "title" | "uploadLabel" | "value"> & {
27
+ export declare const createMultiUploadInputComponent: (uploadInputProps: Pick<MultiUploadInputComponent, "uid" | "id" | "accepts" | "analyticsId" | "alert" | "autoComplete" | "cameraConfig" | "control" | "errors" | "description" | "disabled" | "format" | "help" | "hidden" | "maxSize" | "media" | "minItems" | "maxItems" | "persistedState" | "placeholder" | "required" | "source" | "title" | "uploadLabel" | "value"> & {
28
28
  checks: IsInvalidCheck<File[]>[];
29
29
  fileChecks: IsInvalidCheck<File>[];
30
30
  performPersistAsync: PerformPersistAsync | undefined;
@@ -10,7 +10,7 @@ export type NumberInputComponent = BaseInputComponent<number | null> & {
10
10
  validationAsyncState: ValidationAsyncState;
11
11
  onChange: (value: number | null) => void;
12
12
  };
13
- export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "icon" | "image" | "maximum" | "minimum" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
13
+ export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "uid" | "id" | "analyticsId" | "alert" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "media" | "minimum" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
14
14
  checks: IsInvalidCheck<number | null>[];
15
15
  schemaOnChange: SchemaOnChange | undefined;
16
16
  performValidationAsync: PerformValidationAsync | undefined;
@@ -6,7 +6,7 @@ export type ObjectComponent = BaseSchemaComponent<LocalValueObject> & {
6
6
  alert?: InlineAlert;
7
7
  getChildren: () => SchemaComponent[];
8
8
  };
9
- export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "componentMap" | "help" | "hidden" | "icon" | "image" | "title"> & {
9
+ export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "uid" | "schemaId" | "analyticsId" | "alert" | "control" | "description" | "componentMap" | "help" | "hidden" | "media" | "title"> & {
10
10
  displayOrder: string[];
11
11
  summariser: (value: LocalValue | null) => RepeatableSummary;
12
12
  }) => ObjectComponent;