@wise/dynamic-flow-client-internal 4.8.0 → 4.9.0

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
@@ -1168,7 +1168,11 @@ var getImageNode = (image, size) => {
1168
1168
  var import_jsx_runtime16 = require("react/jsx-runtime");
1169
1169
  var mediaSize = 64;
1170
1170
  var badgeMediaSize = 48;
1171
- function OptionMedia({ icon, image }) {
1171
+ function OptionMedia({
1172
+ icon,
1173
+ image,
1174
+ preferAvatar
1175
+ }) {
1172
1176
  const imageNode = getImageNode(image, mediaSize);
1173
1177
  const iconNode = getIconNode(icon);
1174
1178
  const badge = getBadgedMedia(iconNode, imageNode, badgeMediaSize);
@@ -1176,7 +1180,7 @@ function OptionMedia({ icon, image }) {
1176
1180
  return badge;
1177
1181
  }
1178
1182
  if (imageNode) {
1179
- return imageNode;
1183
+ return preferAvatar ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components8.AvatarView, { children: imageNode }) : imageNode;
1180
1184
  }
1181
1185
  if (iconNode) {
1182
1186
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components8.AvatarView, { children: iconNode });
@@ -1187,7 +1191,7 @@ function OptionMedia({ icon, image }) {
1187
1191
  var import_jsx_runtime17 = require("react/jsx-runtime");
1188
1192
  var DecisionRenderer = {
1189
1193
  canRenderType: "decision",
1190
- render: ({ margin, options, title }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: getMargin(margin), children: [
1194
+ render: ({ control, margin, options, title }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: getMargin(margin), children: [
1191
1195
  title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components9.Header, { as: "h2", title }),
1192
1196
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components9.NavigationOptionsList, { children: options.map((option) => {
1193
1197
  const { description, disabled, icon, image, title: itemTitle, onClick } = option;
@@ -1197,7 +1201,7 @@ var DecisionRenderer = {
1197
1201
  title: itemTitle,
1198
1202
  content: description,
1199
1203
  disabled,
1200
- media: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OptionMedia, { icon, image }),
1204
+ media: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OptionMedia, { icon, image, preferAvatar: control === "with-avatar" }),
1201
1205
  showMediaCircle: false,
1202
1206
  showMediaAtAllSizes: true,
1203
1207
  onClick
@@ -1676,7 +1680,7 @@ function MultiSelectInputRendererComponent(props) {
1676
1680
  const contentProps = {
1677
1681
  title: option.title,
1678
1682
  description: option.description,
1679
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OptionMedia, { icon: option.icon, image: option.image })
1683
+ icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
1680
1684
  };
1681
1685
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
1682
1686
  };
@@ -2075,7 +2079,7 @@ function ItemSummaryOption({
2075
2079
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2076
2080
  import_components25.NavigationOption,
2077
2081
  {
2078
- media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionMedia, __spreadValues({}, item)),
2082
+ media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionMedia, __spreadProps(__spreadValues({}, item), { preferAvatar: false })),
2079
2083
  title: item.title,
2080
2084
  content: item.description,
2081
2085
  showMediaAtAllSizes: true,
@@ -2213,7 +2217,7 @@ function SearchResults({
2213
2217
  {
2214
2218
  title: result.title,
2215
2219
  content: result.description,
2216
- media: OptionMedia({ icon, image }),
2220
+ media: OptionMedia({ icon, image, preferAvatar: false }),
2217
2221
  showMediaCircle: false,
2218
2222
  showMediaAtAllSizes: true,
2219
2223
  onClick: () => {
@@ -2348,7 +2352,7 @@ function RadioInputRendererComponent(props) {
2348
2352
  value: index,
2349
2353
  secondary: option.description,
2350
2354
  disabled: option.disabled || disabled,
2351
- avatar: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2355
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
2352
2356
  })),
2353
2357
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
2354
2358
  onChange: onSelect
@@ -2456,7 +2460,7 @@ function SelectInputRendererComponent(props) {
2456
2460
  } : {
2457
2461
  title: option.title,
2458
2462
  description: option.description,
2459
- icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2463
+ icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
2460
2464
  };
2461
2465
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
2462
2466
  };
@@ -3032,9 +3036,9 @@ var import_classnames6 = __toESM(require("classnames"));
3032
3036
  var import_jsx_runtime56 = require("react/jsx-runtime");
3033
3037
  var ListRenderer = {
3034
3038
  canRenderType: "list",
3035
- render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: getMargin(margin), children: [
3039
+ render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: getMargin(margin), children: [
3036
3040
  (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components41.Header, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
3037
- items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DesignSystemListItem, __spreadValues({}, props), props.title))
3041
+ items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
3038
3042
  ] })
3039
3043
  };
3040
3044
  var DesignSystemListItem = ({
@@ -3043,7 +3047,8 @@ var DesignSystemListItem = ({
3043
3047
  value,
3044
3048
  subvalue,
3045
3049
  icon,
3046
- image
3050
+ image,
3051
+ control
3047
3052
  }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3048
3053
  "label",
3049
3054
  {
@@ -3052,7 +3057,7 @@ var DesignSystemListItem = ({
3052
3057
  "np-option__container-aligned": true
3053
3058
  }),
3054
3059
  children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "media", children: [
3055
- icon || image ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ListItemMedia, { image, icon }) }) : null,
3060
+ icon || image ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ListItemMedia, { image, icon, preferAvatar: control === "with-avatar" }) }) : null,
3056
3061
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "media-body", children: [
3057
3062
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "d-flex justify-content-between", children: [
3058
3063
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
@@ -3067,12 +3072,16 @@ var DesignSystemListItem = ({
3067
3072
  },
3068
3073
  title
3069
3074
  );
3070
- var ListItemMedia = ({ icon, image }) => {
3075
+ var ListItemMedia = ({
3076
+ icon,
3077
+ image,
3078
+ preferAvatar
3079
+ }) => {
3071
3080
  if (icon) {
3072
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { icon, image }) });
3081
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { icon, image, preferAvatar }) });
3073
3082
  }
3074
3083
  if (image) {
3075
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { icon, image }) });
3084
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { icon, image, preferAvatar }) });
3076
3085
  }
