@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.mjs CHANGED
@@ -1611,7 +1611,14 @@ var hiddenComponentToProps = () => ({
1611
1611
  });
1612
1612
 
1613
1613
  // src/revamp/renderers/mappers/imageComponentToProps.ts
1614
- var imageComponentToProps = (component) => pick(component, "type", "accessibilityDescription", "control", "margin", "size", "url");
1614
+ var imageComponentToProps = (component) => {
1615
+ var _a;
1616
+ return __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "size")), {
1617
+ accessibilityDescription: component.content.accessibilityDescription,
1618
+ url: (_a = component.content.url) != null ? _a : "",
1619
+ uri: component.content.uri
1620
+ });
1621
+ };
1615
1622
 
1616
1623
  // src/revamp/renderers/mappers/instructionsComponentToProps.ts
1617
1624
  var instructionsComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
@@ -6931,12 +6938,12 @@ var getStepPolling = ({
6931
6938
  }).catch(() => {
6932
6939
  });
6933
6940
  };
6934
- poll();
6935
6941
  const intervalRef = setInterval(poll, delay * 1e3);
6936
6942
  const stop = () => {
6937
6943
  clearTimeout(intervalRef);
6938
6944
  abortController.abort();
6939
6945
  };
6946
+ poll();
6940
6947
  return { stop };
6941
6948
  };
6942
6949
 
@@ -10107,13 +10114,12 @@ var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
10107
10114
  });
10108
10115
 
10109
10116
  // src/revamp/domain/mappers/layout/imageLayoutToComponent.ts
