@wise/dynamic-flow-client 3.31.2 → 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) =>
|
|
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");
|
|
@@ -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
|
-
|
|
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
|
-
|
|
5
|
+
content: ImageContent;
|
|
6
6
|
size: Size;
|
|
7
|
-
url: string;
|
|
8
7
|
};
|
|
9
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
36
|
+
"@babel/preset-env": "7.26.7",
|
|
37
37
|
"@babel/preset-react": "7.26.3",
|
|
38
38
|
"@babel/preset-typescript": "7.26.0",
|
|
39
39
|
"@chromatic-com/storybook": "3.2.4",
|
|
40
|
-
"@formatjs/cli": "^6.5.
|
|
41
|
-
"@storybook/addon-a11y": "^8.5.
|
|
42
|
-
"@storybook/addon-actions": "^8.5.
|
|
43
|
-
"@storybook/addon-essentials": "^8.5.
|
|
44
|
-
"@storybook/addon-interactions": "^8.5.
|
|
45
|
-
"@storybook/addon-links": "^8.5.
|
|
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.5.
|
|
48
|
-
"@storybook/react": "^8.5.
|
|
49
|
-
"@storybook/react-webpack5": "^8.5.
|
|
50
|
-
"@storybook/test": "^8.5.
|
|
51
|
-
"@storybook/types": "^8.5.
|
|
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
54
|
"@testing-library/react": "16.2.0",
|
|
55
|
-
"@testing-library/user-event": "14.6.
|
|
56
|
-
"@transferwise/components": "46.
|
|
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.
|
|
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",
|
|
@@ -77,16 +77,16 @@
|
|
|
77
77
|
"react": "18.3.1",
|
|
78
78
|
"react-dom": "18.3.1",
|
|
79
79
|
"react-intl": "6.8.9",
|
|
80
|
-
"storybook": "^8.5.
|
|
81
|
-
"stylelint": "16.
|
|
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-
|
|
89
|
-
"@wise/dynamic-flow-
|
|
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.
|
|
105
|
+
"@wise/dynamic-flow-types": "2.31.0"
|
|
106
106
|
},
|
|
107
107
|
"scripts": {
|
|
108
108
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|