3077
3086
  };
3078
3087
  var getListAction = (callToAction) => {
@@ -3192,7 +3201,7 @@ var getWiseRenderers = () => [
3192
3201
  ];
3193
3202
 
3194
3203
  // src/dynamicFlow/telemetry/app-version.ts
3195
- var appVersion = "4.8.0";
3204
+ var appVersion = "4.9.0";
3196
3205
 
3197
3206
  // src/dynamicFlow/telemetry/getLogEvent.ts
3198
3207
  var getLogEvent = (onLog) => (level, message, extra) => {
package/build/main.mjs CHANGED
@@ -1134,7 +1134,11 @@ var getImageNode = (image, size) => {
1134
1134
  import { jsx as jsx16 } from "react/jsx-runtime";
1135
1135
  var mediaSize = 64;
1136
1136
  var badgeMediaSize = 48;
1137
- function OptionMedia({ icon, image }) {
1137
+ function OptionMedia({
1138
+ icon,
1139
+ image,
1140
+ preferAvatar
1141
+ }) {
1138
1142
  const imageNode = getImageNode(image, mediaSize);
1139
1143
  const iconNode = getIconNode(icon);
1140
1144
  const badge = getBadgedMedia(iconNode, imageNode, badgeMediaSize);
@@ -1142,7 +1146,7 @@ function OptionMedia({ icon, image }) {
1142
1146
  return badge;
1143
1147
  }
1144
1148
  if (imageNode) {
1145
- return imageNode;
1149
+ return preferAvatar ? /* @__PURE__ */ jsx16(AvatarView2, { children: imageNode }) : imageNode;
1146
1150
  }
1147
1151
  if (iconNode) {
1148
1152
  return /* @__PURE__ */ jsx16(AvatarView2, { children: iconNode });
@@ -1153,7 +1157,7 @@ function OptionMedia({ icon, image }) {
1153
1157
  import { jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
1154
1158
  var DecisionRenderer = {
1155
1159
  canRenderType: "decision",
1156
- render: ({ margin, options, title }) => /* @__PURE__ */ jsxs3("div", { className: getMargin(margin), children: [
1160
+ render: ({ control, margin, options, title }) => /* @__PURE__ */ jsxs3("div", { className: getMargin(margin), children: [
1157
1161
  title && /* @__PURE__ */ jsx17(Header, { as: "h2", title }),
1158
1162
  /* @__PURE__ */ jsx17(NavigationOptionsList, { children: options.map((option) => {
1159
1163
  const { description, disabled, icon, image, title: itemTitle, onClick } = option;
@@ -1163,7 +1167,7 @@ var DecisionRenderer = {
1163
1167
  title: itemTitle,
1164
1168
  content: description,
1165
1169
  disabled,
1166
- media: /* @__PURE__ */ jsx17(OptionMedia, { icon, image }),
1170
+ media: /* @__PURE__ */ jsx17(OptionMedia, { icon, image, preferAvatar: control === "with-avatar" }),
1167
1171
  showMediaCircle: false,
1168
1172
  showMediaAtAllSizes: true,
1169
1173
  onClick
@@ -1646,7 +1650,7 @@ function MultiSelectInputRendererComponent(props) {
1646
1650
  const contentProps = {
1647
1651
  title: option.title,
1648
1652
  description: option.description,
1649
- icon: /* @__PURE__ */ jsx33(OptionMedia, { icon: option.icon, image: option.image })
1653
+ icon: /* @__PURE__ */ jsx33(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
1650
1654
  };
1651
1655
  return /* @__PURE__ */ jsx33(SelectInputOptionContent, __spreadValues({}, contentProps));
1652
1656
  };
@@ -2045,7 +2049,7 @@ function ItemSummaryOption({
2045
2049
  return /* @__PURE__ */ jsx38(
2046
2050
  NavigationOption2,
2047
2051
  {
2048
- media: /* @__PURE__ */ jsx38(OptionMedia, __spreadValues({}, item)),
2052
+ media: /* @__PURE__ */ jsx38(OptionMedia, __spreadProps(__spreadValues({}, item), { preferAvatar: false })),
2049
2053
  title: item.title,
2050
2054
  content: item.description,
2051
2055
  showMediaAtAllSizes: true,
@@ -2183,7 +2187,7 @@ function SearchResults({
2183
2187
  {
2184
2188
  title: result.title,
2185
2189
  content: result.description,
2186
- media: OptionMedia({ icon, image }),
2190
+ media: OptionMedia({ icon, image, preferAvatar: false }),
2187
2191
  showMediaCircle: false,
2188
2192
  showMediaAtAllSizes: true,
2189
2193
  onClick: () => {
@@ -2318,7 +2322,7 @@ function RadioInputRendererComponent(props) {
2318
2322
  value: index,
2319
2323
  secondary: option.description,
2320
2324
  disabled: option.disabled || disabled,
2321
- avatar: /* @__PURE__ */ jsx43(OptionMedia, { icon: option.icon, image: option.image })
2325
+ avatar: /* @__PURE__ */ jsx43(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
2322
2326
  })),
2323
2327
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
2324
2328
  onChange: onSelect
@@ -2426,7 +2430,7 @@ function SelectInputRendererComponent(props) {
2426
2430
  } : {
2427
2431
  title: option.title,
2428
2432
  description: option.description,
2429
- icon: /* @__PURE__ */ jsx45(OptionMedia, { icon: option.icon, image: option.image })
2433
+ icon: /* @__PURE__ */ jsx45(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
2430
2434
  };
2431
2435
  return /* @__PURE__ */ jsx45(SelectInputOptionContent2, __spreadValues({}, contentProps));
2432
2436
  };
@@ -3008,9 +3012,9 @@ import classNames6 from "classnames";
3008
3012
  import { jsx as jsx56, jsxs as jsxs21 } from "react/jsx-runtime";
3009
3013
  var ListRenderer = {
3010
3014
  canRenderType: "list",
3011
- render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ jsxs21("div", { className: getMargin(margin), children: [
3015
+ render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs21("div", { className: getMargin(margin), children: [
3012
3016
  (title || callToAction) && /* @__PURE__ */ jsx56(Header7, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
3013
- items.map((props) => /* @__PURE__ */ jsx56(DesignSystemListItem, __spreadValues({}, props), props.title))
3017
+ items.map((props) => /* @__PURE__ */ jsx56(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
3014
3018
  ] })
3015
3019
  };
3016
3020
  var DesignSystemListItem = ({
@@ -3019,7 +3023,8 @@ var DesignSystemListItem = ({
3019
3023
  value,
3020
3024
  subvalue,
3021
3025
  icon,
3022
- image
3026
+ image,
3027
+ control
3023
3028
  }) => /* @__PURE__ */ jsx56(
3024
3029
  "label",
3025
3030
  {
@@ -3028,7 +3033,7 @@ var DesignSystemListItem = ({
3028
3033
  "np-option__container-aligned": true
3029
3034
  }),
3030
3035
  children: /* @__PURE__ */ jsxs21("div", { className: "media", children: [
3031
- icon || image ? /* @__PURE__ */ jsx56("div", { className: "media-left", children: /* @__PURE__ */ jsx56(ListItemMedia, { image, icon }) }) : null,
3036
+ icon || image ? /* @__PURE__ */ jsx56("div", { className: "media-left", children: /* @__PURE__ */ jsx56(ListItemMedia, { image, icon, preferAvatar: control === "with-avatar" }) }) : null,
3032
3037
  /* @__PURE__ */ jsxs21("div", { className: "media-body", children: [
3033
3038
  /* @__PURE__ */ jsxs21("div", { className: "d-flex justify-content-between", children: [
3034
3039
  /* @__PURE__ */ jsx56("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
@@ -3043,12 +3048,16 @@ var DesignSystemListItem = ({
3043
3048
  },
3044
3049
  title
3045
3050
  );
3046
- var ListItemMedia = ({ icon, image }) => {
3051
+ var ListItemMedia = ({
3052
+ icon,
3053
+ image,
3054
+ preferAvatar
3055
+ }) => {
3047
3056
  if (icon) {
3048
- return /* @__PURE__ */ jsx56("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ jsx56(OptionMedia, { icon, image }) });
3057
+ return /* @__PURE__ */ jsx56("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ jsx56(OptionMedia, { icon, image, preferAvatar }) });
3049
3058
  }
3050
3059
  if (image) {
3051
- return /* @__PURE__ */ jsx56("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx56(OptionMedia, { icon, image }) });
3060
+ return /* @__PURE__ */ jsx56("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx56(OptionMedia, { icon, image, preferAvatar }) });
3052
3061
  }
3053
3062
  };
3054
3063
  var getListAction = (callToAction) => {
@@ -3168,7 +3177,7 @@ var getWiseRenderers = () => [
3168
3177
  ];
3169
3178
 
3170
3179
  // src/dynamicFlow/telemetry/app-version.ts
3171
- var appVersion = "4.8.0";
3180
+ var appVersion = "4.9.0";
3172
3181
 
3173
3182
  // src/dynamicFlow/telemetry/getLogEvent.ts
3174
3183
  var getLogEvent = (onLog) => (level, message, extra) => {
@@ -0,0 +1,12 @@
1
+ import { DynamicFlowRevamp } from '../dynamicFlow/DynamicFlow';
2
+ declare const _default: {
3
+ title: string;
4
+ component: typeof DynamicFlowRevamp;
5
+ };
6
+ export default _default;
7
+ export declare const InitialisationWithSuccessfulStep: {
8
+ render: () => import("react/jsx-runtime").JSX.Element;
9
+ };
10
+ export declare const InitialisationWith404Step: {
11
+ render: () => import("react/jsx-runtime").JSX.Element;
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client-internal",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "Dynamic Flow web client for Wise",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -99,7 +99,7 @@
99
99
  },
100
100
  "dependencies": {
101
101
  "classnames": "2.5.1",
102
- "@wise/dynamic-flow-client": "4.3.8",
102
+ "@wise/dynamic-flow-client": "4.3.9",
103
103
  "@wise/dynamic-flow-types": "3.1.3"
104
104
  },
105
105
  "scripts": {