@wise/dynamic-flow-client 3.25.1 → 3.25.2

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
@@ -10164,23 +10164,30 @@ var getReviewAction = ({ onAction, onLink, callToAction, action }) => {
10164
10164
  return void 0;
10165
10165
  }
10166
10166
  const { accessibilityDescription, action: behaviorAction, link } = behavior;
10167
- const onClick = () => {
10168
- if (behaviorAction) {
10169
- return () => {
10167
+ if (behaviorAction) {
10168
+ return {
10169
+ accessibilityDescription,
10170
+ title,
10171
+ onClick: () => {
10170
10172
  void onAction(behaviorAction);
10171
- };
10172
- }
10173
- if (link) {
10174
- return () => {
10173
+ }
10174
+ };
10175
+ }
10176
+ if (link) {
10177
+ return {
10178
+ accessibilityDescription,
10179
+ href: link.url,
10180
+ title,
10181
+ onClick: () => {
10175
10182
  onLink(link.url);
10176
- };
10177
- }
10178
- };
10183
+ }
10184
+ };
10185
+ }
10179
10186
  return {
10180
10187
  accessibilityDescription,
10181
- href: link == null ? void 0 : link.url,
10182
10188
  title,
10183
- onClick
10189
+ onClick: () => {
10190
+ }
10184
10191
  };
10185
10192
  }
10186
10193
  if (ctaAction) {
@@ -10393,28 +10400,33 @@ var getItemCallToAction = (callToAction, onAction, onLink) => {
10393
10400
  if ("type" in behavior) {
10394
10401
  return void 0;
10395
10402
  }
10396
- if (behavior.link) {
10397
- const { url } = behavior.link;
10403
+ if (behavior.action) {
10404
+ const { action } = behavior;
10398
10405
  return {
10399
10406
  accessibilityDescription,
10400
- href: url,
10401
10407
  title,
10402
10408
  onClick: () => {
10403
- void onLink(url);
10409
+ void onAction(action);
10404
10410
  }
10405
10411
  };
10406
10412
  }
10407
- if (behavior.action) {
10408
- const { action } = behavior;
10413
+ if (behavior.link) {
10414
+ const { url } = behavior.link;
10409
10415
  return {
10410
10416
  accessibilityDescription,
10417
+ href: url,
10411
10418
  title,
10412
10419
  onClick: () => {
10413
- void onAction(action);
10420
+ void onLink(url);
10414
10421
  }
10415
10422
  };
10416
10423
  }
10417
- return void 0;
10424
+ return {
10425
+ accessibilityDescription,
10426
+ title,
10427
+ onClick: () => {
10428
+ }
10429
+ };
10418
10430
  };
10419
10431
 
10420
10432
  // src/revamp/domain/mappers/layout/listLayoutToComponent.ts
@@ -13048,19 +13060,32 @@ var StatusListRenderer = {
13048
13060
  description,
13049
13061
  icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DynamicIcon_default, { name: icon.name }) : null,
13050
13062
  status: mapStatus(status),
13051
- action: callToAction ? {
13052
- "aria-label": callToAction.accessibilityDescription,
13053
- href: callToAction.href,
13054
- text: callToAction.title,
13055
- target: callToAction.href ? "_blank" : void 0,
13056
- onClick: callToAction.href ? void 0 : callToAction.onClick
13057
- } : void 0
13063
+ action: getSummaryAction(callToAction)
13058
13064
  },
13059
13065
  `${itemTitle}/${description || ""}`
13060
13066
  ))
13061
13067
  ] })
13062
13068
  };
13063
13069
  var StatusListRenderer_default = StatusListRenderer;
13070
+ var getSummaryAction = (callToAction) => {
13071
+ if (!callToAction) {
13072
+ return void 0;
13073
+ }
13074
+ const { accessibilityDescription, href, title, onClick } = callToAction;
13075
+ if (!href) {
13076
+ return {
13077
+ "aria-label": accessibilityDescription,
13078
+ text: title,
13079
+ onClick
13080
+ };
13081
+ }
13082
+ return {
13083
+ "aria-label": accessibilityDescription,
13084
+ href,
13085
+ target: "_blank",
13086
+ text: title
13087
+ };
13088
+ };
13064
13089
  var mapStatus = (status) => {
13065
13090
  if (status === "not-done") {
13066
13091
  return "notDone";
@@ -13347,20 +13372,21 @@ var getReviewAction2 = (callToAction) => {
13347
13372
  return void 0;
13348
13373
  }
13349
13374
  const { accessibilityDescription, href, title, onClick } = callToAction;
13350
- if (href) {
13375
+ if (!href) {
13351
13376
  return {
13352
13377
  "aria-label": accessibilityDescription,
13353
- href,
13354
- text: title
13378
+ text: title,
13379
+ onClick: (event) => {
13380
+ event.preventDefault();
13381
+ onClick();
13382
+ }
13355
13383
  };
13356
13384
  }
13357
13385
  return {
13358
13386
  "aria-label": accessibilityDescription,
13359
- text: title,
13360
- onClick: (event) => {
13361
- event.preventDefault();
13362
- onClick();
13363
- }
13387
+ href,
13388
+ target: "_blank",
13389
+ text: title
13364
13390
  };
13365
13391
  };
13366
13392
 
@@ -18242,12 +18268,11 @@ var DynamicStatusList = ({ component, onAction }) => {
18242
18268
  var mapListItemToSummary = (props, onAction) => {
18243
18269
  const { title, description, icon, status } = props;
18244
18270
  const summaryProps = __spreadValues(__spreadValues({
18245
- key: `${title}/${description || ""}`,
18246
18271
  title,
18247
18272
  description,
18248
18273
  action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
18249
18274
  }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
18250
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components65.Summary, __spreadValues({}, summaryProps));
18275
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components65.Summary, __spreadValues({}, summaryProps), `${title}/${description || ""}`);
18251
18276
  };
18252
18277
  var callToActionToSummaryAction = (callToAction, onAction) => {
18253
18278
  if (!callToAction) {
@@ -18273,7 +18298,12 @@ var callToActionToSummaryAction = (callToAction, onAction) => {
18273
18298
  }
18274
18299
  };
18275
18300
  }
18276
- return void 0;
18301
+ return {
18302
+ text: "title",
18303
+ "aria-label": accessibilityDescription,
18304
+ onClick: () => {
18305
+ }
18306
+ };
18277
18307
  };
18278
18308
  var statusListMap = {
18279
18309
  done: "done",
@@ -18419,16 +18449,16 @@ function DynamicReview(props) {
18419
18449
  const { title, action, behavior } = callToAction2;
18420
18450
  if (behavior) {
18421
18451
  const { action: behaviorAction, link } = behavior;
18422
- if (link) {
18452
+ if (behaviorAction) {
18423
18453
  return {
18424
18454
  text: title != null ? title : "",
18425
- href: link == null ? void 0 : link.url
18455
+ onClick: behaviorAction ? getOnClick(behaviorAction) : void 0
18426
18456
  };
18427
18457
  }
18428
- if (behaviorAction) {
18458
+ if (link) {
18429
18459
  return {
18430
18460
  text: title != null ? title : "",
18431
- onClick: behaviorAction ? getOnClick(behaviorAction) : void 0
18461
+ href: link == null ? void 0 : link.url
18432
18462
  };
18433
18463
  }
18434
18464
  }