@wise/dynamic-flow-client 3.25.0 → 3.25.1

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
@@ -6989,12 +6989,18 @@ var alertLayoutToComponent = (uid, { control, markdown, margin = "md", context =
6989
6989
  control,
6990
6990
  markdown,
6991
6991
  margin,
6992
- callToAction: callToAction ? getComponentCallToAction(callToAction, onAction) : void 0,
6992
+ callToAction: getComponentCallToAction(callToAction, onAction),
6993
6993
  context: mapLegacyContext(context)
6994
6994
  });
6995
6995
  };
6996
6996
  var getComponentCallToAction = (callToAction, onAction) => {
6997
+ if (!callToAction) {
6998
+ return void 0;
6999
+ }
6997
7000
  const { accessibilityDescription, behavior, title } = callToAction;
7001
+ if ("type" in behavior) {
7002
+ return void 0;
7003
+ }
6998
7004
  if (behavior.link) {
6999
7005
  const { url } = behavior.link;
7000
7006
  return {
@@ -7095,9 +7101,13 @@ var buttonLayoutToComponent = (uid, button, mapperProps) => {
7095
7101
  var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
7096
7102
  const { onAction, onLink, step } = mapperProps;
7097
7103
  const { context, control, disabled, margin = "md", pinOrder, size, title, behavior } = button;
7098
- const { action, link } = behavior;
7099
- const inlinedAction = action ? inlineAction(action, step == null ? void 0 : step.actions) : null;
7100
- const onClick = (() => {
7104
+ const getOnClick = () => {
7105
+ if ("type" in behavior) {
7106
+ return () => {
7107
+ };
7108
+ }
7109
+ const { action, link } = behavior;
7110
+ const inlinedAction = action ? inlineAction(action, step == null ? void 0 : step.actions) : null;
7101
7111
  if (inlinedAction) {
7102
7112
  return () => {
7103
7113
  void onAction(inlinedAction);
@@ -7110,7 +7120,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
7110
7120
  }
7111
7121
  return () => {
7112
7122
  };
7113
- })();
7123
+ };
7114
7124
  return createButtonComponent({
7115
7125
  uid,
7116
7126
  context: mapLegacyContext(context != null ? context : "neutral"),
@@ -7120,7 +7130,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
7120
7130
  pinOrder,
7121
7131
  size,
7122
7132
  title: title != null ? title : "",
7123
- onClick
7133
+ onClick: getOnClick()
7124
7134
  });
7125
7135
  };
7126
7136
  var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
@@ -10150,6 +10160,9 @@ var getReviewAction = ({ onAction, onLink, callToAction, action }) => {
10150
10160
  if (callToAction) {
10151
10161
  const { action: ctaAction, behavior, title } = callToAction;
10152
10162
  if (behavior) {
10163
+ if ("type" in behavior) {
10164
+ return void 0;
10165
+ }
10153
10166
  const { accessibilityDescription, action: behaviorAction, link } = behavior;
10154
10167
  const onClick = () => {
10155
10168
  if (behaviorAction) {
@@ -10354,18 +10367,32 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
10354
10367
  var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onAction, onLink }) => createStatusListComponent({
10355
10368
  uid,
10356
10369
  control,
10357
- items: items.map((item) => {
10358
- var _a, _b, _c;
10359
- return __spreadProps(__spreadValues({}, item), {
10360
- href: (_c = (_b = (_a = item == null ? void 0 : item.callToAction) == null ? void 0 : _a.behavior) == null ? void 0 : _b.link) == null ? void 0 : _c.url,
10361
- callToAction: item.callToAction ? getItemCallToAction(item.callToAction, onAction, onLink) : void 0
10362
- });
10363
- }),
10370
+ items: items.map((item) => __spreadProps(__spreadValues({}, item), {
10371
+ href: getItemHref(item.callToAction),
10372
+ callToAction: getItemCallToAction(item.callToAction, onAction, onLink)
10373
+ })),
10364
10374
  margin,
10365
10375
  title
10366
10376
  });
10377
+ var getItemHref = (callToAction) => {
10378
+ var _a;
10379
+ if (!callToAction) {
10380
+ return void 0;
10381
+ }
10382
+ const { behavior } = callToAction;
10383
+ if ("type" in behavior) {
10384
+ return void 0;
10385
+ }
10386
+ return (_a = behavior == null ? void 0 : behavior.link) == null ? void 0 : _a.url;
10387
+ };
10367
10388
  var getItemCallToAction = (callToAction, onAction, onLink) => {
10389
+ if (!callToAction) {
10390
+ return void 0;
10391
+ }
10368
10392
  const { accessibilityDescription, behavior, title } = callToAction;
10393
+ if ("type" in behavior) {
10394
+ return void 0;
10395
+ }
10369
10396
  if (behavior.link) {
10370
10397
  const { url } = behavior.link;
10371
10398
  return {