@wise/dynamic-flow-client 4.2.3 → 4.3.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.css CHANGED
@@ -152,47 +152,47 @@ button.df-back-btn {
152
152
  display: flex;
153
153
  }
154
154
  }
155
- .df-image {
155
+ .df-legacy-image {
156
156
  display: flex;
157
157
  justify-content: center;
158
158
  align-items: center;
159
159
  }
160
- .df-image img {
160
+ .df-legacy-image img {
161
161
  height: auto;
162
162
  width: 100%;
163
163
  }
164
164
  /* narrow screens */
165
- .df-image.xs img {
165
+ .df-legacy-image.xs img {
166
166
  width: 50px;
167
167
  }
168
- .df-image.sm img {
168
+ .df-legacy-image.sm img {
169
169
  width: 100px;
170
170
  }
171
- .df-image.md img {
171
+ .df-legacy-image.md img {
172
172
  width: 200px;
173
173
  }
174
- .df-image.lg img {
174
+ .df-legacy-image.lg img {
175
175
  width: 300px;
176
176
  }
177
177
  /* wide screens */
178
- @media (width >= 576px) {
179
- .df-image.xs img {
178
+ @media (width >=576px) {
179
+ .df-legacy-image.xs img {
180
180
  width: 100px;
181
181
  }
182
182
 
183
- .df-image.sm img {
183
+ .df-legacy-image.sm img {
184
184
  width: 200px;
185
185
  }
186
186
 
187
- .df-image.md img {
187
+ .df-legacy-image.md img {
188
188
  width: 300px;
189
189
  }
190
190
 
191
- .df-image.lg img {
191
+ .df-legacy-image.lg img {
192
192
  width: 500px;
193
193
  }
194
194
 
195
- .df-image.xl img {
195
+ .df-legacy-image.xl img {
196
196
  max-width: 600px;
197
197
  }
198
198
  }
@@ -268,6 +268,60 @@ button.df-back-btn {
268
268
  .df-image .df-illustration {
269
269
  padding: 0;
270
270
  }
271
+ .df-image {
272
+ display: flex;
273
+ }
274
+ .df-image.start {
275
+ justify-content: start;
276
+ align-items: start;
277
+ }
278
+ .df-image.center {
279
+ justify-content: center;
280
+ align-items: center;
281
+ }
282
+ .df-image.end {
283
+ justify-content: end;
284
+ align-items: end;
285
+ }
286
+ .df-image img {
287
+ height: auto;
288
+ width: 100%;
289
+ }
290
+ /* narrow screens */
291
+ .df-image.xs img {
292
+ width: 50px;
293
+ }
294
+ .df-image.sm img {
295
+ width: 100px;
296
+ }
297
+ .df-image.md img {
298
+ width: 200px;
299
+ }
300
+ .df-image.lg img {
301
+ width: 300px;
302
+ }
303
+ /* wide screens */
304
+ @media (width >=576px) {
305
+ .df-image.xs img {
306
+ width: 100px;
307
+ }
308
+
309
+ .df-image.sm img {
310
+ width: 200px;
311
+ }
312
+
313
+ .df-image.md img {
314
+ width: 300px;
315
+ }
316
+
317
+ .df-image.lg img {
318
+ width: 500px;
319
+ }
320
+
321
+ .df-image.xl img {
322
+ max-width: 600px;
323
+ }
324
+ }
271
325
  .df-back-btn .tw-avatar__content {
272
326
  cursor: pointer;
273
327
  background-color: var(--color-background-neutral);
package/build/main.js CHANGED
@@ -143,10 +143,10 @@ var init_clsx = __esm({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_5ykmpxdtw4fzxswo7budy4j22i/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js
146
+ // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.23.0_@types+react@18.3.20_react-dom@18.3.1_reac_3u2gepknok7a4fhfc5ygus7hla/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js
147
147
  var import_react14, import_jsx_runtime12, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
148
148
  var init_index_ClPpN6dk_esm = __esm({
149
- "../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_5ykmpxdtw4fzxswo7budy4j22i/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js"() {
149
+ "../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.23.0_@types+react@18.3.20_react-dom@18.3.1_reac_3u2gepknok7a4fhfc5ygus7hla/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js"() {
150
150
  "use strict";
151
151
  init_clsx();
152
152
  import_react14 = require("react");
@@ -1777,7 +1777,7 @@ var hiddenComponentToProps = ({ uid }) => ({
1777
1777
  });
1778
1778
 
1779
1779
  // src/revamp/renderers/mappers/imageComponentToProps.ts
1780
- var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin", "size")), rendererMapperProps), {
1780
+ var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "align", "control", "margin", "size")), rendererMapperProps), {
1781
1781
  uri: component.content.uri,
1782
1782
  accessibilityDescription: component.content.accessibilityDescription
1783
1783
  });
@@ -10500,6 +10500,7 @@ var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
10500
10500
  // src/revamp/domain/mappers/layout/imageLayoutToComponent.ts
10501
10501
  var imageLayoutToComponent = (uid, {
10502
10502
  accessibilityDescription,
10503
+ align = "center",
10503
10504
  content,
10504
10505
  control,
10505
10506
  margin = "md",
@@ -10510,6 +10511,7 @@ var imageLayoutToComponent = (uid, {
10510
10511
  var _a, _b, _c;
10511
10512
  return createImageComponent({
10512
10513
  uid,
10514
+ align: mapLegacyAlign(align),
10513
10515
  content: content ? {
10514
10516
  uri: (_b = (_a = content.uri) != null ? _a : content.url) != null ? _b : "",
10515
10517
  accessibilityDescription: (_c = content.accessibilityDescription) != null ? _c : content.text
@@ -13401,7 +13403,7 @@ var import_components3 = require("@transferwise/components");
13401
13403
  // src/legacy/layout/utils/getNavigationOptionMedia.tsx
13402
13404
  var import_components2 = require("@transferwise/components");
13403
13405
 
13404
- // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_5ykmpxdtw4fzxswo7budy4j22i/node_modules/@wise/art/dist/index.esm.js
13406
+ // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.23.0_@types+react@18.3.20_react-dom@18.3.1_reac_3u2gepknok7a4fhfc5ygus7hla/node_modules/@wise/art/dist/index.esm.js
13405
13407
  init_index_ClPpN6dk_esm();
13406
13408
  init_clsx();
13407
13409
  var import_react15 = require("react");
@@ -16595,7 +16597,7 @@ function DynamicImage({ component: image }) {
16595
16597
  if (!imageSource) {
16596
16598
  return null;
16597
16599
  }
16598
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components24.Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
16600
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: `df-legacy-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components24.Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
16599
16601
  }
16600
16602
  var readImageBlobAsDataURL = (imageBlob) => (
16601
16603
  // we can safely assume the type of reader.result is string
package/build/main.mjs CHANGED
@@ -137,12 +137,12 @@ var init_clsx = __esm({
137
137
  }
138
138
  });
139
139
 
140
- // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_5ykmpxdtw4fzxswo7budy4j22i/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js
140
+ // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.23.0_@types+react@18.3.20_react-dom@18.3.1_reac_3u2gepknok7a4fhfc5ygus7hla/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js
141
141
  import { useState as useState4, useEffect as useEffect3, forwardRef as forwardRef2, Suspense, lazy } from "react";
142
142
  import { jsx as jsx12, jsxs as jsxs2, Fragment as Fragment4 } from "react/jsx-runtime";
143
143
  var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
144
144
  var init_index_ClPpN6dk_esm = __esm({
145
- "../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_5ykmpxdtw4fzxswo7budy4j22i/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js"() {
145
+ "../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.23.0_@types+react@18.3.20_react-dom@18.3.1_reac_3u2gepknok7a4fhfc5ygus7hla/node_modules/@wise/art/dist/index-ClPpN6dk.esm.js"() {
146
146
  "use strict";
147
147
  init_clsx();
148
148
  unknownFlagName = "wise";
@@ -1754,7 +1754,7 @@ var hiddenComponentToProps = ({ uid }) => ({
1754
1754
  });
1755
1755
 
1756
1756
  // src/revamp/renderers/mappers/imageComponentToProps.ts
1757
- var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin", "size")), rendererMapperProps), {
1757
+ var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "align", "control", "margin", "size")), rendererMapperProps), {
1758
1758
  uri: component.content.uri,
1759
1759
  accessibilityDescription: component.content.accessibilityDescription
1760
1760
  });
@@ -10477,6 +10477,7 @@ var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
10477
10477
  // src/revamp/domain/mappers/layout/imageLayoutToComponent.ts
10478
10478
  var imageLayoutToComponent = (uid, {
10479
10479
  accessibilityDescription,
10480
+ align = "center",
10480
10481
  content,
10481
10482
  control,
10482
10483
  margin = "md",
@@ -10487,6 +10488,7 @@ var imageLayoutToComponent = (uid, {
10487
10488
  var _a, _b, _c;
10488
10489
  return createImageComponent({
10489
10490
  uid,
10491
+ align: mapLegacyAlign(align),
10490
10492
  content: content ? {
10491
10493
  uri: (_b = (_a = content.uri) != null ? _a : content.url) != null ? _b : "",
10492
10494
  accessibilityDescription: (_c = content.accessibilityDescription) != null ? _c : content.text
@@ -13378,7 +13380,7 @@ import { Alert as Alert2 } from "@transferwise/components";
13378
13380
  // src/legacy/layout/utils/getNavigationOptionMedia.tsx
13379
13381
  import { Avatar, AvatarType } from "@transferwise/components";
13380
13382
 
13381
- // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_5ykmpxdtw4fzxswo7budy4j22i/node_modules/@wise/art/dist/index.esm.js
13383
+ // ../../node_modules/.pnpm/@wise+art@2.20.0_@transferwise+neptune-css@14.23.0_@types+react@18.3.20_react-dom@18.3.1_reac_3u2gepknok7a4fhfc5ygus7hla/node_modules/@wise/art/dist/index.esm.js
13382
13384
  init_index_ClPpN6dk_esm();
13383
13385
  init_clsx();
13384
13386
  import "react";
@@ -16587,7 +16589,7 @@ function DynamicImage({ component: image }) {
16587
16589
  if (!imageSource) {
16588
16590
  return null;
16589
16591
  }
16590
- return /* @__PURE__ */ jsx52("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx52(Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
16592
+ return /* @__PURE__ */ jsx52("div", { className: `df-legacy-image ${size || "md"}`, children: /* @__PURE__ */ jsx52(Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
16591
16593
  }
16592
16594
  var readImageBlobAsDataURL = (imageBlob) => (
16593
16595
  // we can safely assume the type of reader.result is string
@@ -1,7 +1,8 @@
1
1
  import type { Size } from '@wise/dynamic-flow-types/build/next';
2
- import type { LayoutComponent } from '../types';
2
+ import type { Align, LayoutComponent } from '../types';
3
3
  export type ImageComponent = LayoutComponent & {
4
4
  type: 'image';
5
+ align: Align;
5
6
  content: ImageContent;
6
7
  size: Size;
7
8
  };
@@ -9,5 +10,5 @@ type ImageContent = {
9
10
  accessibilityDescription?: string;
10
11
  uri: string;
11
12
  };
12
- export declare const createImageComponent: (imageProps: Pick<ImageComponent, "uid" | "content" | "control" | "margin" | "size">) => ImageComponent;
13
+ export declare const createImageComponent: (imageProps: Pick<ImageComponent, "uid" | "align" | "content" | "control" | "margin" | "size">) => ImageComponent;
13
14
  export {};
@@ -1,2 +1,2 @@
1
1
  import type { ImageLayout } from '@wise/dynamic-flow-types/build/next';
2
- export declare const imageLayoutToComponent: (uid: string, { accessibilityDescription, content, control, margin, size, text, url, }: ImageLayout) => import("../../components/ImageComponent").ImageComponent;
2
+ export declare const imageLayoutToComponent: (uid: string, { accessibilityDescription, align, content, control, margin, size, text, url, }: ImageLayout) => import("../../components/ImageComponent").ImageComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -37,29 +37,29 @@
37
37
  "@babel/preset-react": "7.26.3",
38
38
  "@babel/preset-typescript": "7.26.0",
39
39
  "@chromatic-com/storybook": "3.2.6",
40
- "@formatjs/cli": "^6.6.1",
41
- "@storybook/addon-a11y": "^8.6.7",
42
- "@storybook/addon-actions": "^8.6.7",
43
- "@storybook/addon-essentials": "^8.6.7",
44
- "@storybook/addon-interactions": "^8.6.7",
45
- "@storybook/addon-links": "^8.6.7",
40
+ "@formatjs/cli": "^6.6.2",
41
+ "@storybook/addon-a11y": "^8.6.8",
42
+ "@storybook/addon-actions": "^8.6.8",
43
+ "@storybook/addon-essentials": "^8.6.8",
44
+ "@storybook/addon-interactions": "^8.6.8",
45
+ "@storybook/addon-links": "^8.6.8",
46
46
  "@storybook/addon-webpack5-compiler-babel": "^3.0.5",
47
- "@storybook/manager-api": "^8.6.7",
48
- "@storybook/react": "^8.6.7",
49
- "@storybook/react-webpack5": "^8.6.7",
50
- "@storybook/test": "^8.6.7",
51
- "@storybook/types": "^8.6.7",
47
+ "@storybook/manager-api": "^8.6.8",
48
+ "@storybook/react": "^8.6.8",
49
+ "@storybook/react-webpack5": "^8.6.8",
50
+ "@storybook/test": "^8.6.8",
51
+ "@storybook/types": "^8.6.8",
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
55
  "@testing-library/user-event": "14.6.1",
56
- "@transferwise/components": "46.94.1",
56
+ "@transferwise/components": "46.94.2",
57
57
  "@transferwise/formatting": "^2.13.1",
58
58
  "@transferwise/icons": "3.19.1",
59
- "@transferwise/neptune-css": "14.22.0",
60
- "@types/node": "22.13.10",
59
+ "@transferwise/neptune-css": "14.23.0",
60
+ "@types/node": "22.13.12",
61
61
  "@types/jest": "29.5.14",
62
- "@types/react": "18.3.18",
62
+ "@types/react": "18.3.20",
63
63
  "@types/react-dom": "18.3.5",
64
64
  "@types/react-intl": "3.0.0",
65
65
  "@wise/art": "2.20.0",
@@ -77,7 +77,7 @@
77
77
  "react": "18.3.1",
78
78
  "react-dom": "18.3.1",
79
79
  "react-intl": "6.8.9",
80
- "storybook": "^8.6.7",
80
+ "storybook": "^8.6.8",
81
81
  "stylelint": "16.16.0",
82
82
  "stylelint-config-standard": "36.0.1",
83
83
  "stylelint-no-unsupported-browser-features": "8.0.4",
@@ -85,8 +85,8 @@
85
85
  "tsx": "4.19.3",
86
86
  "typescript": "5.8.2",
87
87
  "webpack": "5.98.0",
88
- "@wise/dynamic-flow-renderers": "0.0.0",
89
- "@wise/dynamic-flow-fixtures": "0.0.1"
88
+ "@wise/dynamic-flow-fixtures": "0.0.1",
89
+ "@wise/dynamic-flow-renderers": "0.0.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/components": "^46.92.0",