10110
- var imageLayoutToComponent = (uid, { accessibilityDescription, control, margin = "md", size: size2 = "md", text, url }) => createImageComponent({
10117
+ var imageLayoutToComponent = (uid, { accessibilityDescription, content, control, margin = "md", size: size2 = "md", text, url }) => createImageComponent({
10111
10118
  uid,
10112
- accessibilityDescription: accessibilityDescription != null ? accessibilityDescription : text,
10119
+ content: content != null ? content : { accessibilityDescription: accessibilityDescription != null ? accessibilityDescription : text, url },
10113
10120
  control,
10114
10121
  margin,
10115
- size: size2,
10116
- url
10122
+ size: size2
10117
10123
  });
10118
10124
 
10119
10125
  // src/revamp/domain/components/MarkdownComponent.ts
@@ -12114,12 +12120,20 @@ function ImageRendererComponent({
12114
12120
  accessibilityDescription,
12115
12121
  margin,
12116
12122
  size: size2,
12117
- url
12123
+ url,
12124
+ uri
12118
12125
  }) {
12119
12126
  const [imageSource, setImageSource] = useState3("");
12120
12127
  const httpClient = useRendererHttpClient();
12121
12128
  useEffect3(() => {
12122
- void getImageSource(httpClient, url).then(setImageSource);
12129
+ if (!uri) {
12130
+ void getImageSource(httpClient, url).then(setImageSource);
12131
+ return;
12132
+ }
12133
+ if (!uri.startsWith("urn:")) {
12134
+ void getImageSource(httpClient, uri).then(setImageSource);
12135
+ return;
12136
+ }
12123
12137
  }, [url, httpClient]);
12124
12138
  return /* @__PURE__ */ jsx27("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx27(
12125
12139
  Image,
@@ -2,8 +2,14 @@ import type { Size } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { LayoutComponent } from '../types';
3
3
  export type ImageComponent = LayoutComponent & {
4
4
  type: 'image';
5
- accessibilityDescription?: string;
5
+ content: ImageContent;
6
6
  size: Size;
7
- url: string;
8
7
  };
9
- export declare const createImageComponent: (imageProps: Pick<ImageComponent, "uid" | "accessibilityDescription" | "control" | "margin" | "size" | "url">) => ImageComponent;
8
+ type ImageContent = {
9
+ accessibilityDescription?: string;
10
+ text?: string;
11
+ url?: string;
12
+ uri?: string;
13
+ };
14
+ export declare const createImageComponent: (imageProps: Pick<ImageComponent, "uid" | "content" | "control" | "margin" | "size">) => ImageComponent;
15
+ export {};
@@ -1,2 +1,11 @@
1
1
  import type { ImageLayout } from '@wise/dynamic-flow-types/build/next';
2
- export declare const imageLayoutToComponent: (uid: string, { accessibilityDescription, control, margin, size, text, url }: ImageLayout) => import("../../components/ImageComponent").ImageComponent;
2
+ type ImageContent = {
3
+ accessibilityDescription?: string;
4
+ text?: string;
5
+ url?: string;
6
+ uri?: string;
7
+ };
8
+ export declare const imageLayoutToComponent: (uid: string, { accessibilityDescription, content, control, margin, size, text, url }: ImageLayout & {
9
+ content?: ImageContent;
10
+ }) => import("../../components/ImageComponent").ImageComponent;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.31.1",
3
+ "version": "3.32.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -30,34 +30,34 @@
30
30
  "url": "git+https://github.com/transferwise/dynamic-flow.git"
31
31
  },
32
32
  "devDependencies": {
33
- "@babel/core": "7.26.0",
33
+ "@babel/core": "7.26.7",
34
34
  "@babel/plugin-syntax-flow": "7.26.0",
35
35
  "@babel/plugin-transform-react-jsx": "7.25.9",
36
- "@babel/preset-env": "7.26.0",
36
+ "@babel/preset-env": "7.26.7",
37
37
  "@babel/preset-react": "7.26.3",
38
38
  "@babel/preset-typescript": "7.26.0",
39
- "@chromatic-com/storybook": "3.2.3",
40
- "@formatjs/cli": "^6.3.15",
41
- "@storybook/addon-a11y": "^8.4.7",
42
- "@storybook/addon-actions": "^8.4.7",
43
- "@storybook/addon-essentials": "^8.4.7",
44
- "@storybook/addon-interactions": "^8.4.7",
45
- "@storybook/addon-links": "^8.4.7",
39
+ "@chromatic-com/storybook": "3.2.4",
40
+ "@formatjs/cli": "^6.5.1",
41
+ "@storybook/addon-a11y": "^8.5.1",
42
+ "@storybook/addon-actions": "^8.5.1",
43
+ "@storybook/addon-essentials": "^8.5.1",
44
+ "@storybook/addon-interactions": "^8.5.1",
45
+ "@storybook/addon-links": "^8.5.1",
46
46
  "@storybook/addon-webpack5-compiler-babel": "^3.0.5",
47
- "@storybook/manager-api": "^8.4.7",
48
- "@storybook/react": "^8.4.7",
49
- "@storybook/react-webpack5": "^8.4.7",
50
- "@storybook/test": "^8.4.7",
51
- "@storybook/types": "^8.4.7",
47
+ "@storybook/manager-api": "^8.5.1",
48
+ "@storybook/react": "^8.5.1",
49
+ "@storybook/react-webpack5": "^8.5.1",
50
+ "@storybook/test": "^8.5.1",
51
+ "@storybook/types": "^8.5.1",
52
52
  "@testing-library/dom": "10.4.0",
53
53
  "@testing-library/jest-dom": "6.6.3",
54
- "@testing-library/react": "16.1.0",
55
- "@testing-library/user-event": "14.5.2",
56
- "@transferwise/components": "46.86.1",
54
+ "@testing-library/react": "16.2.0",
55
+ "@testing-library/user-event": "14.6.1",
56
+ "@transferwise/components": "46.87.0",
57
57
  "@transferwise/formatting": "^2.13.0",
58
58
  "@transferwise/icons": "3.18.0",
59
59
  "@transferwise/neptune-css": "14.20.1",
60
- "@types/node": "22.10.6",
60
+ "@types/node": "22.10.10",
61
61
  "@types/jest": "29.5.14",
62
62
  "@types/react": "18.3.18",
63
63
  "@types/react-dom": "18.3.5",
@@ -65,7 +65,7 @@
65
65
  "@wise/art": "2.19.0",
66
66
  "@wise/components-theming": "^1.6.1",
67
67
  "babel-jest": "29.7.0",
68
- "esbuild": "0.24.0",
68
+ "esbuild": "0.24.2",
69
69
  "jest": "29.7.0",
70
70
  "jest-environment-jsdom": "29.7.0",
71
71
  "jest-fetch-mock": "^3.0.3",
@@ -73,20 +73,20 @@
73
73
  "npm-run-all2": "7.0.2",
74
74
  "postcss": "^8.5.1",
75
75
  "postcss-cli": "^11.0.0",
76
- "postcss-import": "^15.1.0",
76
+ "postcss-import": "^16.1.0",
77
77
  "react": "18.3.1",
78
78
  "react-dom": "18.3.1",
79
79
  "react-intl": "6.8.9",
80
- "storybook": "^8.4.7",
81
- "stylelint": "16.13.1",
80
+ "storybook": "^8.5.1",
81
+ "stylelint": "16.14.0",
82
82
  "stylelint-config-standard": "36.0.1",
83
83
  "stylelint-no-unsupported-browser-features": "8.0.2",
84
84
  "stylelint-value-no-unknown-custom-properties": "6.0.1",
85
85
  "tsx": "4.19.2",
86
86
  "typescript": "5.7.3",
87
87
  "webpack": "5.97.1",
88
- "@wise/dynamic-flow-fixtures": "0.0.1",
89
- "@wise/dynamic-flow-renderers": "0.0.0"
88
+ "@wise/dynamic-flow-renderers": "0.0.0",
89
+ "@wise/dynamic-flow-fixtures": "0.0.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/components": "^46.31",
@@ -102,7 +102,7 @@
102
102
  "classnames": "2.5.1",
103
103
  "react-webcam": "^7.2.0",
104
104
  "screenfull": "^5.2.0",
105
- "@wise/dynamic-flow-types": "2.30.0"
105
+ "@wise/dynamic-flow-types": "2.31.0"
106
106
  },
107
107
  "scripts": {
108
108
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",