@wise/dynamic-flow-client 3.31.1 → 3.32.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
@@ -436,8 +436,8 @@ var require_screenfull = __commonJS({
436
436
  });
437
437
 
438
438
  // src/index.ts
439
- var src_exports = {};
440
- __export(src_exports, {
439
+ var index_exports = {};
440
+ __export(index_exports, {
441
441
  DynamicFlow: () => DynamicFlow_default,
442
442
  DynamicFlowCoreRevamp: () => DynamicFlowCore,
443
443
  DynamicFlowRevamp: () => DynamicFlowWise_default,
@@ -451,7 +451,7 @@ __export(src_exports, {
451
451
  makeHttpClient: () => makeHttpClient,
452
452
  translations: () => i18n_default
453
453
  });
454
- module.exports = __toCommonJS(src_exports);
454
+ module.exports = __toCommonJS(index_exports);
455
455
 
456
456
  // src/common/utils/api-utils.ts
457
457
  function isRelativePath(url = "") {
@@ -1635,7 +1635,14 @@ var hiddenComponentToProps = () => ({
1635
1635
  });
1636
1636
 
1637
1637
  // src/revamp/renderers/mappers/imageComponentToProps.ts
1638
- var imageComponentToProps = (component) => pick(component, "type", "accessibilityDescription", "control", "margin", "size", "url");
1638
+ var imageComponentToProps = (component) => {
1639
+ var _a;
1640
+ return __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "size")), {
1641
+ accessibilityDescription: component.content.accessibilityDescription,
1642
+ url: (_a = component.content.url) != null ? _a : "",
1643
+ uri: component.content.uri
1644
+ });
1645
+ };
1639
1646
 
1640
1647
  // src/revamp/renderers/mappers/instructionsComponentToProps.ts
1641
1648
  var instructionsComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
@@ -6955,12 +6962,12 @@ var getStepPolling = ({
6955
6962
  }).catch(() => {
6956
6963
  });
6957
6964
  };
6958
- poll();
6959
6965
  const intervalRef = setInterval(poll, delay * 1e3);
6960
6966
  const stop = () => {
6961
6967
  clearTimeout(intervalRef);
6962
6968
  abortController.abort();
6963
6969
  };
6970
+ poll();
6964
6971
  return { stop };
6965
6972
  };
6966
6973
 
@@ -10131,13 +10138,12 @@ var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
10131
10138
  });
10132
10139
 
10133
10140
  // src/revamp/domain/mappers/layout/imageLayoutToComponent.ts
10134
- var imageLayoutToComponent = (uid, { accessibilityDescription, control, margin = "md", size: size2 = "md", text, url }) => createImageComponent({
10141
+ var imageLayoutToComponent = (uid, { accessibilityDescription, content, control, margin = "md", size: size2 = "md", text, url }) => createImageComponent({
10135
10142
  uid,
10136
- accessibilityDescription: accessibilityDescription != null ? accessibilityDescription : text,
10143
+ content: content != null ? content : { accessibilityDescription: accessibilityDescription != null ? accessibilityDescription : text, url },
10137
10144
  control,
10138
10145
  margin,
10139
- size: size2,
10140
- url
10146
+ size: size2
10141
10147
  });
10142
10148
 
10143
10149
  // src/revamp/domain/components/MarkdownComponent.ts
@@ -12138,12 +12144,20 @@ function ImageRendererComponent({
12138
12144
  accessibilityDescription,
12139
12145
  margin,
12140
12146
  size: size2,
12141
- url
12147
+ url,
12148
+ uri
12142
12149
  }) {
12143
12150
  const [imageSource, setImageSource] = (0, import_react9.useState)("");
12144
12151
  const httpClient = useRendererHttpClient();
12145
12152
  (0, import_react9.useEffect)(() => {
12146
- void getImageSource(httpClient, url).then(setImageSource);
12153
+ if (!uri) {
12154
+ void getImageSource(httpClient, url).then(setImageSource);
12155
+ return;
12156
+ }
12157
+ if (!uri.startsWith("urn:")) {
12158
+ void getImageSource(httpClient, uri).then(setImageSource);
12159
+ return;
12160
+ }
12147
12161
  }, [url, httpClient]);
12148
12162
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12149
12163
  import_components12.Image,